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 anchor in datagrid-based lists #5246

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Conversation

Cloud11PL
Copy link
Member

@Cloud11PL Cloud11PL commented Nov 13, 2024

  • Makes anchor render in correct place allowing user o middle click or right click on the anchor
  • Since onClick of the <a /> anchor is now executed instead of Datagrid's onRowClick then it adds missing navigatorOpts to Datagrid lists allowing them to preserve state of the previous location so that the backlink redirects to list with pagination and filters
  • Cleans up backlink logic

What type of PR is this?

  • 💅 Refactor
  • 🌟 Feature
  • 🔥 Bug Fix
  • 🔩 Maintenance
  • 🛠 Workflow CI/CD changes

Related Issues or Documents

  • closes #

Usage Instructions, Screenshots, Recordings

Have you written tests?

  • Yes!
  • No... here is why: Test here would have to be directly on Datagrid checking behaviour on hover (if anchor is rendered or not) - as datagrid is a canvas it is not possible.

[Optional] Description

Copy link

changeset-bot bot commented Nov 13, 2024

🦋 Changeset detected

Latest commit: 68c82af

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

This PR includes changesets to release 1 package
Name Type
saleor-dashboard Patch

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

@github-actions github-actions bot temporarily deployed to pr-5246 November 13, 2024 14:40 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5246 November 13, 2024 14:47 Destroyed
@Cloud11PL Cloud11PL marked this pull request as ready for review November 13, 2024 15:09
@Cloud11PL Cloud11PL requested a review from a team as a code owner November 13, 2024 15:09
Copy link
Member

@poulch poulch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one think that I've noticed is that anchor right click does not work on select channel column in product datagrid

@@ -120,6 +119,7 @@ export const AttributeListDatagrid = ({
onToggle={handlers.onToggle}
/>
)}
navigatorOpts={{ state: getPrevLocationState(location) }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is repeated across each view with the gridd, can just grid call useLocation inside of its component?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about it but I think I would rather have opts like that controlled outside of <Datagrid /> component.

@github-actions github-actions bot temporarily deployed to pr-5246 November 18, 2024 12:04 Destroyed
@Cloud11PL Cloud11PL merged commit e3a23d8 into main Nov 19, 2024
14 checks passed
@Cloud11PL Cloud11PL deleted the MERX-1174-product-page-new-tab branch November 19, 2024 10:11
poulch pushed a commit that referenced this pull request Nov 19, 2024
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.

4 participants