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

Sync QueryView and QuerySource #4430

Merged
merged 11 commits into from
Dec 13, 2019

Conversation

gabrieldutra
Copy link
Member

@gabrieldutra gabrieldutra commented Dec 10, 2019

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

  • Other

Description

@kravets-levko this is a sync for the code, opening a PR since I was also working on some changes to simplify the Query Header component (moving style to query-page-header.less

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

@gabrieldutra gabrieldutra mentioned this pull request Dec 10, 2019
27 tasks
- don't use fixed layout
- show correct last modified by picture
- order visualizations by id
@gabrieldutra
Copy link
Member Author

@kravets-levko although the QueryView page isn't done, please give it a check when possible to sync (mainly the changes in the QueryPageHeader) and share you opinion. Link to View - Link to Source

width: 100%;
margin-bottom: 5px !important;
display: block !important;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I noticed some difference between old and new header version: when query does not have tags, tags control should stay on the same line with query name (see screenshots). Seems this style is related to that

image
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems it's better to keep markup from base branch, unless you have some better UX ideas for this component. Also, if you think that button group does not fit here - feel free to remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

It wraps in the older version too, just take more for it to happen 🙂. That's due to the existing conflict with .page-title { display: block }, fixed in 37c9b46

Copy link
Collaborator

Choose a reason for hiding this comment

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

Now layout is good, but still there some differences:

existing
image

react
image

Notice: favorites control should be on the same line with query name, too much space between query name and tags, and tags should go under buttons on right side.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, in the original there are two QueryTagsControl components, one for the desktop position and another for the mobile one 😪

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 usually feel css is more reliable than js when it can be used, do you have any advantages in mind?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In this case the only advantage is that tags component will be rendered only once (+markup will simplified a bit). CSS Grid is the perfect solution, but it still is not supported good enough. For JS, there is a matchMedia API which is 100% supported in all our target browsers.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW you meant to use a hook, right? (like this one)

It's an interesting hook to have anyway, I tried to use it once I wanted to check in JS if the browser was in Percy,

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, something like that 🙂

Copy link
Member Author

Choose a reason for hiding this comment

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

That hook is not hard to be applied in this context:

const isMobile = useMedia(['(max-width: 880px)'], [true], false);

But I prefer keeping it in css for now as I don't want to break the angular page yet (we can reconsider when cleaning angular stuff)

@gabrieldutra gabrieldutra mentioned this pull request Dec 12, 2019
1 task
@restyled-io
Copy link
Contributor

restyled-io bot commented Dec 12, 2019

Hey there-

I'm a bot, here to let you know that some code in this PR might not
match the team's automated styling. I ran the team's auto-reformatting tools on
the files changed in this PR and found some differences. Those differences can
be seen in #4440.

Please see that Pull Request's description for more details.

Copy link
Collaborator

@kravets-levko kravets-levko left a comment

Choose a reason for hiding this comment

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

Look good 👍 Feel free to merge when you're happy with the code

@gabrieldutra gabrieldutra merged commit e61c628 into migrate-query-source-view-to-react Dec 13, 2019
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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

Co-authored-by: Levko Kravets <[email protected]>
@gabrieldutra gabrieldutra deleted the react-query-view branch January 13, 2020 17:22
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