GitLab Version - Properly import on dashboard
What does this MR do and why?
Related to #369442 (closed)
The GitLab Version check badge is a badge that informs users of their instance's version status and the severity of an upgrade if they are behind versions. This badge exists in three places:
- Help Dropdown (? in top right of nav)
- Admin Dashboard (/admin)
- Help Page (/help)
The Vue Application is bootstrapped to the element when the page is loaded for Admin and Help pages but only when the ? is clicked for the Help Dropdown. However, the HAML element still exists until it is replaced by Vue.
The Issue
The problem is that when adding the Vue application at the admin/index.js
level it tries to bootstrap the element on EVERY admin route. Since the element is technically in the help dropdown it then renders it for every admin page even though it isn't needed. Moving the import to admin/dashboard/index.js
will ensure it only renders on the Admin Dashboard page and then for all other admin pages it would only render IF a user clicks the ? dropdown.
Screenshots or screen recordings
N/A
How to set up and validate locally
Important
- Ensure
Gitlab::CurrentSettings.version_check_enabled
is set to true (it defaults to true) - Version Check uses
ReactiveCache
so the first time you navigate to a place where the badge should be, it may not be in the cache and required a single reload. - Please read note above in the first section about my issues with setting up snowplow locally.
Testing Instructions
- Go to
/admin
and check the network logs forversion_check.json
in the requests (it will fire twice since it will find the element hidden in the help dropdown, the results are cached so this should be okay) - Go to any other admin path
/admin/users
for example. Ensure noversion_check.json
call is made on load - Click the ? dropdown
- Ensure now a
version_check.json
call is made
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #369442 (closed)