mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
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
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:
commit
eec0f103ef
5 changed files with 108 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue