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
Simplify logic for picking root category #68
Conversation
@Hlavtox: I really like your work on dropping cookie usage in the #67 . As for Would you be kind to look at my proposed change, please? Would you agree my logic with |
Previous logic grew into a bit complex one. It had 2 conditional parts each checking for selected BLOCK_CATEG_ROOT_CATEGORY values. They were checking for different setups and later one was conditionally modifying result of the first one. All of that made getWidgetVariables() code a bit hard to follow (understand) and hard to extend (add more scenarios). This change cleans that up. It adds a switch() and handles each BLOCK_CATEG_ROOT_CATEGORY value with a separated code. It should make code easier to understand, debug & develop. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5622dd5
to
90fc817
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.
Thank you @rmilecki nice PR 👍
I'm asking QA team if they can verify we changed no behavior
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.
Hello @rmilecki ,
I have checked every "Category root" available option one by one and they work as expectedin FO. 🎉
So it's QA approved ✔️
Thank you
Thank you @rmilecki ! |
Thank you! |
BLOCK_CATEG_ROOT_CATEGORY
values. They were checking for different setups and later one was conditionally modifying result of the first one.All of that made
getWidgetVariables()
code a bit hard to follow (understand) and hard to extend (add more scenarios).This change cleans that up. It adds a
switch()
and handles eachBLOCK_CATEG_ROOT_CATEGORY
value with a separated code. It should make code easier to understand, debug & develop.ps_categorytree
module configuration. Select every "Category root" available option one by one and verify in FO they work as expected. This PR does not modify the behavior, it modifies how the code is written.