Skip to content

Commit

Permalink
SKeske
Browse files Browse the repository at this point in the history
  • Loading branch information
jyhein committed Oct 14, 2024
1 parent 11726b1 commit 802075d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions src/components/Form/fields/FieldBaseAutosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,17 @@
<li>
{{ suggestion.label }}
</li>
<li v-if="suggestion.value.uri?.match(/^http/)">
<a :href="suggestion.value.uri" target="_blank" @click.stop>
{{ suggestion.value.uri }}
<li v-if="suggestion.value.identifier?.match(/^http/)">
<a
:href="suggestion.value.identifier"
target="_blank"
@click.stop
>
{{ suggestion.value.identifier }}
</a>
</li>
<li v-else-if="suggestion.value.uri">
{{ suggestion.value.uri }}
<li v-else-if="suggestion.value.identifier">
{{ suggestion.value.identifier }}
</li>
<li
v-for="(extraItem, extraItemKey) in suggestion.extraItems ??
Expand Down
4 changes: 2 additions & 2 deletions src/components/Form/fields/FieldControlledVocab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import FieldBaseAutosuggest from './FieldBaseAutosuggest.vue';
import debounce from 'debounce';
function setSuggestion(value) {
const {term, label = null, uri = null, ...extraItems} = value;
const {term, label = null, identifier = null, ...extraItems} = value;
const suggestion = {
value: value,
label: label ?? term,
uri: uri,
identifier: identifier,
...(extraItems ? {extraItems: extraItems} : {}),
};
return suggestion;
Expand Down

0 comments on commit 802075d

Please sign in to comment.