Skip to content

Commit

Permalink
Correct check for enabled expiration date
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fenn-CS committed Sep 28, 2023
1 parent a962925 commit 8862b3b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
12 changes: 9 additions & 3 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Expand Up @@ -377,13 +377,19 @@ export default {
*/
hasExpirationDate: {
get() {
const isDefaultExpireDateEnabled = this.config.isDefaultExpireDateEnabled
const hasExistingExpirationDate = !!this.share.expireDate || isDefaultExpireDateEnabled
const isDefaultInternalExpireDateEnabled = this.config.isDefaultInternalExpireDateEnabled
const isDefaultRemoteExpireDateEnabled = this.config.isDefaultRemoteExpireDateEnabled
if (this.isPublicShare) {
return !!this.share.expireDate || this.config.isDefaultExpireDateEnforced
return hasExistingExpirationDate
}
if (this.isRemoteShare) {
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
return hasExistingExpirationDate || isDefaultRemoteExpireDateEnabled
}
return !!this.share.expireDate || this.config.isDefaultInternalExpireDateEnforced || this.config.isDefaultExpireDateEnforced
return hasExistingExpirationDate || isDefaultInternalExpireDateEnabled
},
set(enabled) {
this.share.expireDate = enabled
Expand Down
1 change: 0 additions & 1 deletion dist/1339-1339.js.map

This file was deleted.

6 changes: 3 additions & 3 deletions dist/1339-1339.js → dist/3306-3306.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

0 comments on commit 8862b3b

Please sign in to comment.