Commit 5d9ea35fd9d0b773aaeba6cb07e0e39cbf9212d3
Committed by
GitHub
Merge pull request #4284 from TTvanWillegen/master
UI: Added show logo option in dashboard settings [Issue #3544]
Showing
8 changed files
with
39 additions
and
3 deletions
... | ... | @@ -56,6 +56,8 @@ |
56 | 56 | [syncStateWithQueryParam]="syncStateWithQueryParam" |
57 | 57 | [states]="dashboardConfiguration.states"> |
58 | 58 | </tb-states-component> |
59 | + <img *ngIf="showDashboardLogo() && isFullscreen" [src]="dashboardLogo" | |
60 | + aria-label="dashboard_logo" class="dashboard_logo"/> | |
59 | 61 | </div> |
60 | 62 | <div class="tb-dashboard-action-panel" fxFlex="1 0 auto" fxLayout="row-reverse" |
61 | 63 | fxLayoutAlign.gt-sm="start center" fxLayoutAlign="space-between center" fxLayoutGap="12px"> | ... | ... |
... | ... | @@ -54,6 +54,11 @@ div.tb-dashboard-page { |
54 | 54 | z-index: 13; |
55 | 55 | pointer-events: none; |
56 | 56 | |
57 | + .dashboard_logo{ | |
58 | + height: 75%; | |
59 | + margin-right: 16px; | |
60 | + } | |
61 | + | |
57 | 62 | &.tb-dashboard-toolbar-opened { |
58 | 63 | right: 0; |
59 | 64 | // transition: right .3s cubic-bezier(.55, 0, .55, .2); | ... | ... |
... | ... | @@ -191,6 +191,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
191 | 191 | |
192 | 192 | addingLayoutCtx: DashboardPageLayoutContext; |
193 | 193 | |
194 | + logo = 'assets/logo_title_white.svg'; | |
194 | 195 | |
195 | 196 | dashboardCtx: DashboardContext = { |
196 | 197 | instanceId: this.utils.guid(), |
... | ... | @@ -484,6 +485,19 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
484 | 485 | } |
485 | 486 | } |
486 | 487 | |
488 | + public showDashboardLogo(): boolean { | |
489 | + if (this.dashboard.configuration.settings && | |
490 | + isDefined(this.dashboard.configuration.settings.showDashboardLogo)) { | |
491 | + return this.dashboard.configuration.settings.showDashboardLogo; | |
492 | + } else { | |
493 | + return false; | |
494 | + } | |
495 | + } | |
496 | + | |
497 | + public get dashboardLogo(): string { | |
498 | + return this.dashboard.configuration.settings.dashboardLogoUrl || this.logo; | |
499 | + } | |
500 | + | |
487 | 501 | public showRightLayoutSwitch(): boolean { |
488 | 502 | return this.isMobile && this.layouts.right.show; |
489 | 503 | } |
... | ... | @@ -605,7 +619,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC |
605 | 619 | panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], |
606 | 620 | data: { |
607 | 621 | settings: deepClone(this.dashboard.configuration.settings), |
608 | - gridSettings | |
622 | + gridSettings, | |
609 | 623 | } |
610 | 624 | }).afterClosed().subscribe((data) => { |
611 | 625 | if (data) { | ... | ... |
... | ... | @@ -52,7 +52,8 @@ |
52 | 52 | formControlName="titleColor"> |
53 | 53 | </tb-color-input> |
54 | 54 | </div> |
55 | - <div fxLayout="row" fxLayoutAlign="start center" fxLayout.lt-md="column" fxLayoutAlign.lt-md fxLayoutGap="8px"> | |
55 | + <div fxLayout="row" fxLayoutAlign="start center" style="margin-bottom: 8px;" | |
56 | + fxLayout.lt-md="column" fxLayoutAlign.lt-md fxLayoutGap="8px"> | |
56 | 57 | <mat-checkbox fxFlex formControlName="showDashboardsSelect"> |
57 | 58 | {{ 'dashboard.display-dashboards-selection' | translate }} |
58 | 59 | </mat-checkbox> |
... | ... | @@ -69,6 +70,13 @@ |
69 | 70 | {{ 'dashboard.display-dashboard-export' | translate }} |
70 | 71 | </mat-checkbox> |
71 | 72 | </div> |
73 | + <mat-checkbox formControlName="showDashboardLogo"> | |
74 | + {{ 'dashboard.display-dashboard-toolbar-logo' | translate }} | |
75 | + </mat-checkbox> | |
76 | + <tb-image-input fxFlex *ngIf="settingsFormGroup.get('showDashboardLogo').value" | |
77 | + label="{{'dashboard.dashboard-logo-image' | translate}}" | |
78 | + formControlName="dashboardLogoUrl"> | |
79 | + </tb-image-input> | |
72 | 80 | </div> |
73 | 81 | <div *ngIf="gridSettings" [formGroup]="gridSettingsFormGroup"> |
74 | 82 | <tb-color-input fxFlex | ... | ... |
... | ... | @@ -79,6 +79,8 @@ export class DashboardSettingsDialogComponent extends DialogComponent<DashboardS |
79 | 79 | showDashboardsSelect: [isUndefined(this.settings.showDashboardsSelect) ? true : this.settings.showDashboardsSelect, []], |
80 | 80 | showEntitiesSelect: [isUndefined(this.settings.showEntitiesSelect) ? true : this.settings.showEntitiesSelect, []], |
81 | 81 | showFilters: [isUndefined(this.settings.showFilters) ? true : this.settings.showFilters, []], |
82 | + showDashboardLogo: [isUndefined(this.settings.showDashboardLogo) ? false : this.settings.showDashboardLogo, []], | |
83 | + dashboardLogoUrl: [isUndefined(this.settings.dashboardLogoUrl) ? null : this.settings.dashboardLogoUrl, []], | |
82 | 84 | showDashboardTimewindow: [isUndefined(this.settings.showDashboardTimewindow) ? true : this.settings.showDashboardTimewindow, []], |
83 | 85 | showDashboardExport: [isUndefined(this.settings.showDashboardExport) ? true : this.settings.showDashboardExport, []] |
84 | 86 | }); | ... | ... |
... | ... | @@ -4413,7 +4413,8 @@ |
4413 | 4413 | "showDashboardExport": false, |
4414 | 4414 | "toolbarAlwaysOpen": true, |
4415 | 4415 | "titleColor": "rgba(0,0,0,0.870588)", |
4416 | - "showFilters": false | |
4416 | + "showFilters": false, | |
4417 | + "showDashboardLogo": false | |
4417 | 4418 | } |
4418 | 4419 | }, |
4419 | 4420 | "name": "Api Usage" | ... | ... |
... | ... | @@ -86,6 +86,8 @@ export interface DashboardSettings { |
86 | 86 | showDashboardsSelect?: boolean; |
87 | 87 | showEntitiesSelect?: boolean; |
88 | 88 | showFilters?: boolean; |
89 | + showDashboardLogo?: boolean; | |
90 | + dashboardLogoUrl?: string; | |
89 | 91 | showDashboardTimewindow?: boolean; |
90 | 92 | showDashboardExport?: boolean; |
91 | 93 | toolbarAlwaysOpen?: boolean; | ... | ... |
... | ... | @@ -746,6 +746,8 @@ |
746 | 746 | "display-filters": "Display filters", |
747 | 747 | "display-dashboard-timewindow": "Display timewindow", |
748 | 748 | "display-dashboard-export": "Display export", |
749 | + "display-dashboard-toolbar-logo": "Display dashboard logo in fullscreen mode", | |
750 | + "dashboard-logo-image": "Dashboard image logo", | |
749 | 751 | "import": "Import dashboard", |
750 | 752 | "export": "Export dashboard", |
751 | 753 | "export-failed-error": "Unable to export dashboard: {{error}}", | ... | ... |