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

Remove route.resolve feature #4607

Merged
merged 3 commits into from
Mar 10, 2020
Merged

Remove route.resolve feature #4607

merged 3 commits into from
Mar 10, 2020

Conversation

kravets-levko
Copy link
Collaborator

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

  • Refactor
  • Bug Fix

Description

During React migration of Router we decided to temporary keep resolve feature like in angular-router (this feature allows route to define dependencies that should be resolved before rendering page). Till now only Query View and Editor pages were using this feature, so it's time to remove it.

Now query pages will load query object themselves showing spinner while loading. It's a little bit different from previous behavior (with resolve feature previous page stays visible until new is completely ready), but considering that other pages already work in the same manner - it shouldn't be an issue.

Related Tickets & Documents

Fixes #4605

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.

Code looks good to me, regarding the LoadingState I do feel we should have something better (not in this scope, but we should address it in case).

As for other pages, the dashboard currently doesn't have a LoadingState (it's just blank) and the Alert Page has this spinner, but with a margin-top: 30px. If the matter is a quick win I'd go with just adding this margin.

@kravets-levko
Copy link
Collaborator Author

As for other pages, the dashboard currently doesn't have a LoadingState (it's just blank) and the Alert Page has this spinner, but with a margin-top: 30px. If the matter is a quick win I'd go with just adding this margin.

I also noticed that different pages have different spinners. I was planning to revisit all that stuff together (it will also affect ItemsList component), and for me it feels a bit out of scope of this PR.

function QueryPageWrapper({ queryId, onError, ...props }) {
const [query, setQuery] = useState(null);
const onErrorRef = useRef();
onErrorRef.current = onError;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to persist the onError callback?

@arikfr arikfr merged commit e552eff into master Mar 10, 2020
@arikfr arikfr deleted the remove-route-resolve branch March 10, 2020 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pages with "resolve" don't redirect guests to the login page
3 participants