Agent layout fixes (#1559)

* added layout to agent

* formatting

* formatting
This commit is contained in:
Anthony Dresser
2018-06-07 14:57:50 -07:00
committed by GitHub
parent e9747a61ac
commit 0a839c7321
5 changed files with 52 additions and 42 deletions

View File

@@ -242,4 +242,8 @@ export class PanelComponent extends Disposable {
this.selectTab(this._mru[0]); this.selectTab(this._mru[0]);
} }
} }
public layout() {
this._activeTab.layout();
}
} }

View File

@@ -72,4 +72,8 @@ export class TabComponent implements OnDestroy {
return false; return false;
} }
} }
public layout() {
this._child.layout();
}
} }

View File

@@ -44,6 +44,7 @@ export class ControlHostContent {
} }
public layout(): void { public layout(): void {
this._agentViewComponent.layout();
} }
public get id(): string { public get id(): string {

View File

@@ -103,4 +103,8 @@ export class AgentViewComponent {
public setExpanded(jobId: string, errorMessage: string) { public setExpanded(jobId: string, errorMessage: string) {
this._expanded.set(jobId, errorMessage); this._expanded.set(jobId, errorMessage);
} }
public layout() {
this._panel.layout();
}
} }

View File

@@ -12,37 +12,29 @@ import 'vs/css!../common/media/jobs';
import 'vs/css!sql/media/icons/common-icons'; import 'vs/css!sql/media/icons/common-icons';
import { Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, AfterContentChecked } from '@angular/core'; import { Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, AfterContentChecked } from '@angular/core';
import { FieldType, IObservableCollection, CollectionChange, SlickGrid } from 'angular2-slickgrid';
import * as sqlops from 'sqlops'; import * as sqlops from 'sqlops';
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import { IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IDisposable } from 'vs/base/common/lifecycle';
import * as themeColors from 'vs/workbench/common/theme';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import * as nls from 'vs/nls'; import * as nls from 'vs/nls';
import * as dom from 'vs/base/browser/dom';
import { IGridDataSet } from 'sql/parts/grid/common/interfaces';
import { Table } from 'sql/base/browser/ui/table/table'; import { Table } from 'sql/base/browser/ui/table/table';
import { attachTableStyler } from 'sql/common/theme/styler';
import { JobHistoryComponent } from './jobHistory.component';
import { AgentViewComponent } from '../agent/agentView.component'; import { AgentViewComponent } from '../agent/agentView.component';
import { RowDetailView } from 'sql/base/browser/ui/table/plugins/rowdetailview'; import { RowDetailView } from 'sql/base/browser/ui/table/plugins/rowdetailview';
import { JobCacheObject } from 'sql/parts/jobManagement/common/jobManagementService'; import { JobCacheObject } from 'sql/parts/jobManagement/common/jobManagementService';
import { AgentJobUtilities } from '../common/agentJobUtilities'; import { AgentJobUtilities } from '../common/agentJobUtilities';
import * as Utils from 'sql/parts/connection/common/utils';
import { IJobManagementService } from '../common/interfaces'; import { IJobManagementService } from '../common/interfaces';
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service'; import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
import { DashboardPage } from 'sql/parts/dashboard/common/dashboardPage.component'; import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
export const JOBSVIEW_SELECTOR: string = 'jobsview-component'; export const JOBSVIEW_SELECTOR: string = 'jobsview-component';
@Component({ @Component({
selector: JOBSVIEW_SELECTOR, selector: JOBSVIEW_SELECTOR,
templateUrl: decodeURI(require.toUrl('./jobsView.component.html')) templateUrl: decodeURI(require.toUrl('./jobsView.component.html')),
providers: [{ provide: TabChild, useExisting: forwardRef(() => JobsViewComponent) }],
}) })
export class JobsViewComponent implements AfterContentChecked { export class JobsViewComponent implements AfterContentChecked {
@@ -97,6 +89,10 @@ export class JobsViewComponent implements AfterContentChecked {
this._isCloud = this._dashboardService.connectionManagementService.connectionInfo.serverInfo.isCloud; this._isCloud = this._dashboardService.connectionManagementService.connectionInfo.serverInfo.isCloud;
} }
public layout() {
this._table.layout(new dom.Dimension(dom.getContentWidth(this._gridEl.nativeElement), dom.getContentHeight(this._gridEl.nativeElement)));
}
ngAfterContentChecked() { ngAfterContentChecked() {
if (this.isVisible === false && this._gridEl.nativeElement.offsetParent !== null) { if (this.isVisible === false && this._gridEl.nativeElement.offsetParent !== null) {
this.isVisible = true; this.isVisible = true;
@@ -274,7 +270,8 @@ export class JobsViewComponent implements AfterContentChecked {
let hash: { let hash: {
[index: number]: { [index: number]: {
[id: string]: string; [id: string]: string;
}} = {}; }
} = {};
hash = this.setRowWithErrorClass(hash, row, 'job-with-error'); hash = this.setRowWithErrorClass(hash, row, 'job-with-error');
hash = this.setRowWithErrorClass(hash, row + 1, 'error-row'); hash = this.setRowWithErrorClass(hash, row + 1, 'error-row');
this._table.grid.setCellCssStyles('error-row' + row.toString(), hash); this._table.grid.setCellCssStyles('error-row' + row.toString(), hash);