Skip to content

Commit

Permalink
Merge pull request #10159 from owncloud/reset-password-messages-for-i…
Browse files Browse the repository at this point in the history
…nternal-link

fix: reset password input for internal links
  • Loading branch information
JammingBen authored Dec 13, 2023
2 parents 25b48b9 + 6ca11d0 commit f6bf478
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog/unreleased/enhancement-create-link-modal
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ When creating a link while passwords are enfoced, Web will now display a modal t

https://github.com/owncloud/web/pull/10104
https://github.com/owncloud/web/pull/10145
https://github.com/owncloud/web/pull/10159
https://github.com/owncloud/web/issues/10157
8 changes: 8 additions & 0 deletions packages/web-pkg/src/components/CreateLinkModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<div>
<oc-text-input
v-if="!onlyInternalLinksAllowed"
:key="passwordInputKey"
:model-value="password.value"
type="password"
:password-policy="passwordPolicy"
Expand Down Expand Up @@ -136,6 +137,7 @@

<script lang="ts">
import { DateTime } from 'luxon'
import { v4 as uuidV4 } from 'uuid'
import { useGettext } from 'vue3-gettext'
import {
computed,
Expand Down Expand Up @@ -207,6 +209,7 @@ export default defineComponent({
const isFolder = computed(() => props.resources.every(({ isFolder }) => isFolder))
const passwordInputKey = ref(uuidV4())
const roleRefs = ref<Record<string, ComponentPublicInstance>>({})
const password = reactive({ value: '', error: undefined })
Expand Down Expand Up @@ -348,7 +351,11 @@ export default defineComponent({
selectedRole.value = role
if (unref(selectedRoleIsInternal)) {
password.value = ''
password.error = ''
selectedExpiry.value = undefined
// re-render password because it's the only way to remove policy messages
passwordInputKey.value = uuidV4()
}
}
Expand All @@ -369,6 +376,7 @@ export default defineComponent({
passwordEnforced,
passwordPolicy,
generatePasswordMethod: () => passwordPolicyService.generatePassword(),
passwordInputKey,
selectedExpiry,
expirationDateTooltip,
expirationRules,
Expand Down

0 comments on commit f6bf478

Please sign in to comment.