Skip to content

Commit

Permalink
Set undefined prefLabel as Unlabeled Item #10552
Browse files Browse the repository at this point in the history
  • Loading branch information
chiatt authored and jacobtylerwalls committed May 15, 2024
1 parent da2c3d6 commit 5bdfb1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arches/app/media/js/viewmodels/reference-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ define([
WidgetViewModel.apply(this, [params]);

this.getPrefLabel = function(labels){
return koMapping.toJS(labels)?.find(label => label.language===arches.activeLanguage && label.valuetype === 'prefLabel')?.value;
return koMapping.toJS(labels)?.find(label => label.language===arches.activeLanguage && label.valuetype === 'prefLabel')?.value || arches.translations.unlabeledItem;
};

this.displayValue = ko.computed(function() {
Expand Down
1 change: 1 addition & 0 deletions arches/app/templates/javascript.htm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
concept-collection='{% trans "Concept Collection" as conceptCollection %} "{{ conceptCollection|escapejs }}"'
select-a-concept-collection='{% trans "Select a concept collection" as selectAConceptCollection %} "{{ selectAConceptCollection|escapejs }}"'
controlled-list='{% trans "Controlled List" as controlledList %} "{{ controlledList|escapejs }}"'
unlabeled-item='{% trans "Unlabeled Item" as unlabeledItem %} "{{ unlabeledItem|escapejs }}"'
select-a-controlled-list='{% trans "Select a controlled list" as selectAControlledList %} "{{ selectAControlledList|escapejs }}"'
multiple-values='{% trans "Multiple Values" as multipleValues %} "{{ multipleValues|escapejs }}"'
allow-selection-of-multiple-items='{% trans "Allow selection of multiple items" as allowSelectionOfMultipleItems %} "{{ allowSelectionOfMultipleItems|escapejs }}"'
Expand Down

0 comments on commit 5bdfb1d

Please sign in to comment.