diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts
index a8acb51291..85f12c2a32 100644
--- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts
+++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts
@@ -140,7 +140,7 @@ import { MatButton } from '@angular/material/button';
import { VersionControlComponent } from '@home/components/vc/version-control.component';
import { TbPopoverService } from '@shared/components/popover.service';
import { tap } from 'rxjs/operators';
-import { LayoutWidthType } from "@home/components/dashboard-page/layout/layout.models";
+import { LayoutWidthType } from '@home/components/dashboard-page/layout/layout.models';
// @dynamic
@Component({
@@ -685,34 +685,34 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
}
private calculateWidth(layout: DashboardLayoutId): string {
- let layoutDimension: LayoutDimension;
- const mainLayout = this.dashboard.configuration.states[this.dashboardCtx.state].layouts.main;
- const rightLayout = this.dashboard.configuration.states[this.dashboardCtx.state].layouts.right;
- if (rightLayout) {
- if (mainLayout.gridSettings.layoutDimension) {
- layoutDimension = mainLayout.gridSettings.layoutDimension;
- } else {
- layoutDimension = rightLayout.gridSettings.layoutDimension;
- }
+ let layoutDimension: LayoutDimension;
+ const mainLayout = this.dashboard.configuration.states[this.dashboardCtx.state].layouts.main;
+ const rightLayout = this.dashboard.configuration.states[this.dashboardCtx.state].layouts.right;
+ if (rightLayout) {
+ if (mainLayout.gridSettings.layoutDimension) {
+ layoutDimension = mainLayout.gridSettings.layoutDimension;
+ } else {
+ layoutDimension = rightLayout.gridSettings.layoutDimension;
}
- if (layoutDimension) {
- if (layoutDimension.type === LayoutWidthType.PERCENTAGE) {
- if (layout === 'right') {
- return (100 - layoutDimension.leftWidthPercentage) + '%';
- } else {
- return layoutDimension.leftWidthPercentage + '%';
- }
+ }
+ if (layoutDimension) {
+ if (layoutDimension.type === LayoutWidthType.PERCENTAGE) {
+ if (layout === 'right') {
+ return (100 - layoutDimension.leftWidthPercentage) + '%';
} else {
- if (layoutDimension.fixedLayout === layout) {
- return layoutDimension.fixedWidth + 'px';
- } else {
- const layoutWidth = this.dashboardContainer.nativeElement.getBoundingClientRect().width - layoutDimension.fixedWidth;
- return layoutWidth + 'px';
- }
+ return layoutDimension.leftWidthPercentage + '%';
}
} else {
- return '50%';
+ if (layoutDimension.fixedLayout === layout) {
+ return layoutDimension.fixedWidth + 'px';
+ } else {
+ const layoutWidth = this.dashboardContainer.nativeElement.getBoundingClientRect().width - layoutDimension.fixedWidth;
+ return layoutWidth + 'px';
+ }
}
+ } else {
+ return '50%';
+ }
}
public rightLayoutHeight(): string {
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts
index ea2421ed1e..4fadc96039 100644
--- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts
+++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts
@@ -14,12 +14,7 @@
/// limitations under the License.
///
-import {
- Dashboard,
- DashboardLayoutId,
- GridSettings,
- WidgetLayouts
-} from '@app/shared/models/dashboard.models';
+import { Dashboard, DashboardLayoutId, GridSettings, WidgetLayouts } from '@app/shared/models/dashboard.models';
import { Widget, WidgetPosition } from '@app/shared/models/widget.models';
import { Timewindow } from '@shared/models/time/time.models';
import { IAliasController, IStateController } from '@core/api/widget-api.models';
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/layout.models.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/layout.models.ts
index 768d300934..d27922f500 100644
--- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/layout.models.ts
+++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/layout.models.ts
@@ -24,7 +24,7 @@ export interface ILayoutController {
}
export enum LayoutWidthType {
- PERCENTAGE = "percentage",
- FIXED = "fixed"
+ PERCENTAGE = 'percentage',
+ FIXED = 'fixed'
}
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html
index a4923cd305..7cc135e68f 100644
--- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html
+++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html
@@ -25,167 +25,147 @@