Add AmsifySuggestags settings

With 'whiteList' to true, only can add tags related with suggestions.
Update 'keepLastOnHoverTag' and 'checkSimilar' to improve usability.
This commit is contained in:
taitus
2021-01-18 12:03:21 +01:00
parent 25501c74bb
commit 1eb06dfb99
2 changed files with 12 additions and 0 deletions

View File

@@ -7,6 +7,9 @@
amsify_suggestags._settings({
suggestions: $(".sdg-related-list-selector .input").data("suggestions-list"),
whiteList: true,
keepLastOnHoverTag: false,
checkSimilar: false
});
amsify_suggestags.classes.focus = ".sdg-related-list-focus";
amsify_suggestags.classes.sTagsInput = ".sdg-related-list-selector-input";

View File

@@ -278,5 +278,14 @@ describe "SDG Relations", :js do
expect(page).to have_css "td", exact_text: "1.1"
end
end
scenario "allows adding only white list suggestions" do
process = create(:legislation_process, title: "SDG process")
visit sdg_management_edit_legislation_process_path(process)
fill_in "Sustainable Development Goals and Targets", with: "tag nonexistent,"
within(".amsify-suggestags-input-area") { expect(page).not_to have_content "tag nonexistent" }
end
end
end