Skip to content

Commit

Permalink
Merge pull request #589 from OnroerendErfgoed/feature/epic_498/501_ad…
Browse files Browse the repository at this point in the history
…min_fitler

add matches filter in admin interface
  • Loading branch information
cedrikv committed Aug 12, 2020
2 parents 003db32 + 6718c0b commit b689c07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions atramhasis/static/admin/src/app/ui/widgets/SearchPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ define([
_search: function (evt) {
evt ? evt.preventDefault() : null;
var schemeId = domUtils.getSelectedOption(this.conceptSchemeSelect);

this.matchInput.value = this.matchInput.value.trim();
this.labelInput.value = this.labelInput.value.trim();

if (schemeId == -1) {
topic.publish('dGrowl', "You have to select a scheme.", {'title': "", 'sticky': false, 'channel':'warn'});
return;
Expand All @@ -262,6 +266,9 @@ define([
label: this.labelInput.value,
sort: '+label'
};
if (this.matchInput.value !== '') {
filter.match= this.matchInput.value;
}
var store = this.appUi.conceptController.getConceptStore(schemeId).filter(filter);
this.init(schemeId, store);
this.appUi._slideMenu._slideOpen();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
</select>
</div>
</div>
<div class="large-12 columns">
<div class="placeholder-container">
<label for="matchfilter-${id}">Filter by match</label>
<input id="matchfilter-${id}" data-dojo-attach-point="matchInput" type="text" placeholder="e.g. http://vocab.getty.edu/aat/300005241"/>
</div>
</div>
<div class="text-center large-12 columns">
<button href="#/search" class="button tiny search-button" data-dojo-attach-event="onClick: _search"><span class="ico ico-mglass"></span></button>
</div>
Expand Down

0 comments on commit b689c07

Please sign in to comment.