Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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)" />
Expand Down Expand Up @@ -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() {
Expand All @@ -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()
}
},
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/src/components/AdminSettingsSharingForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,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"
Expand Down
2 changes: 2 additions & 0 deletions dist/1252-1252.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/1252-1252.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/1252-1252.js.map.license
2 changes: 0 additions & 2 deletions dist/6509-6509.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/6509-6509.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/6509-6509.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files_sharing-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-admin-sharing.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-admin-sharing.js.map

Large diffs are not rendered by default.

Loading