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

feat(ui): Add project id to URL when visiting Issue Details directly #13875

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Jul 2, 2019

There is still a problem when visiting an issue details page with a direct URL and when a user does not have access to multiple projects. When this happens the global selection header tries to select a seemingly random project.

This PR makes a few changes -- if there is no existing project URL param and you visit an issue details page, it will add the issues project id to the URL. This way when you go back to the issues stream it will have the proper project in context (instead of selecting a random project).

This also fixes the project selector on issue details: there is an async loading state that we are not handling well. The project selector flashes from "All Projects" (and unlocked) to a locked state with project slug. This will make the project selector aware of its "loading" state and show an empty string until we have the project slug.

Header change: https://cl.ly/44b3bfd218fb

There is still a problem when visiting an issue details page with a direct URL and when a user does not have access to multiple projects. When this happens the global selection header tries to select a seemingly random project.

This PR makes a few changes -- if there is no existing `project` URL param and you visit an issue details page, it will add the issues project id to the URL. This way when you go back to the issues stream it will have the proper project in context (instead of selecting a random project).

This also fixes the project selector on issue details: there is an async loading state that we are not handling well. The project selector flashes from "All Projects" (and unlocked) to a locked state with project slug. This will make the project selector aware of its "loading" state and show an empty string until we have the project slug.
@billyvg billyvg requested review from Chrissy and a team July 2, 2019 00:59
Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good to me. Is there a reasonable way to capture this behavior either with jest or with an acceptance test?

@billyvg billyvg merged commit d3ce160 into master Jul 3, 2019
@billyvg billyvg deleted the feat/ui/change-global-selection-header-loading-state-issue-details branch July 3, 2019 16:43
billyvg added a commit that referenced this pull request Apr 22, 2020
This basically re-implements #13689 in a more simple way. This is possible due to other changes that we have done to issue details (#13875, #14731).

This also (semi) fixes an issue with loading Issue Details with an environment in the URL. Previously, it would fetch details API serially: 1) without env and 2) with env.
There would be a slight flicker between loading -> finished req #1 -> loading -> finished req #2. Now this seems to fire both at near the same time and cancels the initial request almost immediately.

This is still not ideal but is an interim-fix as the ideal solution is a bit more involved, but will be on its way.
billyvg added a commit that referenced this pull request Apr 23, 2020
This basically re-implements #13689 in a more simple way. This is possible due to other changes that we have done to issue details (#13875, #14731).

This also (semi) fixes an issue with loading Issue Details with an environment in the URL. Previously, it would fetch details API serially: 1) without env and 2) with env.
There would be a slight flicker between loading -> finished req #1 -> loading -> finished req #2. Now this seems to fire both at near the same time and cancels the initial request almost immediately.

This is still not ideal but is an interim-fix as the ideal solution is a bit more involved, but will be on its way.
billyvg added a commit that referenced this pull request Apr 26, 2020
This basically re-implements #13689 in a more simple way. This is possible due to other changes that we have done to issue details (#13875, #14731).

This also (semi) fixes an issue with loading Issue Details with an environment in the URL. Previously, it would fetch details API serially: 1) without env and 2) with env.
There would be a slight flicker between loading -> finished req #1 -> loading -> finished req #2. Now this seems to fire both at near the same time and cancels the initial request almost immediately.

This is still not ideal but is an interim-fix as the ideal solution is a bit more involved, but will be on its way.
billyvg added a commit that referenced this pull request Apr 27, 2020
This basically re-implements #13689 in a more simple way. This is possible due to other changes that we have done to issue details (#13875, #14731).

This also (semi) fixes an issue with loading Issue Details with an environment in the URL. Previously, it would fetch details API serially: 1) without env and 2) with env.
There would be a slight flicker between loading -> finished req #1 -> loading -> finished req #2. Now this seems to fire both at near the same time and cancels the initial request almost immediately.

This is still not ideal but is an interim-fix as the ideal solution is a bit more involved, but will be on its way.

The tests introduced in #18452 should cover the changes in this PR.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants