Skip to content

Commit

Permalink
Allow share expiry dates lower than enforced limits
Browse files Browse the repository at this point in the history
Previously, users could change the share expiry date up
to the enforced maximum.

The new share flow imposed the enforced share expiry
date maximum literally and did not allow even dates
lower than the maximum enforced.

That does not make much sense, if the enforced expiry date is 30
days from creation date, then it's logical to allow users set the
date to anything less than 30 days from the creation date.

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
  • Loading branch information
nfebe committed Oct 16, 2023
1 parent 356c221 commit 9757e68
Show file tree
Hide file tree
Showing 31 changed files with 71 additions and 49 deletions.
20 changes: 12 additions & 8 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@
</NcCheckboxRadioSwitch>
<NcDateTimePickerNative v-if="hasExpirationDate"
id="share-date-picker"
:value="new Date(share.expireDate)"
:value="new Date(share.expireDate ?? dateTomorrow)"
:min="dateTomorrow"
:max="dateMaxEnforced"
:max="maxExpirationDateEnforced"
:hide-label="true"
:disabled="isExpiryDateEnforced"
:placeholder="t('files_sharing', 'Expiration date')"
type="date"
@input="onExpirationChange" />
Expand Down Expand Up @@ -430,11 +429,16 @@ export default {
isFolder() {
return this.fileInfo.type === 'dir'
},
dateMaxEnforced() {
if (!this.isRemoteShare && this.config.isDefaultInternalExpireDateEnforced) {
return new Date(new Date().setDate(new Date().getDate() + 1 + this.config.defaultInternalExpireDate))
} else if (this.config.isDefaultRemoteExpireDateEnforced) {
return new Date(new Date().setDate(new Date().getDate() + 1 + this.config.defaultRemoteExpireDate))
maxExpirationDateEnforced() {
if (this.isPublicShare) {
return this.config.defaultExpirationDate
}
if (this.isRemoteShare) {
return this.config.defaultRemoteExpirationDateString
}
// If it get's here then it must be an internal share
if (this.isExpiryDateEnforced) {
return this.config.defaultInternalExpirationDate
}
return null
},
Expand Down
6 changes: 3 additions & 3 deletions dist/523-523.js → dist/280-280.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

This file was deleted.

4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions dist/core-common.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,36 @@
* @license MIT
*/

/*!
* focus-trap 7.2.0
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/

/*!
* focus-trap 7.5.2
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/

/*!
* tabbable 6.0.1
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/

/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/

/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */

/*! For license information please see NcButton.js.LICENSE.txt */

/*! For license information please see NcModal.js.LICENSE.txt */

/*! For license information please see NcNoteCard.js.LICENSE.txt */

/*! For license information please see NcPasswordField.js.LICENSE.txt */

/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
Expand Down
2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/federatedfilesharing-vue-settings-admin.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.

2 changes: 1 addition & 1 deletion dist/preview-service-worker.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-info.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-info.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-security.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-webauthn.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-webauthn.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/twofactor_backupcodes-settings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/twofactor_backupcodes-settings.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

0 comments on commit 9757e68

Please sign in to comment.