WIP: Remove duplicate escaping from branch dropdown
What does this MR do?
Remove one of the two places where branch names are escaped from the switch branch dropdown.
Why was this MR needed?
Branch names were escaped twice such that switching branch didn't work for certain branch names (e.g. feature/#1234
).
- first place:
escape()
- second place:
$form.serialize()
see also https://jsfiddle.net/mep7v3rz/
What are the relevant issue numbers?
fixes #21248 (closed), #20759 (closed)
cc @smcgivern
Merge request reports
Activity
@iamphill Can you please have a look at this?
Reassigned to @iamphill
Added 8 commits:
-
bdaa9e9d...f2b36bfd - 7 commits from branch
gitlab-org:master
- 04a996d3 - Remove duplicate escaping from branch dropdown (!5956 (closed))
-
bdaa9e9d...f2b36bfd - 7 commits from branch
Added 8 commits:
-
bdaa9e9d...f2b36bfd - 7 commits from branch
gitlab-org:master
- 04a996d3 - Remove duplicate escaping from branch dropdown (!5956 (closed))
-
bdaa9e9d...f2b36bfd - 7 commits from branch
Added 11 commits:
-
04a996d3...739620fe - 10 commits from branch
gitlab-org:master
- acf5edf0 - Remove duplicate escaping from branch dropdown (!5956 (closed))
-
04a996d3...739620fe - 10 commits from branch
Added 10 commits:
-
acf5edf0...02591b04 - 9 commits from branch
gitlab-org:master
- bd21565a - Remove duplicate escaping from branch dropdown (!5956 (closed))
-
acf5edf0...02591b04 - 9 commits from branch
@winniehell this fails a spinach spec, which looks legit! https://gitlab.com/winniehell/gitlab-ce/builds/3375111
Also, @iamphill is off this week, maybe try @alfredo1 or @jschatz1.
Also also, I think this missed 8.11.1 which is ready-pending-Omnibus.
Reassigned to @winniehell
this fails a spinach spec, which looks legit!
@smcgivern Yep, thank you for the ping.
I just didn't have enough time to look into it.I think this missed 8.11.1
Thank was expected—at least by me.
It got delayed a few times by failing tests on master.Added 1 commit:
- 4263617c - Remove duplicate escaping from branch dropdown (!5956 (closed))
556 556 if (isInput) { 557 557 field = $(this.el); 558 558 } else { 559 field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value + "']"); @smcgivern The failing test was caused by this line. Because value now correctly contains a
'
this concatenation didn't work.@smcgivern Finally got escaping the
'
to work...I was curious and made a small performance test. It clearly shows we want to have the CSS selector: https://jsfiddle.net/zc0vd5sy/2/
Added 1 commit:
- 6ad7d006 - Remove duplicate escaping from branch dropdown (!5956 (closed))
Added 1 commit:
- 1af12998 - Remove duplicate escaping from branch dropdown (!5956 (closed))
Added 1 commit:
- 84580701 - Remove duplicate escaping from branch dropdown (!5956 (closed))
Reassigned to @winniehell
Added 1 commit:
- 7f8ed082 - Remove duplicate escaping from branch dropdown (!5956 (closed))
Added 1 commit:
- 4b71c9f5 - Remove duplicate escaping from branch dropdown (!5956 (closed))
Added 35 commits:
-
4b71c9f5...f52cf56e - 34 commits from branch
gitlab-org:master
- b9febf80 - Remove duplicate escaping from branch dropdown (!5956 (closed))
-
4b71c9f5...f52cf56e - 34 commits from branch
Added 470 commits:
-
b9febf80...1c4e8663 - 469 commits from branch
gitlab-org:master
- 71d19335 - Remove duplicate escaping from branch dropdown (!5956 (closed))
-
b9febf80...1c4e8663 - 469 commits from branch
Added 1 commit:
- e417fc7f - Remove duplicate escaping from branch dropdown (!5956 (closed))
Added 1 commit:
-
cf42a3e6 - 1 commit from branch
gitlab-org:master
-
cf42a3e6 - 1 commit from branch
mentioned in merge request !6237 (closed)
mentioned in issue #21880 (closed)
@winniehell will you be adding tests to this?
@ClemMakesApps That definitely makes sense!
Not sure when I will get that done though...Reassigned to @winniehell
@ClemMakesApps I find it very difficult to write tests for the dropdown because it encapsulates so much logic in it. If you know a way, feel free to replace this merge request by yours!
Yeah, I was getting stuck on it too @winniehell. Perhaps we can add a new test case that has a value containing spaces? (If that's not already in there, I'm not 100% sure)
mentioned in merge request !6313 (merged)
!6313 (merged) does in fact fix this :) Thanks for making me check :')