Skip to content

Commit

Permalink
bug/extension-expected-date (#367)
Browse files Browse the repository at this point in the history
* - Prevents user from changing Current Expected date
from database when filling out extension form

* - Fixes key console error for mapped options
- Removes deleted css sheet from extension form templates
- Removes required badge from Current Expected Date field
  • Loading branch information
sophia-massie authored Nov 20, 2024
1 parent 0dd8a1d commit 4685e4a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

{% block content %}

<link rel="stylesheet" href="{% static 'forms/css/extension_submission_form.css' %}">
<div class="container">
{% include "nav_cms_breadcrumbs.html" %}
<div id="extension-submission-root">
</div>
</div>
{% endblock %}
{% endblock %}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const ExtensionFormInfo: React.FC<{
>
<option value="">-- Select period --</option>
{dataPeriods.map((item) => (
<option value={item.data_period}>{item.data_period}</option>
<option value={item.data_period} key={item.data_period}>{item.data_period}</option>
))}
</Field>
</FieldWrapper>
Expand Down Expand Up @@ -166,11 +166,13 @@ const ExtensionFormInfo: React.FC<{
Current Expected Date <sup>3</sup>
</>
}
required={true}
required={false}
className={`position-relative ${styles.dateInputContainer} `}
>
<Field
type="date"
readOnly
className={`position-relative ${styles.currentExpectedDate}`}
name={`extensions.${index}.currentExpectedDate`}
id={`extensions.${index}.currentExpectedDate`}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@
.justification {
font-size: unset;
}
.dateInputContainer :is(input):read-only {
border-color: unset;
background-color: #e9ecef;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const validationSchema = Yup.object().shape({
requestedTargetDate: Yup.date().required(
'Requested Target Date is required'
),
currentExpectedDate: Yup.date().required(
'Current Expected Date is required'
),
currentExpectedDate: Yup.date()
})
),
requestorName: Yup.string().required('Requestor Name is required'),
Expand Down

0 comments on commit 4685e4a

Please sign in to comment.