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

Bug: Edit intent gets removed from menu item buttons #4891

Closed
israelroldan opened this issue Sep 1, 2023 · 3 comments · Fixed by #5728
Closed

Bug: Edit intent gets removed from menu item buttons #4891

israelroldan opened this issue Sep 1, 2023 · 3 comments · Fixed by #5728
Labels

Comments

@israelroldan
Copy link
Contributor

Describe the bug

The Structure builder documentation indicates that a menu item can have an intent of type create and edit. When using the create intent things work as expected, but when using an edit intent nothing happens.

To Reproduce

Steps to reproduce the behaviour:

  1. Use the structure builder to add an menu item with an edit intent
        S.menuItem()
            .title('Open course container config')
            .icon(CogIcon)
            .showAsAction(true)
            .intent({
                  type: 'edit',
                  params: {
                    id: courseContainerId,
                    type: 'courseContainer',
                  },
                }),
    
  2. When rendered, click on the menu item with edit intent
  3. Nothing happens

Expected behavior

The edit intent is executed and the studio navigates to the edit route so the document can be edited

Screenshots
image

Which versions of Sanity are you using?

@sanity/cli                   3.16.2 (up to date)
@sanity/code-input             4.1.1 (up to date)
@sanity/eslint-config-studio   3.0.1 (up to date)
@sanity/icons                  2.4.1 (up to date)
@sanity/types                 3.16.2 (up to date)
@sanity/ui                     1.8.2 (up to date)
@sanity/vision                3.16.2 (up to date)
sanity                        3.16.2 (up to date)

What operating system are you using?

macOS Ventura 13.4.1

Which versions of Node.js / npm are you running?

8.19.3
v18.13.0

Additional context

I have dug into the desk code and found out the root cause: sanity/desk/menuNodes.ts is excluding the intent when resolving the menuNodes from the pane actions configuration.

@kamerat
Copy link

kamerat commented Feb 12, 2024

I'm having the same issue. It seems to break in v3.13.0

@rexxars
Copy link
Member

rexxars commented Feb 14, 2024

Thanks for raising! Reproduced and fixed in #5728

Copy link
Contributor

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants