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

Improve QueryEditor flow #844

Merged
merged 8 commits into from
Aug 26, 2022
Merged

Improve QueryEditor flow #844

merged 8 commits into from
Aug 26, 2022

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Aug 23, 2022

  • Add SystemDialogs abstraction to increase uniformity
  • add confirmation dialog to remove button
  • close the queryeditor dialog on save
  • close the page url parameters dialog on save

Closes #798

@render
Copy link

render bot commented Aug 23, 2022

@oliviertassinari oliviertassinari requested a deployment to query-editor-flow - toolpad-db PR #844 August 23, 2022 17:24 — with Render Abandoned
@Janpot Janpot marked this pull request as ready for review August 23, 2022 18:03
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 24, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 24, 2022
@Janpot Janpot requested a review from apedroferreira August 25, 2022 07:15
Copy link
Member

@apedroferreira apedroferreira left a comment

Choose a reason for hiding this comment

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

LGTM!

export default function useBoolean(initialValue: boolean) {
const [value, setValue] = React.useState(initialValue);
const toggle = React.useCallback(() => setValue((existing) => !!existing), []);
const set = React.useCallback(() => setValue(true), []);
Copy link
Member

Choose a reason for hiding this comment

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

if we plan to reuse this hook a lot maybe the names of the props could be a bit more intuitive?
maybe even something like setTrue or setFalse?

Copy link
Member Author

Choose a reason for hiding this comment

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

set/reset is quite common nomenclature in boolean logic, but I have no strong feelings about it, I renamed it to setTrue/setFalse

Copy link
Member

Choose a reason for hiding this comment

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

ok i hadn't heard about it, not a big deal. thanks for the change though!

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe it's more common in electronic circuits 🙂

@Janpot Janpot enabled auto-merge (squash) August 26, 2022 10:45
@Janpot Janpot merged commit 9927cf1 into master Aug 26, 2022
@Janpot Janpot deleted the query-editor-flow branch August 26, 2022 10:49
@Janpot Janpot mentioned this pull request Sep 7, 2022
1 task
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.

Query dialog box UX enhancements
3 participants