fixes #127620
This commit is contained in:
parent
07a0575b6c
commit
057062f462
|
@ -90,6 +90,7 @@ class WorkspaceTrustedUrisTable extends Disposable {
|
|||
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
|
||||
@IWorkspaceTrustManagementService private readonly workspaceTrustManagementService: IWorkspaceTrustManagementService,
|
||||
@IUriIdentityService private readonly uriService: IUriIdentityService,
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@IFileDialogService private readonly fileDialogService: IFileDialogService
|
||||
) {
|
||||
super();
|
||||
|
@ -134,6 +135,23 @@ class WorkspaceTrustedUrisTable extends Disposable {
|
|||
alwaysConsumeMouseWheel: false,
|
||||
openOnSingleClick: false,
|
||||
multipleSelectionSupport: false,
|
||||
accessibilityProvider: {
|
||||
getAriaLabel: (item: ITrustedUriItem) => {
|
||||
if (item.entryType === TrustedUriItemType.Add) {
|
||||
return localize('addFolderAriaLabel', "Add a Trusted Folder");
|
||||
} else {
|
||||
const hostLabel = getHostLabel(this.labelService, item);
|
||||
if (hostLabel === undefined || hostLabel.length === 0) {
|
||||
return localize('trustedFolderAriaLabel', "You trust {0}", this.labelService.getUriLabel(item.uri));
|
||||
}
|
||||
|
||||
return localize('trustedFolderWithHostAriaLabel', "You trust {0} on {1}", this.labelService.getUriLabel(item.uri), hostLabel);
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
getWidgetAriaLabel: () => localize('trustedFoldersAndWorkspaces', "Trusted Folders & Workspaces")
|
||||
}
|
||||
}
|
||||
) as WorkbenchTable<ITrustedUriItem>;
|
||||
|
||||
|
@ -483,6 +501,10 @@ interface ITrustedUriHostColumnTemplateData {
|
|||
renderDisposables: DisposableStore;
|
||||
}
|
||||
|
||||
function getHostLabel(labelService: ILabelService, item: ITrustedUriItem): string {
|
||||
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : localize('localAuthority', "Local");
|
||||
}
|
||||
|
||||
class TrustedUriHostColumnRenderer implements ITableRenderer<ITrustedUriItem, ITrustedUriHostColumnTemplateData> {
|
||||
static readonly TEMPLATE_ID = 'host';
|
||||
|
||||
|
@ -515,7 +537,7 @@ class TrustedUriHostColumnRenderer implements ITableRenderer<ITrustedUriItem, IT
|
|||
templateData.renderDisposables.clear();
|
||||
templateData.renderDisposables.add({ dispose: () => { clearNode(templateData.buttonBarContainer); } });
|
||||
|
||||
templateData.hostContainer.innerText = item.uri.authority ? this.labelService.getHostLabel(item.uri.scheme, item.uri.authority) : localize('localAuthority', "Local");
|
||||
templateData.hostContainer.innerText = getHostLabel(this.labelService, item);
|
||||
templateData.element.classList.toggle('current-workspace-parent', item.parentOfWorkspaceItem);
|
||||
|
||||
if (item.entryType === TrustedUriItemType.Add) {
|
||||
|
|
Loading…
Reference in a new issue