mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 09:35:38 -05:00
mi page shows prompt to select DB to see any warnings (#14921)
This commit is contained in:
@@ -46,6 +46,10 @@ export class SqlDatabaseTree {
|
||||
private _databaseTable!: azdata.DeclarativeTableComponent;
|
||||
private _assessmentResultsTable!: azdata.DeclarativeTableComponent;
|
||||
private _impactedObjectsTable!: azdata.DeclarativeTableComponent;
|
||||
private _assessmentContainer!: azdata.FlexContainer;
|
||||
private _dbMessageContainer!: azdata.FlexContainer;
|
||||
private _rootContainer!: azdata.FlexContainer;
|
||||
private _resultComponent!: azdata.Component;
|
||||
|
||||
private _recommendation!: azdata.TextComponent;
|
||||
private _dbName!: azdata.TextComponent;
|
||||
@@ -65,12 +69,31 @@ export class SqlDatabaseTree {
|
||||
private _serverName!: string;
|
||||
private _dbNames!: string[];
|
||||
|
||||
|
||||
constructor(
|
||||
private _model: MigrationStateModel,
|
||||
private _targetType: MigrationTargetType
|
||||
) {
|
||||
}
|
||||
|
||||
async createRootContainer(view: azdata.ModelView): Promise<azdata.Component> {
|
||||
this._view = view;
|
||||
|
||||
const selectDbMessage = this.createSelectDbMessage();
|
||||
this._resultComponent = await this.createComponentResult(view);
|
||||
const treeComponent = await this.createComponent(view, this._targetType === MigrationTargetType.SQLVM ? this._model._vmDbs : this._model._miDbs);
|
||||
this._rootContainer = view.modelBuilder.flexContainer().withLayout({
|
||||
flexFlow: 'row',
|
||||
height: '100%',
|
||||
width: '100%'
|
||||
}).component();
|
||||
this._rootContainer.addItem(treeComponent, { flex: '0 0 auto' });
|
||||
this._rootContainer.addItem(this._resultComponent, { flex: '0 0 auto' });
|
||||
this._rootContainer.addItem(selectDbMessage, { flex: '1 1 auto' });
|
||||
|
||||
return this._rootContainer;
|
||||
}
|
||||
|
||||
async createComponent(view: azdata.ModelView, dbs: string[]): Promise<azdata.Component> {
|
||||
this._view = view;
|
||||
const component = view.modelBuilder.flexContainer().withLayout({
|
||||
@@ -129,6 +152,12 @@ export class SqlDatabaseTree {
|
||||
this._activeIssues = this._model._assessmentResults?.databaseAssessments[row].issues;
|
||||
this._selectedIssue = this._model._assessmentResults?.databaseAssessments[row].issues[0];
|
||||
this._dbName.value = this._dbNames[row];
|
||||
this._resultComponent.updateCssStyles({
|
||||
'display': 'block'
|
||||
});
|
||||
this._dbMessageContainer.updateCssStyles({
|
||||
'display': 'none'
|
||||
});
|
||||
this.refreshResults();
|
||||
});
|
||||
|
||||
@@ -199,7 +228,7 @@ export class SqlDatabaseTree {
|
||||
async createComponentResult(view: azdata.ModelView): Promise<azdata.Component> {
|
||||
this._view = view;
|
||||
const topContainer = this.createTopContainer();
|
||||
const bottomContainer = this.createBottomContainer();
|
||||
this._assessmentContainer = this.createBottomContainer();
|
||||
|
||||
const container = this._view.modelBuilder.flexContainer().withLayout({
|
||||
flexFlow: 'column',
|
||||
@@ -207,12 +236,13 @@ export class SqlDatabaseTree {
|
||||
}).withProps({
|
||||
CSSStyles: {
|
||||
'margin': '32px 0px 0px 18px',
|
||||
'overflow-y': 'hidden'
|
||||
'overflow-y': 'hidden',
|
||||
'display': 'none'
|
||||
}
|
||||
}).component();
|
||||
|
||||
container.addItem(topContainer, { flex: '0 0 auto' });
|
||||
container.addItem(bottomContainer, { flex: '1 1 auto', CSSStyles: { 'overflow-y': 'hidden' } });
|
||||
container.addItem(this._assessmentContainer, { flex: '1 1 auto', CSSStyles: { 'overflow-y': 'hidden' } });
|
||||
|
||||
return container;
|
||||
}
|
||||
@@ -267,6 +297,26 @@ export class SqlDatabaseTree {
|
||||
return container;
|
||||
}
|
||||
|
||||
private createSelectDbMessage(): azdata.FlexContainer {
|
||||
const message = this._view.modelBuilder.text().withProps({
|
||||
value: constants.SELECT_DB_PROMPT,
|
||||
CSSStyles: {
|
||||
'font-size': '14px',
|
||||
'width': '400px',
|
||||
'margin': '10px 0px 0px 0px',
|
||||
'text-align': 'left'
|
||||
}
|
||||
}).component();
|
||||
this._dbMessageContainer = this._view.modelBuilder.flexContainer().withItems([message]).withProps({
|
||||
CSSStyles: {
|
||||
'margin-left': '24px',
|
||||
'margin-top': '20px'
|
||||
}
|
||||
}).component();
|
||||
|
||||
return this._dbMessageContainer;
|
||||
}
|
||||
|
||||
private createAssessmentContainer(): azdata.FlexContainer {
|
||||
const title = this.createAssessmentTitle();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user