Skip to content

Commit

Permalink
Hotfix for POS not providing autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
PonteIneptique committed Sep 4, 2024
1 parent 57bb164 commit 8e7dfc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/templates/macros/tokens_macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h3>{{ _('Save checked similar lemma') }}</h3>
};

$('td[contenteditable="true"]').on("keyup", function(e){
if (e.keyCode == 13)  {
if (e.keyCode == 13) {
$(this).html($(this).text())
}
});
Expand Down Expand Up @@ -234,7 +234,7 @@ <h3>{{ _('Save checked similar lemma') }}</h3>
});
{% endif %}

{% if 'pos' in visible %}
{% if 'POS' in visible %}
$('td.token_pos').autoComplete({
minChars: 1,
source: function(term, suggest){
Expand Down
11 changes: 11 additions & 0 deletions tests/test_selenium/test_token_correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ def test_edit_POS(self):
self.assert_token_has_values(token, lemma="de", POS="ADJqua")
self.assert_saved(row)

def test_edit_POS_autoselect(self):
""" [Wauchier] Edit POS of a token with autoselection """
self.addCorpus(with_token=True, with_allowed_lemma=True, with_allowed_pos=True, tokens_up_to=24)
self.driver.refresh()
token, status_text, row = self.edith_nth_row_value(
"ADJ", id_row="1", value_type="POS",
autocomplete_selector=".autocomplete-suggestion[data-val='ADJqua']"
)
self.assert_token_has_values(token, lemma="de", POS="ADJqua")
self.assert_saved(row)

def test_edit_morph(self):
""" [Wauchier] Edit morph of a token """
self.addCorpus(with_token=True, with_allowed_lemma=True, tokens_up_to=24)
Expand Down

0 comments on commit 8e7dfc5

Please sign in to comment.