mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add a button which would allow the user to jump directly to add account dialog from Migration Status Dialog (#17011)
This commit is contained in:
@@ -366,7 +366,8 @@ export const FILE_NAME = localize('sql.migration.file.name', "File name");
|
|||||||
export const SIZE_COLUMN_HEADER = localize('sql.migration.size.column.header', "Size");
|
export const SIZE_COLUMN_HEADER = localize('sql.migration.size.column.header', "Size");
|
||||||
export const NO_PENDING_BACKUPS = localize('sql.migration.no.pending.backups', "No pending backups. Click refresh to check current status.");
|
export const NO_PENDING_BACKUPS = localize('sql.migration.no.pending.backups', "No pending backups. Click refresh to check current status.");
|
||||||
//Migration status dialog
|
//Migration status dialog
|
||||||
export const ADD_ACCOUNT = localize('sql.migration.status.add.account', "Add your Azure account to view existing migrations and their status.");
|
export const ADD_ACCOUNT = localize('sql.migration.status.add.account', "Add account");
|
||||||
|
export const ADD_ACCOUNT_MESSAGE = localize('sql.migration.status.add.account.MESSAGE', "Add your Azure account to view existing migrations and their status.");
|
||||||
export const STATUS_ALL = localize('sql.migration.status.dropdown.all', "Status: All");
|
export const STATUS_ALL = localize('sql.migration.status.dropdown.all', "Status: All");
|
||||||
export const STATUS_ONGOING = localize('sql.migration.status.dropdown.ongoing', "Status: Ongoing");
|
export const STATUS_ONGOING = localize('sql.migration.status.dropdown.ongoing', "Status: Ongoing");
|
||||||
export const STATUS_COMPLETING = localize('sql.migration.status.dropdown.completing', "Status: Completing");
|
export const STATUS_COMPLETING = localize('sql.migration.status.dropdown.completing', "Status: Completing");
|
||||||
|
|||||||
@@ -617,14 +617,14 @@ export class DashboardWidget {
|
|||||||
height: 96,
|
height: 96,
|
||||||
CSSStyles: {
|
CSSStyles: {
|
||||||
'opacity': '50%',
|
'opacity': '50%',
|
||||||
'margin': '20% auto 10% auto',
|
'margin': '15% auto 10% auto',
|
||||||
'filter': 'drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))',
|
'filter': 'drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))',
|
||||||
'display': 'none'
|
'display': 'none'
|
||||||
}
|
}
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
const addAccountText = view.modelBuilder.text().withProps({
|
const addAccountText = view.modelBuilder.text().withProps({
|
||||||
value: loc.ADD_ACCOUNT,
|
value: loc.ADD_ACCOUNT_MESSAGE,
|
||||||
width: 198,
|
width: 198,
|
||||||
height: 34,
|
height: 34,
|
||||||
CSSStyles: {
|
CSSStyles: {
|
||||||
@@ -637,6 +637,37 @@ export class DashboardWidget {
|
|||||||
}
|
}
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
|
const addAccountButton = view.modelBuilder.button().withProps({
|
||||||
|
label: loc.ADD_ACCOUNT,
|
||||||
|
width: '100px',
|
||||||
|
enabled: true,
|
||||||
|
CSSStyles: {
|
||||||
|
'margin': '5% 40%',
|
||||||
|
'display': 'none'
|
||||||
|
}
|
||||||
|
}).component();
|
||||||
|
|
||||||
|
this._disposables.push(addAccountButton.onDidClick(async (e) => {
|
||||||
|
await vscode.commands.executeCommand('workbench.actions.modal.linkedAccount');
|
||||||
|
addAccountButton.enabled = false;
|
||||||
|
let accounts = await azdata.accounts.getAllAccounts();
|
||||||
|
|
||||||
|
if (accounts.length !== 0) {
|
||||||
|
addAccountImage.updateCssStyles({
|
||||||
|
'display': 'none'
|
||||||
|
});
|
||||||
|
addAccountText.updateCssStyles({
|
||||||
|
'display': 'none'
|
||||||
|
});
|
||||||
|
addAccountButton.updateCssStyles({
|
||||||
|
'display': 'none'
|
||||||
|
});
|
||||||
|
this._migrationStatusCardsContainer.updateCssStyles({ 'visibility': 'visible' });
|
||||||
|
this._viewAllMigrationsButton.updateCssStyles({ 'visibility': 'visible' });
|
||||||
|
}
|
||||||
|
await this.refreshMigrations();
|
||||||
|
}));
|
||||||
|
|
||||||
const header = view.modelBuilder.flexContainer().withItems(
|
const header = view.modelBuilder.flexContainer().withItems(
|
||||||
[
|
[
|
||||||
statusContainerTitle,
|
statusContainerTitle,
|
||||||
@@ -657,13 +688,11 @@ export class DashboardWidget {
|
|||||||
addAccountText.updateCssStyles({
|
addAccountText.updateCssStyles({
|
||||||
'display': 'block'
|
'display': 'block'
|
||||||
});
|
});
|
||||||
this._migrationStatusCardsContainer.updateCssStyles({
|
addAccountButton.updateCssStyles({
|
||||||
'visibility': 'hidden'
|
'display': 'block'
|
||||||
});
|
|
||||||
buttonContainer.removeItem(this._viewAllMigrationsButton);
|
|
||||||
refreshButton.updateCssStyles({
|
|
||||||
'float': 'right'
|
|
||||||
});
|
});
|
||||||
|
this._migrationStatusCardsContainer.updateCssStyles({ 'visibility': 'hidden' });
|
||||||
|
this._viewAllMigrationsButton.updateCssStyles({ 'visibility': 'hidden' });
|
||||||
}
|
}
|
||||||
|
|
||||||
this._inProgressMigrationButton = this.createStatusCard(
|
this._inProgressMigrationButton = this.createStatusCard(
|
||||||
@@ -754,6 +783,7 @@ export class DashboardWidget {
|
|||||||
|
|
||||||
statusContainer.addItem(addAccountImage, {});
|
statusContainer.addItem(addAccountImage, {});
|
||||||
statusContainer.addItem(addAccountText, {});
|
statusContainer.addItem(addAccountText, {});
|
||||||
|
statusContainer.addItem(addAccountButton, {});
|
||||||
|
|
||||||
statusContainer.addItem(this._migrationStatusCardLoadingContainer, {
|
statusContainer.addItem(this._migrationStatusCardLoadingContainer, {
|
||||||
CSSStyles: {
|
CSSStyles: {
|
||||||
|
|||||||
Reference in New Issue
Block a user