mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
add aria label for agreement checkbox (#8439)
This commit is contained in:
@@ -286,7 +286,9 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createAgreementCheckbox(agreementInfo: AgreementInfo): azdata.FlexContainer {
|
private createAgreementCheckbox(agreementInfo: AgreementInfo): azdata.FlexContainer {
|
||||||
const checkbox = this._view.modelBuilder.checkBox().component();
|
const checkbox = this._view.modelBuilder.checkBox().withProperties<azdata.CheckBoxProperties>({
|
||||||
|
ariaLabel: this.getAgreementDisplayText(agreementInfo)
|
||||||
|
}).component();
|
||||||
checkbox.checked = false;
|
checkbox.checked = false;
|
||||||
this._toDispose.push(checkbox.onChanged(() => {
|
this._toDispose.push(checkbox.onChanged(() => {
|
||||||
this._agreementCheckboxChecked = !!checkbox.checked;
|
this._agreementCheckboxChecked = !!checkbox.checked;
|
||||||
@@ -299,6 +301,16 @@ export class ResourceTypePickerDialog extends DialogBase {
|
|||||||
return createFlexContainer(this._view, [checkbox, text]);
|
return createFlexContainer(this._view, [checkbox, text]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getAgreementDisplayText(agreementInfo: AgreementInfo): string {
|
||||||
|
// the agreement template will have {index} as placeholder for hyperlinks
|
||||||
|
// this method will get the display text after replacing the placeholders
|
||||||
|
let text = agreementInfo.template;
|
||||||
|
for (let i: number = 0; i < agreementInfo.links.length; i++) {
|
||||||
|
text = text.replace(`{${i}}`, agreementInfo.links[i].text);
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
private getCurrentProvider(): DeploymentProvider {
|
private getCurrentProvider(): DeploymentProvider {
|
||||||
const options: { option: string, value: string }[] = [];
|
const options: { option: string, value: string }[] = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user