[SQL Migration] Add state check to target MI resource on target selection page (#18673)

* Add MI ready state check and error message

* Fix a typo

* Update error message logic

* Update '(Unavailable)' prefix to be localized string

* Show error messsage when non-Ready MI is initially selected (not just on Next button)

* Update error message with appropriate casing and actionable step
This commit is contained in:
Raymond Truong
2022-03-15 10:45:43 -07:00
committed by GitHub
parent cb607e34d7
commit fa227c88c9
3 changed files with 41 additions and 6 deletions

View File

@@ -1008,10 +1008,21 @@ export class MigrationStateModel implements Model, vscode.Disposable {
}
this._targetManagedInstances.forEach((managedInstance) => {
managedInstanceValues.push({
name: managedInstance.id,
displayName: `${managedInstance.name}`
});
let managedInstanceValue: azdata.CategoryValue;
if (managedInstance.properties.state === 'Ready') {
managedInstanceValue = {
name: managedInstance.id,
displayName: `${managedInstance.name}`
};
} else {
managedInstanceValue = {
name: managedInstance.id,
displayName: constants.UNAVAILABLE_MANAGED_INSTANCE_PREFIX(managedInstance.name)
};
}
managedInstanceValues.push(managedInstanceValue);
});
if (managedInstanceValues.length === 0) {