-
Notifications
You must be signed in to change notification settings - Fork 95
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
Show tag cloud in search results #375
Show tag cloud in search results #375
Conversation
ead5aea
to
5c50b46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend code looks good to me. There is no way to use GROUP_CONCAT
as we are not based on MySQL but a generic SQL driver.
Regarding the Vue.JS I cannot confirm everything as I am not an expert.
One thing I found during testing the functionality:
When one filters the search result by keyword further, it is possible to generate an empty result. This might be surprising for the user. We might want to hide all keywords that are no longer present in the currently filtered view. However, I suggest to keep the current behavior and open an issue/additional PR to solve that bug. Otherwise we might never finish this PR.
} | ||
}) | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create a huge list of keywords to filter for. If there are many recipes visible, this might be more then fitting in one row. I have not tested but we might have to think of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will depent how many recipes you have in your cookbook. Some pages set a certain amount of keywords to the tag per recipe. Of course, there will be similarities but for a few 100 recipes the amount of keywords might become significant. But you are right, this might be ok if done later.
ul { | ||
ul.keywords { | ||
display: flex; | ||
flex-wrap: wrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make the comment swap around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure, which comment you mean? What do you mean by swap around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, typo. I meant wrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that’s good, isn’t it? If the keywords don't fit in a single line, the user is still able to see them as in this picture.
src/components/RecipeKeyword.vue
Outdated
li:hover, .active li:hover { | ||
border: 1px solid var(--color-primary); | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file might conflict with #373.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes and no. it should be identical 🤞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but for the merging we might have a close look for conflicts. No big deal if it's only whitespace or the like.
I ignored your suggestion and implemented your idea of disabling keywords which are not contained in visible recipes! |
Apart from my inability to review the Vue code in detail, it seems to work for me ;-) |
I'm not sure why, but I am not able to test this PR out. When I try to search for recipes, I get the error This in turn triggers an uncaught type error Am I the only one having this problem? Maybe it's something with my setup? |
I don’t think I can reproduce this. Should I see this in the server logs? I’m using @christianlupus docker setup. Where would I have to look? Also, I did not touch the |
Probably something weird going on with my dev setup. I can see how it works on the index page though and it looks cool :) There are some inconsistencies with line endings in the script sections, but if you wouldn't mind removing those few semicolons here and there, I would definitely give this a thumbs up! |
I removed the semicolons I could find from the updated vue components. Jumping back and forth between languages is annoying 😓 |
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
78bb0f3
to
4ca22cf
Compare
Regarding #188.
Added tag cloud between the breadcrumb nav and the recipe overview grid. What it currently does, is
Things to consider
GROUP_CONCAT
working with the QueryBuilder. This might be more efficient than my workaround, so if anyone knows how to get this working - feel free to contribute!Feedback, as always, welcome.