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

Group special-components by type #280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zkdev
Copy link
Member

@zkdev zkdev commented Jan 10, 2025

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Special components on landing page will now be grouped by their type

@zkdev zkdev requested a review from a team as a code owner January 10, 2025 14:33
@ocm-ci-robot-0 ocm-ci-robot-0 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 10, 2025
src/landing.js Outdated
@@ -271,6 +271,14 @@ const SpecialComponents = () => {

const mergedSpecialComponents = getMergedSpecialComponents(specialComponentsFeature)

const specialComponentsByType = {}
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason you didn't use reduce here? I think it might be a good fit

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that this could also be implemented using reduce. However, I find many reduce usages hard to comprehend already some days after implementing them.

edit:
after some considerations I will update to use reduce variant. the "complex" part (conditional object construction) is given in both variants, however using reduce will avoid mutation and be more consistent across our (mostly functional) codebase 👍

@zkdev zkdev force-pushed the zkdev-group-special-components branch from 28023a8 to 6b4cb30 Compare January 13, 2025 16:00
@zkdev zkdev requested a review from 8R0WNI3 January 13, 2025 16:00
@ocm-ci-robot-0 ocm-ci-robot-0 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants