mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 17:23:10 -05:00
mi page shows prompt to select DB to see any warnings (#14921)
This commit is contained in:
@@ -310,6 +310,7 @@ export const RECOMMENDATION = localize('sql.migration.recommendation', "Recommen
|
||||
export const MORE_INFO = localize('sql.migration.more.info', "More Info");
|
||||
export const TARGET_PLATFORM = localize('sql.migration.target.platform', "Target Platform");
|
||||
export const WARNINGS_DETAILS = localize('sql.migration.warnings.details', "Warnings Details");
|
||||
export const SELECT_DB_PROMPT = localize('sql.migration.select.prompt', "Click on SQL Server Instance or any of the databases on the left to view its details.");
|
||||
export function IMPACT_OBJECT_TYPE(objectType: string): string {
|
||||
return localize('sql.migration.impact.object.type', "Type: {0}", objectType);
|
||||
}
|
||||
|
||||
@@ -39,15 +39,12 @@ export class AssessmentResultsDialog {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
dialog.registerContent(async (view) => {
|
||||
try {
|
||||
const resultComponent = await this._tree.createComponentResult(view);
|
||||
const treeComponent = await this._tree.createComponent(view, this._targetType === MigrationTargetType.SQLVM ? this.model._vmDbs : this._model._miDbs);
|
||||
const flex = view.modelBuilder.flexContainer().withLayout({
|
||||
flexFlow: 'row',
|
||||
height: '100%',
|
||||
width: '100%'
|
||||
}).component();
|
||||
flex.addItem(treeComponent, { flex: '0 0 auto' });
|
||||
flex.addItem(resultComponent, { flex: '1 1 auto' });
|
||||
flex.addItem(await this._tree.createRootContainer(view), { flex: '1 1 auto' });
|
||||
|
||||
view.initializeModel(flex);
|
||||
resolve();
|
||||
|
||||
@@ -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