mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 17:23:02 -05:00
filter assessment results by MigationTargetType (#16701)
This commit is contained in:
@@ -185,12 +185,22 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
public async getDatabaseAssessments(): Promise<ServerAssessement> {
|
||||
public async getDatabaseAssessments(targetType: MigrationTargetType): Promise<ServerAssessement> {
|
||||
const ownerUri = await azdata.connection.getUriForConnection(this.sourceConnectionId);
|
||||
try {
|
||||
this._assessmentApiResponse = (await this.migrationService.getAssessments(ownerUri, this._databaseAssessment))!;
|
||||
const response = (await this.migrationService.getAssessments(ownerUri, this._databaseAssessment))!;
|
||||
if (response?.assessmentResult) {
|
||||
response.assessmentResult.items = response.assessmentResult.items?.filter(
|
||||
issue => issue.appliesToMigrationTargetPlatform === targetType);
|
||||
|
||||
response.assessmentResult.databases?.forEach(
|
||||
database => database.items = database.items?.filter(
|
||||
issue => issue.appliesToMigrationTargetPlatform === targetType));
|
||||
}
|
||||
|
||||
this._assessmentApiResponse = response;
|
||||
this._assessmentResults = {
|
||||
issues: this._assessmentApiResponse?.assessmentResult?.items ?? [],
|
||||
issues: this._assessmentApiResponse?.assessmentResult?.items || [],
|
||||
databaseAssessments: this._assessmentApiResponse?.assessmentResult?.databases?.map(d => {
|
||||
return {
|
||||
name: d.name,
|
||||
|
||||
@@ -444,7 +444,7 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
||||
const serverName = (await this.migrationStateModel.getSourceConnectionProfile()).serverName;
|
||||
this._igComponent.value = constants.ASSESSMENT_COMPLETED(serverName);
|
||||
try {
|
||||
await this.migrationStateModel.getDatabaseAssessments();
|
||||
await this.migrationStateModel.getDatabaseAssessments(MigrationTargetType.SQLMI);
|
||||
this._detailsComponent.value = constants.SKU_RECOMMENDATION_ALL_SUCCESSFUL(this.migrationStateModel._assessmentResults.databaseAssessments.length);
|
||||
|
||||
const errors: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user