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

refactored hard coded logic from homepage menu #236

Merged
merged 20 commits into from
May 23, 2023

Conversation

Yashita101
Copy link
Contributor

No description provided.

@abhijitb abhijitb added the Code Review The PR is in Code Review label May 9, 2023
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
Copy link
Member

@arunshenoy99 arunshenoy99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks better, thanks @Yashita101, have suggested some more changes, please do take a look.

*
* @return array
*/
protected static function get_theme_step_patterns_callback() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected static function get_theme_step_patterns_callback() {
protected static function get_theme_step_filters() {

includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
Comment on lines 369 to 371
public static function filter_pattern_data( $pattern_slugs ) {
return in_array( 'yith-wonder-pages', $pattern_slugs['categories'] );
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we combine the header and footer identification part with this? Seems like we're going through the entire array anyway with array_filter? Also, this function name can be confusing, I think we should just stick to using a single foreach in get_patterns_for_homepage_menu_slugs to populate the header/footer/homepages instead of array_filter and then a foreach on the remaining elements.

includes/Data/Patterns.php Outdated Show resolved Hide resolved
src/OnboardingSPA/pages/Steps/DesignHomepageMenu/index.js Outdated Show resolved Hide resolved
src/OnboardingSPA/pages/Steps/DesignHomepageMenu/index.js Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
includes/Data/Patterns.php Outdated Show resolved Hide resolved
@arunshenoy99 arunshenoy99 added QA This PR is in QA and removed Code Review The PR is in Code Review labels May 23, 2023
@arunshenoy99 arunshenoy99 removed the QA This PR is in QA label May 23, 2023
@arunshenoy99 arunshenoy99 added the Ready to merge The Code Review and QA is done and it can be merged. label May 23, 2023
@arunshenoy99 arunshenoy99 merged commit 0713bc5 into trunk May 23, 2023
@arunshenoy99 arunshenoy99 deleted the add/refactor-homepage-menu-pattern-slug-data branch May 23, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge The Code Review and QA is done and it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants