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

Fix admin-menu so that data layer only accepts numeric values for siteID #45572

Open
getdave opened this issue Sep 11, 2020 · 1 comment
Open
Assignees
Labels
[Feature] Calypso & wp-admin Navigation All navigation in Calypso and wp-admin, and the unified transitions between the two. [Pri] Low Address when resources are available. [Status] Stale

Comments

@getdave
Copy link
Contributor

getdave commented Sep 11, 2020

Sub Issue of #45435.

Currently as of #45495 it is possible to make a request like this:

dispatch({ 
    type: 'ADMIN_MENU_REQUEST', 
    siteId: 123456,
});
dispatch({ 
    type: 'ADMIN_MENU_REQUEST', 
    siteId: '{{DOMAIN_OF_YOUR_WPCOM_TESTING_SITE}}'
});

...and the resulting state will be:

{
    123456: { // menu data here }
    '{{DOMAIN_OF_YOUR_WPCOM_TESTING_SITE}}': { // menu data here }
}

So basically the state ends up being "keyed" by different types of data:

  1. Int
  2. String

Ideally, we should be consistent and use one or the other. We need to adjust the data layer to only allow requests using numeric values for siteId.

@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 11, 2020
@getdave getdave self-assigned this Sep 11, 2020
@getdave getdave changed the title Admin Menu keyedReducer state - accepts domain name as well as numeric siteId. Fix admin-menu so that data layer only accepts numeric values for siteID Sep 11, 2020
@getdave getdave added the [Pri] Low Address when resources are available. label Jan 25, 2021
@github-actions
Copy link

This issue is stale because it has been 180 days with no activity. You can keep the issue open by adding a comment. If you do, please provide additional context and explain why you’d like it to remain open. You can also close the issue yourself — if you do, please add a brief explanation and apply one of relevant issue close labels.

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. [Pri] Low Address when resources are available. [Status] Stale
Projects
None yet
Development

No branches or pull requests

1 participant