Skip to content

Commit f74143b

Browse files
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
2 parents fdf7fd4 + 9f8fa48 commit f74143b

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

apps/files_sharing/src/components/SharingEntryLink.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</NcActions>
4848

4949
<!-- pending actions -->
50-
<NcActions v-if="!pending && (pendingPassword || pendingExpirationDate)"
50+
<NcActions v-if="!pending && (pendingPassword || pendingEnforcedPassword || pendingExpirationDate)"
5151
class="sharing-entry__actions"
5252
:aria-label="actionsTooltip"
5353
menu-align="right"
@@ -64,18 +64,18 @@
6464
</NcActionText>
6565

6666
<!-- password -->
67-
<NcActionText v-if="pendingPassword" icon="icon-password">
67+
<NcActionText v-if="pendingEnforcedPassword" icon="icon-password">
6868
{{ t('files_sharing', 'Password protection (enforced)') }}
6969
</NcActionText>
70-
<NcActionCheckbox v-else-if="config.enableLinkPasswordByDefault"
70+
<NcActionCheckbox v-else-if="pendingPassword"
7171
:checked.sync="isPasswordProtected"
7272
:disabled="config.enforcePasswordForPublicLink || saving"
7373
class="share-link-password-checkbox"
7474
@uncheck="onPasswordDisable">
7575
{{ t('files_sharing', 'Password protection') }}
7676
</NcActionCheckbox>
7777

78-
<NcActionInput v-if="pendingPassword || share.password"
78+
<NcActionInput v-if="pendingEnforcedPassword || share.password"
7979
class="share-link-password"
8080
:value.sync="share.password"
8181
:disabled="saving"
@@ -517,6 +517,9 @@ export default {
517517
* @return {boolean}
518518
*/
519519
pendingPassword() {
520+
return this.config.enableLinkPasswordByDefault && this.share && !this.share.id
521+
},
522+
pendingEnforcedPassword() {
520523
return this.config.enforcePasswordForPublicLink && this.share && !this.share.id
521524
},
522525
pendingExpirationDate() {
@@ -613,12 +616,9 @@ export default {
613616
// expiration is the share object key, not expireDate
614617
shareDefaults.expiration = this.formatDateToString(this.config.defaultExpirationDate)
615618
}
616-
if (this.config.enableLinkPasswordByDefault) {
617-
shareDefaults.password = await GeneratePassword()
618-
}
619619
620620
// do not push yet if we need a password or an expiration date: show pending menu
621-
if (this.config.enforcePasswordForPublicLink || this.config.isDefaultExpireDateEnforced) {
621+
if (this.config.enableLinkPasswordByDefault || this.config.enforcePasswordForPublicLink || this.config.isDefaultExpireDateEnforced) {
622622
this.pending = true
623623
624624
// if a share already exists, pushing it
@@ -641,8 +641,8 @@ export default {
641641
}
642642
643643
// ELSE, show the pending popovermenu
644-
// if password enforced, pre-fill with random one
645-
if (this.config.enforcePasswordForPublicLink) {
644+
// if password default or enforced, pre-fill with random one
645+
if (this.config.enableLinkPasswordByDefault || this.config.enforcePasswordForPublicLink) {
646646
shareDefaults.password = await GeneratePassword()
647647
}
648648

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)