mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
- Adding mouse in and out styling to clickbale divs (#15956)
* - Adding mouse in and out styling to clickbale divs -Moving dashboard card styling to outer div container from inner form container * removing detect changes * Localizing aria label * moving css from template to styles * adding themeing participant to change hover styling * removing unused event handlers * separating styling
This commit is contained in:
@@ -290,6 +290,7 @@ export const SUCCESSFULLY_MIGRATED_TO_AZURE_SQL = localize('sql.migration.succes
|
|||||||
export const MIGRATION_NOT_STARTED = localize('sql.migration.migration.not.started', "Migration not started");
|
export const MIGRATION_NOT_STARTED = localize('sql.migration.migration.not.started', "Migration not started");
|
||||||
export const CHOOSE_TO_MIGRATE_TO_AZURE_SQL = localize('sql.migration.choose.to.migrate.to.azure.sql', "Choose to migrate to Azure SQL");
|
export const CHOOSE_TO_MIGRATE_TO_AZURE_SQL = localize('sql.migration.choose.to.migrate.to.azure.sql', "Choose to migrate to Azure SQL");
|
||||||
export const COMING_SOON = localize('sql.migration.coming.soon', "Coming soon");
|
export const COMING_SOON = localize('sql.migration.coming.soon', "Coming soon");
|
||||||
|
export const SHOW_STATUS = localize('sql.migration.show.status', "Show status");
|
||||||
export function MIGRATION_INPROGRESS_WARNING(count: number) {
|
export function MIGRATION_INPROGRESS_WARNING(count: number) {
|
||||||
switch (count) {
|
switch (count) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@@ -270,9 +270,9 @@ export class DashboardWidget {
|
|||||||
if (warningCount > 0) {
|
if (warningCount > 0) {
|
||||||
this._inProgressWarningMigrationButton.warningText!.value = loc.MIGRATION_INPROGRESS_WARNING(warningCount);
|
this._inProgressWarningMigrationButton.warningText!.value = loc.MIGRATION_INPROGRESS_WARNING(warningCount);
|
||||||
this._inProgressMigrationButton.container.display = 'none';
|
this._inProgressMigrationButton.container.display = 'none';
|
||||||
this._inProgressWarningMigrationButton.container.display = 'inline';
|
this._inProgressWarningMigrationButton.container.display = '';
|
||||||
} else {
|
} else {
|
||||||
this._inProgressMigrationButton.container.display = 'inline';
|
this._inProgressMigrationButton.container.display = '';
|
||||||
this._inProgressWarningMigrationButton.container.display = 'none';
|
this._inProgressWarningMigrationButton.container.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,8 +286,8 @@ export class DashboardWidget {
|
|||||||
const failedMigrations = filterMigrations(migrations, AdsMigrationStatus.FAILED);
|
const failedMigrations = filterMigrations(migrations, AdsMigrationStatus.FAILED);
|
||||||
const failedCount = failedMigrations.length;
|
const failedCount = failedMigrations.length;
|
||||||
if (failedCount > 0) {
|
if (failedCount > 0) {
|
||||||
this._failedMigrationButton.container.display = 'inline';
|
this._failedMigrationButton.container.display = '';
|
||||||
this._failedMigrationButton.count.value = failedMigrations.length.toString();
|
this._failedMigrationButton.count.value = failedCount.toString();
|
||||||
} else {
|
} else {
|
||||||
this._failedMigrationButton.container.display = 'none';
|
this._failedMigrationButton.container.display = 'none';
|
||||||
}
|
}
|
||||||
@@ -295,7 +295,7 @@ export class DashboardWidget {
|
|||||||
const completingCutoverMigrations = filterMigrations(migrations, AdsMigrationStatus.COMPLETING);
|
const completingCutoverMigrations = filterMigrations(migrations, AdsMigrationStatus.COMPLETING);
|
||||||
const cutoverCount = completingCutoverMigrations.length;
|
const cutoverCount = completingCutoverMigrations.length;
|
||||||
if (cutoverCount > 0) {
|
if (cutoverCount > 0) {
|
||||||
this._completingMigrationButton.container.display = 'inline';
|
this._completingMigrationButton.container.display = '';
|
||||||
this._completingMigrationButton.count.value = cutoverCount.toString();
|
this._completingMigrationButton.count.value = cutoverCount.toString();
|
||||||
} else {
|
} else {
|
||||||
this._completingMigrationButton.container.display = 'none';
|
this._completingMigrationButton.container.display = 'none';
|
||||||
@@ -327,6 +327,7 @@ export class DashboardWidget {
|
|||||||
'margin-bottom': '0px',
|
'margin-bottom': '0px',
|
||||||
'width': '300px',
|
'width': '300px',
|
||||||
'font-size': '14px',
|
'font-size': '14px',
|
||||||
|
'font-weight': 'bold'
|
||||||
}
|
}
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
@@ -342,9 +343,7 @@ export class DashboardWidget {
|
|||||||
const flex = this._view.modelBuilder.flexContainer().withProps({
|
const flex = this._view.modelBuilder.flexContainer().withProps({
|
||||||
CSSStyles: {
|
CSSStyles: {
|
||||||
'width': '400px',
|
'width': '400px',
|
||||||
'height': '50px',
|
'height': '50px'
|
||||||
'margin-top': '10px',
|
|
||||||
'border': '1px solid',
|
|
||||||
}
|
}
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
@@ -374,8 +373,14 @@ export class DashboardWidget {
|
|||||||
|
|
||||||
const compositeButton = this._view.modelBuilder.divContainer().withItems([flex]).withProps({
|
const compositeButton = this._view.modelBuilder.divContainer().withItems([flex]).withProps({
|
||||||
ariaRole: 'button',
|
ariaRole: 'button',
|
||||||
ariaLabel: 'show status',
|
ariaLabel: loc.SHOW_STATUS,
|
||||||
clickable: true
|
clickable: true,
|
||||||
|
CSSStyles: {
|
||||||
|
'width': '400px',
|
||||||
|
'border': '1px solid',
|
||||||
|
'margin-top': '10px',
|
||||||
|
'height': '50px'
|
||||||
|
}
|
||||||
}).component();
|
}).component();
|
||||||
return {
|
return {
|
||||||
container: compositeButton,
|
container: compositeButton,
|
||||||
@@ -456,8 +461,6 @@ export class DashboardWidget {
|
|||||||
CSSStyles: {
|
CSSStyles: {
|
||||||
'width': '400px',
|
'width': '400px',
|
||||||
'height': '70px',
|
'height': '70px',
|
||||||
'margin-top': '10px',
|
|
||||||
'border': '1px solid'
|
|
||||||
}
|
}
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
@@ -488,7 +491,13 @@ export class DashboardWidget {
|
|||||||
const compositeButton = this._view.modelBuilder.divContainer().withItems([flex]).withProps({
|
const compositeButton = this._view.modelBuilder.divContainer().withItems([flex]).withProps({
|
||||||
ariaRole: 'button',
|
ariaRole: 'button',
|
||||||
ariaLabel: 'show status',
|
ariaLabel: 'show status',
|
||||||
clickable: true
|
clickable: true,
|
||||||
|
CSSStyles: {
|
||||||
|
'width': '400px',
|
||||||
|
'height': '70px',
|
||||||
|
'margin-top': '10px',
|
||||||
|
'border': '1px solid'
|
||||||
|
}
|
||||||
}).component();
|
}).component();
|
||||||
return {
|
return {
|
||||||
container: compositeButton,
|
container: compositeButton,
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import { KeyCode } from 'vs/base/common/keyCodes';
|
|||||||
import { IComponentDescriptor, IComponent, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
|
import { IComponentDescriptor, IComponent, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
|
||||||
import { convertSize } from 'sql/base/browser/dom';
|
import { convertSize } from 'sql/base/browser/dom';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
|
import { registerThemingParticipant, IColorTheme, IThemeService, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||||
|
import * as colorRegistry from 'vs/platform/theme/common/colorRegistry';
|
||||||
|
|
||||||
class DivItem {
|
class DivItem {
|
||||||
constructor(public descriptor: IComponentDescriptor, public config: azdata.DivItemLayout) { }
|
constructor(public descriptor: IComponentDescriptor, public config: azdata.DivItemLayout) { }
|
||||||
@@ -25,7 +27,7 @@ class DivItem {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: `
|
||||||
<div #divContainer *ngIf="items" class="divContainer" [ngStyle]="CSSStyles" [style.height]="height" [style.width]="width" [style.display]="display" (keyup)="onKey($event)" [attr.role]="ariaRole" [attr.aria-selected]="ariaSelected">
|
<div #divContainer *ngIf="items" [ngClass] = "{'divContainer': true, 'clickable-divContainer': clickable}" [ngStyle]="CSSStyles" [style.height]="height" [style.width]="width" [style.display]="display" (keyup)="onKey($event)" [attr.role]="ariaRole" [attr.aria-selected]="ariaSelected">
|
||||||
<div *ngFor="let item of items" [style.order]="getItemOrder(item)" [ngStyle]="getItemStyles(item)">
|
<div *ngFor="let item of items" [style.order]="getItemOrder(item)" [ngStyle]="getItemStyles(item)">
|
||||||
<model-component-wrapper [descriptor]="item.descriptor" [modelStore]="modelStore">
|
<model-component-wrapper [descriptor]="item.descriptor" [modelStore]="modelStore">
|
||||||
</model-component-wrapper>
|
</model-component-wrapper>
|
||||||
@@ -47,10 +49,22 @@ export default class DivContainer extends ContainerBase<azdata.DivItemLayout, az
|
|||||||
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
|
||||||
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
|
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
|
||||||
@Inject(forwardRef(() => Renderer2)) private renderer: Renderer2,
|
@Inject(forwardRef(() => Renderer2)) private renderer: Renderer2,
|
||||||
@Inject(ILogService) logService: ILogService
|
@Inject(ILogService) logService: ILogService,
|
||||||
|
@Inject(IThemeService) themeService: IThemeService,
|
||||||
) {
|
) {
|
||||||
super(changeRef, el, logService);
|
super(changeRef, el, logService);
|
||||||
this._overflowY = ''; // default
|
this._overflowY = ''; // default
|
||||||
|
|
||||||
|
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||||
|
const editorHoverBackground = theme.getColor(colorRegistry.editorHoverBackground).toString();
|
||||||
|
if (editorHoverBackground) {
|
||||||
|
collector.addRule(`
|
||||||
|
.clickable-divContainer:hover {
|
||||||
|
background-color: ${editorHoverBackground};
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
@@ -170,3 +184,5 @@ export default class DivContainer extends ContainerBase<azdata.DivItemLayout, az
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.divContainer:focus {
|
||||||
|
outline-offset: 2px
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user