Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear searched keyword when it is deleted #879

Closed
erikabourque opened this issue Sep 10, 2021 · 5 comments
Closed

Clear searched keyword when it is deleted #879

erikabourque opened this issue Sep 10, 2021 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@erikabourque
Copy link

erikabourque commented Sep 10, 2021

I imported recipes, and then deleted the import keyword. When returning to the search page, it was empty because it was still filtering with the deleted keyword. The keyword should be removed from current search parameters when it is deleted.

@vabene1111 vabene1111 added the bug Something isn't working label Sep 11, 2021
@vabene1111 vabene1111 added this to the 0.17.0 milestone Sep 11, 2021
@vabene1111
Copy link
Collaborator

ah yes that makes sense, i recently fixed one other issue with the keywords in search saving. This should be easy to implement

@vabene1111
Copy link
Collaborator

@smilerz you changed this so that the generic facets api call resolves the pre existing facets (which is good), i think the best solution to this would be to filter the results (RecipeSearchView L455) for keywords still having "Loading .." as their name and removing them from the search_settings variable/cookie as well or am i missing somethign ?

@smilerz
Copy link
Collaborator

smilerz commented Sep 14, 2021

i think the best solution to this would be to filter the results (RecipeSearchView L455) for keywords still having "Loading .." as their name and removing them from the search_settings variable/cookie as well or am i missing somethign ?

I wouldn't do anything automatically honestly - adding code to detect if recipes have been loaded then removing missing keywords, then triggering a new recipe search seems like a lot of extra complexity to replace just manually removing the deleted keywords. Maybe some tweaks in recipe search to not filter on non-existent keywords/foods/etc.

@vabene1111
Copy link
Collaborator

ok so i just tested it, it does already ignore keywords that do not exist but there seems to be an issue that you cannot remove it from the input unless you hit the "reset search" button.

This can easily be tested by using ?keyword=500 or some other non existent ID on the search as a GET parameter. Will need to fix the import, maybe same issue as before with the ID type being string not int

@smilerz
Copy link
Collaborator

smilerz commented Sep 14, 2021

OK, I see it now. We can switch those fields to computed fields and pass a filtered list (add a hidden attribute to pre-loaded terms) that only filteres when the length of recipes > 0

@vabene1111 vabene1111 modified the milestones: 0.17.0, 0.18.0 Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants