mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixing the disabled next button on migration wizard (#15226)
* Fixing the next button disabled on wizard * vbump extension
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "sql-migration",
|
"name": "sql-migration",
|
||||||
"displayName": "%displayName%",
|
"displayName": "%displayName%",
|
||||||
"description": "%description%",
|
"description": "%description%",
|
||||||
"version": "0.0.10",
|
"version": "0.0.11",
|
||||||
"publisher": "Microsoft",
|
"publisher": "Microsoft",
|
||||||
"preview": true,
|
"preview": true,
|
||||||
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
"license": "https://raw.githubusercontent.com/Microsoft/azuredatastudio/main/LICENSE.txt",
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export class AccountsSelectionPage extends MigrationWizardPage {
|
|||||||
})
|
})
|
||||||
.withValidation((c) => {
|
.withValidation((c) => {
|
||||||
if (c.value) {
|
if (c.value) {
|
||||||
if ((<azdata.CategoryValue>c.value).displayName === constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR) {
|
if ((<azdata.CategoryValue>c.value)?.displayName === constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR) {
|
||||||
this.wizard.message = {
|
this.wizard.message = {
|
||||||
text: constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR,
|
text: constants.ACCOUNT_SELECTION_PAGE_NO_LINKED_ACCOUNTS_ERROR,
|
||||||
level: azdata.window.MessageLevel.Error
|
level: azdata.window.MessageLevel.Error
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this._dmsDropdown = this._view.modelBuilder.dropDown().withProps({
|
this._dmsDropdown = this._view.modelBuilder.dropDown().withProps({
|
||||||
required: true,
|
|
||||||
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
width: WIZARD_INPUT_COMPONENT_WIDTH,
|
||||||
editable: true
|
editable: true
|
||||||
}).component();
|
}).component();
|
||||||
@@ -231,8 +230,10 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
width: '18px'
|
width: '18px'
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this._refreshButton.onDidClick((e) => {
|
this._refreshButton.onDidClick(async (e) => {
|
||||||
this.loadStatus();
|
this._connectionStatusLoader.loading = true;
|
||||||
|
await this.loadStatus();
|
||||||
|
this._connectionStatusLoader.loading = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const connectionLabelContainer = this._view.modelBuilder.flexContainer().withProps({
|
const connectionLabelContainer = this._view.modelBuilder.flexContainer().withProps({
|
||||||
@@ -261,11 +262,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
CSSStyles: {
|
CSSStyles: {
|
||||||
'font-size': '13px'
|
'font-size': '13px'
|
||||||
}
|
}
|
||||||
}).withValidation(component => {
|
|
||||||
if (component.style === 'error') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
const authenticationKeysLabel = this._view.modelBuilder.text().withProps({
|
const authenticationKeysLabel = this._view.modelBuilder.text().withProps({
|
||||||
@@ -276,7 +272,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
|
||||||
this._copy1 = this._view.modelBuilder.button().withProps({
|
this._copy1 = this._view.modelBuilder.button().withProps({
|
||||||
iconPath: IconPathHelper.copy,
|
iconPath: IconPathHelper.copy,
|
||||||
}).component();
|
}).component();
|
||||||
@@ -302,7 +297,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
this._refresh2 = this._view.modelBuilder.button().withProps({
|
this._refresh2 = this._view.modelBuilder.button().withProps({
|
||||||
iconPath: IconPathHelper.refresh,
|
iconPath: IconPathHelper.refresh,
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this._authKeyTable = this._view.modelBuilder.declarativeTable().withProps({
|
this._authKeyTable = this._view.modelBuilder.declarativeTable().withProps({
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@@ -357,7 +351,9 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
|
|
||||||
this._connectionStatusLoader = this._view.modelBuilder.loadingComponent().withItem(
|
this._connectionStatusLoader = this._view.modelBuilder.loadingComponent().withItem(
|
||||||
statusContainer
|
statusContainer
|
||||||
).component();
|
).withProps({
|
||||||
|
loading: false
|
||||||
|
}).component();
|
||||||
|
|
||||||
container.addItems(
|
container.addItems(
|
||||||
[
|
[
|
||||||
@@ -376,20 +372,19 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
this.migrationStateModel._sqlMigrationService = sqlMigrationService;
|
this.migrationStateModel._sqlMigrationService = sqlMigrationService;
|
||||||
this.migrationStateModel._nodeNames = serviceNodes;
|
this.migrationStateModel._nodeNames = serviceNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this._subscription.value = this.migrationStateModel._targetSubscription.name;
|
this._subscription.value = this.migrationStateModel._targetSubscription.name;
|
||||||
this._location.value = await getLocationDisplayName(this.migrationStateModel._targetServerInstance.location);
|
this._location.value = await getLocationDisplayName(this.migrationStateModel._targetServerInstance.location);
|
||||||
this._resourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupDropdownValues(this.migrationStateModel._targetSubscription);
|
this._resourceGroupDropdown.values = await this.migrationStateModel.getAzureResourceGroupDropdownValues(this.migrationStateModel._targetSubscription);
|
||||||
|
|
||||||
|
let index = 0;
|
||||||
if (resourceGroupName) {
|
if (resourceGroupName) {
|
||||||
const index = (<azdata.CategoryValue[]>this._resourceGroupDropdown.values).findIndex(v => v.displayName.toLowerCase() === resourceGroupName.toLowerCase());
|
index = (<azdata.CategoryValue[]>this._resourceGroupDropdown.values).findIndex(v => v.displayName.toLowerCase() === resourceGroupName.toLowerCase());
|
||||||
if (resourceGroupName.toLowerCase() === (<azdata.CategoryValue>this._resourceGroupDropdown.value).displayName.toLowerCase()) {
|
}
|
||||||
this.populateDms(resourceGroupName);
|
if ((<azdata.CategoryValue>this._resourceGroupDropdown.value)?.displayName.toLowerCase() === (<azdata.CategoryValue>this._resourceGroupDropdown.values[index])?.displayName.toLowerCase()) {
|
||||||
} else {
|
this.populateDms((<azdata.CategoryValue>this._resourceGroupDropdown.value)?.displayName);
|
||||||
this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[index];
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[0];
|
this._resourceGroupDropdown.value = this._resourceGroupDropdown.values[index];
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -400,6 +395,9 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async populateDms(resourceGroupName: string): Promise<void> {
|
public async populateDms(resourceGroupName: string): Promise<void> {
|
||||||
|
if (!resourceGroupName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._dmsDropdown.loading = true;
|
this._dmsDropdown.loading = true;
|
||||||
try {
|
try {
|
||||||
this._dmsDropdown.values = await this.migrationStateModel.getSqlMigrationServiceValues(this.migrationStateModel._targetSubscription, this.migrationStateModel._targetServerInstance, resourceGroupName);
|
this._dmsDropdown.values = await this.migrationStateModel.getSqlMigrationServiceValues(this.migrationStateModel._targetSubscription, this.migrationStateModel._targetServerInstance, resourceGroupName);
|
||||||
@@ -432,7 +430,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async loadStatus(): Promise<void> {
|
private async loadStatus(): Promise<void> {
|
||||||
this._connectionStatusLoader.loading = true;
|
|
||||||
try {
|
try {
|
||||||
if (this.migrationStateModel._sqlMigrationService) {
|
if (this.migrationStateModel._sqlMigrationService) {
|
||||||
const migrationService = await getSqlMigrationService(
|
const migrationService = await getSqlMigrationService(
|
||||||
@@ -474,10 +471,6 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this._dmsStatusInfoBox.validate();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -503,14 +496,10 @@ export class IntergrationRuntimePage extends MigrationWizardPage {
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
this._authKeyTable.updateProperties({
|
this._authKeyTable.dataValues = data;
|
||||||
dataValues: data
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
} finally {
|
|
||||||
this._connectionStatusLoader.loading = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -451,14 +451,14 @@ export class SKURecommendationPage extends MigrationWizardPage {
|
|||||||
errors.push('Please select databases to migrate');
|
errors.push('Please select databases to migrate');
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value).displayName === constants.NO_SUBSCRIPTIONS_FOUND) {
|
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value)?.displayName === constants.NO_SUBSCRIPTIONS_FOUND) {
|
||||||
errors.push(constants.INVALID_SUBSCRIPTION_ERROR);
|
errors.push(constants.INVALID_SUBSCRIPTION_ERROR);
|
||||||
}
|
}
|
||||||
if ((<azdata.CategoryValue>this._azureLocationDropdown.value).displayName === constants.NO_LOCATION_FOUND) {
|
if ((<azdata.CategoryValue>this._azureLocationDropdown.value)?.displayName === constants.NO_LOCATION_FOUND) {
|
||||||
errors.push(constants.INVALID_LOCATION_ERROR);
|
errors.push(constants.INVALID_LOCATION_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value).displayName === constants.RESOURCE_GROUP_NOT_FOUND) {
|
if ((<azdata.CategoryValue>this._managedInstanceSubscriptionDropdown.value)?.displayName === constants.RESOURCE_GROUP_NOT_FOUND) {
|
||||||
errors.push(constants.INVALID_RESOURCE_GROUP_ERROR);
|
errors.push(constants.INVALID_RESOURCE_GROUP_ERROR);
|
||||||
}
|
}
|
||||||
const resourceDropdownValue = (<azdata.CategoryValue>this._resourceDropdown.value).displayName;
|
const resourceDropdownValue = (<azdata.CategoryValue>this._resourceDropdown.value).displayName;
|
||||||
|
|||||||
Reference in New Issue
Block a user