From b9ca2b5abafe51ed7498005f6479acd749a725a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=83=D1=84=20=D0=9B=D0=B0=D1=82=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 27 Dec 2024 02:21:26 +0300 Subject: [PATCH] SUPPORT-8831: add grid columns filters changed event + AC for button visibility --- .../ervu/component/grid/InMemoryStaticGrid.ts | 15 +- .../business-model/Журнал взаимодействия.page | 201 ++++++++++++++++++ 2 files changed, 215 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/ervu/component/grid/InMemoryStaticGrid.ts b/frontend/src/ts/ervu/component/grid/InMemoryStaticGrid.ts index c9ff00c5..5d64be8f 100644 --- a/frontend/src/ts/ervu/component/grid/InMemoryStaticGrid.ts +++ b/frontend/src/ts/ervu/component/grid/InMemoryStaticGrid.ts @@ -1,4 +1,5 @@ import { + Event, GridColumnIdUtils, GridRow, GridRowModelType, @@ -7,7 +8,7 @@ import { } from "@webbpm/base-package"; import {ChangeDetectionStrategy, Component} from "@angular/core"; import { - ColDef, + ColDef, FilterChangedEvent, ICellRendererParams, ITooltipParams, ValueFormatterParams, @@ -24,6 +25,8 @@ import {StaticGridColumn} from "../../../generated/ru/micord/ervu/property/grid/ changeDetection: ChangeDetectionStrategy.OnPush }) export class InMemoryStaticGrid extends GridV2 { + @Visible("false") + public filterChangeEvent: Event = new Event(); private rpcService: InMemoryStaticGridRpcService; @@ -109,4 +112,14 @@ export class InMemoryStaticGrid extends GridV2 { public getRowDataSize(): number { return this.rowData ? this.rowData.length : 0; } + + @Visible() + public hasFilterModel(): boolean { + return !!this.getGridApi().getFilterModel(); + } + + public columnFilterChanged(event: FilterChangedEvent) { + this.filterChangeEvent.trigger(event); + super.columnFilterChanged(event); + } } diff --git a/resources/src/main/resources/business-model/Журнал взаимодействия.page b/resources/src/main/resources/business-model/Журнал взаимодействия.page index afe5cb02..7b306f3b 100644 --- a/resources/src/main/resources/business-model/Журнал взаимодействия.page +++ b/resources/src/main/resources/business-model/Журнал взаимодействия.page @@ -307,6 +307,12 @@ + + visible + +false + + @@ -431,6 +437,41 @@ + + + + + behavior + + {"objectId":"26242dda-11df-42f0-be93-9fe67ccc016e","packageName":"component.button","className":"Button","type":"TS"} + + + + method + + "setVisible" + + + + value + + + + staticValue + + + boolean + + +false + + + + + + + + @@ -584,6 +625,166 @@ + + + + + + + + 98594cec-0a9b-4cef-af09-e1b71cb2ad9e + dec5e904-4f52-444e-8478-d873461616d6 + AC - Кнопка visibility + false + false + + + + eventRefs + + + + + + behavior + + {"objectId":"bbaf33d7-0679-440b-a394-cb805ce80300","packageName":"ervu.component.grid","className":"InMemoryStaticGrid","type":"TS"} + + + + propertyName + + "filterChangeEvent" + + + + + + + + + ifCondition + + + + conditions + + + + + + _isGroupSelected + +false + + + + one + + + + conditionFirstPart + + + + objectValue + + + +behavior + + {"objectId":"bbaf33d7-0679-440b-a394-cb805ce80300","packageName":"ervu.component.grid","className":"InMemoryStaticGrid","type":"TS"} + + + +method + + "hasFilterModel" + + + + + + + + + + conditionSecondPart + + + + staticValue + + + boolean + + + true + + + + + + + operation + + "EQUALS" + + + + + + + + + + + + logicalOperation + + null + + + + + + + thenActions + + + + + + behavior + + {"objectId":"26242dda-11df-42f0-be93-9fe67ccc016e","packageName":"component.button","className":"Button","type":"TS"} + + + + method + + "setVisible" + + + + value + + + + staticValue + + + boolean + + +true + + + + + + +