mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 00:02:54 -04:00
Merge pull request #49724 from nextcloud/backport/49442/stable30
[stable30] fix(files_sharing): Stop infinite loop blocking link share requests
This commit is contained in:
commit
c1c64c7a80
9 changed files with 30 additions and 21 deletions
|
|
@ -81,7 +81,7 @@
|
|||
</template>
|
||||
</NcActionInput>
|
||||
|
||||
<NcActionCheckbox v-if="hasDefaultExpirationDate"
|
||||
<NcActionCheckbox v-if="pendingDefaultExpirationDate"
|
||||
:checked.sync="defaultExpirationDateEnabled"
|
||||
:disabled="pendingEnforcedExpirationDate || saving"
|
||||
class="share-link-expiration-date-checkbox"
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
</NcActionCheckbox>
|
||||
|
||||
<!-- expiration date -->
|
||||
<NcActionInput v-if="(hasDefaultExpirationDate || pendingEnforcedExpirationDate) && defaultExpirationDateEnabled"
|
||||
<NcActionInput v-if="(pendingDefaultExpirationDate || pendingEnforcedExpirationDate) && defaultExpirationDateEnabled"
|
||||
class="share-link-expire-date"
|
||||
:label="pendingEnforcedExpirationDate ? t('files_sharing', 'Enter expiration date (enforced)') : t('files_sharing', 'Enter expiration date')"
|
||||
:disabled="saving"
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
</template>
|
||||
</NcActionInput>
|
||||
|
||||
<NcActionButton @click.prevent.stop="onNewLinkShare">
|
||||
<NcActionButton @click.prevent.stop="onNewLinkShare(true)">
|
||||
<template #icon>
|
||||
<CheckIcon :size="20" />
|
||||
</template>
|
||||
|
|
@ -470,7 +470,7 @@ export default {
|
|||
* @return {boolean}
|
||||
*/
|
||||
pendingDataIsMissing() {
|
||||
return this.pendingPassword || this.pendingEnforcedPassword || this.pendingEnforcedExpirationDate
|
||||
return this.pendingPassword || this.pendingEnforcedPassword || this.pendingDefaultExpirationDate || this.pendingEnforcedExpirationDate
|
||||
},
|
||||
pendingPassword() {
|
||||
return this.config.enableLinkPasswordByDefault && this.isPendingShare
|
||||
|
|
@ -481,18 +481,13 @@ export default {
|
|||
pendingEnforcedExpirationDate() {
|
||||
return this.config.isDefaultExpireDateEnforced && this.isPendingShare
|
||||
},
|
||||
hasDefaultExpirationDate() {
|
||||
pendingDefaultExpirationDate() {
|
||||
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() {
|
||||
return this.config.enforcePasswordForPublicLink || this.config.isDefaultExpireDateEnforced
|
||||
},
|
||||
|
|
@ -602,9 +597,23 @@ export default {
|
|||
|
||||
methods: {
|
||||
/**
|
||||
* Create a new share link and append it to the list
|
||||
* Check if the share requires review
|
||||
*
|
||||
* @param {boolean} shareReviewComplete if the share was reviewed
|
||||
* @return {boolean}
|
||||
*/
|
||||
async onNewLinkShare() {
|
||||
shareRequiresReview(shareReviewComplete) {
|
||||
// If a user clicks 'Create share' it means they have reviewed the share
|
||||
if (shareReviewComplete) {
|
||||
return false
|
||||
}
|
||||
return this.defaultExpirationDateEnabled || this.config.enableLinkPasswordByDefault
|
||||
},
|
||||
/**
|
||||
* Create a new share link and append it to the list
|
||||
* @param {boolean} shareReviewComplete if the share was reviewed
|
||||
*/
|
||||
async onNewLinkShare(shareReviewComplete = false) {
|
||||
this.logger.debug('onNewLinkShare called (with this.share)', this.share)
|
||||
// do not run again if already loading
|
||||
if (this.loading) {
|
||||
|
|
@ -624,11 +633,11 @@ export default {
|
|||
// 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) {
|
||||
if ((this.sharePolicyHasEnforcedProperties && this.enforcedPropertiesMissing) || this.shareRequiresReview(shareReviewComplete === true)) {
|
||||
this.pending = true
|
||||
this.shareCreationComplete = false
|
||||
|
||||
this.logger.info('Share policy requires mandated properties (password)...')
|
||||
this.logger.info('Share policy requires a review or has mandated properties (password, expirationDate)...')
|
||||
|
||||
// ELSE, show the pending popovermenu
|
||||
// if password default or enforced, pre-fill with random one
|
||||
|
|
|
|||
1
dist/5153-5153.js.map
vendored
1
dist/5153-5153.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/5153-5153.js.map.license
vendored
1
dist/5153-5153.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
5153-5153.js.license
|
||||
4
dist/5153-5153.js → dist/8142-8142.js
vendored
4
dist/5153-5153.js → dist/8142-8142.js
vendored
File diff suppressed because one or more lines are too long
1
dist/8142-8142.js.map
vendored
Normal file
1
dist/8142-8142.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/8142-8142.js.map.license
vendored
Symbolic link
1
dist/8142-8142.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
8142-8142.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