Skip to content

Commit 5f4c56e

Browse files
nfebenextcloud-command
authored andcommitted
Correct check for enabled expiration date
The default expiration date cannot be enforced if it is not enabled in the first place. Hence, the check for whether a share has an expiration date should not consider enforcements but only where the share expiry type is enabled. For example : Using `this.config.isDefaultExpireDateEnabled` instead of `this.config.isDefaultExpireDateEnforced` which can be verified by checking `isExpiryDateEnforced`. Resolves : #40612 Signed-off-by: fenn-cs <fenn25.fn@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
1 parent fe9258a commit 5f4c56e

7 files changed

Lines changed: 18 additions & 12 deletions

File tree

apps/files_sharing/src/views/SharingDetailsTab.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,19 @@ export default {
368368
*/
369369
hasExpirationDate: {
370370
get() {
371+
const isDefaultExpireDateEnabled = this.config.isDefaultExpireDateEnabled
372+
const hasExistingExpirationDate = !!this.share.expireDate || isDefaultExpireDateEnabled
373+
const isDefaultInternalExpireDateEnabled = this.config.isDefaultInternalExpireDateEnabled
374+
const isDefaultRemoteExpireDateEnabled = this.config.isDefaultRemoteExpireDateEnabled
371375
if (this.isPublicShare) {
372-
return !!this.share.expireDate || this.config.isDefaultExpireDateEnforced
376+
return hasExistingExpirationDate
373377
}
378+
374379
if (this.isRemoteShare) {
375-
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
380+
return hasExistingExpirationDate || isDefaultRemoteExpireDateEnabled
376381
}
377-
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
382+
383+
return hasExistingExpirationDate || isDefaultInternalExpireDateEnabled
378384
},
379385
set(enabled) {
380386
this.share.expireDate = enabled

dist/core-common.js

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/core-common.js.map

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

dist/files-main.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.

dist/files-main.js.map

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

dist/files_sharing-files_sharing_tab.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.

dist/files_sharing-files_sharing_tab.js.map

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

0 commit comments

Comments
 (0)