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

Plans 2023: Revise and split the grid component props #82335

Closed
6 tasks done
chriskmnds opened this issue Sep 28, 2023 · 3 comments · Fixed by #84580
Closed
6 tasks done

Plans 2023: Revise and split the grid component props #82335

chriskmnds opened this issue Sep 28, 2023 · 3 comments · Fixed by #84580

Comments

@chriskmnds
Copy link
Contributor

chriskmnds commented Sep 28, 2023

This we ought to address in a bit of immediate follow-up. We may consider splitting these props across several pieces, and updating the respective READMEs while at it, possibly:

  1. ContextProps (not exported) all the props that pertain to things added to the context
  2. SharedPlansGridProps (not exported) all the props that are shared between the FeaturesGrid and ComparisonGrid (et al)
  3. ComparisonGridProps
  4. FeaturesGridProps

Originally posted by @chriskmnds in #82249 (comment)

Additional Notes

As of #82112 , and later #82249 we have a single PlansGridProp type that encloses all the types used in the grid components. This has only been done this way to address a more holistic props refactor separately, and to also ship the split PR (#82249) while leaving less room for conflicts in the interim.

The TODO comment left there should guide this refactor more:

/*
 *	TODO clk: On PlansGridProps:
 *	1.	These props need to be split into what's needed separately for the internal grids and what's needed for the exported wrappers.
 *		This is currently also used as the internal type for the FeaturesGrid (wrongly).
 *			- onUpgradeClick is only needed for the wrappers exported from here. Internally the grids take a transformed
 *			handleUpgradeClick/onUpgradeClick function (force renamed to handleUpgradeClick in FeaturesGrid)
 *			- allFeaturesList is only relevant for the ComparisonGrid
 *			- gridPlanForSpotlight is only relevant for the FeaturesGrid
 *			- etc.
 *	2.	Explicitly set optional props and default values. Only absolutely vital props should be required.
 */
@ddc22
Copy link
Contributor

ddc22 commented Oct 11, 2023

@chriskmnds I am starting work on this :)

@ddc22
Copy link
Contributor

ddc22 commented Oct 26, 2023

Working on related cleanup of props in following branches. Review PRs in the following order.

----o Trunk
    | #82894 Refactor: Cleanup pro plan related dead code. 
    | #83443 ( refactor/remove-dead-step-code )
    | #83473 ( refactor/remove-is-reskinned-parameter )
    | #83728 ( refactor/remove-is-in-vertical-scrolling-experiment-prop )
    o---o 
        | #83728 ( refactor/remove-is-in-vertical-scrolling-experiment-prop )
        | #84486 ( add/remove-plan-actions-for-wvip-woo-and-flowname )
        o
  1. Refactor: Cleanup pro plan related dead code. #82894
  2. Plans Grid Refactor: Remove plan-features legacy component and dependent dead atomic store dead code #83443
  3. Plans Grid Refactor: Remove is reskinned parameter from plan grid related code #83473
  4. Plans Grid Refactor: Move action override related props to the relevant data structure #83976
  5. Plans Grid Refactor: remove is in vertical scrolling experiment prop #83728
  6. Plans Grid Refactor: Lift action button redirect outside of grid so that flowName prop can be removed and cleanup enterprise woo references #84486

@ddc22
Copy link
Contributor

ddc22 commented Nov 2, 2023

Started a manual audit of the props on a spreadsheet.
https://docs.google.com/spreadsheets/d/1IAkWaxbKOMgD2GH3TITTK-5bY5Z8heuYg6jtxdwaBZE/edit#gid=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants