Merge pull request #54243 from nextcloud/backport/54159/stable30

This commit is contained in:
John Molakvoæ 2025-08-05 14:00:40 +02:00 committed by GitHub
commit 13a0fc8c97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 32 additions and 20 deletions

View file

@ -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()
}
},

View file

@ -133,7 +133,7 @@
</NcCheckboxRadioSwitch>
<fieldset v-show="settings.allowLinks && settings.defaultExpireDate" id="settings-sharing-api-api-expiration" class="sharing__sub-section">
<NcCheckboxRadioSwitch :checked.sync="settings.enforceExpireDate">
{{ t('settings', 'Enforce expiration date for remote shares') }}
{{ t('settings', 'Enforce expiration date for link or mail shares') }}
</NcCheckboxRadioSwitch>
<NcTextField type="number"
class="sharing__input"

2
dist/4215-4215.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
4215-4215.js.license

2
dist/7508-7508.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/7508-7508.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/7508-7508.js.map.license vendored Symbolic link
View file

@ -0,0 +1 @@
7508-7508.js.license

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long