Skip to content

Commit 13a0fc8

Browse files
authored
Merge pull request #54243 from nextcloud/backport/54159/stable30
2 parents 91c9812 + 483a8fa commit 13a0fc8

13 files changed

+32
-20
lines changed

apps/files_sharing/src/components/NewFileRequestDialog/NewFileRequestDialogDatePassword.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
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>
@@ -46,9 +46,9 @@
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>
@@ -59,7 +59,7 @@
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
},

apps/settings/src/components/AdminSettingsSharingForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
</NcCheckboxRadioSwitch>
134134
<fieldset v-show="settings.allowLinks && settings.defaultExpireDate" id="settings-sharing-api-api-expiration" class="sharing__sub-section">
135135
<NcCheckboxRadioSwitch :checked.sync="settings.enforceExpireDate">
136-
{{ t('settings', 'Enforce expiration date for remote shares') }}
136+
{{ t('settings', 'Enforce expiration date for link or mail shares') }}
137137
</NcCheckboxRadioSwitch>
138138
<NcTextField type="number"
139139
class="sharing__input"

dist/4215-4215.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/4215-4215.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/4215-4215.js.map.license

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/7508-7508.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

dist/7508-7508.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/7508-7508.js.map.license

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7508-7508.js.license

dist/files_sharing-init.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)