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: table sorting during insight creation #11456

Merged
merged 5 commits into from
Aug 24, 2022

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Aug 24, 2022

Problem

Sorting the insight table changes the URL. While editing a new insight this causes the protection against navigating away from the unsaved URL to fire.

We don't store the sort order on the insight itself so don't need to persist sorting during insight creation

closes #9570
closes #9568
closes #10023

Changes

  • flyby removal of custom styles
  • allows LemonTable to not store sort order on the URL

after

2022-08-24 07 41 38

How did you test this code?

Running it locally and seeing it work

Comment on lines 310 to 311
const useURLForSorting = !!insightProps.dashboardItemId && !insightProps.dashboardItemId.startsWith('new')

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the overall solution makes sense but I wonder if here it makes more sense to use the "editing" mode as the flag rather than the "new" check (if that is possible) as otherwise this remains broken when editing an Insight

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 would have put money on testing that but it turns out that :homer-hege.gif: is appropriate

Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

Nice!

@pauldambra pauldambra merged commit aee716a into master Aug 24, 2022
@pauldambra pauldambra deleted the fix/table-sorting-during-insight-creation branch August 24, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants