[TSK-1338] Update issue filters order (#3141)

Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@icloud.com>
This commit is contained in:
Sergei Ogorelkov 2023-05-05 15:12:15 +04:00 committed by GitHub
parent 2444992f19
commit 1362b556d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 46 additions and 17 deletions

View File

@ -104,7 +104,7 @@ export class TContact extends TDoc implements Contact {
@Index(IndexKind.FullText)
city!: string
@Prop(TypeTimestamp(), contact.string.CreatedOn)
@Prop(TypeTimestamp(), contact.string.CreatedDate)
@ReadOnly()
createOn!: Timestamp
}

View File

@ -77,7 +77,7 @@ export default mergeIds(contactId, contact, {
TypeLabel: '' as IntlString,
Homepage: '' as IntlString,
Birthday: '' as IntlString,
CreatedOn: '' as IntlString,
CreatedDate: '' as IntlString,
Whatsapp: '' as IntlString,
WhatsappPlaceholder: '' as IntlString,
Skype: '' as IntlString,

View File

@ -90,7 +90,7 @@ export class TDoc extends TObj implements Doc {
@Hidden()
space!: Ref<Space>
@Prop(TypeTimestamp(), core.string.Modified)
@Prop(TypeTimestamp(), core.string.ModifiedDate)
@Index(IndexKind.Indexed)
modifiedOn!: Timestamp

View File

@ -168,7 +168,7 @@ export class TApplicant extends TTask implements Applicant {
@Prop(TypeRef(contact.class.Employee), recruit.string.AssignedRecruiter)
declare assignee: Ref<Employee> | null
@Prop(TypeTimestamp(), contact.string.CreatedOn)
@Prop(TypeTimestamp(), contact.string.CreatedDate)
@ReadOnly()
createOn!: Timestamp
}
@ -454,7 +454,7 @@ export function createModel (builder: Builder): void {
'description',
{
key: '@applications.modifiedOn',
label: core.string.Modified
label: core.string.ModifiedDate
}
],
hiddenKeys: ['name', 'space', 'modifiedOn']
@ -484,7 +484,7 @@ export function createModel (builder: Builder): void {
'$lookup.channels',
{
key: '@applications.modifiedOn',
label: core.string.Modified
label: core.string.ModifiedDate
}
],
hiddenKeys: ['name', 'space', 'modifiedOn']

View File

@ -256,7 +256,7 @@ export class TIssue extends TAttachedDoc implements Issue {
@Prop(Collection(tracker.class.TimeSpendReport), tracker.string.TimeSpendReports)
reports!: number
@Prop(TypeTimestamp(), tracker.string.CreatedOn)
@Prop(TypeTimestamp(), tracker.string.CreatedDate)
@ReadOnly()
createOn!: Timestamp
@ -1352,7 +1352,22 @@ export function createModel (builder: Builder): void {
})
builder.mixin(tracker.class.Issue, core.class.Class, view.mixin.ClassFilters, {
filters: ['space']
filters: [
'status',
'assignee',
'createdBy',
'priority',
'labels',
'title',
'sprint',
'component',
'dueDate',
'createOn',
'modifiedOn',
'modifiedBy',
'space'
],
ignoreKeys: ['number', 'estimation', 'attachedTo']
})
builder.mixin(tracker.class.IssueTemplate, core.class.Class, view.mixin.ClassFilters, {

View File

@ -38,7 +38,7 @@ export default mergeIds(trackerId, tracker, {
GotoMyIssues: '' as IntlString,
SearchIssue: '' as IntlString,
Parent: '' as IntlString,
CreatedOn: '' as IntlString,
CreatedDate: '' as IntlString,
ChangeStatus: '' as IntlString,
ConfigLabel: '' as IntlString,
ConfigDescription: '' as IntlString

View File

@ -127,6 +127,8 @@ export class TFilterMode extends TDoc implements FilterMode {
@Mixin(view.mixin.ClassFilters, core.class.Class)
export class TClassFilters extends TClass implements ClassFilters {
filters!: (string | KeyFilter)[]
ignoreKeys?: string[] | undefined
strict?: boolean | undefined
}
@Mixin(view.mixin.AttributeFilter, core.class.Class)

View File

@ -148,6 +148,7 @@ export default plugin(coreId, {
Id: '' as IntlString,
Space: '' as IntlString,
Modified: '' as IntlString,
ModifiedDate: '' as IntlString,
ModifiedBy: '' as IntlString,
Class: '' as IntlString,
AttachedTo: '' as IntlString,

View File

@ -3,6 +3,7 @@
"Id": "Id",
"Space": "Space",
"Modified": "Modified",
"ModifiedDate": "Modified date",
"ModifiedBy": "Modified by",
"Class": "Class",
"AttachedTo": "Attached to",

View File

@ -3,6 +3,7 @@
"Id": "Id",
"Space": "Пространство",
"Modified": "Изменено",
"ModifiedDate": "Дата изменения",
"ModifiedBy": "Изменен",
"Class": "Класс",
"AttachedTo": "Прикреплен к",

View File

@ -71,7 +71,7 @@
"UseGravatar": "Gravatar",
"UseColor": "Color",
"NotSpecified": "Not specified",
"CreatedOn": "Created",
"CreatedDate": "Created date",
"Whatsapp": "Whatsapp",
"WhatsappPlaceholder": "Whatsapp",
"Skype": "Skype",

View File

@ -72,7 +72,7 @@
"UseColor": "Цвет",
"AvatarProvider": "Тип аватара",
"NotSpecified": "Не указан",
"CreatedOn": "Создан",
"CreatedDate": "Дата создания",
"Whatsapp": "Whatsapp",
"WhatsappPlaceholder": "Whatsapp",
"Skype": "Skype",

View File

@ -169,7 +169,7 @@
{
key: '',
presenter: recruit.component.VacancyModifiedPresenter,
label: core.string.Modified,
label: core.string.ModifiedDate,
props: { applications },
sortingKey: 'modifiedOn',
sortingFunction: modifiedSorting

View File

@ -91,7 +91,7 @@
{
key: '',
presenter: recruit.component.VacancyModifiedPresenter,
label: core.string.Modified,
label: core.string.ModifiedDate,
props: { applications },
sortingKey: 'modifiedOn',
sortingFunction: modifiedSorting

View File

@ -284,7 +284,7 @@
"SevenHoursLength": "Seven Hours",
"EightHoursLength": "Eight Hours",
"CreatedOn": "Created on",
"CreatedDate": "Created date",
"HourLabel": "h",
"Saved": "Saved...",
"CreatedIssue": "Created issue",

View File

@ -284,7 +284,7 @@
"SevenHoursLength": "Семь Часов",
"EightHoursLength": "Восемь Часов",
"CreatedOn": "Создана",
"CreatedDate": "Дата создания",
"HourLabel": "ч",
"Saved": "Сохранено...",
"CreatedIssue": "Создал(а) задачу",

View File

@ -69,7 +69,7 @@
return
}
const value = getValue(attribute.name, attribute.type)
if (result.findIndex((p) => p.key === value) !== -1) {
if (result.findIndex((p) => p.attribute.name === value) !== -1) {
return
}
const filter = buildFilterKey(hierarchy, _class, value, attribute)
@ -97,6 +97,12 @@
const clazz = hierarchy.getClass(_class)
const mixin = hierarchy.as(clazz, view.mixin.ClassFilters)
const result = getFilters(_class, mixin)
if (mixin.strict) {
// Attributes not specified in "mixing.filters" are ignored
return result
}
const allAttributes = hierarchy.getAllAttributes(_class)
buildFilterFor(_class, allAttributes, result, mixin)

View File

@ -104,6 +104,9 @@ export interface FilteredView extends Preference {
export interface ClassFilters extends Class<Doc> {
filters: (KeyFilter | string)[]
ignoreKeys?: string[]
// Ignore attributes not specified in the "filters" array
strict?: boolean
}
/**

View File

@ -154,7 +154,7 @@ test('report-time-from-main-view', async ({ page }) => {
await page.click('text="Issues"')
await page.click('button:has-text("View")')
await page.click('.ordering >> nth=0')
await page.click('text="Modified"')
await page.click('text="Modified date"')
await page.keyboard.press('Escape')
const values = [0.25, 0.5, 0.75, 1]