Inform screen-readers of Dacpac Deploy loading and loading complete for summary (#7000)

* Loading components now announce themselves.  Likely need way to disable.

* Adding focus elements to table for screen-reading after component is loaded in

* Adding piping for aria roles on tables

* Alerting on completion of deploy plan summary

* Removing extra ariaLive property
This commit is contained in:
Benjin Dubishar
2019-08-28 14:42:40 -07:00
committed by GitHub
parent 40d5667e63
commit faf6eae535
6 changed files with 38 additions and 2 deletions

View File

@@ -99,7 +99,8 @@ export class DeployPlanPage extends DacFxConfigPage {
data: this.getColumnData(result), data: this.getColumnData(result),
columns: this.getTableColumns(result.dataLossAlerts.size > 0), columns: this.getTableColumns(result.dataLossAlerts.size > 0),
width: 875, width: 875,
height: 300 height: 300,
ariaRole: 'alert'
}); });
if (result.dataLossAlerts.size > 0) { if (result.dataLossAlerts.size > 0) {

2
src/sql/azdata.d.ts vendored
View File

@@ -2951,6 +2951,8 @@ declare module 'azdata' {
title?: string; title?: string;
ariaRowCount?: number; ariaRowCount?: number;
ariaColumnCount?: number; ariaColumnCount?: number;
ariaRole?: string;
focused?: boolean;
moveFocusOutWithTab?: boolean; //accessibility requirement for tables with no actionable cells moveFocusOutWithTab?: boolean; //accessibility requirement for tables with no actionable cells
} }

View File

@@ -359,4 +359,8 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
public set ariaColumnCount(value: number) { public set ariaColumnCount(value: number) {
this._tableContainer.setAttribute('aria-colcount', value.toString()); this._tableContainer.setAttribute('aria-colcount', value.toString());
} }
public set ariaRole(value: string) {
this._tableContainer.setAttribute('role', value);
}
} }

View File

@@ -1191,6 +1191,13 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
this.setProperty('moveFocusOutWithTab', v); this.setProperty('moveFocusOutWithTab', v);
} }
public get focused(): boolean {
return this.properties['focused'];
}
public set focused(v: boolean) {
this.setProperty('focused', v);
}
public get onRowSelected(): vscode.Event<any> { public get onRowSelected(): vscode.Event<any> {
let emitter = this._emitterMap.get(ComponentEventType.onSelectedRowChanged); let emitter = this._emitterMap.get(ComponentEventType.onSelectedRowChanged);
return emitter && emitter.event; return emitter && emitter.event;
@@ -1200,6 +1207,8 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
let emitter = this._emitterMap.get(ComponentEventType.onCellAction); let emitter = this._emitterMap.get(ComponentEventType.onCellAction);
return emitter && emitter.event; return emitter && emitter.event;
} }
} }
class DropDownWrapper extends ComponentWrapper implements azdata.DropDownComponent { class DropDownWrapper extends ComponentWrapper implements azdata.DropDownComponent {

View File

@@ -17,7 +17,7 @@ import * as nls from 'vs/nls';
@Component({ @Component({
selector: 'modelview-loadingComponent', selector: 'modelview-loadingComponent',
template: ` template: `
<div class="modelview-loadingComponent-container" *ngIf="loading"> <div class="modelview-loadingComponent-container" role="alert" aria-busy="true" *ngIf="loading">
<div class="modelview-loadingComponent-spinner" *ngIf="loading" [title]=_loadingTitle #spinnerElement></div> <div class="modelview-loadingComponent-spinner" *ngIf="loading" [title]=_loadingTitle #spinnerElement></div>
</div> </div>
<model-component-wrapper #childElement [descriptor]="_component" [modelStore]="modelStore" *ngIf="_component" [ngClass]="{'modelview-loadingComponent-content-loading': loading}"> <model-component-wrapper #childElement [descriptor]="_component" [modelStore]="modelStore" *ngIf="_component" [ngClass]="{'modelview-loadingComponent-content-loading': loading}">

View File

@@ -245,6 +245,14 @@ export default class TableComponent extends ComponentBase implements IComponent,
this._table.ariaColumnCount = this.ariaColumnCount; this._table.ariaColumnCount = this.ariaColumnCount;
} }
if (this.ariaRole) {
this._table.ariaRole = this.ariaRole;
}
if (this.focused) {
this._table.focus();
}
this.layoutTable(); this.layoutTable();
this.validate(); this.validate();
} }
@@ -328,6 +336,10 @@ export default class TableComponent extends ComponentBase implements IComponent,
return this.getPropertyOrDefault<azdata.TableComponentProperties, number>((props) => props.ariaColumnCount, -1); return this.getPropertyOrDefault<azdata.TableComponentProperties, number>((props) => props.ariaColumnCount, -1);
} }
public get ariaRole(): string {
return this.getPropertyOrDefault<azdata.TableComponentProperties, string>((props) => props.ariaRole, undefined);
}
public set moveFocusOutWithTab(newValue: boolean) { public set moveFocusOutWithTab(newValue: boolean) {
this.setPropertyFromUI<azdata.TableComponentProperties, boolean>((props, value) => props.moveFocusOutWithTab = value, newValue); this.setPropertyFromUI<azdata.TableComponentProperties, boolean>((props, value) => props.moveFocusOutWithTab = value, newValue);
} }
@@ -335,4 +347,12 @@ export default class TableComponent extends ComponentBase implements IComponent,
public get moveFocusOutWithTab(): boolean { public get moveFocusOutWithTab(): boolean {
return this.getPropertyOrDefault<azdata.TableComponentProperties, boolean>((props) => props.moveFocusOutWithTab, false); return this.getPropertyOrDefault<azdata.TableComponentProperties, boolean>((props) => props.moveFocusOutWithTab, false);
} }
public get focused(): boolean {
return this.getPropertyOrDefault<azdata.RadioButtonProperties, boolean>((props) => props.focused, false);
}
public set focused(newValue: boolean) {
this.setPropertyFromUI<azdata.RadioButtonProperties, boolean>((properties, value) => { properties.focused = value; }, newValue);
}
} }