aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-05-22 14:17:27 +0200
committerGitHub <noreply@github.com>2023-05-22 14:17:27 +0200
commitf74143be4b09dc9c1b8d336117af1fe2fc8cb91c (patch)
tree76c006cd49170f36f9b61c594b82a3162b6cf0ec /apps
parentfdf7fd45bef220862e569d1233c6b6448e57164b (diff)
parent9f8fa4802bc419b9f0637efad32c24778e8215ff (diff)
downloadnextcloud-server-f74143be4b09dc9c1b8d336117af1fe2fc8cb91c.tar.gz
nextcloud-server-f74143be4b09dc9c1b8d336117af1fe2fc8cb91c.zip
Merge pull request #38164 from nextcloud/show-pending-popover-menu-when-password-is-enabled-by-default
Show pending popover menu when password is enabled by default
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/components/SharingEntryLink.vue20
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryLink.vue b/apps/files_sharing/src/components/SharingEntryLink.vue
index b3740d4097f..f462f6eec9a 100644
--- a/apps/files_sharing/src/components/SharingEntryLink.vue
+++ b/apps/files_sharing/src/components/SharingEntryLink.vue
@@ -47,7 +47,7 @@
</NcActions>
<!-- pending actions -->
- <NcActions v-if="!pending && (pendingPassword || pendingExpirationDate)"
+ <NcActions v-if="!pending && (pendingPassword || pendingEnforcedPassword || pendingExpirationDate)"
class="sharing-entry__actions"
:aria-label="actionsTooltip"
menu-align="right"
@@ -64,10 +64,10 @@
</NcActionText>
<!-- password -->
- <NcActionText v-if="pendingPassword" icon="icon-password">
+ <NcActionText v-if="pendingEnforcedPassword" icon="icon-password">
{{ t('files_sharing', 'Password protection (enforced)') }}
</NcActionText>
- <NcActionCheckbox v-else-if="config.enableLinkPasswordByDefault"
+ <NcActionCheckbox v-else-if="pendingPassword"
:checked.sync="isPasswordProtected"
:disabled="config.enforcePasswordForPublicLink || saving"
class="share-link-password-checkbox"
@@ -75,7 +75,7 @@
{{ t('files_sharing', 'Password protection') }}
</NcActionCheckbox>
- <NcActionInput v-if="pendingPassword || share.password"
+ <NcActionInput v-if="pendingEnforcedPassword || share.password"
class="share-link-password"
:value.sync="share.password"
:disabled="saving"
@@ -517,6 +517,9 @@ export default {
* @return {boolean}
*/
pendingPassword() {
+ return this.config.enableLinkPasswordByDefault && this.share && !this.share.id
+ },
+ pendingEnforcedPassword() {
return this.config.enforcePasswordForPublicLink && this.share && !this.share.id
},
pendingExpirationDate() {
@@ -613,12 +616,9 @@ export default {
// expiration is the share object key, not expireDate
shareDefaults.expiration = this.formatDateToString(this.config.defaultExpirationDate)
}
- if (this.config.enableLinkPasswordByDefault) {
- shareDefaults.password = await GeneratePassword()
- }
// do not push yet if we need a password or an expiration date: show pending menu
- if (this.config.enforcePasswordForPublicLink || this.config.isDefaultExpireDateEnforced) {
+ if (this.config.enableLinkPasswordByDefault || this.config.enforcePasswordForPublicLink || this.config.isDefaultExpireDateEnforced) {
this.pending = true
// if a share already exists, pushing it
@@ -641,8 +641,8 @@ export default {
}
// ELSE, show the pending popovermenu
- // if password enforced, pre-fill with random one
- if (this.config.enforcePasswordForPublicLink) {
+ // if password default or enforced, pre-fill with random one
+ if (this.config.enableLinkPasswordByDefault || this.config.enforcePasswordForPublicLink) {
shareDefaults.password = await GeneratePassword()
}