Skip to content

fix(chakra-ui): add meta to ShowButton Props#6740

Merged
alicanerdurmaz merged 5 commits into
refinedev:nextfrom
arndom:fix/chakra-ui/meta-in-show-button
May 2, 2025
Merged

fix(chakra-ui): add meta to ShowButton Props#6740
alicanerdurmaz merged 5 commits into
refinedev:nextfrom
arndom:fix/chakra-ui/meta-in-show-button

Conversation

@arndom
Copy link
Copy Markdown
Contributor

@arndom arndom commented Apr 3, 2025

  • add changeset

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

meta doesn't impact URL in chakra-ui show button

What is the new behavior?

meta now impacts URL in chakra-ui show button

fixes (issue)
#6707

Notes for reviewers

@arndom arndom requested a review from a team as a code owner April 3, 2025 14:43
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 3, 2025

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d83ce97
🔍 Latest deploy log https://app.netlify.com/sites/refine-doc-live-previews/deploys/681492f2c52c800008aa625f
😎 Deploy Preview https://deploy-preview-6740--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@arndom
Copy link
Copy Markdown
Contributor Author

arndom commented Apr 3, 2025

I had attempted to write a test for this, to the ui-tests/src/tests/buttons/show.tsx shared by all ShowButtons but it kept failing, even though it should be correct.

Could something be wrong with my implementation? Here is the code:

    it("should go to show page with id coming from meta", async () => {
      const { getByText } = render(
        <Routes>
          <Route
            path="/:resource"
            element={
              <ShowButton
                recordItemId="1"
                meta={{
                  authorId: "10",
                }}
              />
            }
          />
        </Routes>,
        {
          wrapper: TestWrapper({
            resources: [
              {
                name: "posts",
                list: "/posts",
                show: "/posts/:authorId/show/:id",
              },
            ],
            routerInitialEntries: ["/posts"],
          }),
        },
      );

      await act(async () => {
        fireEvent.click(getByText("Show"));
      });

      expect(window.location.pathname).toBe("/posts/10/show/1");
    });

This test case is important because the master branch(what I previously based my fork on) already had the meta prop passed, but at some point the main branch had it removed.

@alicanerdurmaz alicanerdurmaz added this to the April 2025 Release milestone Apr 8, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 2, 2025

🦋 Changeset detected

Latest commit: 16f2590

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/chakra-ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alicanerdurmaz alicanerdurmaz changed the base branch from main to next May 2, 2025 09:40
@alicanerdurmaz alicanerdurmaz changed the base branch from next to main May 2, 2025 09:49
@alicanerdurmaz alicanerdurmaz changed the base branch from main to next May 2, 2025 09:50
@alicanerdurmaz alicanerdurmaz merged commit 16d9fa1 into refinedev:next May 2, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants