Skip to content

Commit 08b04d9

Browse files
authored
Merge pull request #61658 from nextcloud/fix/files-node-name
fix(files): proper accessible row name and title for overflow
2 parents 3b7e586 + e0bc30e commit 08b04d9

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

apps/files/src/components/FileEntry/FileEntryName.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default defineComponent({
136136
return {
137137
is: 'span',
138138
params: {
139-
title: t('files', 'This node is unavailable'),
139+
title: this.source.displayname + ` (${t('files', 'unavailable')})`,
140140
},
141141
}
142142
}
@@ -148,11 +148,12 @@ export default defineComponent({
148148
folder: this.activeFolder!,
149149
contents: [],
150150
})
151+
const accessibleName = `${displayName}: ${this.source.displayname}`
151152
return {
152153
is: 'button',
153154
params: {
154-
'aria-label': displayName,
155-
title: displayName,
155+
'aria-label': accessibleName,
156+
title: accessibleName,
156157
tabindex: '0',
157158
},
158159
}

dist/files-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/playwright/e2e/files_external/files-external-failed.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test('Create a failed user storage with invalid url', async ({ page, user, files
3636

3737
await expect(row).toBeVisible()
3838
await expect(filesListPage.getRowNameLinkForFile('Storage1'))
39-
.toHaveAttribute('title', 'This node is unavailable')
39+
.toHaveAttribute('title', / \(unavailable\)$/)
4040

4141
// Clicking an unavailable storage must not open it (location stays the same)
4242
const url = page.url()
@@ -68,7 +68,7 @@ test('Create a failed user storage with invalid login credentials', async ({ pag
6868

6969
await expect(row).toBeVisible()
7070
await expect(filesListPage.getRowNameLinkForFile('Storage2'))
71-
.toHaveAttribute('title', 'This node is unavailable')
71+
.toHaveAttribute('title', / \(unavailable\)$/)
7272

7373
const url = page.url()
7474
await filesListPage.getRowNameLinkForFile('Storage2').click()

tests/playwright/support/sections/FilesListPage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ export class FilesListPage {
205205

206206
/**
207207
* The clickable name link of a row. Clicking it opens a folder or previews a
208-
* file; for an unavailable external storage it is inert (and carries the
209-
* "This node is unavailable" title).
208+
* file; for an unavailable storage it is inert.
210209
*/
211210
getRowNameLinkForFile(filename: string): Locator {
212211
return this.getRowForFile(filename).locator('[data-cy-files-list-row-name-link]')

0 commit comments

Comments
 (0)