Skip to content

Commit

Permalink
Use password input type for enforcing link passwords in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed May 24, 2022
1 parent 4826281 commit 33b12bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/web-app-files/src/quickActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
2 changes: 2 additions & 0 deletions packages/web-runtime/src/store/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const state = {
inputPlaceholder: '',
inputLabel: '',
inputError: '',
inputType: 'text',
// Events
onCancel: emptyReturn,
onConfirm: emptyReturn,
Expand Down Expand Up @@ -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
},

Expand Down

0 comments on commit 33b12bf

Please sign in to comment.