Skip to content

data citations field authors#629

Merged
jardakotesovec merged 1 commit into
pkp:mainfrom
GaziYucel:data-citations-field-authors
Jun 25, 2025
Merged

data citations field authors#629
jardakotesovec merged 1 commit into
pkp:mainfrom
GaziYucel:data-citations-field-authors

Conversation

@GaziYucel
Copy link
Copy Markdown
Contributor

@GaziYucel GaziYucel commented May 27, 2025

Copy link
Copy Markdown
Contributor

@jardakotesovec jardakotesovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to reach out on mattermost if something is not clear. Thanks!

@@ -0,0 +1,136 @@
<template>
<div
:id="`${props.formId}-${props.name}`"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to have the label and description - similarly to what we have for ROR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also in this case we need to make it configurable - so it has to be possible to pass it to be able to differentiate between authors and creators

:id="`${props.formId}-${props.name}`"
class="pkpFormField pkpFormField--citationAuthors"
>
<PkpTable aria-label="CitationAuthors">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be localised, best I think is just to reference label and description - example you can find in the FieldAffiliations on main - I tweaked that today.

import TableHeader from '@/components/Table/TableHeader.vue';
import TableBody from '@/components/Table/TableBody.vue';
import {computed} from 'vue';
import {t} from '@/utils/i18n';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use useLocalize instead..

import {useLocalize} from '@/composables/useLocalize';

const {t} = useLocalize();

<a v-if="author.orcid" :href="author.orcid" target="_blank">
<Icon
icon="Orcid"
:class="'relative top-[-2px] inline-block h-auto w-[16px] align-middle'"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this could be vertically centered without using specific -2px offset.. For sizing h-4 w-4 should work.

</TableCell>
<TableCell>
<a
class="pkpButton flex cursor-pointer items-center border-transparent py-2 text-lg-semibold text-primary hover:enabled:underline"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use our Button.vue aka PkpButton. It supports all the looks we might need - https://main--6555d3db80418bb1681b8b17.chromatic.com/?path=/story/components-button--link-like-button

:key="authorIndex"
>
<TableCell>
<FieldText :value="author.givenName" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think similarly as you have addAuthor and deleteAuthor - you need to have editAuthor, to correctly update the structure and emit the change.

<FieldText :value="author.givenName" />
</TableCell>
<TableCell>
<FieldText v-if="!author.orcid" :value="author.orcid" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest just to keep it free text field.. so you don't have to keep additional information to differentiate between fact if it was sourced from somewhere or entered by user.
And than lets have a meeting to figure out how that could be improved.

<TableRow>
<TableCell>
<Button @click="addAuthor()">
{{ t('common.add') }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one would be better to have configurable so it can be passed when this field is created - so we can differentiate between 'Add Author' and 'Add Creator'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add button via #bottom-controls slot: https://github.com/pkp/ui-library/blob/main/src/managers/FileManager/FileManager.vue#L42

Its semantically better for accessibility to have the button below the table, rather than part of it

@GaziYucel GaziYucel force-pushed the data-citations-field-authors branch 2 times, most recently from 797571a to f9b7d08 Compare June 25, 2025 10:58
Copy link
Copy Markdown
Contributor

@jardakotesovec jardakotesovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just couple more minor things. Thanks!

default: () => [],
},
/** Default locale of the form */
primaryLocale: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is also opportunity to clean up some of the props - which these field does not care about.
I expect these to be - primaryLocale, locales,

...row,
[fieldName]: fieldValue,
};
updatedRow.displayName = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the displayName was introduced? Can't see where thats used.

</TableRow>
</TableBody>
<template #bottom-controls>
<Button @click="addRow()">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing wrong with using Button like this - but can I ask you to rename it to PkpButton? We do that for couple of exceptions where the name is same as existing html element - like button, table, form. So its more obvious that its our component, and not native html element. Thanks!

@GaziYucel GaziYucel force-pushed the data-citations-field-authors branch 2 times, most recently from fe1ff7d to 78a173b Compare June 25, 2025 12:30
@GaziYucel GaziYucel changed the base branch from stable-3_5_0 to main June 25, 2025 12:52
@GaziYucel GaziYucel changed the base branch from main to stable-3_5_0 June 25, 2025 12:52
@GaziYucel GaziYucel force-pushed the data-citations-field-authors branch from 78a173b to 6afbed1 Compare June 25, 2025 13:07
@GaziYucel GaziYucel changed the base branch from stable-3_5_0 to main June 25, 2025 13:08
@jardakotesovec jardakotesovec merged commit 01208ab into pkp:main Jun 25, 2025
@GaziYucel GaziYucel deleted the data-citations-field-authors branch February 20, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants