1414 <fieldset class =" file-request-dialog__expiration" data-cy-file-request-dialog-fieldset =" expiration" >
1515 <!-- Enable expiration -->
1616 <legend >{{ t('files_sharing', 'When should the request expire?') }}</legend >
17- <NcCheckboxRadioSwitch v-show =" !defaultExpireDateEnforced "
18- :checked =" defaultExpireDateEnforced || expirationDate !== null"
19- :disabled =" disabled || defaultExpireDateEnforced "
17+ <NcCheckboxRadioSwitch v-show =" !isExpirationDateEnforced "
18+ :checked =" isExpirationDateEnforced || expirationDate !== null"
19+ :disabled =" disabled || isExpirationDateEnforced "
2020 @update:checked =" onToggleDeadline" >
2121 {{ t('files_sharing', 'Set a submission expiration date') }}
2222 </NcCheckboxRadioSwitch >
4646 <fieldset class =" file-request-dialog__password" data-cy-file-request-dialog-fieldset =" password" >
4747 <!-- Enable password -->
4848 <legend >{{ t('files_sharing', 'What password should be used for the request?') }}</legend >
49- <NcCheckboxRadioSwitch v-show =" !enforcePasswordForPublicLink "
50- :checked =" enforcePasswordForPublicLink || password !== null"
51- :disabled =" disabled || enforcePasswordForPublicLink "
49+ <NcCheckboxRadioSwitch v-show =" !isPasswordEnforced "
50+ :checked =" isPasswordEnforced || password !== null"
51+ :disabled =" disabled || isPasswordEnforced "
5252 @update:checked =" onTogglePassword" >
5353 {{ t('files_sharing', 'Set a password') }}
5454 </NcCheckboxRadioSwitch >
5959 :disabled =" disabled"
6060 :label =" t('files_sharing', 'Password')"
6161 :placeholder =" t('files_sharing', 'Enter a valid password')"
62- :required =" false "
62+ :required =" enforcePasswordForPublicLink "
6363 :value =" password"
6464 name =" password"
6565 @update:value =" $emit('update:password', $event)" />
@@ -180,6 +180,18 @@ export default defineComponent({
180180
181181 return ' '
182182 },
183+
184+ isExpirationDateEnforced(): boolean {
185+ // Both fields needs to be enabled in the settings
186+ return this .defaultExpireDateEnabled
187+ && this .defaultExpireDateEnforced
188+ },
189+
190+ isPasswordEnforced(): boolean {
191+ // Both fields needs to be enabled in the settings
192+ return this .enableLinkPasswordByDefault
193+ && this .enforcePasswordForPublicLink
194+ },
183195 },
184196
185197 mounted() {
@@ -189,12 +201,12 @@ export default defineComponent({
189201 }
190202
191203 // If enforced, we cannot set a date before the default expiration days (see admin settings)
192- if (this .defaultExpireDateEnforced ) {
204+ if (this .isExpirationDateEnforced ) {
193205 this .maxDate = sharingConfig .defaultExpirationDate
194206 }
195207
196208 // If enabled by default, we generate a valid password
197- if (this .enableLinkPasswordByDefault ) {
209+ if (this .isPasswordEnforced ) {
198210 this .generatePassword ()
199211 }
200212 },
0 commit comments