Fix VM Page displaying MI assessment results (#15190)

* fix vm page displaying mi assessment results

* vm page fix
This commit is contained in:
Christopher Suh
2021-04-23 12:07:17 -07:00
committed by GitHub
parent f4d47e9675
commit 9fabf85fe2
2 changed files with 37 additions and 17 deletions

View File

@@ -364,6 +364,7 @@ export const INSTANCE = localize('sql.migration.instance', "Instance");
export const WARNINGS = localize('sql.migration.warnings', "Warnings");
export const IMPACTED_OBJECTS = localize('sql.migration.impacted.objects', "Impacted Objects");
export const OBJECT_DETAILS = localize('sql.migration.object.details', "Object details");
export const ASSESSMENT_RESULTS = localize('sql.migration.assessmen.results', "Assessment Results");
export const TYPES_LABEL = localize('sql.migration.type.label', "Type:");
export const NAMES_LABEL = localize('sql.migration.name.label', "Names:");
export const DESCRIPTION = localize('sql.migration.description', "Description");

View File

@@ -179,8 +179,12 @@ export class SqlDatabaseTree {
this._databaseTable.onRowSelected(({ row }) => {
this._databaseTable.focus();
this._activeIssues = this._model._assessmentResults?.databaseAssessments[row].issues;
this._selectedIssue = this._model._assessmentResults?.databaseAssessments[row].issues[0];
if (this._targetType === MigrationTargetType.SQLMI) {
this._activeIssues = this._model._assessmentResults?.databaseAssessments[row].issues;
this._selectedIssue = this._model._assessmentResults?.databaseAssessments[row].issues[0];
} else {
this._activeIssues = [];
}
this._dbName.value = this._dbNames[row];
this._recommendationTitle.value = constants.ISSUES_COUNT(this._activeIssues.length);
this._recommendation.value = constants.ISSUES_DETAILS;
@@ -349,7 +353,7 @@ export class SqlDatabaseTree {
value: constants.NO_ISSUES_FOUND_VM,
CSSStyles: {
'font-size': '14px',
'width': '400px',
'width': '100%',
'margin': '10px 0px 0px 0px',
'text-align': 'left'
}
@@ -359,7 +363,7 @@ export class SqlDatabaseTree {
value: constants.NO_ISSUES_FOUND_MI,
CSSStyles: {
'font-size': '14px',
'width': '400px',
'width': '100%',
'margin': '10px 0px 0px 0px',
'text-align': 'left'
}
@@ -744,8 +748,32 @@ export class SqlDatabaseTree {
public refreshResults(): void {
const assessmentResults: azdata.DeclarativeTableCellValue[][] = [];
if (this._activeIssues.length === 0) {
/// show no issues here
if (this._model._targetType === MigrationTargetType.SQLMI) {
if (this._activeIssues.length === 0) {
/// show no issues here
this._assessmentsTable.updateCssStyles({
'display': 'none',
'border-right': 'none'
});
this._assessmentContainer.updateCssStyles({
'display': 'none'
});
this._noIssuesContainer.updateCssStyles({
'display': 'flex'
});
} else {
this._assessmentContainer.updateCssStyles({
'display': 'flex'
});
this._assessmentsTable.updateCssStyles({
'display': 'flex',
'border-right': 'solid 1px'
});
this._noIssuesContainer.updateCssStyles({
'display': 'none'
});
}
} else {
this._assessmentsTable.updateCssStyles({
'display': 'none',
'border-right': 'none'
@@ -756,17 +784,8 @@ export class SqlDatabaseTree {
this._noIssuesContainer.updateCssStyles({
'display': 'flex'
});
} else {
this._assessmentContainer.updateCssStyles({
'display': 'flex'
});
this._assessmentsTable.updateCssStyles({
'display': 'flex',
'border-right': 'solid 1px'
});
this._noIssuesContainer.updateCssStyles({
'display': 'none'
});
this._recommendationTitle.value = constants.ASSESSMENT_RESULTS;
this._recommendation.value = '';
}
this._activeIssues.forEach((v) => {
assessmentResults.push(