Browse Source
Merge pull request #14020 from mtsymbarov-del/fix/entities-table-widget
Fixed column order for "On cell click" action for Entities Table widget
pull/14063/head
Igor Kulikov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
21 additions and
2 deletions
-
ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.html
-
ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts
|
|
|
@ -57,7 +57,7 @@ |
|
|
|
<mat-option *ngFor="let column of configuredColumns; let $index = index" |
|
|
|
[value]="$index" |
|
|
|
[disabled]="usedCellClickColumns.includes($index)"> |
|
|
|
{{ getCellClickColumnInfo($index, column) }} |
|
|
|
{{ getCellClickColumnInfo($index, column) | customTranslate }} |
|
|
|
</mat-option> |
|
|
|
</mat-select> |
|
|
|
<mat-icon matSuffix |
|
|
|
|
|
|
|
@ -926,7 +926,26 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe |
|
|
|
if (this.modelValue) { |
|
|
|
const configuredColumns = new Array<CellClickColumnInfo>(); |
|
|
|
if (this.modelValue.config?.datasources[0]?.dataKeys?.length) { |
|
|
|
configuredColumns.push(...this.keysToCellClickColumns(this.modelValue.config.datasources[0].dataKeys)); |
|
|
|
const { |
|
|
|
displayEntityLabel, |
|
|
|
displayEntityName, |
|
|
|
displayEntityType, |
|
|
|
entityNameColumnTitle, |
|
|
|
entityLabelColumnTitle |
|
|
|
} = this.modelValue.config.settings; |
|
|
|
const displayEntitiesArray = []; |
|
|
|
if (isDefined(displayEntityName)) { |
|
|
|
const displayName = entityNameColumnTitle ? entityNameColumnTitle : 'entityName'; |
|
|
|
displayEntitiesArray.push({name: displayName, label: displayName}); |
|
|
|
} |
|
|
|
if (isDefined(displayEntityLabel)) { |
|
|
|
const displayLabel = entityLabelColumnTitle ? entityLabelColumnTitle : 'entityLabel'; |
|
|
|
displayEntitiesArray.push({name: displayLabel, label: displayLabel}); |
|
|
|
} |
|
|
|
if (isDefined(displayEntityType)) { |
|
|
|
displayEntitiesArray.push({name: 'entityType', label: 'entityType'}); |
|
|
|
} |
|
|
|
configuredColumns.push(...displayEntitiesArray, ...this.keysToCellClickColumns(this.modelValue.config.datasources[0].dataKeys)); |
|
|
|
} |
|
|
|
if (this.modelValue.config?.alarmSource?.dataKeys?.length) { |
|
|
|
configuredColumns.push(...this.keysToCellClickColumns(this.modelValue.config.alarmSource.dataKeys)); |
|
|
|
|