Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix(files_sharing): Password field must not be required if already set #49013

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions apps/files_sharing/src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,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" />

Expand Down Expand Up @@ -713,6 +713,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
*
Expand Down Expand Up @@ -877,7 +884,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 {
Expand Down Expand Up @@ -971,6 +978,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)
},
Expand Down
4 changes: 2 additions & 2 deletions dist/6818-6818.js → dist/3154-3154.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/3154-3154.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/3154-3154.js.map.license
1 change: 0 additions & 1 deletion dist/6818-6818.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/6818-6818.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

Loading