Skip to content

Commit

Permalink
Link directly to content item in whitehall
Browse files Browse the repository at this point in the history
This commit changes the “Go to whitehall” link to point directly to the relevant content item in whitehall rather than the homepage. This is enabled by the `/by-content-id` route in whitehall.
  • Loading branch information
Ruben Arakelyan committed Jan 8, 2018
1 parent 38621b8 commit ecf4dbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion spec/javascripts/external_links_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,15 @@ describe("Popup.generateExternalLinks", function () {

it("generates edit links for Whitehall items", function () {
var contentItem = {
content_id: '4d8568c4-67f2-48da-a578-5ac6f35b69b4',
publishing_app: 'whitehall'
}

var links = Popup.generateExternalLinks(contentItem, PROD_ENV)

expect(links).toContain({
name: 'Go to Whitehall Publisher',
url: 'https://whitehall-admin.publishing.service.gov.uk/'
url: 'https://whitehall-admin.publishing.service.gov.uk/government/admin/by-content-id/4d8568c4-67f2-48da-a578-5ac6f35b69b4'
})
})

Expand Down
2 changes: 1 addition & 1 deletion src/popup/external_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function generateEditLink(contentItem, env) {
} else if (contentItem.publishing_app == 'whitehall') {
return {
name: 'Go to Whitehall Publisher',
url: env.protocol + '://whitehall-admin.' + env.serviceDomain + '/',
url: env.protocol + '://whitehall-admin.' + env.serviceDomain + '/government/admin/by-content-id/' + contentItem.content_id,
}
} else if (contentItem.document_type == 'manual') {
return {
Expand Down

0 comments on commit ecf4dbc

Please sign in to comment.