add ariaLive to publish options description (#22338)

* add ariaLive to publish options description

* use correct string and update typings

* update type

* remove comment update

* create type AriaLiveType

* update MockInputBoxComponent with AriaLiveValue

* update azdata-test and add comment
This commit is contained in:
Kim Santiago
2023-03-16 16:08:24 -07:00
committed by GitHub
parent 20cf2489a2
commit 931c44ac41
7 changed files with 20 additions and 14 deletions

View File

@@ -248,7 +248,7 @@ export class MockInputBoxComponent extends MockUIComponent implements azdata.Inp
onEnterKeyPressed: vscode.Event<string>; onEnterKeyPressed: vscode.Event<string>;
value?: string; value?: string;
ariaLabel?: string; ariaLabel?: string;
ariaLive?: string; ariaLive?: azdata.AriaLiveValue;
placeHolder?: string; placeHolder?: string;
inputType?: azdata.InputBoxInputType; inputType?: azdata.InputBoxInputType;
required?: boolean; required?: boolean;

View File

@@ -538,7 +538,7 @@
"@types/semver": "^7.3.1", "@types/semver": "^7.3.1",
"@types/sinon": "^9.0.8", "@types/sinon": "^9.0.8",
"@types/yamljs": "0.2.30", "@types/yamljs": "0.2.30",
"@microsoft/azdata-test": "^3.0.1", "@microsoft/azdata-test": "^3.0.2",
"mocha": "^7.1.1", "mocha": "^7.1.1",
"should": "^13.2.3", "should": "^13.2.3",
"sinon": "^9.2.0", "sinon": "^9.2.0",

View File

@@ -196,10 +196,10 @@
dependencies: dependencies:
"@vscode/extension-telemetry" "0.6.1" "@vscode/extension-telemetry" "0.6.1"
"@microsoft/azdata-test@^3.0.1": "@microsoft/azdata-test@^3.0.2":
version "3.0.1" version "3.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.1.tgz#a8b89a12de42f277d33aae71c277d0c8efcfbee0" resolved "https://registry.yarnpkg.com/@microsoft/azdata-test/-/azdata-test-3.0.2.tgz#71cfbbc2ee9c1805311f3a5828b50679a5e6d73c"
integrity sha512-Zrctm/zKufwIRF9jfw8TOBzr5woLdKXAGNTlbAQl0IGLzVoIGULj9Gqdc1Ikhrov3rM0NkbAF/PY6j6BHiW8Tw== integrity sha512-NMoSKp/Zgs+1ZIe07w+FeKhqMaxgViLGmLTQHPfYN7RRTFErJBd8JgskxYoLZbgcctfVsV+Yw+zQEn1+g2mPKg==
dependencies: dependencies:
http-proxy-agent "^5.0.0" http-proxy-agent "^5.0.0"
https-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0"

View File

@@ -105,7 +105,8 @@ export class PublishOptionsDialog {
// data[row][1] contains the option display name // data[row][1] contains the option display name
const displayName = this.optionsTable?.data[row!][1]; const displayName = this.optionsTable?.data[row!][1];
await this.descriptionText?.updateProperties({ await this.descriptionText?.updateProperties({
value: this.optionsModel.getOptionDescription(displayName) value: this.optionsModel.getOptionDescription(displayName),
ariaLive: 'polite'
}); });
})); }));

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

@@ -3574,7 +3574,7 @@ declare module 'azdata' {
export interface InputBoxProperties extends ComponentProperties { export interface InputBoxProperties extends ComponentProperties {
value?: string | undefined; value?: string | undefined;
ariaLive?: string | undefined; ariaLive?: AriaLiveValue | undefined;
placeHolder?: string | undefined; placeHolder?: string | undefined;
inputType?: InputBoxInputType | undefined; inputType?: InputBoxInputType | undefined;
required?: boolean | undefined; required?: boolean | undefined;

View File

@@ -1804,9 +1804,14 @@ declare module 'azdata' {
/** /**
* Corresponds to the aria-live accessibility attribute for this component * Corresponds to the aria-live accessibility attribute for this component
*/ */
ariaLive?: string; ariaLive?: AriaLiveValue
} }
/**
* Supported values for aria-live accessibility attribute
*/
export type AriaLiveValue = 'polite' | 'assertive' | 'off';
export interface ContainerBuilder<TComponent extends Component, TLayout, TItemLayout, TPropertyBag extends ContainerProperties> extends ComponentBuilder<TComponent, TPropertyBag> { export interface ContainerBuilder<TComponent extends Component, TLayout, TItemLayout, TPropertyBag extends ContainerProperties> extends ComponentBuilder<TComponent, TPropertyBag> {
/** /**
* Sets the initial set of properties for the container being created * Sets the initial set of properties for the container being created
@@ -1819,7 +1824,7 @@ declare module 'azdata' {
/** /**
* Corresponds to the aria-live accessibility attribute for this component * Corresponds to the aria-live accessibility attribute for this component
*/ */
ariaLive?: string; ariaLive?: AriaLiveValue
} }
export namespace queryeditor { export namespace queryeditor {

View File

@@ -1004,10 +1004,10 @@ class InputBoxWrapper extends ComponentWrapper implements azdata.InputBoxCompone
this.setProperty('value', v); this.setProperty('value', v);
} }
public get ariaLive(): string { public get ariaLive(): azdata.AriaLiveValue | undefined {
return this.properties['ariaLive']; return this.properties['ariaLive'];
} }
public set ariaLive(v: string) { public set ariaLive(v: azdata.AriaLiveValue | undefined) {
this.setProperty('ariaLive', v); this.setProperty('ariaLive', v);
} }
@@ -1392,11 +1392,11 @@ class TextComponentWrapper extends ComponentWrapper implements azdata.TextCompon
this.setProperty('textType', type); this.setProperty('textType', type);
} }
public get ariaLive(): string | undefined { public get ariaLive(): azdata.AriaLiveValue | undefined {
return this.properties['ariaLive']; return this.properties['ariaLive'];
} }
public set ariaLive(ariaLive: string | undefined) { public set ariaLive(ariaLive: azdata.AriaLiveValue | undefined) {
this.setProperty('ariaLive', ariaLive); this.setProperty('ariaLive', ariaLive);
} }
} }