mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #49115 from nextcloud/fix/48860/stop-silent-expiry-date-addition-on-link-shares
fix(SharingEntryLink): Show default password before create if any
This commit is contained in:
commit
2ec74f9dc1
10 changed files with 48 additions and 16 deletions
|
|
@ -41,7 +41,7 @@
|
|||
</div>
|
||||
|
||||
<!-- pending actions -->
|
||||
<NcActions v-if="!pending && (pendingPassword || pendingEnforcedPassword || pendingExpirationDate)"
|
||||
<NcActions v-if="!pending && pendingDataIsMissing"
|
||||
class="sharing-entry__actions"
|
||||
:aria-label="actionsTooltip"
|
||||
menu-align="right"
|
||||
|
|
@ -82,10 +82,18 @@
|
|||
</template>
|
||||
</NcActionInput>
|
||||
|
||||
<NcActionCheckbox v-if="hasDefaultExpirationDate"
|
||||
:checked.sync="defaultExpirationDateEnabled"
|
||||
:disabled="pendingEnforcedExpirationDate || saving"
|
||||
class="share-link-expiration-date-checkbox"
|
||||
@change="onDefaultExpirationDateEnabledChange">
|
||||
{{ config.enforcePasswordForPublicLink ? t('files_sharing', 'Enable link expiration (enforced)') : t('files_sharing', 'Enable link expiration') }}
|
||||
</NcActionCheckbox>
|
||||
|
||||
<!-- expiration date -->
|
||||
<NcActionInput v-if="pendingExpirationDate"
|
||||
<NcActionInput v-if="(hasDefaultExpirationDate || pendingEnforcedExpirationDate) && defaultExpirationDateEnabled"
|
||||
class="share-link-expire-date"
|
||||
:label="t('files_sharing', 'Expiration date (enforced)')"
|
||||
:label="pendingEnforcedExpirationDate ? t('files_sharing', 'Enter expiration date (enforced)') : t('files_sharing', 'Enter expiration date')"
|
||||
:disabled="saving"
|
||||
:is-native-picker="true"
|
||||
:hide-label="true"
|
||||
|
|
@ -289,6 +297,7 @@ export default {
|
|||
shareCreationComplete: false,
|
||||
copySuccess: true,
|
||||
copied: false,
|
||||
defaultExpirationDateEnabled: false,
|
||||
|
||||
// Are we waiting for password/expiration date
|
||||
pending: false,
|
||||
|
|
@ -462,14 +471,28 @@ export default {
|
|||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
pendingDataIsMissing() {
|
||||
return this.pendingPassword || this.pendingEnforcedPassword || this.pendingEnforcedExpirationDate
|
||||
},
|
||||
pendingPassword() {
|
||||
return this.config.enableLinkPasswordByDefault && this.share && !this.share.id
|
||||
return this.config.enableLinkPasswordByDefault && this.isPendingShare
|
||||
},
|
||||
pendingEnforcedPassword() {
|
||||
return this.config.enforcePasswordForPublicLink && this.share && !this.share.id
|
||||
return this.config.enforcePasswordForPublicLink && this.isPendingShare
|
||||
},
|
||||
pendingExpirationDate() {
|
||||
return this.config.isDefaultExpireDateEnforced && this.share && !this.share.id
|
||||
pendingEnforcedExpirationDate() {
|
||||
return this.config.isDefaultExpireDateEnforced && this.isPendingShare
|
||||
},
|
||||
hasDefaultExpirationDate() {
|
||||
return (this.config.defaultExpirationDate instanceof Date || !isNaN(new Date(this.config.defaultExpirationDate).getTime())) && this.isPendingShare
|
||||
},
|
||||
|
||||
isPendingShare() {
|
||||
return !!(this.share && !this.share.id)
|
||||
},
|
||||
|
||||
shareRequiresReview() {
|
||||
return this.defaultExpirationDateEnabled || this.config.enableLinkPasswordByDefault
|
||||
},
|
||||
|
||||
sharePolicyHasRequiredProperties() {
|
||||
|
|
@ -572,6 +595,10 @@ export default {
|
|||
return this.share.isFileRequest
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.defaultExpirationDateEnabled = this.config.defaultExpirationDate instanceof Date
|
||||
this.share.expireDate = this.defaultExpirationDateEnabled ? this.formatDateToString(this.config.defaultExpirationDate) : ''
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
|
|
@ -594,8 +621,10 @@ export default {
|
|||
}
|
||||
|
||||
this.logger.debug('Missing required properties?', this.requiredPropertiesMissing)
|
||||
// do not push yet if we need a password or an expiration date: show pending menu
|
||||
if (this.sharePolicyHasRequiredProperties && this.requiredPropertiesMissing) {
|
||||
// Do not push yet if we need a password or an expiration date: show pending menu
|
||||
// A share would require a review for example is default expiration date is set but not enforced, this allows
|
||||
// the user to review the share and remove the expiration date if they don't want it
|
||||
if ((this.sharePolicyHasRequiredProperties && this.requiredPropertiesMissing) || this.shareRequiresReview) {
|
||||
this.pending = true
|
||||
this.shareCreationComplete = false
|
||||
|
||||
|
|
@ -829,6 +858,9 @@ export default {
|
|||
this.onPasswordSubmit()
|
||||
this.onNoteSubmit()
|
||||
},
|
||||
onDefaultExpirationDateEnabledChange(enabled) {
|
||||
this.share.expireDate = enabled ? this.formatDateToString(this.config.defaultExpirationDate) : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* Cancel the share creation
|
||||
|
|
|
|||
2
dist/3718-3718.js
vendored
2
dist/3718-3718.js
vendored
File diff suppressed because one or more lines are too long
1
dist/3718-3718.js.map
vendored
1
dist/3718-3718.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/3718-3718.js.map.license
vendored
1
dist/3718-3718.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
3718-3718.js.license
|
||||
2
dist/7705-7705.js
vendored
Normal file
2
dist/7705-7705.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/7705-7705.js.map
vendored
Normal file
1
dist/7705-7705.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/7705-7705.js.map.license
vendored
Symbolic link
1
dist/7705-7705.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
7705-7705.js.license
|
||||
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
Loading…
Reference in a new issue