mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Adding aria role to hyperlink cell in slickgrid (#21998)
* Adding aria role to hyperlink * Adding default
This commit is contained in:
@@ -414,11 +414,13 @@ export class MigrationsListTab extends TabBase<MigrationsListTab> {
|
|||||||
<azdata.HyperlinkColumnCellValue>{
|
<azdata.HyperlinkColumnCellValue>{
|
||||||
icon: IconPathHelper.sqlDatabaseLogo,
|
icon: IconPathHelper.sqlDatabaseLogo,
|
||||||
title: migration.properties.sourceDatabaseName ?? EmptySettingValue,
|
title: migration.properties.sourceDatabaseName ?? EmptySettingValue,
|
||||||
|
role: 'button'
|
||||||
}, // sourceDatabase
|
}, // sourceDatabase
|
||||||
migration.properties.sourceServerName ?? EmptySettingValue, // sourceServer
|
migration.properties.sourceServerName ?? EmptySettingValue, // sourceServer
|
||||||
<azdata.HyperlinkColumnCellValue>{
|
<azdata.HyperlinkColumnCellValue>{
|
||||||
icon: getMigrationStatusImage(migration),
|
icon: getMigrationStatusImage(migration),
|
||||||
title: getMigrationStatusWithErrors(migration),
|
title: getMigrationStatusWithErrors(migration),
|
||||||
|
role: 'button'
|
||||||
}, // statue
|
}, // statue
|
||||||
getMigrationMode(migration), // mode
|
getMigrationMode(migration), // mode
|
||||||
getMigrationTargetType(migration), // targetType
|
getMigrationTargetType(migration), // targetType
|
||||||
|
|||||||
4
src/sql/azdata.proposed.d.ts
vendored
4
src/sql/azdata.proposed.d.ts
vendored
@@ -749,6 +749,10 @@ declare module 'azdata' {
|
|||||||
* The url to open.
|
* The url to open.
|
||||||
*/
|
*/
|
||||||
url?: string;
|
url?: string;
|
||||||
|
/**
|
||||||
|
* The role of the hyperlink. By default, the role is 'link' and the url will be opened in a new tab.
|
||||||
|
*/
|
||||||
|
role?: 'button' | 'link';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ContextMenuColumnCellValue {
|
export interface ContextMenuColumnCellValue {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export interface HyperlinkCellValue {
|
|||||||
iconCssClass?: string;
|
iconCssClass?: string;
|
||||||
title: string;
|
title: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
|
role?: 'button' | 'link';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HyperlinkColumnOptions extends IconColumnOptions, ClickableColumnOptions {
|
export interface HyperlinkColumnOptions extends IconColumnOptions, ClickableColumnOptions {
|
||||||
@@ -32,7 +33,7 @@ export class HyperlinkColumn<T extends Slick.SlickData> extends BaseClickableCol
|
|||||||
const cssClasses = iconValue.iconCssClass ? `codicon icon slick-plugin-icon ${iconValue.iconCssClass}` : '';
|
const cssClasses = iconValue.iconCssClass ? `codicon icon slick-plugin-icon ${iconValue.iconCssClass}` : '';
|
||||||
const urlPart = cellValue?.url ? `href="${encodeURI(cellValue.url)}" target="blank"` : '';
|
const urlPart = cellValue?.url ? `href="${encodeURI(cellValue.url)}" target="blank"` : '';
|
||||||
const disabledAttribute = this.isCellEnabled(row, cell) ? '' : 'disabled';
|
const disabledAttribute = this.isCellEnabled(row, cell) ? '' : 'disabled';
|
||||||
return `<a ${urlPart} class="slick-hyperlink-cell ${cssClasses}" tabindex=-1 title="${escapedTitle}" aria-label="${escapedTitle}" ${disabledAttribute}>${escapedTitle}</a>`;
|
return `<a ${urlPart} class="slick-hyperlink-cell ${cssClasses}" tabindex=-1 title="${escapedTitle}" aria-label="${escapedTitle}" role="${cellValue.role ?? 'link'}" ${disabledAttribute}>${escapedTitle}</a>`;
|
||||||
},
|
},
|
||||||
name: this.options.name,
|
name: this.options.name,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
|
|||||||
@@ -205,7 +205,8 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
|
|||||||
cellValue = <HyperlinkCellValue>{
|
cellValue = <HyperlinkCellValue>{
|
||||||
iconCssClass: hyperlinkValue.icon ? this.createIconCssClassInternal(hyperlinkValue.icon) : undefined,
|
iconCssClass: hyperlinkValue.icon ? this.createIconCssClassInternal(hyperlinkValue.icon) : undefined,
|
||||||
title: hyperlinkValue.title,
|
title: hyperlinkValue.title,
|
||||||
url: hyperlinkValue.url
|
url: hyperlinkValue.url,
|
||||||
|
role: hyperlinkValue.role
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user