Merge lp:~leonardr/launchpad/use-web-link into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Leonard Richardson | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 12356 | ||||
Proposed branch: | lp:~leonardr/launchpad/use-web-link | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
40 lines (+7/-9) 1 file modified
lib/lp/app/javascript/picker.js (+7/-9) |
||||
To merge this branch: | bzr merge lp:~leonardr/launchpad/use-web-link | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeroen T. Vermeulen (community) | code | Approve | |
Review via email:
|
Commit message
[r=jtv] [ui=none][bug=316694][incr] Take advantage of web_link when changing the URL in the browser bar, rather than hacking self_link into web_link.
Description of the change
This branch removes some tech debt. Previously, when the picker edit widget made a PATCH request that changed the URL of the context object (such as changing the target of a bug), the new URL was determined by search-
Now that bug 316694 has been fixed, the document returned by the PATCH request includes a web_link, which is the value we were hacking out of self_link. This branch makes the code that retrieves self_link (which we need, to see whether the URL has changed) also look for web_link, and use it directly rather than deriving it from self_link.
There's at least one other place where we hack self_link into web_link, but it's not as easy to fix, so I'm submitting this branch in the meantime.
To test:
1. Visit https:/
Edit the project by clicking the edit button beneath "Affects", doing a search for "launchpad", and selecting Launchpad as the project.
The URL in the browser address bar should change to https:/
2. Create a recipe for a branch.
Change its owner, and the browser address bar should also change.
Change its daily build archive, and the browser address bar should stay as is.
I can't say I like the "&&" at the beginning of a line, but I won't force my tastes on you. Otherwise, looks fine.
As per IRC, we're not foreseeing any legitimate scenario under which web_link might not be present, so the one obvious path of breakage is not to be expected.
Jeroen