Skip to content

Commit

Permalink
Public link change password validation bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Apr 20, 2023
1 parent 985055c commit 91cae9d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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() {
Expand All @@ -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,
Expand All @@ -493,7 +501,6 @@ export default defineComponent({
})
}
}
this.createModal(modal)
}
}
Expand Down
8 changes: 8 additions & 0 deletions packages/web-runtime/src/store/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const actions = {

toggleModalConfirmButton({ commit }) {
commit('TOGGLE_MODAL_CONFIRM_BUTTON')
},

setModalConfirmButtonDisabled({ commit }, status) {
commit('SET_MODAL_CONFIRM_BUTTON_DISABLED', status)
}
}

Expand Down Expand Up @@ -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
}
}

Expand Down

0 comments on commit 91cae9d

Please sign in to comment.