-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map 581 move question on body worn cameras to details screen #672
Merged
jimbali
merged 6 commits into
main
from
MAP-581-UoF-move-question-on-body-worn-cameras-to-uof-details-screen
Jan 25, 2024
+424
−347
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e499392
MAP-581 moved body camera question to report details page and updated…
GurnankCheema 934dff7
MAP-581 update integration tests
GurnankCheema 4dda810
MAP-581 fix breaking test
GurnankCheema ca059c6
map-581 get body-camera details from 'evidence' and use in 'details' …
GurnankCheema cb2a845
map-581 made macros to be more generic
GurnankCheema 25e037f
MAP-581 remove temporary stop on integ tests
GurnankCheema File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
MAP-581 moved body camera question to report details page and updated…
… unit tests
commit e4993922a25646504eb736b4208e26ded69b806c
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
{% extends "../formTemplate.html" %} | ||
{% from "govuk/components/input/macro.njk" import govukInput %} | ||
{% from "govuk/components/radios/macro.njk" import govukRadios %} | ||
{% from "govuk/components/select/macro.njk" import govukSelect %} | ||
{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %} | ||
{% import "../incidentMacros.njk" as incidentMacro %} | ||
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %} | ||
{% from "govuk/components/button/macro.njk" import govukButton %} | ||
|
@@ -195,105 +193,6 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }} </h1> | |
}) | ||
}} | ||
</div> | ||
|
||
<!-- Q4 --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this has moved to the useOfForceDetails.html |
||
|
||
<div class="govuk-!-margin-bottom-9 | ||
{% if errors | findError('bodyWornCamera') %} | ||
govuk-form-group--error | ||
{% set cameraErrMsg = errors | findError('bodyWornCamera') %} | ||
{% endif %}"> | ||
<fieldset class="govuk-fieldset"> | ||
<legend class="govuk-fieldset__legend "> | ||
Was any part of the incident captured on a body-worn camera? | ||
</legend> | ||
<span id="cameraErrMsg" class="govuk-error-message"> | ||
<span class="govuk-visually-hidden">Error:</span> | ||
{{ cameraErrMsg.text}} | ||
</span> | ||
|
||
<div class="govuk-radios" data-module="govuk-radios"> | ||
<div class=" govuk-radios"> | ||
<div class="govuk-radios__item"> | ||
<input class="govuk-radios__input" id="bodyWornCamera" name="bodyWornCamera" type="radio" value="YES" data-aria-controls="body-worn-camera-conditional" {% if data.bodyWornCamera === 'YES' %} checked="checked" {% endif %}> | ||
<label class="govuk-label govuk-radios__label" for="bodyWornCamera"> | ||
Yes | ||
</label> | ||
</div> | ||
<!-- hidden panel starts here --> | ||
<div class="govuk-radios__conditional govuk-radios__conditional--hidden" id="body-worn-camera-conditional"> | ||
|
||
<!-- add another starts here --> | ||
<div class="add-another-camera" id="bodyWornCameraNumbers"> | ||
{% macro addCameraNumber(index, value, showRemove) %} | ||
{% call govukFieldset({ classes: 'add-another__item' }) %} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-one-third" id="bodyWornCameraNumbers[{{index}}]"> | ||
{{ | ||
govukInput({ | ||
label: { | ||
html: 'Camera number' | ||
}, | ||
id: 'bodyWornCameraNumbers[' + index + '][cameraNum]', | ||
name: 'bodyWornCameraNumbers[' + index + '][cameraNum]', | ||
value: value, | ||
errorMessage: errors | findErrors(['bodyWornCameraNumbers[' + index + ']', 'bodyWornCameraNumbers[' + index + '][cameraNum]']), | ||
attributes: { | ||
'data-name': 'bodyWornCameraNumbers[%index%][cameraNum]', | ||
'data-id': 'bodyWornCameraNumbers[%index%][cameraNum]' | ||
} | ||
}) | ||
}} | ||
</div> | ||
<div class="govuk-grid-column-one-third remove-button-container govuk-!-margin-top-6"> | ||
{% if showRemove %} | ||
<button type="button" class="govuk-button govuk-button--secondary add-another__remove-button"> | ||
Remove | ||
</button> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endcall %} | ||
{% endmacro%} | ||
|
||
{% for camera in data.bodyWornCameraNumbers %} | ||
{{ addCameraNumber(index = loop.index0, value = camera.cameraNum, showRemove = loop.length != 1) }} | ||
{% else %} | ||
{{ addCameraNumber(index = 0, value = null, showRemove = false) }} | ||
{% endfor %} | ||
<div class="button-action"> | ||
{{ | ||
govukButton({ | ||
text: 'Add another', | ||
classes: 'govuk-button--secondary add-another__add-button govuk-!-margin-bottom-4', | ||
attributes: { 'data-qa-add-another-camera': true } | ||
}) | ||
}} | ||
</div> | ||
</div> | ||
<!-- add another ends here --> | ||
</div> | ||
<!-- hidden panel end --> | ||
|
||
<div class="govuk-radios__item"> | ||
<input class="govuk-radios__input" id="body-worn-camera-no" name="bodyWornCamera" type="radio" value="NO" {% if data.bodyWornCamera === 'NO' %} checked="checked" {% endif %}> | ||
<label class="govuk-label govuk-radios__label" for="body-worn-camera-no"> | ||
No | ||
</label> | ||
</div> | ||
<div class="govuk-radios__item"> | ||
<input class="govuk-radios__input" id="body-worn-camera-notKnown" name="bodyWornCamera" type="radio" value="NOT_KNOWN" {% if data.bodyWornCamera === 'NOT_KNOWN' %} checked="checked" {% endif %}> | ||
<label class="govuk-label govuk-radios__label" for="body-worn-camera-notKnown"> | ||
Not known | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- end of radios --> | ||
</fieldset> | ||
</div> | ||
<!-- end of this Q4 component --> | ||
|
||
</div> | ||
<!-- end of govuk-grid-column-full--> | ||
</div> | ||
|
@@ -302,4 +201,4 @@ <h1 class="govuk-heading-xl mainHeading">{{ pageTitle }} </h1> | |
|
||
{% block script %} | ||
<script src="/assets/add-another-evidence.js"></script> | ||
{% endblock %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is input validation and has been moved to /useOfForceDetailsForm. ts