Skip to content

[dashboard] Fix PageWithSubMenu selection state by URL-encoding all links #7259

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

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Dec 15, 2021

Description

Fixes PageWithSubMenu selection state when sub-menu links contain special characters (e.g. a space).

Related Issue(s)

Fixes #7231

How to test

  1. Log in to the preview
  2. Add a repository with a space in its name as a new Project (e.g. Gitpod Test)
  3. Open this PR in Gitpod and run this:
$ kubectl port-forward mysql-0 3306 &
$ mysql -h 127.0.0.1 -pjBzVMe2w4Yi7GagadsyB gitpod
mysql> update d_b_project set slug = NULL;
  1. Refresh the preview tab
  2. Visit the Project Settings for your Project added in 2.

Expected: The current Project Settings subsection should have a different background in the left menu (without needing to hover):

Screenshot 2021-12-16 at 10 20 20 Screenshot 2021-12-16 at 10 20 54

Release Notes

NONE

Documentation

/uncc

@jankeromnes jankeromnes force-pushed the jx/fix-page-with-submenu-select branch from 4d9f998 to c619e6a Compare December 16, 2021 10:10
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 16, 2021

Reroll 🎲

/werft run

👍 started the job as gitpod-build-jx-fix-page-with-submenu-select.4

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 16, 2021

Hard reroll 🎲

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-jx-fix-page-with-submenu-select.5

@jankeromnes jankeromnes requested review from AlexTugarev, gtsiolis and laushinka and removed request for gtsiolis and AlexTugarev December 16, 2021 10:56
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 16, 2021

Laurie, could you please take a look at this small fix when you have some time? 😊 🙏 (Priority: Low 🔅🌴)

@laushinka
Copy link
Contributor

@jankeromnes I checked the project settings page before and after updating the DB.
Before the General tab was highlighted, but after that it's not..

+--------------------------------------+--------------+------+
| id                                   | name         | slug |
+--------------------------------------+--------------+------+
| b4797944-b2ee-4cf2-9268-752985d6c681 | Learn GitLab | NULL |
+--------------------------------------+--------------+------+

Screenshot 2021-12-16 at 12 23 15

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Dec 16, 2021

@jankeromnes I checked the project settings page before and after updating the DB.

Cool, many thanks @laushinka! 🙏

Before the General tab was highlighted, but after that it's not..

Whoops, that's not expected. By any chance, did you stay on a project URL that was opened before the database change? (If so, I guess it still has the slug that got removed from the DB).

Or, put another way, does it work if you go back to your list of Projects, refresh, then open that Project again?

(If it does work, it's a bug in my testing instructions, and not the PR 😅 but if it still doesn't work, it's a bug in my PR 🙈)

@laushinka
Copy link
Contributor

Or, put another way, does it work if you go back to your list of Projects, refresh, then open that Project again?

@jankeromnes Yes it works! Sorry that should've been obvious to make sure nothing's cached still. Great job!

/lgtm

@roboquat
Copy link
Contributor

LGTM label has been added.

Git tree hash: cce4266bb44b3ce2148711a2734fdcc19027901c

@roboquat
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: laushinka

Associated issue: #7231

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roboquat roboquat merged commit db0143f into main Dec 16, 2021
@roboquat roboquat deleted the jx/fix-page-with-submenu-select branch December 16, 2021 11:32
@gtsiolis
Copy link
Contributor

gtsiolis commented Dec 16, 2021

Thanks @jankeromnes and @laushinka for fixing this! 🧡 🧡

5y3l0o

@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/XS team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project settings navigation does not highlight active menu for previously added projects
4 participants