Bug fixes for DC upgrade in arc extension (#19161)

* Removed configure retention policy link. Log errors for upgrade instead of blocking the upgrade. Changed text of version log link.

* Addressing comments on PR

Co-authored-by: Candice Ye <canye@microsoft.com>
This commit is contained in:
Candice Ye
2022-04-20 16:20:52 -07:00
committed by GitHub
parent 6acda40894
commit 0718876300
3 changed files with 6 additions and 24 deletions

View File

@@ -338,8 +338,8 @@ export const loadingClusterContextsError = (error: any): string => localize('arc
// Upgrade
export const upgradeManagement = localize('arc.upgradeManagement', "Upgrade Management");
export const availableUpgrades = localize('arc.availableUpgrades', "Available Upgrades");
export const availableUpgradesDescription = localize('arc.availableUpgradesDescription', "Available upgrades for this resource are listed below. You can apply upgrades by selecting the upgrade button. Learn more about each of these releases at the");
export const versionLog = localize('arc.versionLog', "version log.");
export const availableUpgradesDescription = localize('arc.availableUpgradesDescription', "Available upgrades for this resource are listed below. You can apply upgrades by clicking the upgrade button.");
export const versionLog = localize('arc.versionLog', "Learn more about each release here.");
export const onlyNextImmediateVersion = localize('arc.onlyNextImmediateVersion', "Currently, only upgrading to the next immediate version is supported.");
export const version = localize('arc.version', "Version");
export const releaseDate = localize('arc.releaseDate', "Release Date");
@@ -353,4 +353,3 @@ export function errorListingLogAnalyticsWorkspaces(error: any): string { return
export const noUpgrades = localize('arc.noUpgrades', 'The current version is the latest version. No upgrades available.');
export const upgrading = localize('arc.upgrading', "Data controller is being upgraded. You can check the status of the upgrade by running the following command: 'kubectl get datacontrollers -A'"); // 'kubectl get datacontrollers -A' should not be localized.
export const currentVersion = localize('arc.currentVersion', "Current version");
export const releaseDateNotParsed = localize('arc.releaseDateNotParsed', "Release date could not be parsed.");

View File

@@ -18,7 +18,6 @@ export class ControllerUpgradesPage extends DashboardPage {
this._azApi = vscode.extensions.getExtension(azExt.extension.name)?.exports;
}
private _upgradesContainer!: azdata.DivContainer;
private _configureRetentionPolicyButton!: azdata.ButtonComponent;
private _upgradesTableLoading!: azdata.LoadingComponent;
private _upgradesTable!: azdata.DeclarativeTableComponent;
private _upgradesMessage!: azdata.TextComponent;
@@ -58,25 +57,18 @@ export class ControllerUpgradesPage extends DashboardPage {
const infoAvailableUpgrades = this.modelView.modelBuilder.text().withProps({
value: loc.availableUpgradesDescription,
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px', 'max-width': 'auto' }
CSSStyles: { ...cssStyles.text, 'margin-block-start': '0px', 'margin-block-end': '0px' }
}).component();
const upgradesInfoDescription = this.modelView.modelBuilder.flexContainer()
.withLayout({ flexWrap: 'wrap' })
.withItems([
infoAvailableUpgrades
]).component();
const upgradesVersionLogLink = this.modelView.modelBuilder.hyperlink().withProps({
label: loc.versionLog,
url: 'https://docs.microsoft.com/en-us/azure/azure-arc/data/version-log',
CSSStyles: { 'margin-block-start': '0px', 'margin-block-end': '0px' }
url: 'https://docs.microsoft.com/azure/azure-arc/data/version-log'
}).component();
const upgradesInfoAndLink = this.modelView.modelBuilder.flexContainer()
.withLayout({ flexWrap: 'wrap' })
.withItems([
upgradesInfoDescription,
infoAvailableUpgrades,
upgradesVersionLogLink
], { CSSStyles: { 'margin-right': '5px' } }).component();
@@ -155,16 +147,10 @@ export class ControllerUpgradesPage extends DashboardPage {
refreshButton.enabled = true;
}
}));
this._configureRetentionPolicyButton = this.modelView.modelBuilder.button().withProps({
label: loc.configureRetentionPolicyButton,
enabled: true,
iconPath: IconPathHelper.edit,
}).component();
return this.modelView.modelBuilder.toolbarContainer().withToolbarItems(
[
{ component: refreshButton, toolbarSeparatorAfter: true },
{ component: this._configureRetentionPolicyButton, toolbarSeparatorAfter: false },
]
).component();
@@ -274,9 +260,7 @@ export class ControllerUpgradesPage extends DashboardPage {
}
);
} catch (error) {
vscode.window.showErrorMessage(loc.updateExtensionsFailed(error));
} finally {
this._configureRetentionPolicyButton.enabled = true;
console.log(error);
}
}
}));