add aria-label / name to image only buttons (#16124)

* add aria-label / name to image only buttons

* add correct aria label to image buttons

* add key number to button aria-label, title and action messages to differentient keys
This commit is contained in:
brian-harris
2021-07-15 12:08:59 -07:00
committed by GitHub
parent 0ff8786885
commit b45f3e7218
5 changed files with 59 additions and 30 deletions

View File

@@ -543,33 +543,41 @@ export class CreateSqlMigrationServiceDialog {
const location = this._model._targetServerInstance.location;
const keys = await getSqlMigrationServiceAuthKeys(this._model._azureAccount, subscription, resourceGroup, location, this._createdMigrationService!.name);
this._copyKey1Button = this._view.modelBuilder.button().withProps({
iconPath: IconPathHelper.copy
this._copyKey1Button = this._view.modelBuilder.button().withProperties<azdata.ComponentWithIconProperties>({
title: constants.COPY_KEY1,
iconPath: IconPathHelper.copy,
ariaLabel: constants.COPY_KEY1,
}).component();
this._copyKey1Button.onDidClick((e) => {
vscode.env.clipboard.writeText(<string>this.migrationServiceAuthKeyTable.dataValues![0][1].value);
vscode.window.showInformationMessage(constants.SERVICE_KEY_COPIED_HELP);
vscode.window.showInformationMessage(constants.SERVICE_KEY1_COPIED_HELP);
});
this._copyKey2Button = this._view.modelBuilder.button().withProps({
iconPath: IconPathHelper.copy
this._copyKey2Button = this._view.modelBuilder.button().withProperties<azdata.ComponentWithIconProperties>({
title: constants.COPY_KEY2,
iconPath: IconPathHelper.copy,
ariaLabel: constants.COPY_KEY2,
}).component();
this._copyKey2Button.onDidClick((e) => {
vscode.env.clipboard.writeText(<string>this.migrationServiceAuthKeyTable.dataValues![1][1].value);
vscode.window.showInformationMessage(constants.SERVICE_KEY_COPIED_HELP);
vscode.window.showInformationMessage(constants.SERVICE_KEY2_COPIED_HELP);
});
this._refreshKey1Button = this._view.modelBuilder.button().withProps({
iconPath: IconPathHelper.refresh
this._refreshKey1Button = this._view.modelBuilder.button().withProperties<azdata.ComponentWithIconProperties>({
title: constants.REFRESH_KEY1,
iconPath: IconPathHelper.refresh,
ariaLabel: constants.REFRESH_KEY1,
}).component();
this._refreshKey1Button.onDidClick((e) => {//TODO: add refresh logic
});
this._refreshKey2Button = this._view.modelBuilder.button().withProps({
iconPath: IconPathHelper.refresh
this._refreshKey2Button = this._view.modelBuilder.button().withProperties<azdata.ComponentWithIconProperties>({
title: constants.REFRESH_KEY2,
iconPath: IconPathHelper.refresh,
ariaLabel: constants.REFRESH_KEY2,
}).component();
this._refreshKey2Button.onDidClick((e) => { //TODO: add refresh logic