Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions apps/files_sharing/src/components/NewFileRequestDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<!-- Next -->
<NcButton v-if="currentStep !== STEP.LAST"
:aria-label="t('files_sharing', 'Continue')"
:disabled="loading"
:disabled="loading || (destination === '/' || destination === '')"
data-cy-file-request-dialog-controls="next"
@click="onPageNext">
<template #icon>
Expand Down Expand Up @@ -223,14 +223,6 @@ export default defineComponent({
return
}

// custom destination validation
// cannot share root
if (this.destination === '/' || this.destination === '') {
const destinationInput = form.querySelector('input[name="destination"]') as HTMLInputElement
destinationInput?.setCustomValidity(t('files_sharing', 'Please select a folder, you cannot share the root directory.'))
form.reportValidity()
return
}

if (this.currentStep === STEP.FIRST) {
this.currentStep = STEP.SECOND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
:show-trailing-button="destination !== context.path"
:trailing-button-icon="'undo'"
:trailing-button-label="t('files_sharing', 'Revert to default')"
:error="(destination === '/' || destination === '')"
:helper-text="(destination === '/' || destination === '') ?
t('files_sharing', 'Please select a folder, you cannot share the root directory.'):
''"
name="destination"
@click="onPickDestination"
@keypress.prevent.stop="/* prevent typing in the input, we use the picker */"
Expand Down