mirror of
https://github.com/nextcloud/server.git
synced 2026-04-05 17:16:55 -04:00
fix(files_sharing): Disable folder upload on file drop shares for now
The backend does not allow creating folders currently, so we have to disable it for now. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
395515f346
commit
2bb2bbcae4
3 changed files with 24 additions and 12 deletions
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<!-- Uploader -->
|
||||
<UploadPicker v-if="canUpload && !isQuotaExceeded && currentFolder"
|
||||
allow-folders
|
||||
:allow-folders="canUploadFolders"
|
||||
class="files-list__header-upload-button"
|
||||
:content="getContent"
|
||||
:destination="currentFolder"
|
||||
|
|
@ -282,6 +282,14 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
computed: {
|
||||
canUploadFolders() {
|
||||
// TODO: Remove this small files_sharing hack when https://github.com/nextcloud/server/issues/15921 is implmented
|
||||
if (this.currentView?.id === 'public-file-drop') {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
|
||||
/**
|
||||
* Get a callback function for the uploader to fetch directory contents for conflict resolution
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
:name="t('files_sharing', 'Terms of service')"
|
||||
:message="disclaimer" />
|
||||
</template>
|
||||
<UploadPicker allow-folders
|
||||
:content="() => []"
|
||||
<UploadPicker :content="() => []"
|
||||
no-menu
|
||||
:destination="uploadDestination"
|
||||
multiple />
|
||||
|
|
|
|||
|
|
@ -70,7 +70,8 @@ describe('files_sharing: Public share - File drop', { testIsolation: true }, ()
|
|||
.should('not.exist')
|
||||
})
|
||||
|
||||
it('Can only see upload files and upload folders menu entries', () => {
|
||||
// TODO: reenable folder upload with https://github.com/nextcloud/server/issues/15921
|
||||
it.skip('Can only see upload files and upload folders menu entries', () => {
|
||||
cy.contains(`Upload files to ${shareName}`)
|
||||
.should('be.visible')
|
||||
|
||||
|
|
@ -87,6 +88,16 @@ describe('files_sharing: Public share - File drop', { testIsolation: true }, ()
|
|||
.findAllByRole('menuitem')
|
||||
.should('have.length', 2)
|
||||
})
|
||||
it('Can only see upload files', () => {
|
||||
cy.contains(`Upload files to ${shareName}`)
|
||||
.should('be.visible')
|
||||
|
||||
cy.findByRole('button', { name: 'New' })
|
||||
.should('be.visible')
|
||||
.click()
|
||||
cy.findByRole('menu')
|
||||
.should('not.exist')
|
||||
})
|
||||
|
||||
it('Can only see dedicated upload button', () => {
|
||||
cy.contains(`Upload files to ${shareName}`)
|
||||
|
|
@ -95,15 +106,9 @@ describe('files_sharing: Public share - File drop', { testIsolation: true }, ()
|
|||
cy.findByRole('button', { name: 'Upload' })
|
||||
.should('be.visible')
|
||||
.click()
|
||||
// See upload actions
|
||||
cy.findByRole('menuitem', { name: 'Upload files' })
|
||||
.should('be.visible')
|
||||
cy.findByRole('menuitem', { name: 'Upload folders' })
|
||||
.should('be.visible')
|
||||
// But no other
|
||||
// But no menu
|
||||
cy.findByRole('menu')
|
||||
.findAllByRole('menuitem')
|
||||
.should('have.length', 2)
|
||||
.should('not.exist')
|
||||
})
|
||||
|
||||
it('Can upload files', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue