From 37a4e0851d452c86153284cd3640181f7ff3f4b8 Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Thu, 18 Aug 2022 11:48:15 +0200 Subject: [PATCH 1/3] Add a mask to orcid field and manipulate to work with either full URL or just the id --- src/components/AuthorCardEditing.vue | 4 ++-- src/components/ScreenAuthors.vue | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/AuthorCardEditing.vue b/src/components/AuthorCardEditing.vue index 73aae861..51e82177 100644 --- a/src/components/AuthorCardEditing.vue +++ b/src/components/AuthorCardEditing.vue @@ -139,8 +139,8 @@ bg-color="white" class="col" dense - hint="Format: https://orcid.org/0000-0000-0000-0000" - label="orcid" + fill-mask + mask="https://orcid.org/####-####-####-###X" outlined standout title="The person's ORCID identifier." diff --git a/src/components/ScreenAuthors.vue b/src/components/ScreenAuthors.vue index 5300541d..b14b3a09 100644 --- a/src/components/ScreenAuthors.vue +++ b/src/components/ScreenAuthors.vue @@ -121,7 +121,12 @@ export default defineComponent({ } const setAuthorField = (field: keyof AuthorType, value: string) => { const newAuthor = { ...authors.value[editingId.value] } - newAuthor[field] = value === '' ? undefined : value + if (value === '' || + (field === 'orcid' && value === 'https://orcid.org/____-____-____-____')) { + newAuthor[field] = undefined + } else { + newAuthor[field] = value + } authors.value[editingId.value] = newAuthor setAuthors(authors.value) } From 660e7d8ea0962a674a75c8393e9e5816f271f06f Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Thu, 18 Aug 2022 15:33:05 +0200 Subject: [PATCH 2/3] Remove fill-mask and return hint to orcid --- src/components/AuthorCardEditing.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AuthorCardEditing.vue b/src/components/AuthorCardEditing.vue index 51e82177..0b4f518d 100644 --- a/src/components/AuthorCardEditing.vue +++ b/src/components/AuthorCardEditing.vue @@ -139,7 +139,7 @@ bg-color="white" class="col" dense - fill-mask + hint="Format: https://orcid.org/0000-0000-0000-0000" mask="https://orcid.org/####-####-####-###X" outlined standout From 83f4b62af959e792b28d5997a49a7f8a07cf473e Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Thu, 18 Aug 2022 15:35:17 +0200 Subject: [PATCH 3/3] No need for setAuthorField special case --- src/components/ScreenAuthors.vue | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/ScreenAuthors.vue b/src/components/ScreenAuthors.vue index b14b3a09..5300541d 100644 --- a/src/components/ScreenAuthors.vue +++ b/src/components/ScreenAuthors.vue @@ -121,12 +121,7 @@ export default defineComponent({ } const setAuthorField = (field: keyof AuthorType, value: string) => { const newAuthor = { ...authors.value[editingId.value] } - if (value === '' || - (field === 'orcid' && value === 'https://orcid.org/____-____-____-____')) { - newAuthor[field] = undefined - } else { - newAuthor[field] = value - } + newAuthor[field] = value === '' ? undefined : value authors.value[editingId.value] = newAuthor setAuthors(authors.value) }