mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Allow share expiry dates lower than enforced limits
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>
This commit is contained in:
parent
356c2219bc
commit
9757e680e2
31 changed files with 71 additions and 49 deletions
|
|
@ -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" />
|
||||
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
6
dist/523-523.js → dist/280-280.js
vendored
6
dist/523-523.js → dist/280-280.js
vendored
File diff suppressed because one or more lines are too long
1
dist/280-280.js.map
vendored
Normal file
1
dist/280-280.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/523-523.js.map
vendored
1
dist/523-523.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/core-common.js
vendored
4
dist/core-common.js
vendored
File diff suppressed because one or more lines are too long
18
dist/core-common.js.LICENSE.txt
vendored
18
dist/core-common.js.LICENSE.txt
vendored
|
|
@ -58,11 +58,21 @@
|
|||
* @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
|
||||
|
|
@ -70,6 +80,14 @@
|
|||
|
||||
/*! @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/
|
||||
*
|
||||
|
|
|
|||
2
dist/core-common.js.map
vendored
2
dist/core-common.js.map
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/files_sharing-files_sharing_tab.js
vendored
4
dist/files_sharing-files_sharing_tab.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-files_sharing_tab.js.map
vendored
2
dist/files_sharing-files_sharing_tab.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/preview-service-worker.js
vendored
2
dist/preview-service-worker.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/settings-vue-settings-admin-security.js
vendored
4
dist/settings-vue-settings-admin-security.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/settings-vue-settings-personal-info.js
vendored
4
dist/settings-vue-settings-personal-info.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/twofactor_backupcodes-settings.js
vendored
4
dist/twofactor_backupcodes-settings.js
vendored
File diff suppressed because one or more lines are too long
2
dist/twofactor_backupcodes-settings.js.map
vendored
2
dist/twofactor_backupcodes-settings.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/workflowengine-workflowengine.js
vendored
4
dist/workflowengine-workflowengine.js
vendored
File diff suppressed because one or more lines are too long
2
dist/workflowengine-workflowengine.js.map
vendored
2
dist/workflowengine-workflowengine.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue