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

Migrate Query Source page to React: Editor area #4468

Conversation

kravets-levko
Copy link
Collaborator

@kravets-levko kravets-levko commented Dec 20, 2019

What type of PR is this? (check all applicable)

  • Refactor

Related Tickets & Documents

#4429

@kravets-levko kravets-levko added Frontend Frontend: React Frontend codebase migration to React labels Dec 20, 2019
@kravets-levko kravets-levko self-assigned this Dec 20, 2019
@kravets-levko kravets-levko changed the base branch from master to migrate-query-source-view-to-react December 20, 2019 14:27
@kravets-levko kravets-levko marked this pull request as ready for review December 20, 2019 15:16
@kravets-levko kravets-levko changed the title Migrate Query Source page to React: Editor section Migrate Query Source page to React: Editor area Dec 20, 2019
Copy link
Member

@gabrieldutra gabrieldutra left a comment

Choose a reason for hiding this comment

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

Gave up on having a separate QueryEditorComponent? 🙂

@kravets-levko
Copy link
Collaborator Author

Gave up on having a separate QueryEditorComponent?

Not really 😄 I want to get the entire page working, and then I'll have better vision on the entire thing, and will start decomposing it into components/hooks/etc.

@kravets-levko kravets-levko changed the title Migrate Query Source page to React: Editor area (WIP) Migrate Query Source page to React: Editor area Dec 20, 2019
@kravets-levko
Copy link
Collaborator Author

@gabrieldutra I think tomorrow I'll use your execute query hook to make Execute button working as well, so probably will request review once more

@kravets-levko kravets-levko force-pushed the migrate-query-source-to-react--editor branch from 7571a17 to 126eeba Compare December 23, 2019 11:14
@kravets-levko
Copy link
Collaborator Author

@gabrieldutra I implemented "Execute" button and added execution status block - please review it once more. Thanks!

@kravets-levko kravets-levko changed the title (WIP) Migrate Query Source page to React: Editor area Migrate Query Source page to React: Editor area Dec 23, 2019
Copy link
Member

@gabrieldutra gabrieldutra left a comment

Choose a reason for hiding this comment

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

Another note: the Ctrl/Cmd + Enter is not triggering query execution (don't know if you wanted to do it here, but it makes sense).

}

return (
<Alert
Copy link
Member

@gabrieldutra gabrieldutra Dec 23, 2019

Choose a reason for hiding this comment

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

I think using banner styling may result in a better-looking alert, but perhaps it's worth it to change Antd Alert style globally (not in here of course).

client/app/pages/queries/QuerySource.jsx Outdated Show resolved Hide resolved
@kravets-levko kravets-levko force-pushed the migrate-query-source-to-react--editor branch from 2320544 to d857074 Compare December 23, 2019 18:42
Copy link
Member

@gabrieldutra gabrieldutra left a comment

Choose a reason for hiding this comment

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

Found two issues:
1 - We should check canExecuteQuery for query execution through key press - otherwise it's possible to bypass it (it also creates issues with Parameters Apply All). Perhaps only bind it when canExecuteQuery is true?
2 - Turns out it's also necessary to update dirtyParameters when [parameters] changes, in the query view you couldn't change Parameters, so I didn't know about it before 😅. In any case, you can reproduce a bug when you have Parametes to be applied and you delete the query text containing that parameter.

client/app/pages/queries/QuerySource.jsx Outdated Show resolved Hide resolved
@kravets-levko kravets-levko force-pushed the migrate-query-source-to-react--editor branch from e4e50db to 16057bf Compare December 23, 2019 22:04
title: `${modKey} + Enter`,
disabled: isEmpty(query.query) || !canExecuteQuery || isQueryExecuting,
disabled: !canExecuteQuery,
shortcut: "mod+enter, alt+enter",
Copy link
Member

Choose a reason for hiding this comment

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

Very interesting shortcut definition 🚀

Only thing is that for the Query execution button I think it's better if the tooltip shows only "[Mod]+Enter" (even though it also works for Alt) - looks too much with both shortcuts appearing in the tooltip, so perhaps make the tooltip replaceable if you agree?

Copy link
Collaborator Author

@kravets-levko kravets-levko Dec 24, 2019

Choose a reason for hiding this comment

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

I decided that it may be useful to see all shortcuts, but I agree with your point - tooltip becomes too crowded. Fixed in 57bf864

@kravets-levko kravets-levko merged commit cad0c90 into migrate-query-source-view-to-react Dec 24, 2019
@kravets-levko kravets-levko deleted the migrate-query-source-to-react--editor branch December 24, 2019 12:40
kravets-levko added a commit that referenced this pull request Jan 6, 2020
* Migrate Query Source View page to React: skeleton

* Sync QueryView and QuerySource (#4430)

* Migrate schema browser to react (#4432)

* Restyle code with Prettier

* Migrate Query page to React: Save changes (#4452)

* Migrate query source to React: Set of updates (#4457)

* Migrate Query page to React: Visualization Tabs (#4453)

Co-Authored-By: Levko Kravets <levko.ne@gmail.com>

* Migrate Query Source page to React: Visualizations area (#4463)

* Migrate Query page to React: Delete visualization button (#4461)

* Migrate Query Source page to React: Visualization actions (#4467)

* Migrate Query pages to React: Execute query hook (#4470)

* Migrate Query Source page to React: Editor area (#4468)

* Migrate Query Source page to React: metadata, schedule and description blocks (#4476)

* Migrate Query page to React: Cancel query execution (#4496)

* Migrate Query Source page to React: refine code (#4499)

* Migrate Query Source page to React: alerts (#4504)

* Migrate Query Source page to React: unsaved changes alert (#4505)

* Migrate Query Source to React: resizable areas (v2) (#4503)

* Migrate Query page to React: Query View (#4455)

Co-authored-by: Levko Kravets <levko.ne@gmail.com>

* Switch React and Angular versions of pages (until Angular version removed)

* Migrate Query pages to React: fix permissions (#4506)

* Migrate Query Source page to React: don't reload when saving new query (#4507)

* Migrate Query pages to React: fix tests (#4509)

* Use skipParametersDirtyFlag in executeQuery

* Fix: cannot fork query from Query View page

* Optimize query editor: handle query text changes faster

* Revert "Optimize query editor: handle query text changes faster"

This reverts commit 2934e53.

* Reduce debounced time to 100

* Migrate Query pages to React: cleanup (#4512)

* Migrate Query pages to React: cleanup

* Further cleanup

* Remove unused dependencies

* Fix embed pages

* Attempt to fix flaky test

* Cleanup: explicitly register the last Angular component

* Move contents of /filters folder to /lib

* Remove unnecessary import

* Remove cy.wait from Parameters spec

Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>

Co-authored-by: Levko Kravets <levko.ne@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend: React Frontend codebase migration to React Frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants