</NcActions>
<!-- pending actions -->
- <NcActions v-if="!pending && (pendingEnforcedPassword || pendingExpirationDate)"
+ <NcActions v-if="!pending && (pendingPassword || pendingEnforcedPassword || pendingExpirationDate)"
class="sharing-entry__actions"
:aria-label="actionsTooltip"
menu-align="right"
<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"
*
* @return {boolean}
*/
+ pendingPassword() {
+ return this.config.enableLinkPasswordByDefault && this.share && !this.share.id
+ },
pendingEnforcedPassword() {
return this.config.enforcePasswordForPublicLink && this.share && !this.share.id
},
// 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
}
// 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()
}