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

Create Redux state tree for admin menu #45465

Closed
6 tasks done
getdave opened this issue Sep 8, 2020 · 1 comment · Fixed by #45495
Closed
6 tasks done

Create Redux state tree for admin menu #45465

getdave opened this issue Sep 8, 2020 · 1 comment · Fixed by #45495
Labels
[Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two.

Comments

@getdave
Copy link
Contributor

getdave commented Sep 8, 2020

This is a Sub Issue of #45435.

This documents the need to create a new state tree (or repurpose the existing) to manage state for the sidebar admin-menu.

The expectation is to write simple actions/action creators and reducers. Selectors can be handled in another Issue.

This will interact and depend on the data layer implementation created in #45464. However, it could easily be developed against unit tests to avoid the data layer work becoming blocking. Indeed, note the data layer has the ability to transform API data into any format required by Calypso, so its perfectly acceptable that this Issue leads the way in determining the required "shape" of the data.

Tasks

  • Determine whether to use existing sidebar state tree or create new one (eg: admin-menu).
  • Mirror Redux action "namespace" with that utilised in the data layer (eg: ADMIN_MENU_ or similar).
  • Define all actions (not creators!) by creating constants for each - if this is too difficult at this stage then come back to this later. But ideally, we should use this as a chance to define which actions we expect to receive.
  • Define Reducer skeleton.
  • Define action creator to handle receiving new admin menus (eg: receiveMenuItems).
  • Write reducer to handle the action dispatched by receiveMenuItems action creator and persisting into Redux state.
@getdave
Copy link
Contributor Author

getdave commented Sep 9, 2020

Note that ultimately the items stored in state will need to be keyed by siteID to ensure each site gets it's own personalised admin menu.

@getdave getdave added the [Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two. label Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant