diff --git a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html index 5f023b2efb..ed26721661 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html @@ -251,7 +251,8 @@ , P extends PageLink = P entitiesDeleteEnabled = true; detailsPanelEnabled = true; hideDetailsTabsOnEdit = true; + rowPointer = false; actionsColumnTitle = null; entityTranslations: EntityTypeTranslation; entityResources: EntityTypeResource; @@ -220,6 +221,20 @@ export class EntityTableConfig, P extends PageLink = P } } + toggleEntityDetails($event: Event, entity: T) { + if (this.table) { + this.table.toggleEntityDetails($event, entity); + } + } + + isDetailsOpen(): boolean { + if (this.table) { + return this.table.isDetailsOpen; + } else { + return false; + } + } + getActivatedRoute(): ActivatedRoute { if (this.table) { return this.table.route; diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts index fddc9e94ce..ea22fa590a 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts @@ -94,6 +94,8 @@ export class DashboardsTableConfigResolver implements Resolve this.translate.instant('dashboard.delete-dashboard-title', {dashboardTitle: dashboard.title}); this.config.deleteEntityContent = () => this.translate.instant('dashboard.delete-dashboard-text'); @@ -107,6 +109,15 @@ export class DashboardsTableConfigResolver implements Resolve this.onDashboardAction(action); this.config.detailsReadonly = () => (this.config.componentsData.dashboardScope === 'customer_user' || this.config.componentsData.dashboardScope === 'edge_customer_user'); + + this.config.handleRowClick = ($event, dashboard) => { + if (this.config.isDetailsOpen()) { + this.config.toggleEntityDetails($event, dashboard); + } else { + this.openDashboard($event, dashboard); + } + return true; + }; } resolve(route: ActivatedRouteSnapshot): Observable> { @@ -197,14 +208,6 @@ export class DashboardsTableConfigResolver implements Resolve> { const actions: Array> = []; - actions.push( - { - name: this.translate.instant('dashboard.open-dashboard'), - icon: 'dashboard', - isEnabled: () => true, - onAction: ($event, entity) => this.openDashboard($event, entity) - } - ); if (dashboardScope === 'tenant') { actions.push( { @@ -271,6 +274,14 @@ export class DashboardsTableConfigResolver implements Resolve true, + onAction: ($event, entity) => this.config.toggleEntityDetails($event, entity) + } + ); return actions; } diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts index a3ff812359..b414f2ff21 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts @@ -74,6 +74,8 @@ export class RuleChainsTableConfigResolver implements Resolve this.translate.instant('rulechain.delete-rulechain-title', {ruleChainName: ruleChain.name}); this.config.deleteEntityContent = () => this.translate.instant('rulechain.delete-rulechain-text'); @@ -83,6 +85,14 @@ export class RuleChainsTableConfigResolver implements Resolve this.saveRuleChain(ruleChain); this.config.deleteEntity = id => this.ruleChainService.deleteRuleChain(id.id); this.config.onEntityAction = action => this.onRuleChainAction(action); + this.config.handleRowClick = ($event, ruleChain) => { + if (this.config.isDetailsOpen()) { + this.config.toggleEntityDetails($event, ruleChain); + } else { + this.openRuleChain($event, ruleChain); + } + return true; + }; } resolve(route: ActivatedRouteSnapshot): EntityTableConfig { @@ -214,12 +224,6 @@ export class RuleChainsTableConfigResolver implements Resolve> { const actions: Array> = []; actions.push( - { - name: this.translate.instant('rulechain.open-rulechain'), - icon: 'settings_ethernet', - isEnabled: () => true, - onAction: ($event, entity) => this.openRuleChain($event, entity) - }, { name: this.translate.instant('rulechain.export'), icon: 'file_download', @@ -275,6 +279,14 @@ export class RuleChainsTableConfigResolver implements Resolve true, + onAction: ($event, entity) => this.config.toggleEntityDetails($event, entity) + } + ); return actions; } diff --git a/ui-ngx/src/app/modules/home/pages/widget/widget-library.component.html b/ui-ngx/src/app/modules/home/pages/widget/widget-library.component.html index 5ce4f3f1cf..4c74e68f62 100644 --- a/ui-ngx/src/app/modules/home/pages/widget/widget-library.component.html +++ b/ui-ngx/src/app/modules/home/pages/widget/widget-library.component.html @@ -27,7 +27,8 @@ style="display: flex;" class="mat-headline tb-absolute-fill">widgets-bundle.empty - widgetsBundle ? widgetsBundle.title : ''; @@ -89,17 +91,17 @@ export class WidgetsBundlesTableConfigResolver implements Resolve true, - onAction: ($event, entity) => this.openWidgetsBundle($event, entity) - }, { name: this.translate.instant('widgets-bundle.export'), icon: 'file_download', isEnabled: () => true, onAction: ($event, entity) => this.exportWidgetsBundle($event, entity) + }, + { + name: this.translate.instant('widgets-bundle.widgets-bundle-details'), + icon: 'edit', + isEnabled: () => true, + onAction: ($event, entity) => this.config.toggleEntityDetails($event, entity) } ); @@ -114,6 +116,15 @@ export class WidgetsBundlesTableConfigResolver implements Resolve this.widgetsService.saveWidgetsBundle(widgetsBundle); this.config.deleteEntity = id => this.widgetsService.deleteWidgetsBundle(id.id); this.config.onEntityAction = action => this.onWidgetsBundleAction(action); + + this.config.handleRowClick = ($event, widgetsBundle) => { + if (this.config.isDetailsOpen()) { + this.config.toggleEntityDetails($event, widgetsBundle); + } else { + this.openWidgetsBundle($event, widgetsBundle); + } + return true; + }; } resolve(): EntityTableConfig { diff --git a/ui-ngx/src/styles.scss b/ui-ngx/src/styles.scss index 8c6fffabf1..44480b8e1b 100644 --- a/ui-ngx/src/styles.scss +++ b/ui-ngx/src/styles.scss @@ -1011,6 +1011,9 @@ mat-label { &.tb-current-entity { background-color: #e9e9e9; } + &.tb-pointer { + cursor: pointer; + } } .mat-row:not(.mat-row-select), .mat-header-row:not(.mat-row-select) {