Skip to content

Commit

Permalink
Merge pull request #88 from alphagov/link-to-whitehall-content-item
Browse files Browse the repository at this point in the history
Link directly to content item in whitehall
  • Loading branch information
rubenarakelyan committed Jan 8, 2018
2 parents 38621b8 + ecf4dbc commit fd3f1de
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 fd3f1de

Please sign in to comment.