Browse Source

Merge branch 'feature/iot-hub' into feature/lts-4.3-iot-hub

pull/15690/head
Igor Kulikov 2 weeks ago
parent
commit
dfd61e0c39
  1. 30
      application/src/main/data/json/system/widget_types/iot_hub.json
  2. 45
      ui-ngx/src/app/modules/home/pages/widget/widget-types-table-config.resolver.ts

30
application/src/main/data/json/system/widget_types/iot_hub.json

File diff suppressed because one or more lines are too long

45
ui-ngx/src/app/modules/home/pages/widget/widget-types-table-config.resolver.ts

@ -90,27 +90,6 @@ export class WidgetTypesTableConfigResolver {
entity => checkBoxCell(entity.deprecated))
);
this.config.addActionDescriptors.push(
{
name: this.translate.instant('dashboard.create-new-widget'),
icon: 'insert_drive_file',
isEnabled: () => true,
onAction: ($event) => this.addWidgetType($event)
},
{
name: this.translate.instant('widget.import'),
icon: 'file_upload',
isEnabled: () => true,
onAction: ($event) => this.importWidgetType($event)
},
{
name: this.translate.instant('iot-hub.add-from-iot-hub'),
icon: 'store',
isEnabled: () => true,
onAction: (_$event) => this.addWidgetFromIotHub()
}
);
this.config.cellActionDescriptors.push(
{
name: this.translate.instant('widget.export'),
@ -160,6 +139,30 @@ export class WidgetTypesTableConfigResolver {
resolve(): EntityTableConfig<WidgetTypeInfo | WidgetTypeDetails> {
this.config.tableTitle = this.translate.instant('widget.widgets');
const authUser = getCurrentAuthUser(this.store);
this.config.addActionDescriptors = [
{
name: this.translate.instant('dashboard.create-new-widget'),
icon: 'insert_drive_file',
isEnabled: () => true,
onAction: ($event) => this.addWidgetType($event)
},
{
name: this.translate.instant('widget.import'),
icon: 'file_upload',
isEnabled: () => true,
onAction: ($event) => this.importWidgetType($event)
}
];
if (authUser.authority === Authority.TENANT_ADMIN) {
this.config.addActionDescriptors.push(
{
name: this.translate.instant('iot-hub.add-from-iot-hub'),
icon: 'store',
isEnabled: () => true,
onAction: (_$event) => this.addWidgetFromIotHub()
}
);
}
this.config.deleteEnabled = (widgetType) => this.isWidgetTypeEditable(widgetType, authUser.authority);
this.config.entitySelectionEnabled = (widgetType) => this.isWidgetTypeEditable(widgetType, authUser.authority);
this.config.detailsReadonly = (widgetType) => !this.isWidgetTypeEditable(widgetType, authUser.authority);

Loading…
Cancel
Save