Skip to content

Commit 86ab510

Browse files
committed
remove non-engine pages, leaving just a development UI
1 parent 49fbb9f commit 86ab510

11 files changed

Lines changed: 5 additions & 710 deletions

File tree

src/server/plugins/engine/views/layout.html

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -45,85 +45,11 @@
4545
{% endblock %}
4646

4747
{% block header %}
48-
{% if config.googleAnalyticsTrackingId and slug %}
49-
<form method="post" action="/help/cookie-preferences/{{ slug }}?returnUrl={{ currentPath | urlencode }}">
50-
<input type="hidden" name="crumb" value="{{ crumb }}">
51-
52-
{% set acceptHtml %}
53-
<p class="govuk-body">You’ve accepted analytics cookies. You can <a class="govuk-link" href="/help/cookies/{{ slug }}">change your cookie settings</a> at any time.</p>
54-
{% endset %}
55-
56-
{% set rejectedHtml %}
57-
<p class="govuk-body">You’ve rejected analytics cookies. You can <a class="govuk-link" href="/help/cookies/{{ slug }}">change your cookie settings</a> at any time.</p>
58-
{% endset %}
59-
60-
{% if cookieConsent.analytics !== true and cookieConsent.analytics !== false and cookieConsent.dismissed !== true %}
61-
{% set html %}
62-
<p class="govuk-body">We use some essential cookies to make this service work.</p>
63-
<p class="govuk-body">We’d like to set analytics cookies so we can understand how people use the service and make improvements.</p>
64-
{% endset %}
65-
66-
{{ govukCookieBanner({
67-
ariaLabel: "Cookies on " + config.serviceName,
68-
messages: [
69-
{
70-
headingText: config.serviceName,
71-
html: html,
72-
actions: [
73-
{
74-
text: "Accept analytics cookies",
75-
type: "submit",
76-
name: "cookies[analytics]",
77-
value: "yes"
78-
},
79-
{
80-
text: "Reject analytics cookies",
81-
type: "submit",
82-
name: "cookies[analytics]",
83-
value: "no"
84-
},
85-
{
86-
text: "View cookies",
87-
href: "/help/cookies/" + slug
88-
}
89-
]
90-
}
91-
]
92-
}) }}
93-
{% elif cookieConsent.dismissed === false %}
94-
{{ govukCookieBanner({
95-
ariaLabel: "Cookies on " + config.serviceName,
96-
messages: [
97-
{
98-
html: acceptHtml if cookieConsent.analytics === true else rejectedHtml,
99-
actions: [
100-
{
101-
text: "Hide cookie message",
102-
type: "submit",
103-
name: "cookies[dismissed]",
104-
value: "yes"
105-
}
106-
]
107-
}
108-
]
109-
}) }}
110-
{% endif %}
111-
112-
</form>
113-
{% endif %}
114-
115-
{% if config.serviceBannerText | length %}
116-
{{ appServiceBanner({
117-
title: "Service status",
118-
text: config.serviceBannerText
119-
}) }}
120-
{% endif %}
121-
12248
{{ govukHeader({
12349
homepageUrl: currentPath if context.isForceAccess else "https://www.gov.uk",
12450
containerClasses: "govuk-width-container",
12551
productName: productName | safe | trim,
126-
serviceName: name if name else config.serviceName,
52+
serviceName: "DXT development server",
12753
serviceUrl: currentPath if context.isForceAccess else serviceUrl
12854
}) }}
12955
{% endblock %}

src/server/plugins/errorPages.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
type ResponseToolkit,
44
type ServerRegisterPluginObject
55
} from '@hapi/hapi'
6-
import { StatusCodes } from 'http-status-codes'
76

87
/*
98
* Add an `onPreResponse` listener to return error pages
@@ -20,36 +19,16 @@ export default {
2019
// processing the request
2120
const statusCode = response.output.statusCode
2221

23-
// Check for a form model on the request
24-
// and use it to set the correct service name
25-
// and start page path. In the event of a error
26-
// happening inside a "form" level request, the header
27-
// then displays the contextual form text and href
28-
const model = request.app.model
29-
const viewModel = model
30-
? {
31-
name: model.name,
32-
serviceUrl: `/${model.basePath}`
33-
}
34-
: undefined
35-
36-
// In the event of 404
37-
// return the `404` view
38-
if (statusCode === StatusCodes.NOT_FOUND.valueOf()) {
39-
return h.view('404', viewModel).code(statusCode)
40-
}
41-
42-
request.log('error', {
22+
const error = {
4323
statusCode,
4424
data: response.data,
4525
message: response.message,
4626
stack: response.stack
47-
})
27+
}
4828

49-
request.logger.error(response.stack)
29+
request.log('error', error)
5030

51-
// The return the `500` view
52-
return h.view('500', viewModel).code(statusCode)
31+
return h.response(error).code(statusCode)
5332
}
5433
return h.continue
5534
})

src/server/plugins/router.ts

Lines changed: 0 additions & 201 deletions
This file was deleted.

src/server/views/404.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/server/views/500.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)