diff --git a/frontend/src/app/modules/common/compare-viewer/compare-viewer.component.html b/frontend/src/app/modules/common/compare-viewer/compare-viewer.component.html index b79432927d..accf68a216 100644 --- a/frontend/src/app/modules/common/compare-viewer/compare-viewer.component.html +++ b/frontend/src/app/modules/common/compare-viewer/compare-viewer.component.html @@ -23,7 +23,7 @@
+ (click)="compareMenu.toggle($event); onMenuOpened($event)" > Documents diff --git a/frontend/src/app/modules/contract-engine/dialogs/wipe-requests-dialog/wipe-requests-dialog.component.ts b/frontend/src/app/modules/contract-engine/dialogs/wipe-requests-dialog/wipe-requests-dialog.component.ts index 49b0fea06f..42c9c55c3f 100644 --- a/frontend/src/app/modules/contract-engine/dialogs/wipe-requests-dialog/wipe-requests-dialog.component.ts +++ b/frontend/src/app/modules/contract-engine/dialogs/wipe-requests-dialog/wipe-requests-dialog.component.ts @@ -30,7 +30,7 @@ export class WipeRequestsDialogComponent implements OnInit { private dialogRef: DynamicDialogRef, private config: DynamicDialogConfig, ) { - this.contract = this.config.data.contract; + this.contract = this.config.data ?? {}; this.contractId = this.contract.contractId; this.version = this.contract.version; diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.html b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.html index 0a9ff36395..69debe67f9 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.html +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.html @@ -20,7 +20,9 @@ [options]="options" optionLabel="name" (onChange)="onDropdown()" - placeholder="Выберите значение"> + placeholder="Select" + [appendTo]="'body'" + >
diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.scss b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.scss index 6776ae16fe..9f03e4fb5d 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.scss +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.scss @@ -88,3 +88,7 @@ border-radius: 4px; padding: 1px; } + +.content-dropdown ::ng-deep p-dropdown .p-dropdown { + width: 148px; +} diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.ts b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.ts index e8de6a2eab..6dfe749cb7 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.ts +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/action-block/action-block.component.ts @@ -105,7 +105,9 @@ export class ActionBlockComponent implements OnInit { if (this.type == 'dropdown') { this.field = data.field; this.options = data.options || []; - this.currentValue = this.getObjectValue(this.data, this.field); + const currentValue = this.getObjectValue(this.data, this.field); + this.currentValue = this.options.find((option: {name: string, value: string}) => + option.value === currentValue); } } else { this.data = null; @@ -200,14 +202,15 @@ export class ActionBlockComponent implements OnInit { } onDropdown() { - if (this.getObjectValue(this.data, this.field) == this.currentValue) { + if (this.getObjectValue(this.data, this.field) == this.currentValue.value) { return; } - this.setObjectValue(this.data, this.field, this.currentValue); + + this.setObjectValue(this.data, this.field, this.currentValue.value); + this.policyEngineService .setBlockData(this.id, this.policyId, this.data) .subscribe(() => { - }, (e) => { console.error(e.error); this.loading = false; diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/dropdown-block-addon/dropdown-block-addon.component.html b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/dropdown-block-addon/dropdown-block-addon.component.html index afd0c88f3b..e7a0e6cda4 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/dropdown-block-addon/dropdown-block-addon.component.html +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/dropdown-block-addon/dropdown-block-addon.component.html @@ -9,7 +9,8 @@ [options]="documents" optionLabel="name" (onChange)="onDropdown($event.value)" - placeholder="Выберите значение"> + placeholder="Select" + > diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.html b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.html index 52dbc85a53..d66c45944b 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.html +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.html @@ -16,7 +16,8 @@ [options]="options" optionLabel="name" (onChange)="onFilters()" - placeholder="Выберите значение"> + placeholder="Select" + > diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.scss b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.scss index 9fb8bf6ede..833920a234 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.scss +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.scss @@ -26,17 +26,28 @@ .content { box-shadow: 0px 3px 6px #00000020; background: #e5e5e5; - display: inline-block; + display: grid; + grid-template-columns: 1fr auto; + align-content: center; margin: 7px; - padding: 10px 10px 6px 10px; + padding: 6px 10px 6px 10px; + height: 48px; + width: 270px } .content-name { - display: inline-block; + display: grid; margin-right: 10px; + align-content: center; } .content-select { - display: inline-block; + display: grid; width: 190px; -} \ No newline at end of file + align-content: center; + + ::ng-deep .p-dropdown { + height: 36px; + width: 190px; + } +} diff --git a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.ts b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.ts index 1004912b67..6c81d8fa2f 100644 --- a/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.ts +++ b/frontend/src/app/modules/policy-engine/policy-viewer/blocks/filters-addon-block/filters-addon-block.component.ts @@ -92,7 +92,6 @@ export class FiltersAddonBlockComponent implements OnInit { this.target = data.targetBlock; this.content = data.uiMetaData.content; this.filters = data.filters; - this.currentValue = data.filterValue; if (this.type == 'unelected') { } @@ -113,6 +112,8 @@ export class FiltersAddonBlockComponent implements OnInit { } } } + this.currentValue = this.options.find((option: {value: string, name: string}) => + option.value === data.filterValue) } else { this.data = null; } @@ -121,7 +122,7 @@ export class FiltersAddonBlockComponent implements OnInit { onFilters() { this.loading = true; this.policyEngineService - .setBlockData(this.id, this.policyId, { filterValue: this.currentValue }) + .setBlockData(this.id, this.policyId, { filterValue: this.currentValue.value }) .subscribe(() => { this.loading = false; }, (e) => {