diff --git a/changelog/unreleased/bugfix-public-link-empty-password-message-stays-forever b/changelog/unreleased/bugfix-public-link-empty-password-message-stays-forever new file mode 100644 index 00000000000..815fc06e513 --- /dev/null +++ b/changelog/unreleased/bugfix-public-link-empty-password-message-stays-forever @@ -0,0 +1,6 @@ +Bugfix: Public link empty password stays forever + +We've fixed a bug that caused the error message for the public link password to stay forever. + +https://github.com/owncloud/web/pull/8864 +https://github.com/owncloud/web/issues/8521 diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue index 74f0030b196..3bc65c5f9bd 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Links/DetailsAndEdit.vue @@ -410,7 +410,12 @@ export default defineComponent({ } }, methods: { - ...mapActions(['createModal', 'hideModal', 'setModalInputErrorMessage']), + ...mapActions([ + 'createModal', + 'hideModal', + 'setModalInputErrorMessage', + 'setModalConfirmButtonDisabled' + ]), isSelectedRole(role: ShareRole) { return this.link.permissions === role.bitmask(false) @@ -461,12 +466,15 @@ export default defineComponent({ checkPassword(password) { if (password === '') { + this.setModalConfirmButtonDisabled(true) return this.setModalInputErrorMessage(this.$gettext("Password can't be empty")) } if (password.length > 72) { + this.setModalConfirmButtonDisabled(true) return this.setModalInputErrorMessage(this.$gettext("Password can't exceed 72 characters")) } - return this.setModalInputErrorMessage(null) + this.setModalConfirmButtonDisabled(false) + return this.setModalInputErrorMessage('') }, showPasswordModal() { @@ -476,7 +484,7 @@ export default defineComponent({ cancelText: this.$gettext('Cancel'), confirmText: this.link.password ? this.$gettext('Apply') : this.$gettext('Set'), hasInput: true, - inputDescription: this.$gettext("Password can't be empty"), + confirmDisabled: true, inputLabel: this.$gettext('Password'), inputType: 'password', onCancel: this.hideModal, @@ -493,7 +501,6 @@ export default defineComponent({ }) } } - this.createModal(modal) } } diff --git a/packages/web-runtime/src/store/modal.ts b/packages/web-runtime/src/store/modal.ts index 79918d2c5a7..74935ddf3f6 100644 --- a/packages/web-runtime/src/store/modal.ts +++ b/packages/web-runtime/src/store/modal.ts @@ -46,6 +46,10 @@ const actions = { toggleModalConfirmButton({ commit }) { commit('TOGGLE_MODAL_CONFIRM_BUTTON') + }, + + setModalConfirmButtonDisabled({ commit }, status) { + commit('SET_MODAL_CONFIRM_BUTTON_DISABLED', status) } } @@ -89,6 +93,10 @@ const mutations = { TOGGLE_MODAL_CONFIRM_BUTTON(state) { state.confirmDisabled = !state.confirmDisabled + }, + + SET_MODAL_CONFIRM_BUTTON_DISABLED(state, status) { + state.confirmDisabled = status } }