Skip to content

Commit 7fb6353

Browse files
Swap hidden link to a POST to work around nested query param bug (#160)
* Swap hidden link to a POST to work around nested query param bug
1 parent 36fe3b0 commit 7fb6353

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

app/assets/sass/_misc.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
color: $nhsuk-secondary-text-colour;
4242
}
4343

44+
.app-suppress-link-styles .app-button-link {
45+
text-decoration: none;
46+
color: $nhsuk-secondary-text-colour;
47+
}
48+
4449
.app-image-flip-horizontal {
4550
-webkit-transform: scaleX(-1);
4651
transform: scaleX(-1);

app/assets/sass/_typography.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,20 @@ h3 {
2626
.app-link--warning {
2727
color: $nhsuk-error-colour;
2828
}
29+
30+
.app-button-link {
31+
background: none;
32+
border: none;
33+
color: $nhsuk-link-colour;
34+
cursor: pointer;
35+
font: inherit;
36+
padding: 0;
37+
text-align: left;
38+
text-decoration: underline;
39+
40+
&:hover,
41+
&:focus {
42+
color: $nhsuk-link-hover-colour;
43+
text-decoration: none;
44+
}
45+
}

app/views/events/images-before-mammography.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{% set gridColumn = "nhsuk-grid-column-full" %}
88

9-
{% set formAction = './imaging-answer' %}
9+
{% set formAction = './images' %}
1010

1111
{% set activeTab = 'images' %}
1212

@@ -28,13 +28,26 @@ <h1 class="nhsuk-heading-l js-image-count">
2828
{% set insetHtml %}
2929
<p>Mammography images will appear here once they have been transmitted by the PACS</p>
3030
{% endset %}
31+
3132
{{ insetText({
3233
html: insetHtml
3334
}) }}
3435

35-
<div id="loading-spinner" class="">
36-
<p class="app-suppress-link-styles"><a href="./images?event[workflowStatus][awaiting-images]=completed"><span class="">Loading images...</span></a></p>
37-
</div>
36+
37+
{{ appHiddenInput({
38+
name: "event[workflowStatus][awaiting-images]",
39+
value: "completed"
40+
}) }}
41+
42+
<p class="app-suppress-link-styles">
43+
<button class="app-button-link" type="submit">
44+
Loading images...
45+
</button>
46+
{# <a href="./images?event[workflowStatus][awaiting-images]=completed">
47+
<span class="">Loading images...</span>
48+
</a> #}
49+
</p>
50+
3851

3952

4053
{% include "screening-cannot-proceed-link.njk" %}

app/views/events/images.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{% if isAwaitingImages %}
1212
{% include "events/images-before-mammography.html" %}
1313
{% else %}
14-
{% include "events/images-during-mammography.html" %}
14+
{% include "events/images-during-mammography.html" %}
1515
{% endif %}
1616

1717
{% endif %}

0 commit comments

Comments
 (0)