Skip to content

Commit e5b5f66

Browse files
Adds support for the new has_value search modifier in expert search. See #70914
1 parent 073edc1 commit e5b5f66

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/webfrontend/CustomDataTypeGFBIO.coffee

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,6 @@ class CustomDataTypeGFBIO extends CustomDataTypeWithCommonsAsPlugin
158158
getSearchFilter: (data, key=@name()) ->
159159
that = @
160160

161-
objecttype = @path()
162-
objecttype = objecttype.split('.')
163-
objecttype = objecttype[0]
164-
165161
# search for empty values
166162
if data[key+":unset"]
167163
filter =
@@ -172,6 +168,9 @@ class CustomDataTypeGFBIO extends CustomDataTypeWithCommonsAsPlugin
172168
filter._unset_filter = true
173169
return filter
174170

171+
else if data[key+":has_value"]
172+
return @getHasValueFilter(data, key)
173+
175174
# dropdown or popup without tree or use of searchbar: use sameas
176175
if ! that.renderPopupAsTreeview() || ! data[key]?.experthierarchicalsearchmode
177176
filter =
@@ -234,18 +233,17 @@ class CustomDataTypeGFBIO extends CustomDataTypeWithCommonsAsPlugin
234233
# make tag for expert-search
235234
#######################################################################
236235
getQueryFieldBadge: (data) ->
237-
if ! data[@name()]
238-
value = $$("field.search.badge.without")
239-
else if ! data[@name()]?.conceptURI
240-
value = $$("field.search.badge.without")
236+
if data["#{@name()}:unset"]
237+
value = $$("text.column.badge.without")
238+
else if data["#{@name()}:has_value"]
239+
value = $$("field.search.badge.has_value")
241240
else
242241
value = data[@name()].conceptName
243242

244243
if data[@name()]?.experthierarchicalsearchmode == 'exact' || data[@name()]?.experthierarchicalsearchmode == 'include_children'
245244
searchModeAddition = $$("custom.data.type.gfbio.modal.form.popup.choose_expertsearchmode_." + data[@name()].experthierarchicalsearchmode + "_short")
246245
value = searchModeAddition + ': ' + value
247246

248-
249247
name: @nameLocalized()
250248
value: value
251249

0 commit comments

Comments
 (0)