-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkp/pkp-lib#1550 Controlled vocabulary support #493
base: main
Are you sure you want to change the base?
Conversation
jyhein
commented
Jan 22, 2025
- Use external source to add new keywords etc. using plugins
- Save extra data (identifier, source) with the term to db
a663eaf
to
9d70718
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jyhein I added few questions/suggestion, nothing critical . Please take a look when you get time .
function setSuggestion(value) { | ||
const {name, label = null, identifier = null, ...extraItems} = value; | ||
const suggestion = { | ||
value: value, | ||
label: label ?? name, | ||
identifier: identifier, | ||
...(extraItems ? {extraItems: extraItems} : {}), | ||
}; | ||
return suggestion; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason we are making this as general method than as the part of component's method ? Also If I understand correctly, this method takes the data coming from plugin and transform it to support the updated schema . If that is the case , perhaps a different name so that it does not confuse the setSuggestions
method coming form FieldBaseAutosuggest
component ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm...shouldn't this be private? When it is outside export
<li v-if="suggestion.identifier?.match(/^http/)"> | ||
<a :href="suggestion.identifier" target="_blank" @click.stop> | ||
{{ suggestion.identifier }} | ||
</a> | ||
</li> | ||
<li v-else-if="suggestion.identifier"> | ||
{{ suggestion.identifier }} | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we merge these 2 together as first we need to check if identifier
exists and then if it is an url , then wrap it with anchor tag or just show it as plain text ?
|
||
async function metadataDataChange() { | ||
// Some metadata fields need extra data from db not in publication object | ||
fetchForm(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there be a await
here ?