From 04ec347eebf43e44b07f29e1922464604bcbe972 Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Thu, 16 Apr 2020 15:59:26 -0700 Subject: [PATCH] fix clipping issue (#10020) * fix clipping issue * remove hardcoded height --- .../dashboardGridContainer.component.ts | 4 +- .../dashboardHomeContainer.component.ts | 4 +- .../browser/core/dashboardPage.component.html | 48 ++++++++++--------- .../browser/core/dashboardPage.component.ts | 4 ++ 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardGridContainer.component.ts b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardGridContainer.component.ts index df8429e785..e19977a57e 100644 --- a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardGridContainer.component.ts +++ b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardGridContainer.component.ts @@ -5,7 +5,7 @@ import 'vs/css!./dashboardGridContainer'; -import { Component, Inject, Input, forwardRef, ElementRef, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, ContentChild } from '@angular/core'; +import { Component, Inject, Input, forwardRef, ElementRef, ViewChildren, QueryList, OnDestroy, ChangeDetectorRef, ViewChild } from '@angular/core'; import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { TabConfig, WidgetConfig } from 'sql/workbench/contrib/dashboard/browser/core/dashboardWidget'; @@ -206,7 +206,7 @@ export class DashboardGridContainer extends DashboardTab implements OnDestroy { @ViewChildren(DashboardWidgetWrapper) private _widgets: QueryList; @ViewChildren(WebviewContent) private _webViews: QueryList; - @ContentChild(ScrollableDirective) private _scrollable: ScrollableDirective; + @ViewChild(ScrollableDirective) private _scrollable: ScrollableDirective; constructor( @Inject(forwardRef(() => CommonServiceInterface)) protected dashboardService: CommonServiceInterface, @Inject(forwardRef(() => ElementRef)) protected _el: ElementRef, diff --git a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts index df6b13f920..87a8b512ca 100644 --- a/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts +++ b/src/sql/workbench/contrib/dashboard/browser/containers/dashboardHomeContainer.component.ts @@ -5,7 +5,7 @@ import 'vs/css!./dashboardHomeContainer'; -import { Component, forwardRef, Input, ChangeDetectorRef, Inject, ViewChild, ContentChild, ElementRef } from '@angular/core'; +import { Component, forwardRef, Input, ChangeDetectorRef, Inject, ViewChild, ElementRef } from '@angular/core'; import { DashboardWidgetContainer } from 'sql/workbench/contrib/dashboard/browser/containers/dashboardWidgetContainer.component'; import { WidgetConfig } from 'sql/workbench/contrib/dashboard/browser/core/dashboardWidget'; @@ -44,7 +44,7 @@ export class DashboardHomeContainer extends DashboardWidgetContainer { @Input() private properties: WidgetConfig; @ViewChild('propertiesClass') private _propertiesClass: DashboardWidgetWrapper; @ViewChild('propertiesContainer') private _propertiesContainer: ElementRef; - @ContentChild(ScrollableDirective) private _scrollable: ScrollableDirective; + @ViewChild(ScrollableDirective) private _scrollable: ScrollableDirective; constructor( @Inject(forwardRef(() => ChangeDetectorRef)) _cd: ChangeDetectorRef, diff --git a/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.html b/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.html index 4b4ae5a31e..f634db9934 100644 --- a/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.html +++ b/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.html @@ -8,28 +8,30 @@ [actions]="panelActions">
- - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + - - + +
diff --git a/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.ts b/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.ts index 64a4a9e975..5b68bf5242 100644 --- a/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.ts +++ b/src/sql/workbench/contrib/dashboard/browser/core/dashboardPage.component.ts @@ -553,4 +553,8 @@ export abstract class DashboardPage extends AngularDisposable implements IConfig const border = theme.getColor(DASHBOARD_BORDER); this.toolbarContainer.nativeElement.style.borderBottomColor = border.toString(); } + + public getContentAreaHeight() { + return this.showToolbar ? `calc(100% - ${(this.toolbarContainer.nativeElement).clientHeight}px)` : '100%'; + } }