From f6b883e3f143b61675185d69250e0120984081f8 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 27 Sep 2023 10:32:22 +0200 Subject: [PATCH 1/3] Fix generate password doesnt reset banned password error --- .../src/components/OcTextInput/OcTextInput.vue | 8 ++++++++ .../_OcTextInputPassword/_OcTextInputPassword.vue | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/design-system/src/components/OcTextInput/OcTextInput.vue b/packages/design-system/src/components/OcTextInput/OcTextInput.vue index 065c54ef505..7854156616b 100644 --- a/packages/design-system/src/components/OcTextInput/OcTextInput.vue +++ b/packages/design-system/src/components/OcTextInput/OcTextInput.vue @@ -12,6 +12,7 @@ :is="inputComponent" :id="id" v-bind="additionalAttributes" + v-on="additionalListeners" ref="input" :aria-invalid="ariaInvalid" class="oc-text-input oc-input oc-rounded" @@ -261,6 +262,13 @@ export default defineComponent({ messageId() { return `${this.id}-message` }, + additionalListeners() { + if (this.type === 'password') { + return { passwordGenerated: this.onInput } + } + + return {} + }, additionalAttributes() { const additionalAttrs = {} if (!!this.warningMessage || !!this.errorMessage || !!this.descriptionMessage) { diff --git a/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue b/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue index afb63f4d241..069aea49c74 100644 --- a/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue +++ b/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue @@ -101,8 +101,8 @@ export default defineComponent({ default: false } }, - emits: ['passwordChallengeCompleted', 'passwordChallengeFailed'], - setup(props, { emit, attrs }) { + emits: ['passwordChallengeCompleted', 'passwordChallengeFailed', 'passwordGenerated'], + setup(props, { emit }) { const { $gettext } = useGettext() const password = ref(props.value) const showPassword = ref(false) @@ -138,6 +138,7 @@ export default defineComponent({ const generatedPassword = props.generatePasswordMethod() password.value = generatedPassword showPassword.value = true + emit('passwordGenerated', password.value) } watch(password, (value) => { From 8449d4095948e5eb14ad4abe53924de2aa8f48f2 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 27 Sep 2023 11:17:55 +0200 Subject: [PATCH 2/3] Fix autofocus on password input and enhance changelog item --- .../_OcTextInputPassword/_OcTextInputPassword.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue b/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue index 069aea49c74..20eb65f1271 100644 --- a/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue +++ b/packages/design-system/src/components/_OcTextInputPassword/_OcTextInputPassword.vue @@ -6,7 +6,12 @@ 'oc-text-input-password-wrapper-danger': hasError }" > - + { + unref(passwordInput).focus() + } + watch(password, (value) => { passwordEntered.value = true @@ -156,9 +166,11 @@ export default defineComponent({ }) return { + focus, $gettext, password, showPassword, + passwordInput, copyPasswordIcon, showPasswordPolicyInformation, testedPasswordPolicy, From 2e5dc01517dd4bc556a9788642ce87ea48ffcc47 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 27 Sep 2023 11:29:11 +0200 Subject: [PATCH 3/3] enhance changelog item --- .../unreleased/enhancement-add-password-policy-compatibility | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/unreleased/enhancement-add-password-policy-compatibility b/changelog/unreleased/enhancement-add-password-policy-compatibility index 015859dd791..92a4a12465b 100644 --- a/changelog/unreleased/enhancement-add-password-policy-compatibility +++ b/changelog/unreleased/enhancement-add-password-policy-compatibility @@ -7,5 +7,6 @@ https://github.com/owncloud/web/pull/9682 https://github.com/owncloud/web/pull/9634 https://github.com/owncloud/web/pull/9686 https://github.com/owncloud/web/pull/9688 +https://github.com/owncloud/web/pull/9735 https://github.com/owncloud/web/issues/9638 https://github.com/owncloud/web/issues/9657