Skip to content

Commit

Permalink
Add an <input> to the SemanticSearchView for the query label (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Jul 29, 2021
1 parent f3560a8 commit 2f0ab0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion frontend/src/semantic-search/semantic-search-template.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<h6 class="subtitle is-6">{{#i18n 'semsearch-subtitle'}}Find linked data items based on semantic features{{/i18n}}</h6>
<div class="field">
<div class="field is-grouped">
<div class="control">
<input
type=text
name=label
maxlength=100
value="{{label}}"
placeholder="optional label for reference"
class="input"
>
</div>
<div class="control">
<button type=submit class="button is-primary rit-submit-sem">
<span>{{#i18n 'semsearch-submit'}}Search{{/i18n}}</span>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/semantic-search/semantic-search-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class SemanticSearchView extends CompositeView<Query> {
}

renderContainer(): this {
this.$el.html(this.template({}));
this.$el.html(this.template({ label: this.model.get('label'), }));
this.checkCompleteness();
return this;
}
Expand Down Expand Up @@ -94,6 +94,7 @@ export default class SemanticSearchView extends CompositeView<Query> {

onSubmit(event): void {
event.preventDefault();
this.model.set('label', this.$('input[name="label"]').val());
this.trigger('search', this.model);
}
}
Expand Down

0 comments on commit 2f0ab0a

Please sign in to comment.