Browse Source
Merge pull request #9576 from rusikv/bug/alarm-table-widget-edit-selection
Fixed alarm widget table selection and text search prevents editing widget
pull/10713/head
Igor Kulikov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
9 additions and
2 deletions
-
application/src/main/data/json/system/widget_types/alarms_table.json
-
ui-ngx/src/app/modules/home/components/widget/lib/alarm/alarms-table-widget.component.ts
|
|
|
@ -11,7 +11,7 @@ |
|
|
|
"resources": [], |
|
|
|
"templateHtml": "<tb-alarms-table-widget \n [ctx]=\"ctx\">\n</tb-alarms-table-widget>", |
|
|
|
"templateCss": "", |
|
|
|
"controllerScript": "self.onInit = function() {\n}\n\nself.onDataUpdated = function() {\n self.ctx.$scope.alarmsTableWidget.onDataUpdated();\n}\n\nself.actionSources = function() {\n return {\n 'actionCellButton': {\n name: 'widget-action.action-cell-button',\n multiple: true,\n hasShowCondition: true\n },\n 'rowClick': {\n name: 'widget-action.row-click',\n multiple: false\n }\n };\n}\n\nself.onDestroy = function() {\n}\n", |
|
|
|
"controllerScript": "self.onInit = function() {\n}\n\nself.onDataUpdated = function() {\n self.ctx.$scope.alarmsTableWidget.onDataUpdated();\n}\n\nself.onEditModeChanged = function() {\n self.ctx.$scope.alarmsTableWidget.onEditModeChanged();\n}\n\nself.actionSources = function() {\n return {\n 'actionCellButton': {\n name: 'widget-action.action-cell-button',\n multiple: true,\n hasShowCondition: true\n },\n 'rowClick': {\n name: 'widget-action.row-click',\n multiple: false\n }\n };\n}\n\nself.onDestroy = function() {\n}\n", |
|
|
|
"settingsSchema": "", |
|
|
|
"dataKeySettingsSchema": "", |
|
|
|
"settingsDirective": "tb-alarms-table-widget-settings", |
|
|
|
|
|
|
|
@ -321,6 +321,13 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, |
|
|
|
this.ctx.detectChanges(); |
|
|
|
} |
|
|
|
|
|
|
|
public onEditModeChanged() { |
|
|
|
if (this.textSearchMode || this.enableSelection && this.alarmsDatasource.selection.hasValue()) { |
|
|
|
this.ctx.hideTitlePanel = !this.ctx.isEdit; |
|
|
|
this.ctx.detectChanges(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public pageLinkSortDirection(): SortDirection { |
|
|
|
return entityDataPageLinkSortDirection(this.pageLink); |
|
|
|
} |
|
|
|
@ -487,7 +494,7 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, |
|
|
|
this.alarmsDatasource = new AlarmsDatasource(this.subscription, latestDataKeys, this.ngZone, this.ctx, actionCellDescriptors); |
|
|
|
if (this.enableSelection) { |
|
|
|
this.alarmsDatasource.selectionModeChanged$.subscribe((selectionMode) => { |
|
|
|
const hideTitlePanel = selectionMode || this.textSearchMode; |
|
|
|
const hideTitlePanel = selectionMode || this.textSearchMode && !this.ctx.isEdit; |
|
|
|
if (this.ctx.hideTitlePanel !== hideTitlePanel) { |
|
|
|
this.ctx.hideTitlePanel = hideTitlePanel; |
|
|
|
this.ctx.detectChanges(true); |
|
|
|
|