mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
Show image with "Add Account" message if user hasn't signed in - Migration Status Dialog (#16932)
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user