Skip to content

Commit

Permalink
TSK-1411 Доработка фильтров с датами (#3151)
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
  • Loading branch information
BykhovDenis authored May 8, 2023
1 parent b0e68ed commit 16da75f
Show file tree
Hide file tree
Showing 17 changed files with 959 additions and 477 deletions.
4 changes: 0 additions & 4 deletions models/tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,10 +914,6 @@ export function createModel (builder: Builder): void {
component: view.component.ValueFilter
})

builder.mixin(core.class.TypeDate, core.class.Class, view.mixin.AttributeFilter, {
component: view.component.DateFilter
})

builder.mixin(tracker.class.TypeIssuePriority, core.class.Class, view.mixin.AttributePresenter, {
presenter: tracker.component.PriorityRefPresenter
})
Expand Down
91 changes: 89 additions & 2 deletions models/view/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export function createModel (builder: Builder): void {
})

builder.mixin(core.class.TypeDate, core.class.Class, view.mixin.AttributeFilter, {
component: view.component.ValueFilter
component: view.component.DateFilter
})

builder.mixin(core.class.EnumOf, core.class.Class, view.mixin.AttributeFilter, {
Expand All @@ -681,7 +681,7 @@ export function createModel (builder: Builder): void {
})

builder.mixin(core.class.TypeTimestamp, core.class.Class, view.mixin.AttributeFilter, {
component: view.component.TimestampFilter
component: view.component.DateFilter
})

builder.createDoc(
Expand Down Expand Up @@ -764,6 +764,93 @@ export function createModel (builder: Builder): void {
view.filter.FilterNestedDontMatch
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.Overdue,
result: view.function.FilterDateOutdated,
disableValueSelector: true
},
view.filter.FilterDateOutdated
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.Today,
result: view.function.FilterDateToday,
disableValueSelector: true
},
view.filter.FilterDateToday
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.ThisWeek,
result: view.function.FilterDateWeek,
disableValueSelector: true
},
view.filter.FilterDateWeek
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.NextWeek,
result: view.function.FilterDateNextWeek,
disableValueSelector: true
},
view.filter.FilterDateNextW
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.ThisMonth,
result: view.function.FilterDateMonth,
disableValueSelector: true
},
view.filter.FilterDateM
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.NextMonth,
result: view.function.FilterDateNextMonth,
disableValueSelector: true
},
view.filter.FilterDateNextM
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.CustomDate,
result: view.function.FilterDateCustom
},
view.filter.FilterDateCustom
)

builder.createDoc(
view.class.FilterMode,
core.space.Model,
{
label: view.string.NotSpecified,
result: view.function.FilterDateNotSpecified,
disableValueSelector: true
},
view.filter.FilterDateNotSpecified
)

classPresenter(builder, core.class.EnumOf, view.component.EnumPresenter, view.component.EnumEditor)

// createAction(
Expand Down
8 changes: 8 additions & 0 deletions models/view/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ export default mergeIds(viewId, view, {
FilterAfterResult: '' as FilterFunction,
FilterNestedMatchResult: '' as FilterFunction,
FilterNestedDontMatchResult: '' as FilterFunction,
FilterDateOutdated: '' as FilterFunction,
FilterDateToday: '' as FilterFunction,
FilterDateWeek: '' as FilterFunction,
FilterDateNextWeek: '' as FilterFunction,
FilterDateMonth: '' as FilterFunction,
FilterDateNextMonth: '' as FilterFunction,
FilterDateNotSpecified: '' as FilterFunction,
FilterDateCustom: '' as FilterFunction,
ShowEmptyGroups: '' as ViewCategoryAction
}
})
Loading

0 comments on commit 16da75f

Please sign in to comment.