From 33b12bffa28ab62bbcee6df33a0fedc159c7f926 Mon Sep 17 00:00:00 2001 From: Pascal Wengerter Date: Tue, 24 May 2022 16:33:29 +0200 Subject: [PATCH] Use password input type for enforcing link passwords in modal --- .../src/components/SideBar/Shares/Links/DetailsAndEdit.vue | 2 +- packages/web-app-files/src/quickActions.js | 3 ++- packages/web-runtime/src/store/modal.js | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) 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 a87c9d3bff3..7d924f4cdf9 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 @@ -402,8 +402,8 @@ export default { confirmText: this.link.password ? this.$gettext('Apply') : this.$gettext('Set'), hasInput: true, inputDescription: this.$gettext("Password can't be empty"), - inputType: 'password', inputLabel: this.$gettext('Password'), + inputType: 'password', onCancel: this.hideModal, onInput: (password) => this.checkPasswordNotEmpty(password), onConfirm: (password) => { diff --git a/packages/web-app-files/src/quickActions.js b/packages/web-app-files/src/quickActions.js index d624b178c0c..82099fb8353 100644 --- a/packages/web-app-files/src/quickActions.js +++ b/packages/web-app-files/src/quickActions.js @@ -27,9 +27,10 @@ export function showQuickLinkPasswordModal(ctx, onConfirm) { cancelText: $gettext('Cancel'), confirmText: $gettext('Set'), hasInput: true, + inputDescription: $gettext('Passwords for links are required.'), inputLabel: $gettext('Password'), + inputType: 'password', onCancel: () => ctx.store.dispatch('hideModal'), - inputDescription: $gettext('Passwords for links are required.'), onConfirm: async (password) => { if (!password || password.trim() === '') { ctx.store.dispatch('showMessage', { diff --git a/packages/web-runtime/src/store/modal.js b/packages/web-runtime/src/store/modal.js index 3639e10a97f..ee328b49a0e 100644 --- a/packages/web-runtime/src/store/modal.js +++ b/packages/web-runtime/src/store/modal.js @@ -17,6 +17,7 @@ const state = { inputPlaceholder: '', inputLabel: '', inputError: '', + inputType: 'text', // Events onCancel: emptyReturn, onConfirm: emptyReturn, @@ -60,6 +61,7 @@ const mutations = { state.inputLabel = modal.inputLabel || null state.inputError = modal.inputError || null state.inputDisabled = modal.inputDisabled || false + state.inputType = modal.inputType || 'text' state.onInput = modal.onInput || emptyReturn },