Showing
4 changed files
with
12 additions
and
7 deletions
... | ... | @@ -524,7 +524,7 @@ public class DashboardController extends BaseController { |
524 | 524 | JsonNode additionalInfo = tenant.getAdditionalInfo(); |
525 | 525 | DashboardId dashboardId = null; |
526 | 526 | boolean hideDashboardToolbar = true; |
527 | - if (additionalInfo != null && additionalInfo.has(HOME_DASHBOARD_ID)) { | |
527 | + if (additionalInfo != null && additionalInfo.has(HOME_DASHBOARD_ID) && !additionalInfo.get(HOME_DASHBOARD_ID).isNull()) { | |
528 | 528 | String strDashboardId = additionalInfo.get(HOME_DASHBOARD_ID).asText(); |
529 | 529 | dashboardId = new DashboardId(toUUID(strDashboardId)); |
530 | 530 | if (additionalInfo.has(HOME_DASHBOARD_HIDE_TOOLBAR)) { |
... | ... | @@ -566,7 +566,7 @@ public class DashboardController extends BaseController { |
566 | 566 | |
567 | 567 | private HomeDashboard extractHomeDashboardFromAdditionalInfo(JsonNode additionalInfo) { |
568 | 568 | try { |
569 | - if (additionalInfo != null && additionalInfo.has(HOME_DASHBOARD_ID)) { | |
569 | + if (additionalInfo != null && additionalInfo.has(HOME_DASHBOARD_ID) && !additionalInfo.get(HOME_DASHBOARD_ID).isNull()) { | |
570 | 570 | String strDashboardId = additionalInfo.get(HOME_DASHBOARD_ID).asText(); |
571 | 571 | DashboardId dashboardId = new DashboardId(toUUID(strDashboardId)); |
572 | 572 | Dashboard dashboard = checkDashboardId(dashboardId, Operation.READ); | ... | ... |
... | ... | @@ -223,6 +223,7 @@ export class MenuService { |
223 | 223 | name: 'home.home', |
224 | 224 | type: 'link', |
225 | 225 | path: '/home', |
226 | + notExact: true, | |
226 | 227 | icon: 'home' |
227 | 228 | }, |
228 | 229 | { |
... | ... | @@ -409,6 +410,7 @@ export class MenuService { |
409 | 410 | name: 'home.home', |
410 | 411 | type: 'link', |
411 | 412 | path: '/home', |
413 | + notExact: true, | |
412 | 414 | icon: 'home' |
413 | 415 | }, |
414 | 416 | { | ... | ... |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | <tb-states-component fxFlex.lt-md |
50 | 50 | [statesControllerId]="isEdit ? 'default' : dashboardConfiguration.settings.stateControllerId" |
51 | 51 | [dashboardCtrl]="this" |
52 | - [dashboardId]="dashboard.id ? dashboard.id.id : ''" | |
52 | + [dashboardId]="(!embedded && dashboard.id) ? dashboard.id.id : ''" | |
53 | 53 | [isMobile]="isMobile" |
54 | 54 | [state]="dashboardCtx.state" |
55 | 55 | [currentState]="currentState" |
... | ... | @@ -78,7 +78,7 @@ |
78 | 78 | (click)="isFullscreen = !isFullscreen"> |
79 | 79 | <mat-icon>{{ isFullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon> |
80 | 80 | </button> |
81 | - <button [fxShow]="isEdit || displayExport()" mat-icon-button | |
81 | + <button [fxShow]="currentDashboardId && (isEdit || displayExport())" mat-icon-button | |
82 | 82 | matTooltip="{{'dashboard.export' | translate}}" |
83 | 83 | matTooltipPosition="below" |
84 | 84 | (click)="exportDashboard($event)"> |
... | ... | @@ -118,7 +118,7 @@ |
118 | 118 | (click)="openDashboardSettings($event)"> |
119 | 119 | <mat-icon>settings</mat-icon> |
120 | 120 | </button> |
121 | - <tb-dashboard-select [fxShow]="!isEdit && !widgetEditMode && displayDashboardsSelect()" | |
121 | + <tb-dashboard-select [fxShow]="!isEdit && !widgetEditMode && !embedded && displayDashboardsSelect()" | |
122 | 122 | [(ngModel)]="currentDashboardId" |
123 | 123 | (ngModelChange)="currentDashboardIdChanged(currentDashboardId)" |
124 | 124 | [customerId]="currentCustomerId" | ... | ... |
... | ... | @@ -266,9 +266,12 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
266 | 266 | this.rxSubscriptions.push(this.route.data.subscribe( |
267 | 267 | (data) => { |
268 | 268 | if (this.embedded) { |
269 | - data.dashboard = this.dashboard; | |
269 | + data.dashboard = this.dashboardUtils.validateAndUpdateDashboard(this.dashboard); | |
270 | + data.currentDashboardId = this.dashboard.id ? this.dashboard.id.id : null; | |
270 | 271 | data.widgetEditMode = false; |
271 | 272 | data.singlePageMode = false; |
273 | + } else { | |
274 | + data.currentDashboardId = this.route.snapshot.params.dashboardId; | |
272 | 275 | } |
273 | 276 | this.init(data); |
274 | 277 | this.runChangeDetection(); |
... | ... | @@ -286,7 +289,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
286 | 289 | |
287 | 290 | this.reset(); |
288 | 291 | |
289 | - this.currentDashboardId = this.route.snapshot.params.dashboardId; | |
292 | + this.currentDashboardId = data.currentDashboardId; | |
290 | 293 | |
291 | 294 | if (this.route.snapshot.params.customerId) { |
292 | 295 | this.currentCustomerId = this.route.snapshot.params.customerId; | ... | ... |