diff options
Diffstat (limited to 'apps/files_sharing/src')
3 files changed, 27 insertions, 51 deletions
diff --git a/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue b/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue index 4c14b21e1d5..7e6d56e8794 100644 --- a/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue +++ b/apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue @@ -14,9 +14,9 @@ <fieldset class="file-request-dialog__expiration" data-cy-file-request-dialog-fieldset="expiration"> <!-- Enable expiration --> <legend>{{ t('files_sharing', 'When should the request expire?') }}</legend> - <NcCheckboxRadioSwitch v-show="!defaultExpireDateEnforced" - :checked="defaultExpireDateEnforced || expirationDate !== null" - :disabled="disabled || defaultExpireDateEnforced" + <NcCheckboxRadioSwitch v-show="!isExpirationDateEnforced" + :checked="isExpirationDateEnforced || expirationDate !== null" + :disabled="disabled || isExpirationDateEnforced" @update:checked="onToggleDeadline"> {{ t('files_sharing', 'Set a submission expiration date') }} </NcCheckboxRadioSwitch> @@ -46,9 +46,9 @@ <fieldset class="file-request-dialog__password" data-cy-file-request-dialog-fieldset="password"> <!-- Enable password --> <legend>{{ t('files_sharing', 'What password should be used for the request?') }}</legend> - <NcCheckboxRadioSwitch v-show="!enforcePasswordForPublicLink" - :checked="enforcePasswordForPublicLink || password !== null" - :disabled="disabled || enforcePasswordForPublicLink" + <NcCheckboxRadioSwitch v-show="!isPasswordEnforced" + :checked="isPasswordEnforced || password !== null" + :disabled="disabled || isPasswordEnforced" @update:checked="onTogglePassword"> {{ t('files_sharing', 'Set a password') }} </NcCheckboxRadioSwitch> @@ -59,7 +59,7 @@ :disabled="disabled" :label="t('files_sharing', 'Password')" :placeholder="t('files_sharing', 'Enter a valid password')" - :required="false" + :required="enforcePasswordForPublicLink" :value="password" name="password" @update:value="$emit('update:password', $event)" /> @@ -180,6 +180,18 @@ export default defineComponent({ return '' }, + + isExpirationDateEnforced(): boolean { + // Both fields needs to be enabled in the settings + return this.defaultExpireDateEnabled + && this.defaultExpireDateEnforced + }, + + isPasswordEnforced(): boolean { + // Both fields needs to be enabled in the settings + return this.enableLinkPasswordByDefault + && this.enforcePasswordForPublicLink + }, }, mounted() { @@ -189,12 +201,12 @@ export default defineComponent({ } // If enforced, we cannot set a date before the default expiration days (see admin settings) - if (this.defaultExpireDateEnforced) { + if (this.isExpirationDateEnforced) { this.maxDate = sharingConfig.defaultExpirationDate } // If enabled by default, we generate a valid password - if (this.enableLinkPasswordByDefault) { + if (this.isPasswordEnforced) { this.generatePassword() } }, diff --git a/apps/files_sharing/src/views/CollaborationView.vue b/apps/files_sharing/src/views/CollaborationView.vue deleted file mode 100644 index b75ad53e1b8..00000000000 --- a/apps/files_sharing/src/views/CollaborationView.vue +++ /dev/null @@ -1,36 +0,0 @@ -<!-- - - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors - - SPDX-License-Identifier: AGPL-3.0-or-later ---> - -<template> - <CollectionList v-if="fileId" - :id="fileId" - type="file" - :name="filename" /> -</template> - -<script> -import { CollectionList } from 'nextcloud-vue-collections' - -export default { - name: 'CollaborationView', - components: { - CollectionList, - }, - computed: { - fileId() { - if (this.$root.model && this.$root.model.id) { - return '' + this.$root.model.id - } - return null - }, - filename() { - if (this.$root.model && this.$root.model.name) { - return '' + this.$root.model.name - } - return '' - }, - }, -} -</script> diff --git a/apps/files_sharing/src/views/SharingTab.vue b/apps/files_sharing/src/views/SharingTab.vue index e6acf33e04d..262504aca01 100644 --- a/apps/files_sharing/src/views/SharingTab.vue +++ b/apps/files_sharing/src/views/SharingTab.vue @@ -138,7 +138,7 @@ <div v-if="projectsEnabled" v-show="!showSharingDetailsView && fileInfo" class="sharingTab__additionalContent"> - <CollectionList :id="`${fileInfo.id}`" + <NcCollectionList :id="`${fileInfo.id}`" type="file" :name="fileInfo.name" /> </div> @@ -161,16 +161,16 @@ import { getCapabilities } from '@nextcloud/capabilities' import { orderBy } from '@nextcloud/files' import { loadState } from '@nextcloud/initial-state' import { generateOcsUrl } from '@nextcloud/router' -import { CollectionList } from 'nextcloud-vue-collections' import { ShareType } from '@nextcloud/sharing' -import InfoIcon from 'vue-material-design-icons/InformationOutline.vue' +import NcAvatar from '@nextcloud/vue/components/NcAvatar' +import NcButton from '@nextcloud/vue/components/NcButton' +import NcCollectionList from '@nextcloud/vue/components/NcCollectionList' import NcPopover from '@nextcloud/vue/components/NcPopover' +import InfoIcon from 'vue-material-design-icons/InformationOutline.vue' import axios from '@nextcloud/axios' import moment from '@nextcloud/moment' -import NcAvatar from '@nextcloud/vue/components/NcAvatar' -import NcButton from '@nextcloud/vue/components/NcButton' import { shareWithTitle } from '../utils/SharedWithMe.js' @@ -192,10 +192,10 @@ export default { name: 'SharingTab', components: { - CollectionList, InfoIcon, NcAvatar, NcButton, + NcCollectionList, NcPopover, SharingEntryInternal, SharingEntrySimple, |