diff --git a/extensions/sql-migration/images/noAzureAccount.svg b/extensions/sql-migration/images/noAzureAccount.svg new file mode 100644 index 0000000000..3f0453d409 --- /dev/null +++ b/extensions/sql-migration/images/noAzureAccount.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extensions/sql-migration/src/constants/iconPathHelper.ts b/extensions/sql-migration/src/constants/iconPathHelper.ts index 9e23d122f6..50d1348c10 100644 --- a/extensions/sql-migration/src/constants/iconPathHelper.ts +++ b/extensions/sql-migration/src/constants/iconPathHelper.ts @@ -38,6 +38,7 @@ export class IconPathHelper { public static expandButtonOpen: IconPath; public static newSupportRequest: IconPath; public static emptyTable: IconPath; + public static addAzureAccount: IconPath; public static setExtensionContext(context: vscode.ExtensionContext) { IconPathHelper.copy = { @@ -148,5 +149,9 @@ export class IconPathHelper { light: context.asAbsolutePath('images/emptyTable.svg'), dark: context.asAbsolutePath('images/emptyTable.svg') }; + IconPathHelper.addAzureAccount = { + light: context.asAbsolutePath('images/noAzureAccount.svg'), + dark: context.asAbsolutePath('images/noAzureAccount.svg') + }; } } diff --git a/extensions/sql-migration/src/constants/strings.ts b/extensions/sql-migration/src/constants/strings.ts index 91969254bc..9369a290c6 100644 --- a/extensions/sql-migration/src/constants/strings.ts +++ b/extensions/sql-migration/src/constants/strings.ts @@ -366,6 +366,7 @@ 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 NO_PENDING_BACKUPS = localize('sql.migration.no.pending.backups', "No pending backups. Click refresh to check current status."); //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 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_COMPLETING = localize('sql.migration.status.dropdown.completing', "Status: Completing"); diff --git a/extensions/sql-migration/src/dashboard/sqlServerDashboard.ts b/extensions/sql-migration/src/dashboard/sqlServerDashboard.ts index e6db92a3b2..86c8d49971 100644 --- a/extensions/sql-migration/src/dashboard/sqlServerDashboard.ts +++ b/extensions/sql-migration/src/dashboard/sqlServerDashboard.ts @@ -607,6 +607,34 @@ export class DashboardWidget { } }); + const addAccountImage = view.modelBuilder.image().withProps({ + iconPath: IconPathHelper.addAzureAccount, + iconHeight: 100, + iconWidth: 100, + width: 96, + height: 96, + CSSStyles: { + 'opacity': '50%', + 'margin': '20% auto 10% auto', + 'filter': 'drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))', + 'display': 'none' + } + }).component(); + + const addAccountText = view.modelBuilder.text().withProps({ + value: loc.ADD_ACCOUNT, + width: 198, + height: 34, + CSSStyles: { + 'font-family': 'Segoe UI', + 'font-size': '12px', + 'margin': 'auto', + 'text-align': 'center', + 'line-height': '16px', + 'display': 'none' + } + }).component(); + const header = view.modelBuilder.flexContainer().withItems( [ statusContainerTitle, @@ -618,6 +646,24 @@ export class DashboardWidget { this._migrationStatusCardsContainer = view.modelBuilder.flexContainer().withLayout({ flexFlow: 'column' }).component(); + let accounts = await azdata.accounts.getAllAccounts(); + + if (accounts.length === 0) { + addAccountImage.updateCssStyles({ + 'display': 'block' + }); + addAccountText.updateCssStyles({ + 'display': 'block' + }); + this._migrationStatusCardsContainer.updateCssStyles({ + 'visibility': 'hidden' + }); + buttonContainer.removeItem(this._viewAllMigrationsButton); + refreshButton.updateCssStyles({ + 'float': 'right' + }); + } + this._inProgressMigrationButton = this.createStatusCard( IconPathHelper.inProgressMigration, loc.MIGRATION_IN_PROGRESS @@ -704,6 +750,9 @@ export class DashboardWidget { } ); + statusContainer.addItem(addAccountImage, {}); + statusContainer.addItem(addAccountText, {}); + statusContainer.addItem(this._migrationStatusCardLoadingContainer, { CSSStyles: { 'margin-top': '30px'