mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
ADS Migration UI Fixes (#15011)
* wip database count * wip * added warnings count * changed warnings to issue details when DB selected * updated selected dbs * issues -> issue * fix issues/warnings
This commit is contained in:
@@ -54,6 +54,7 @@ export class SqlDatabaseTree {
|
||||
private _recommendation!: azdata.TextComponent;
|
||||
private _dbName!: azdata.TextComponent;
|
||||
private _recommendationText!: azdata.TextComponent;
|
||||
private _recommendationTitle!: azdata.TextComponent;
|
||||
private _descriptionText!: azdata.TextComponent;
|
||||
private _impactedObjects!: SqlMigrationImpactedObjectInfo[];
|
||||
private _objectDetailsType!: azdata.TextComponent;
|
||||
@@ -61,6 +62,7 @@ export class SqlDatabaseTree {
|
||||
private _objectDetailsSample!: azdata.TextComponent;
|
||||
private _moreInfo!: azdata.HyperlinkComponent;
|
||||
private _assessmentTitle!: azdata.TextComponent;
|
||||
private _databaseTableValues!: azdata.DeclarativeTableCellValue[][];
|
||||
|
||||
private _activeIssues!: SqlMigrationAssessmentResultItem[];
|
||||
private _selectedIssue!: SqlMigrationAssessmentResultItem;
|
||||
@@ -68,6 +70,7 @@ export class SqlDatabaseTree {
|
||||
|
||||
private _serverName!: string;
|
||||
private _dbNames!: string[];
|
||||
private _databaseCount!: azdata.TextComponent;
|
||||
|
||||
|
||||
constructor(
|
||||
@@ -107,10 +110,23 @@ export class SqlDatabaseTree {
|
||||
|
||||
component.addItem(this.createSearchComponent(), { flex: '0 0 auto' });
|
||||
component.addItem(this.createInstanceComponent(), { flex: '0 0 auto' });
|
||||
component.addItem(this.createDatabaseCount(), { flex: '0 0 auto' });
|
||||
component.addItem(this.createDatabaseComponent(dbs), { flex: '1 1 auto', CSSStyles: { 'overflow-y': 'auto' } });
|
||||
return component;
|
||||
}
|
||||
|
||||
private createDatabaseCount(): azdata.TextComponent {
|
||||
this._databaseCount = this._view.modelBuilder.text().withProps({
|
||||
CSSStyles: {
|
||||
'font-size': '11px',
|
||||
'font-weight': 'bold',
|
||||
'margin': '0px 8px 0px 36px'
|
||||
},
|
||||
value: constants.DATABASES(this.selectedDbs.length, this._model._serverDatabases.length)
|
||||
}).component();
|
||||
return this._databaseCount;
|
||||
}
|
||||
|
||||
private createDatabaseComponent(dbs: string[]): azdata.DivContainer {
|
||||
|
||||
this._databaseTable = this._view.modelBuilder.declarativeTable().withProps(
|
||||
@@ -130,7 +146,7 @@ export class SqlDatabaseTree {
|
||||
headerCssStyles: headerLeft,
|
||||
},
|
||||
{
|
||||
displayName: constants.DATABASES,
|
||||
displayName: constants.DATABASE,
|
||||
valueType: azdata.DeclarativeDataType.component,
|
||||
width: 100,
|
||||
isReadOnly: true,
|
||||
@@ -146,12 +162,19 @@ export class SqlDatabaseTree {
|
||||
]
|
||||
}
|
||||
).component();
|
||||
|
||||
this._databaseTable.onDataChanged(() => {
|
||||
this._databaseCount.updateProperties({
|
||||
'value': constants.DATABASES(this.selectedDbs().length, this._model._serverDatabases.length)
|
||||
});
|
||||
});
|
||||
this._databaseTable.onRowSelected(({ row }) => {
|
||||
|
||||
this._databaseTable.focus();
|
||||
this._activeIssues = this._model._assessmentResults?.databaseAssessments[row].issues;
|
||||
this._selectedIssue = this._model._assessmentResults?.databaseAssessments[row].issues[0];
|
||||
this._dbName.value = this._dbNames[row];
|
||||
this._recommendationTitle.value = constants.ISSUES_COUNT(this._activeIssues.length);
|
||||
this._recommendation.value = constants.ISSUES_DETAILS;
|
||||
this._resultComponent.updateCssStyles({
|
||||
'display': 'block'
|
||||
});
|
||||
@@ -227,7 +250,8 @@ export class SqlDatabaseTree {
|
||||
this._dbMessageContainer.updateCssStyles({
|
||||
'display': 'none'
|
||||
});
|
||||
|
||||
this._recommendation.value = constants.WARNINGS_DETAILS;
|
||||
this._recommendationTitle.value = constants.WARNINGS_COUNT(this._activeIssues.length);
|
||||
if (this._model._targetType === MigrationTargetType.SQLMI) {
|
||||
this.refreshResults();
|
||||
}
|
||||
@@ -578,7 +602,7 @@ export class SqlDatabaseTree {
|
||||
}
|
||||
|
||||
private createAssessmentResultsTitle(): azdata.TextComponent {
|
||||
this._recommendation = this._view.modelBuilder.text().withProps({
|
||||
this._recommendationTitle = this._view.modelBuilder.text().withProps({
|
||||
value: constants.WARNINGS,
|
||||
CSSStyles: {
|
||||
'font-size': '13px',
|
||||
@@ -589,7 +613,7 @@ export class SqlDatabaseTree {
|
||||
}
|
||||
}).component();
|
||||
|
||||
return this._recommendation;
|
||||
return this._recommendationTitle;
|
||||
}
|
||||
|
||||
private createAssessmentDetailsTitle(): azdata.TextComponent {
|
||||
@@ -722,7 +746,7 @@ export class SqlDatabaseTree {
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
let instanceTableValues: azdata.DeclarativeTableCellValue[][] = [];
|
||||
let databaseTableValues: azdata.DeclarativeTableCellValue[][] = [];
|
||||
this._databaseTableValues = [];
|
||||
const excludedDatabases = ['master', 'msdb', 'tempdb', 'model'];
|
||||
this._dbNames = (await azdata.connection.listDatabases(this._model.sourceConnectionId)).filter(db => !excludedDatabases.includes(db));
|
||||
const selectedDbs = (this._targetType === MigrationTargetType.SQLVM) ? this._model._vmDbs : this._model._miDbs;
|
||||
@@ -742,7 +766,7 @@ export class SqlDatabaseTree {
|
||||
]
|
||||
];
|
||||
this._dbNames.forEach((db) => {
|
||||
databaseTableValues.push(
|
||||
this._databaseTableValues.push(
|
||||
[
|
||||
{
|
||||
value: selectedDbs.includes(db),
|
||||
@@ -776,7 +800,7 @@ export class SqlDatabaseTree {
|
||||
return db2.issues.length - db1.issues.length;
|
||||
});
|
||||
this._model._assessmentResults.databaseAssessments.forEach((db) => {
|
||||
databaseTableValues.push(
|
||||
this._databaseTableValues.push(
|
||||
[
|
||||
{
|
||||
value: selectedDbs.includes(db.name),
|
||||
@@ -795,7 +819,7 @@ export class SqlDatabaseTree {
|
||||
});
|
||||
}
|
||||
this._instanceTable.dataValues = instanceTableValues;
|
||||
this._databaseTable.dataValues = databaseTableValues;
|
||||
this._databaseTable.dataValues = this._databaseTableValues;
|
||||
}
|
||||
|
||||
private createIconTextCell(icon: IconPath, text: string): azdata.FlexContainer {
|
||||
|
||||
Reference in New Issue
Block a user