Merge pull request #60526 from nextcloud/backport/60134/stable33
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Integration sqlite / changes (push) Waiting to run
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, --tags ~@large files_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, capabilities_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, collaboration_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, comments_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, dav_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, federation_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, file_conversions) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, files_reminders) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, filesdrop_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, ldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, openldap_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, openldap_numerical_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, remoteapi_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, routing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, setup_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, sharees_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, sharing_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, theming_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite (stable33, 8.4, stable33, videoverification_features) (push) Blocked by required conditions
Integration sqlite / integration-sqlite-summary (push) Blocked by required conditions

[stable33] Fix rendering custom columns in file lists
This commit is contained in:
Daniel Calviño Sánchez 2026-05-19 15:13:01 +02:00 committed by GitHub
commit eec0f103ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 108 additions and 4 deletions

View file

@ -98,7 +98,7 @@
<CustomElementRender
:active-folder="activeFolder"
:active-view="activeView"
:render="column.render"
:render="adaptColumnRenderToCustomElementRender(column)"
:source="source" />
</td>
</tr>
@ -299,6 +299,12 @@ export default defineComponent({
view: this.activeView!,
})
},
adaptColumnRenderToCustomElementRender(column) {
return ({ nodes, view }) => {
return column.render(nodes[0], view)
}
},
},
})
</script>

View file

@ -5,7 +5,9 @@
import type { User } from '@nextcloud/e2e-test-server/cypress'
import { ShareType } from '@nextcloud/sharing'
import { deleteDownloadsFolderBeforeEach } from '../../support/utils/deleteDownloadsFolder.ts'
import { randomString } from '../../support/utils/randomString.ts'
import { deleteFileWithRequest, getRowForFileId, selectAllFiles, triggerActionForFileId } from '../files/FilesUtils.ts'
describe('files_trashbin: download files', { testIsolation: true }, () => {
@ -67,3 +69,69 @@ describe('files_trashbin: download files', { testIsolation: true }, () => {
cy.get('[data-cy-files-list-selection-action="download"]').should('not.exist')
})
})
describe('files_trashbin: file row', { testIsolation: true }, () => {
let alice: User
let bob: User
let randomGroupName: string
let fileId: number
before(() => {
randomGroupName = randomString(10)
cy.runOccCommand(`group:add ${randomGroupName}`)
cy.createRandomUser().then((user) => {
alice = user
cy.modifyUser(alice, 'display', 'Alice')
cy.mkdir(alice, '/Shared')
})
cy.createRandomUser().then((user) => {
bob = user
cy.modifyUser(bob, 'display', 'Bob')
cy.runOccCommand(`group:adduser ${randomGroupName} ${bob.userId}`)
})
})
it('shows data for file deleted by owner', () => {
cy.uploadContent(alice, new Blob(['<content>']), 'text/plain', '/test-file.txt')
.then(({ headers }) => fileId = Number.parseInt(headers['oc-fileid']))
.then(() => deleteFileWithRequest(alice, '/test-file.txt'))
cy.login(alice)
cy.visit('/apps/files/trashbin')
getRowForFileId(fileId).should('be.visible')
// The full name includes one span for the name and one span for the
// extension, so text() returns a space when composing them even if it
// will not be visible when rendered in the browser.
getRowForFileId(fileId).find('[data-cy-files-list-row-name]').should((element) => expect(element.text().trim()).to.equal('test-file .txt'))
getRowForFileId(fileId).find('[data-cy-files-list-row-column-custom="files_trashbin--original-location"]').should('have.text', 'All files')
getRowForFileId(fileId).find('[data-cy-files-list-row-column-custom="files_trashbin--deleted-by"]').should('have.text', 'You')
getRowForFileId(fileId).find('[data-cy-files-list-row-column-custom="files_trashbin--deleted"]').should('have.text', 'few seconds ago')
})
it('shows data for file deleted by sharee in a folder shared with a group', () => {
cy.createShare(alice, '/Shared', ShareType.Group, randomGroupName)
cy.uploadContent(alice, new Blob(['<content>']), 'text/plain', '/Shared/test-file.txt')
.then(({ headers }) => fileId = Number.parseInt(headers['oc-fileid']))
.then(() => deleteFileWithRequest(bob, '/Shared/test-file.txt'))
cy.login(alice)
cy.visit('/apps/files/trashbin')
getRowForFileId(fileId).should('be.visible')
// The full name includes one span for the name and one span for the
// extension, so text() returns a space when composing them even if it
// will not be visible when rendered in the browser.
getRowForFileId(fileId).find('[data-cy-files-list-row-name]').should((element) => expect(element.text().trim()).to.equal('test-file .txt'))
getRowForFileId(fileId).find('[data-cy-files-list-row-column-custom="files_trashbin--original-location"]').should('have.text', 'Shared')
getRowForFileId(fileId).find('[data-cy-files-list-row-column-custom="files_trashbin--deleted-by"]').should('have.text', 'Bob')
getRowForFileId(fileId).find('[data-cy-files-list-row-column-custom="files_trashbin--deleted"]').should('have.text', 'few seconds ago')
})
})

View file

@ -181,6 +181,36 @@ Cypress.Commands.add('uploadContent', (user: User, blob: Blob, mimeType: string,
})
})
Cypress.Commands.add('createShare', (sharer: User, path: string, shareType: number, shareWith: string) => {
return cy.clearCookies()
.then(async () => {
try {
const url = `${Cypress.env('baseUrl')}/ocs/v2.php/apps/files_sharing/api/v1/shares`
const response = await axios({
url,
method: 'POST',
auth: {
username: sharer.userId,
password: sharer.password,
},
headers: {
'OCS-ApiRequest': 'true',
},
data: {
path,
shareType,
shareWith,
},
})
cy.log(`Created share for ${path} of type ${shareType} with ${shareWith}`, response)
return response
} catch (cause) {
cy.log('error', cause)
throw new Error(`Unable to create share for ${path} of type ${shareType} with ${shareWith}`, { cause })
}
})
})
/**
* Reset the admin theming entirely
*/

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long