aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-10-31 07:48:45 +0100
committerGitHub <noreply@github.com>2024-10-31 07:48:45 +0100
commit979b91720de89bb94638dc6e358b25a33ff26a2e (patch)
treeeb1b1718ad526d9e58e5b2578441b46ab3551413 /apps/files_sharing
parent7c159937aefc00f0b6b77f36bf5b0e7c0f581f0a (diff)
parent9c20e5c5bcf7e45ae71a45f4af71bb28e5efc51e (diff)
downloadnextcloud-server-979b91720de89bb94638dc6e358b25a33ff26a2e.tar.gz
nextcloud-server-979b91720de89bb94638dc6e358b25a33ff26a2e.zip
Merge pull request #49012 from nextcloud/backport/48991/stable29
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 0b296513782..6b34cd29c4c 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -112,8 +112,8 @@
autocomplete="new-password"
:value="hasUnsavedPassword ? share.newPassword : ''"
:error="passwordError"
- :helper-text="errorPasswordLabel"
- :required="isPasswordEnforced"
+ :helper-text="errorPasswordLabel || passwordHint"
+ :required="isPasswordEnforced && isNewShare"
:label="t('files_sharing', 'Password')"
@update:value="onPasswordChange" />
@@ -707,6 +707,13 @@ export default {
return undefined
},
+ passwordHint() {
+ if (this.isNewShare || this.hasUnsavedPassword) {
+ return undefined
+ }
+ return t('files_sharing', 'Replace current password')
+ },
+
/**
* Additional actions for the menu
*
@@ -867,7 +874,7 @@ export default {
if (this.hasUnsavedPassword && this.isValidShareAttribute(this.share.newPassword)) {
this.share.password = this.share.newPassword
this.$delete(this.share, 'newPassword')
- } else if (this.isPasswordEnforced && !this.isValidShareAttribute(this.share.password)) {
+ } else if (this.isPasswordEnforced && this.isNewShare && !this.isValidShareAttribute(this.share.password)) {
this.passwordError = true
}
} else {
@@ -961,6 +968,11 @@ export default {
* @param {string} password the changed password
*/
onPasswordChange(password) {
+ if (password === '') {
+ this.$delete(this.share, 'newPassword')
+ this.passwordError = this.isNewShare && this.isPasswordEnforced
+ return
+ }
this.passwordError = !this.isValidShareAttribute(password)
this.$set(this.share, 'newPassword', password)
},