Skip to content

Commit

Permalink
Correcting cancel link.
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliecarey committed Sep 15, 2023
1 parent fd70f7a commit bd6347c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/manage-prototype-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,14 @@ async function getPluginsModeHandler (req, res, next) {
const pageName = `${verb.title} ${plugin.name}`

let returnLink
let cancelLink = plugin?.links.pluginDetails

if (req.query.returnTo === 'templates') {
returnLink = {
href: `${contextPath}/templates`,
text: 'Back to templates'
}
cancelLink = returnLink.href
} else if (mode === 'uninstall') {
returnLink = {
href: `${contextPath}/plugins`,
Expand Down Expand Up @@ -752,6 +754,7 @@ async function getPluginsModeHandler (req, res, next) {
verb,
isSameOrigin,
returnLink,
cancelLink,
relatedPlugins
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
attributes: { id: "plugin-action-button" }
}) }}

<a class="govuk-link" href="{{ returnLink.href }}">Cancel {{ verb.para }}</a>
<a class="govuk-link" href="{{ cancelLink }}">Cancel {{ verb.para }}</a>
</div>
</div>
{% elseif not isSameOrigin %}
Expand Down

0 comments on commit bd6347c

Please sign in to comment.