Browse Source
fix(files_versions): correctly show version author also for shared files
fix(files_versions): correctly show version author also for shared files
The users endpoint is not available for other users if the current user has no admin privileges, so instead use the displaynames endpoint. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>pull/51722/head
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400
4 changed files with 113 additions and 44 deletions
-
56apps/files_versions/src/components/Version.vue
-
41apps/files_versions/src/views/VersionTab.vue
-
14cypress/e2e/files_versions/version_creation.cy.ts
-
46cypress/e2e/files_versions/version_sharing.cy.ts
@ -0,0 +1,46 @@ |
|||
/** |
|||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
|||
* SPDX-License-Identifier: AGPL-3.0-or-later |
|||
*/ |
|||
import type { User } from '@nextcloud/cypress' |
|||
import { openVersionsPanel, setupTestSharedFileFromUser, uploadThreeVersions } from './filesVersionsUtils.ts' |
|||
import { navigateToFolder, triggerActionForFile } from '../files/FilesUtils.ts' |
|||
|
|||
describe('Versions on shares', () => { |
|||
const randomSharedFolderName = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(0, 10) |
|||
const randomFileName = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(0, 10) + '.txt' |
|||
const randomFilePath = `${randomSharedFolderName}/${randomFileName}` |
|||
let alice: User |
|||
let bob: User |
|||
|
|||
before(() => { |
|||
cy.createRandomUser() |
|||
.then((user) => { |
|||
alice = user |
|||
}) |
|||
.then(() => { |
|||
cy.mkdir(alice, `/${randomSharedFolderName}`) |
|||
return setupTestSharedFileFromUser(alice, randomSharedFolderName, {}) |
|||
}) |
|||
.then((user) => { bob = user }) |
|||
.then(() => uploadThreeVersions(alice, randomFilePath)) |
|||
}) |
|||
|
|||
it('See sharees display name as author', () => { |
|||
cy.login(bob) |
|||
cy.visit('/apps/files') |
|||
|
|||
navigateToFolder(randomSharedFolderName) |
|||
|
|||
triggerActionForFile(randomFileName, 'details') |
|||
cy.findByRole('tab', { name: 'Versions' }).click() |
|||
|
|||
cy.findByRole('tabpanel', { name: 'Versions' }) |
|||
.findByRole('list', { name: 'File versions' }) |
|||
.findAllByRole('listitem') |
|||
.first() |
|||
.find('[data-cy-files-version-author-name]') |
|||
.should('be.visible') |
|||
.and('contain.text', alice.userId) |
|||
}) |
|||
}) |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue