From 013e65b5c8547677218114b36dc14748e7033301 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 7 Sep 2023 15:03:07 -0400 Subject: [PATCH 01/23] add and use theme color for hints --- .../app-web/src/components/FileUpload/FileUpload.module.scss | 2 +- services/app-web/src/styles/theme/_color.scss | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/app-web/src/components/FileUpload/FileUpload.module.scss b/services/app-web/src/components/FileUpload/FileUpload.module.scss index bdd0ce210a..eff24b0239 100644 --- a/services/app-web/src/components/FileUpload/FileUpload.module.scss +++ b/services/app-web/src/components/FileUpload/FileUpload.module.scss @@ -28,7 +28,7 @@ .fileInputHint { display: flex; flex-direction: column; - color: #71767a; + color: theme-color-hint; margin-bottom: 0.5rem; } diff --git a/services/app-web/src/styles/theme/_color.scss b/services/app-web/src/styles/theme/_color.scss index cdab44ed9b..0f6d5b3f94 100644 --- a/services/app-web/src/styles/theme/_color.scss +++ b/services/app-web/src/styles/theme/_color.scss @@ -108,6 +108,9 @@ $theme-color-success-darker: $cms-color-success-darker; $theme-color-info-dark: #009ec1; // $theme-color-info-darker: 'blue-cool-60'; +// Hint colors +$theme-color-hint: #71767A; + // // Disabled colors // $theme-color-disabled-family: 'gray'; // $theme-color-disabled-light: 'gray-10'; From a9d9e02cd513d4eda5cca2773f909aa1ddf6d5e8 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 8 Sep 2023 10:59:58 -0400 Subject: [PATCH 02/23] start adding required labels --- .../src/pages/StateSubmission/RateDetails/RateDetails.tsx | 3 --- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 4 ++++ .../src/pages/StateSubmission/StateSubmissionForm.module.scss | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.tsx index 06dbdbabac..eb8e66b639 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.tsx @@ -320,9 +320,6 @@ export const RateDetails = ({ >
Rate Details - - All fields are required - {shouldValidate && ( {showFieldErrors('rateType')} @@ -316,6 +317,9 @@ export const SingleRateCert = ({ > Rate certification type definitions + + Required + Date: Fri, 8 Sep 2023 14:44:21 -0400 Subject: [PATCH 03/23] add inline required labels where possible --- .../ContractDetails/ContractDetails.tsx | 36 +++++++++++++++++-- .../SingleRateCert/SingleRateCert.tsx | 18 ++++++++-- .../SubmissionType/SubmissionType.tsx | 18 ++++++++-- 3 files changed, 63 insertions(+), 9 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx index ff9409e7cc..251dd665ef 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx @@ -499,9 +499,6 @@ export const ContractDetails = ({ >
Contract Details - - All fields are required - {shouldValidate && ( )} + + Required + + + Required + {showFieldErrors( errors.contractDateStart || errors.contractDateEnd @@ -697,6 +706,13 @@ export const ContractDetails = ({ aria-required legend="Managed Care entities" > + + Required + + + Required + + + Required + {applicableProvisions.map( (modifiedProvisionName) => ( Programs this rate certification covers + Required {showFieldErrors('rateProgramIDs')} @@ -305,6 +306,9 @@ export const SingleRateCert = ({ aria-required aria-label="Required" > + + Required + {showFieldErrors('rateType')} @@ -317,9 +321,6 @@ export const SingleRateCert = ({ > Rate certification type definitions - - Required - + + Required +

See 42 CFR §§ 438.4(b) and 438.4(c)

@@ -386,6 +390,9 @@ export const SingleRateCert = ({ : 'Rating period' } > + + Required + + + Required + Submission type {showFormAlert && } - - All fields are required - {shouldValidate && ( + + Required + {showFieldErrors( errors.populationCovered ) && ( @@ -417,6 +419,11 @@ export const SubmissionType = ({ legend="Choose a submission type" id="submissionType" > + + Required + {showFieldErrors(errors.submissionType) && ( {errors.submissionType} @@ -467,6 +474,11 @@ export const SubmissionType = ({ legend="Contract action type" id="contractType" > + + Required + {showFieldErrors(errors.contractType) && ( {errors.contractType} From 76bbc360f3e24080edb3f78dee3e0a604a3347fb Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 8 Sep 2023 16:25:38 -0400 Subject: [PATCH 04/23] add styling to inline required label --- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 3 +++ .../src/pages/StateSubmission/StateSubmissionForm.module.scss | 1 + 2 files changed, 4 insertions(+) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index cc9f91e308..4c932d3ad5 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -514,6 +514,9 @@ export const SingleRateCert = ({ ? 'Date certified for rate amendment' : 'Date certified'} + + Required +
Date: Fri, 8 Sep 2023 16:27:58 -0400 Subject: [PATCH 05/23] Add required lable to actuary fields --- .../StateSubmission/Contacts/ActuaryContactFields.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx b/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx index da12dbf656..247aa63f3b 100644 --- a/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx +++ b/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx @@ -5,6 +5,7 @@ import { Fieldset, FormGroup } from '@trussworks/react-uswds' import { FieldRadio, FieldTextInput } from '../../../components/Form' import { PoliteErrorMessage } from '../../../components/PoliteErrorMessage' import { RateCertFormType } from '../RateDetails/SingleRateCert/SingleRateCert' +import styles from '../../StateSubmissionForm.module.scss' type FormError = FormikErrors[keyof FormikErrors] @@ -35,11 +36,12 @@ export const ActuaryContactFields = ({ return (
+ Required Actuarial firm + Required {showFieldErrors( getIn(errors, `${fieldNamePrefix}.actuarialFirm`) ) && ( From 52edc2f92c0278377ff2d158dffeac2aab462c10 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 8 Sep 2023 16:43:01 -0400 Subject: [PATCH 06/23] Add required label to file uploads --- .../src/components/FileUpload/FileUpload.module.scss | 5 +++++ services/app-web/src/components/FileUpload/FileUpload.tsx | 6 +++++- .../pages/StateSubmission/Contacts/ActuaryContactFields.tsx | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/services/app-web/src/components/FileUpload/FileUpload.module.scss b/services/app-web/src/components/FileUpload/FileUpload.module.scss index eff24b0239..33525fe7e2 100644 --- a/services/app-web/src/components/FileUpload/FileUpload.module.scss +++ b/services/app-web/src/components/FileUpload/FileUpload.module.scss @@ -32,6 +32,11 @@ margin-bottom: 0.5rem; } +.requiredOptionalText { + display: block; + color: $theme-color-hint; +} + .fileSummary { font-weight: normal; @include u-font('sans', 'sm'); diff --git a/services/app-web/src/components/FileUpload/FileUpload.tsx b/services/app-web/src/components/FileUpload/FileUpload.tsx index 801fa28597..0bbc14a224 100644 --- a/services/app-web/src/components/FileUpload/FileUpload.tsx +++ b/services/app-web/src/components/FileUpload/FileUpload.tsx @@ -61,6 +61,7 @@ export const FileUpload = ({ uploadFile, scanFile, deleteFile, + // ariaRequired, onFileItemsUpdate, isContractOnly, shouldDisplayMissingCategoriesError = false, @@ -71,8 +72,8 @@ export const FileUpload = ({ const fileInputRef = useRef(null) // reference to the HTML input which has files const summaryRef = useRef(null) // reference to the heading that we will focus const previousFileItems = usePrevious(fileItems) + const isRequired = inputProps['aria-required'] // eslint-disable-next-line @typescript-eslint/no-unused-vars - const handleCheckboxClick = ( event: React.ChangeEvent ) => { @@ -424,6 +425,9 @@ export const FileUpload = ({ + {isRequired && ( + Required + )} {error} {hint && ( diff --git a/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx b/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx index 247aa63f3b..4ff0b89af8 100644 --- a/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx +++ b/services/app-web/src/pages/StateSubmission/Contacts/ActuaryContactFields.tsx @@ -5,7 +5,7 @@ import { Fieldset, FormGroup } from '@trussworks/react-uswds' import { FieldRadio, FieldTextInput } from '../../../components/Form' import { PoliteErrorMessage } from '../../../components/PoliteErrorMessage' import { RateCertFormType } from '../RateDetails/SingleRateCert/SingleRateCert' -import styles from '../../StateSubmissionForm.module.scss' +import styles from '../StateSubmissionForm.module.scss' type FormError = FormikErrors[keyof FormikErrors] From 9407dddcf210c630cb0dc61fddb379a8191b41d6 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 8 Sep 2023 16:50:44 -0400 Subject: [PATCH 07/23] Add required label to FieldYesNo component --- services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx index 01a1f3f18a..6d88f44300 100644 --- a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx +++ b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx @@ -57,6 +57,9 @@ export const FieldYesNo = ({ className={classes} data-testid="yes-no-radio-fieldset" > + {isRequired && ( + Required + )} {showError && {meta.error}} {hint && (
Date: Fri, 8 Sep 2023 16:54:43 -0400 Subject: [PATCH 08/23] conditionally display required or optional label depending on whats passed in --- .../app-web/src/components/FileUpload/FileUpload.tsx | 6 +++--- .../src/components/Form/FieldYesNo/FieldYesNo.tsx | 6 +++--- .../Contacts/ActuaryContactFields.tsx | 12 ++++++++---- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 1 + 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/services/app-web/src/components/FileUpload/FileUpload.tsx b/services/app-web/src/components/FileUpload/FileUpload.tsx index 0bbc14a224..86504a0799 100644 --- a/services/app-web/src/components/FileUpload/FileUpload.tsx +++ b/services/app-web/src/components/FileUpload/FileUpload.tsx @@ -425,9 +425,9 @@ export const FileUpload = ({ - {isRequired && ( - Required - )} + + {isRequired ? 'Required' : 'Optional'} + {error} {hint && ( diff --git a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx index 6d88f44300..30ed865016 100644 --- a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx +++ b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx @@ -57,9 +57,9 @@ export const FieldYesNo = ({ className={classes} data-testid="yes-no-radio-fieldset" > - {isRequired && ( - Required - )} + + {isRequired ? 'Required' : 'Optional'} + {showError && {meta.error}} {hint && (
+ isRequired: boolean shouldValidate: boolean fieldNamePrefix: string fieldSetLegend?: string @@ -24,6 +25,7 @@ export const ActuaryContactFields = ({ errors, shouldValidate, fieldNamePrefix, + isRequired, fieldSetLegend = 'Actuary Contact', inputRef, }: ActuaryFormPropType) => { @@ -36,12 +38,14 @@ export const ActuaryContactFields = ({ return (
- Required + + {isRequired ? 'Required' : 'Optional'} + Date: Fri, 8 Sep 2023 16:56:26 -0400 Subject: [PATCH 09/23] pass required prop to contacts --- .../app-web/src/pages/StateSubmission/Contacts/Contacts.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx b/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx index b28647c159..1c864b6240 100644 --- a/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx +++ b/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx @@ -477,6 +477,9 @@ export const Contacts = ({ shouldValidate={ shouldValidate } + isRequired={ + true + } fieldNamePrefix={`addtlActuaryContacts.${index}`} fieldSetLegend={handleContactLegend( index, From ffe0c92b94a952aeb20af43aadefa0ca016f3497 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 8 Sep 2023 17:04:24 -0400 Subject: [PATCH 10/23] include required/optional label for textarea --- .../src/components/Form/FieldTextarea/FieldTextarea.tsx | 5 +++++ .../pages/StateSubmission/SubmissionType/SubmissionType.tsx | 1 + 2 files changed, 6 insertions(+) diff --git a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx index 9c0e7ad6c6..c207559a10 100644 --- a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx +++ b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx @@ -2,6 +2,7 @@ import React from 'react' import { useField } from 'formik' import { Label, Textarea, FormGroup } from '@trussworks/react-uswds' import { PoliteErrorMessage } from '../..' +import styles from './FieldTextarea.module.scss' /** * This component renders a ReactUSWDS TextArea component inside of a FormGroup, @@ -34,6 +35,7 @@ export const FieldTextarea = ({ ...inputProps }: TextAreaProps): React.ReactElement => { const [field, meta] = useField({ name }) + const isRequired = inputProps['aria-required'] // Latch into onBlur to do any input cleaning // Initial use case is to trim away trailing whitespace in email addresses @@ -50,6 +52,9 @@ export const FieldTextarea = ({ + + {isRequired ? 'Required' : 'Optional'} + {showError && {meta.error}} {hint && (
Date: Fri, 8 Sep 2023 17:04:49 -0400 Subject: [PATCH 11/23] add new styles for textarea --- .../Form/FieldTextarea/FieldTextarea.module.scss | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 services/app-web/src/components/Form/FieldTextarea/FieldTextarea.module.scss diff --git a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.module.scss b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.module.scss new file mode 100644 index 0000000000..3c6b095ea6 --- /dev/null +++ b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.module.scss @@ -0,0 +1,7 @@ +@import '../../../styles/uswdsImports.scss'; +@import '../../../styles/custom.scss'; + +.requiredOptionalText { + display: block; + color: $theme-color-hint; +} \ No newline at end of file From 80e9a59e8b6c975a5aebe4e28a2e0dbd19ee65ac Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 8 Sep 2023 17:08:22 -0400 Subject: [PATCH 12/23] add optional label to supporting documents upload field --- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index 72eb68ef54..73919370c6 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -218,9 +218,9 @@ export const SingleRateCert = ({ From 92239f7a04f5f6197c6807deda527d9e67707077 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Tue, 12 Sep 2023 20:39:30 -0400 Subject: [PATCH 13/23] update so that required/optional labels are on the contacts and rate details page --- .../Form/FieldTextarea/FieldTextarea.tsx | 12 +++++++++++- .../components/Form/FieldYesNo/FieldYesNo.tsx | 13 +++++++++++-- .../ContractDetails/ContractDetails.test.tsx | 9 +++++++-- .../RateDetails/RateDetails.test.tsx | 12 +++++++++--- .../SubmissionType/SubmissionType.tsx | 19 +++---------------- 5 files changed, 41 insertions(+), 24 deletions(-) diff --git a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx index c207559a10..9f4b30c7a1 100644 --- a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx +++ b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx @@ -21,6 +21,7 @@ export type TextAreaProps = { hint?: React.ReactNode error?: string showError: boolean + showRequiredOptionalLabel?: boolean name: string } & JSX.IntrinsicElements['textarea'] @@ -32,6 +33,7 @@ export const FieldTextarea = ({ showError, name, onBlur, + showRequiredOptionalLabel = false, ...inputProps }: TextAreaProps): React.ReactElement => { const [field, meta] = useField({ name }) @@ -47,13 +49,21 @@ export const FieldTextarea = ({ if (onBlur) onBlur(e) } + let isRequiredLabel + if (showRequiredOptionalLabel) { + if (isRequired) { + isRequiredLabel = 'Required' + } else { + isRequiredLabel = 'Optional' + } + } return ( - {isRequired ? 'Required' : 'Optional'} + {isRequiredLabel} {showError && {meta.error}} {hint && ( diff --git a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx index 30ed865016..0bf2926d47 100644 --- a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx +++ b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx @@ -22,6 +22,7 @@ export type FieldYesNoProps = { label: string hint?: React.ReactNode showError?: boolean + showRequiredOptionalLabel?: boolean id: string variant?: 'TOPLEVEL' | 'SUBHEAD' // subhead variant used for nested fields yes/no fields under an overarching heading } & React.JSX.IntrinsicElements['input'] @@ -31,6 +32,7 @@ export const FieldYesNo = ({ label, hint, showError = false, + showRequiredOptionalLabel = false, variant = 'TOPLEVEL', id, className, @@ -47,7 +49,14 @@ export const FieldYesNo = ({ const isRequired = inputProps['aria-required'] !== false && inputProps.required !== false // consumer must explicitly say this field is not required, otherwise we assume aria-required - + let isRequiredLabel + if (showRequiredOptionalLabel) { + if (isRequired) { + isRequiredLabel = 'Required' + } else { + isRequiredLabel = 'Optional' + } + } return (
- {isRequired ? 'Required' : 'Optional'} + {isRequiredLabel} {showError && {meta.error}} {hint && ( diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx index 8e4facd193..d217f7c410 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.test.tsx @@ -51,8 +51,13 @@ describe('ContractDetails', () => { }, } ) - - expect(screen.getByText(/All fields are required/)).toBeInTheDocument() + expect( + screen.queryByText(/All fields are required/) + ).not.toBeInTheDocument() + const requiredLabels = await screen.findAllByText('Required') + expect(requiredLabels).toHaveLength(6) + const optionalLabels = await screen.queryAllByText('Optional') + expect(optionalLabels).toHaveLength(0) }) describe('Contract documents file upload', () => { diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index 1995959d84..fad844c1bc 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -87,6 +87,8 @@ describe('RateDetails', () => { }) it('displays correct form guidance', async () => { + ldUseClientSpy({ 'supporting-docs-by-rate': true }) + renderWithProviders( { } ) expect( - screen.getByText(/All fields are required/) - ).toBeInTheDocument() + screen.queryByText(/All fields are required/) + ).not.toBeInTheDocument() + const requiredLabels = await screen.findAllByText('Required') + expect(requiredLabels).toHaveLength(6) + const optionalLabels = await screen.queryAllByText('Optional') + expect(optionalLabels).toHaveLength(1) }) it('loads with empty rate type and document upload fields visible', async () => { @@ -1677,7 +1683,7 @@ describe('RateDetails', () => { 'Upload one rate certification document' ) const supportingDocsInput = screen.getByLabelText( - 'Upload supporting documents (optional)' + 'Upload supporting documents' ) const backButton = screen.getByRole('button', { name: 'Back', diff --git a/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx b/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx index d5ae6f73ca..05d5d600e8 100644 --- a/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx +++ b/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx @@ -313,6 +313,9 @@ export const SubmissionType = ({
Submission type {showFormAlert && } + + All fields are required + {shouldValidate && ( - - Required - {showFieldErrors( errors.populationCovered ) && ( @@ -419,11 +417,6 @@ export const SubmissionType = ({ legend="Choose a submission type" id="submissionType" > - - Required - {showFieldErrors(errors.submissionType) && ( {errors.submissionType} @@ -474,11 +467,6 @@ export const SubmissionType = ({ legend="Contract action type" id="contractType" > - - Required - {showFieldErrors(errors.contractType) && ( {errors.contractType} @@ -509,7 +497,6 @@ export const SubmissionType = ({ id="riskBasedContract" name="riskBasedContract" label="Is this a risk-based contract?" - aria-required hint="See 42 CFR § 438.2" showError={showFieldErrors( errors.riskBasedContract From 04ae2874dfc26c1663a0d4f6bf47813f36b5fec5 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Tue, 12 Sep 2023 20:57:11 -0400 Subject: [PATCH 14/23] update styling --- .../SingleRateCert/SingleRateCert.tsx | 17 ++++++++++++++--- .../StateSubmissionForm.module.scss | 4 ++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index 73919370c6..bde0bc6673 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -8,6 +8,7 @@ import { Label, Link, } from '@trussworks/react-uswds' +import classnames from 'classnames' import { ActuaryContact, RateCapitationType, @@ -341,14 +342,24 @@ export const SingleRateCert = ({ className={styles.radioGroup} legend={
-

+

Does the actuary certify capitation rates specific to each rate cell or a rate range?

- + Required -

+

See 42 CFR §§ 438.4(b) and 438.4(c)

diff --git a/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss b/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss index 0c312595a9..6bb35fd288 100644 --- a/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss +++ b/services/app-web/src/pages/StateSubmission/StateSubmissionForm.module.scss @@ -133,6 +133,10 @@ .legendSubHeader { font-weight: normal; + &.requiredOptionalText { + margin-bottom: units(2); + } + } .guidanceTextBlock{ From cfd80fa404284b03c62ab50b6d97fe2811ae33cf Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Wed, 13 Sep 2023 08:51:35 -0400 Subject: [PATCH 15/23] add correct file types for supporting rate docs --- .../src/components/FileUpload/constants.ts | 3 +++ .../app-web/src/components/FileUpload/index.ts | 1 + .../RateDetails/SingleRateCert/SingleRateCert.tsx | 15 ++++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/services/app-web/src/components/FileUpload/constants.ts b/services/app-web/src/components/FileUpload/constants.ts index cec25bc027..9c122cff7c 100644 --- a/services/app-web/src/components/FileUpload/constants.ts +++ b/services/app-web/src/components/FileUpload/constants.ts @@ -6,3 +6,6 @@ export const ACCEPTED_SUBMISSION_FILE_TYPES = export const ACCEPTED_RATE_CERTIFICATION_FILE_TYPES = 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document' + +export const ACCEPTED_RATE_SUPPORTING_DOCS_FILE_TYPES = + 'application/pdf,text/csv,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel.sheet.macroEnabled.12' diff --git a/services/app-web/src/components/FileUpload/index.ts b/services/app-web/src/components/FileUpload/index.ts index 8bffadc4b8..85ad08b2a6 100644 --- a/services/app-web/src/components/FileUpload/index.ts +++ b/services/app-web/src/components/FileUpload/index.ts @@ -6,6 +6,7 @@ export { FileUpload } from './FileUpload' export { ACCEPTED_SUBMISSION_FILE_TYPES, ACCEPTED_RATE_CERTIFICATION_FILE_TYPES, + ACCEPTED_RATE_SUPPORTING_DOCS_FILE_TYPES, } from './constants' export { hasNoLoadingFiles, diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index bde0bc6673..a2947528b4 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -25,7 +25,7 @@ import { import styles from '../../StateSubmissionForm.module.scss' import { formatUserInputDate, isDateRangeEmpty } from '../../../../formHelpers' import { - ACCEPTED_SUBMISSION_FILE_TYPES, + ACCEPTED_RATE_SUPPORTING_DOCS_FILE_TYPES, ACCEPTED_RATE_CERTIFICATION_FILE_TYPES, } from '../../../../components/FileUpload' import { useS3 } from '../../../../contexts/S3Context' @@ -125,10 +125,11 @@ export const SingleRateCert = ({ featureFlags.PACKAGES_WITH_SHARED_RATES.flag, featureFlags.PACKAGES_WITH_SHARED_RATES.defaultValue ) - const supportingDocsByRate = ldClient?.variation( - featureFlags.SUPPORTING_DOCS_BY_RATE.flag, - featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue - ) + const supportingDocsByRate = true + // const supportingDocsByRate = ldClient?.variation( + // featureFlags.SUPPORTING_DOCS_BY_RATE.flag, + // featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue + // ) // page level setup const { handleDeleteFile, handleUploadFile, handleScanFile } = useS3() @@ -244,11 +245,11 @@ export const SingleRateCert = ({ This input only accepts PDF, CSV, DOC, DOCX, - XLS, XLSX, XLSM files. + XLS, XLSX files. } - accept={ACCEPTED_SUBMISSION_FILE_TYPES} + accept={ACCEPTED_RATE_SUPPORTING_DOCS_FILE_TYPES} initialItems={rateInfo.supportingDocuments} uploadFile={(file) => handleUploadFile(file, 'HEALTH_PLAN_DOCS') From c930bd7462d6b936d6a2392e9f389a624c7ef6f8 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 14 Sep 2023 10:08:10 -0400 Subject: [PATCH 16/23] clean up single rate cert file --- .../RateDetails/SingleRateCert/SingleRateCert.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx index a2947528b4..c0ab0ee735 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/SingleRateCert/SingleRateCert.tsx @@ -125,11 +125,10 @@ export const SingleRateCert = ({ featureFlags.PACKAGES_WITH_SHARED_RATES.flag, featureFlags.PACKAGES_WITH_SHARED_RATES.defaultValue ) - const supportingDocsByRate = true - // const supportingDocsByRate = ldClient?.variation( - // featureFlags.SUPPORTING_DOCS_BY_RATE.flag, - // featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue - // ) + const supportingDocsByRate = ldClient?.variation( + featureFlags.SUPPORTING_DOCS_BY_RATE.flag, + featureFlags.SUPPORTING_DOCS_BY_RATE.defaultValue + ) // page level setup const { handleDeleteFile, handleUploadFile, handleScanFile } = useS3() From 678779e628bd1316475d08431d9e57a94e77761c Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 14 Sep 2023 11:22:23 -0400 Subject: [PATCH 17/23] ensure file upload only shows required/optional contract and rate pages --- .../src/components/FileUpload/FileUpload.tsx | 14 ++++++++++++-- .../ContractDetails/ContractDetails.tsx | 1 + .../RateDetails/SingleRateCert/SingleRateCert.tsx | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/services/app-web/src/components/FileUpload/FileUpload.tsx b/services/app-web/src/components/FileUpload/FileUpload.tsx index 86504a0799..5a464c991c 100644 --- a/services/app-web/src/components/FileUpload/FileUpload.tsx +++ b/services/app-web/src/components/FileUpload/FileUpload.tsx @@ -33,6 +33,7 @@ export type FileUploadProps = { hint?: React.ReactNode initialItems?: FileItemT[] isLabelVisible?: boolean + showRequiredOptionalLabel?: boolean uploadFile: (file: File) => Promise scanFile?: (key: string) => Promise // optional function to be called after uploading (used for scanning) deleteFile: (key: string) => Promise @@ -61,9 +62,9 @@ export const FileUpload = ({ uploadFile, scanFile, deleteFile, - // ariaRequired, onFileItemsUpdate, isContractOnly, + showRequiredOptionalLabel = false, shouldDisplayMissingCategoriesError = false, innerInputRef, ...inputProps @@ -420,13 +421,22 @@ export const FileUpload = ({ fileItems.length )} added ` + let isRequiredLabel + if (showRequiredOptionalLabel) { + if (isRequired) { + isRequiredLabel = 'Required' + } else { + isRequiredLabel = 'Optional' + } + } + return ( - {isRequired ? 'Required' : 'Optional'} + {isRequiredLabel} {error} diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx index 251dd665ef..fcc2bd323d 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx @@ -522,6 +522,7 @@ export const ContractDetails = ({ label="Upload contract" renderMode="list" aria-required + showRequiredOptionalLabel={true} error={documentsErrorMessage} hint={ @@ -222,6 +223,7 @@ export const SingleRateCert = ({ label="Upload supporting documents" renderMode="list" aria-required={false} + showRequiredOptionalLabel={true} error={showFieldErrors('supportingDocuments')} hint={ From 2f64d62b427016fd89c171f14ab9443dd8df0cd7 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 14 Sep 2023 12:31:58 -0400 Subject: [PATCH 18/23] remove the showRequiredOptionalLabel prop --- .../src/components/FileUpload/FileUpload.tsx | 13 +------------ .../components/Form/FieldTextarea/FieldTextarea.tsx | 12 +----------- .../src/components/Form/FieldYesNo/FieldYesNo.tsx | 13 ++----------- .../ContractDetails/ContractDetails.tsx | 1 - .../RateDetails/SingleRateCert/SingleRateCert.tsx | 2 -- 5 files changed, 4 insertions(+), 37 deletions(-) diff --git a/services/app-web/src/components/FileUpload/FileUpload.tsx b/services/app-web/src/components/FileUpload/FileUpload.tsx index 5a464c991c..aaab067fbe 100644 --- a/services/app-web/src/components/FileUpload/FileUpload.tsx +++ b/services/app-web/src/components/FileUpload/FileUpload.tsx @@ -33,7 +33,6 @@ export type FileUploadProps = { hint?: React.ReactNode initialItems?: FileItemT[] isLabelVisible?: boolean - showRequiredOptionalLabel?: boolean uploadFile: (file: File) => Promise scanFile?: (key: string) => Promise // optional function to be called after uploading (used for scanning) deleteFile: (key: string) => Promise @@ -64,7 +63,6 @@ export const FileUpload = ({ deleteFile, onFileItemsUpdate, isContractOnly, - showRequiredOptionalLabel = false, shouldDisplayMissingCategoriesError = false, innerInputRef, ...inputProps @@ -421,22 +419,13 @@ export const FileUpload = ({ fileItems.length )} added ` - let isRequiredLabel - if (showRequiredOptionalLabel) { - if (isRequired) { - isRequiredLabel = 'Required' - } else { - isRequiredLabel = 'Optional' - } - } - return ( - {isRequiredLabel} + {isRequired ? 'Required' : 'Optional'} {error} diff --git a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx index 9f4b30c7a1..c207559a10 100644 --- a/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx +++ b/services/app-web/src/components/Form/FieldTextarea/FieldTextarea.tsx @@ -21,7 +21,6 @@ export type TextAreaProps = { hint?: React.ReactNode error?: string showError: boolean - showRequiredOptionalLabel?: boolean name: string } & JSX.IntrinsicElements['textarea'] @@ -33,7 +32,6 @@ export const FieldTextarea = ({ showError, name, onBlur, - showRequiredOptionalLabel = false, ...inputProps }: TextAreaProps): React.ReactElement => { const [field, meta] = useField({ name }) @@ -49,21 +47,13 @@ export const FieldTextarea = ({ if (onBlur) onBlur(e) } - let isRequiredLabel - if (showRequiredOptionalLabel) { - if (isRequired) { - isRequiredLabel = 'Required' - } else { - isRequiredLabel = 'Optional' - } - } return ( - {isRequiredLabel} + {isRequired ? 'Required' : 'Optional'} {showError && {meta.error}} {hint && ( diff --git a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx index 0bf2926d47..30ed865016 100644 --- a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx +++ b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx @@ -22,7 +22,6 @@ export type FieldYesNoProps = { label: string hint?: React.ReactNode showError?: boolean - showRequiredOptionalLabel?: boolean id: string variant?: 'TOPLEVEL' | 'SUBHEAD' // subhead variant used for nested fields yes/no fields under an overarching heading } & React.JSX.IntrinsicElements['input'] @@ -32,7 +31,6 @@ export const FieldYesNo = ({ label, hint, showError = false, - showRequiredOptionalLabel = false, variant = 'TOPLEVEL', id, className, @@ -49,14 +47,7 @@ export const FieldYesNo = ({ const isRequired = inputProps['aria-required'] !== false && inputProps.required !== false // consumer must explicitly say this field is not required, otherwise we assume aria-required - let isRequiredLabel - if (showRequiredOptionalLabel) { - if (isRequired) { - isRequiredLabel = 'Required' - } else { - isRequiredLabel = 'Optional' - } - } + return (
- {isRequiredLabel} + {isRequired ? 'Required' : 'Optional'} {showError && {meta.error}} {hint && ( diff --git a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx index fcc2bd323d..251dd665ef 100644 --- a/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx +++ b/services/app-web/src/pages/StateSubmission/ContractDetails/ContractDetails.tsx @@ -522,7 +522,6 @@ export const ContractDetails = ({ label="Upload contract" renderMode="list" aria-required - showRequiredOptionalLabel={true} error={documentsErrorMessage} hint={ @@ -223,7 +222,6 @@ export const SingleRateCert = ({ label="Upload supporting documents" renderMode="list" aria-required={false} - showRequiredOptionalLabel={true} error={showFieldErrors('supportingDocuments')} hint={ From 0a3c8610e9dda81322cb9510560b7e0ccabfea7b Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Thu, 14 Sep 2023 13:56:39 -0400 Subject: [PATCH 19/23] add required labels to the submission type page --- .../Form/FieldYesNo/FieldYesNo.module.scss | 8 +++++++ .../SubmissionType/SubmissionType.test.tsx | 5 ++++- .../SubmissionType/SubmissionType.tsx | 22 ++++++++++++++++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.module.scss b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.module.scss index 9c8ad60c96..cde14abc41 100644 --- a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.module.scss +++ b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.module.scss @@ -1,3 +1,6 @@ +@import '../../../styles/uswdsImports.scss'; +@import '../../../styles/custom.scss'; + .optionsContainer { display: flex; } @@ -18,3 +21,8 @@ .no { margin-left: 3em; } + +.requiredOptionalText { + display: block; + color: $theme-color-hint; +} \ No newline at end of file diff --git a/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.test.tsx b/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.test.tsx index f7d0d16a81..d858a96b9a 100644 --- a/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.test.tsx +++ b/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.test.tsx @@ -30,7 +30,10 @@ describe('SubmissionType', () => { }, }) - expect(screen.getByText(/All fields are required/)).toBeInTheDocument() + const requiredLabels = await screen.findAllByText('Required') + expect(requiredLabels).toHaveLength(6) + const optionalLabels = await screen.queryAllByText('Optional') + expect(optionalLabels).toHaveLength(0) }) it('displays submission type form when expected', async () => { diff --git a/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx b/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx index 05d5d600e8..f9e5d5211b 100644 --- a/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx +++ b/services/app-web/src/pages/StateSubmission/SubmissionType/SubmissionType.tsx @@ -313,9 +313,6 @@ export const SubmissionType = ({
Submission type {showFormAlert && } - - All fields are required - {shouldValidate && ( + + Required + {showFieldErrors( errors.populationCovered ) && ( @@ -395,6 +397,9 @@ export const SubmissionType = ({ + + Required + {showFieldErrors(errors.programIDs) && ( {errors.programIDs} @@ -417,6 +422,11 @@ export const SubmissionType = ({ legend="Choose a submission type" id="submissionType" > + + Required + {showFieldErrors(errors.submissionType) && ( {errors.submissionType} @@ -467,6 +477,11 @@ export const SubmissionType = ({ legend="Contract action type" id="contractType" > + + Required + {showFieldErrors(errors.contractType) && ( {errors.contractType} @@ -497,6 +512,7 @@ export const SubmissionType = ({ id="riskBasedContract" name="riskBasedContract" label="Is this a risk-based contract?" + aria-required hint="See 42 CFR § 438.2" showError={showFieldErrors( errors.riskBasedContract From 1a1a5549fb1f198b5aad05acc735dc2bb6281e6a Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 15 Sep 2023 10:55:13 -0400 Subject: [PATCH 20/23] add required/optional labels to the Contacts page --- .../components/Form/FieldYesNo/FieldYesNo.tsx | 9 ++++---- .../Contacts/ActuaryContactFields.tsx | 9 +------- .../Contacts/Contacts.test.tsx | 15 +++++++----- .../StateSubmission/Contacts/Contacts.tsx | 23 ++++++++++++------- .../ContractDetails/ContractDetails.tsx | 10 ++++---- .../SingleRateCert/SingleRateCert.tsx | 1 - 6 files changed, 35 insertions(+), 32 deletions(-) diff --git a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx index 30ed865016..83f075e209 100644 --- a/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx +++ b/services/app-web/src/components/Form/FieldYesNo/FieldYesNo.tsx @@ -47,7 +47,6 @@ export const FieldYesNo = ({ const isRequired = inputProps['aria-required'] !== false && inputProps.required !== false // consumer must explicitly say this field is not required, otherwise we assume aria-required - return (
- - {isRequired ? 'Required' : 'Optional'} - + {inputProps['aria-required'] !== undefined && ( + + {isRequired ? 'Required' : 'Optional'} + + )} {showError && {meta.error}} {hint && (
- isRequired: boolean shouldValidate: boolean fieldNamePrefix: string fieldSetLegend?: string @@ -25,7 +24,6 @@ export const ActuaryContactFields = ({ errors, shouldValidate, fieldNamePrefix, - isRequired, fieldSetLegend = 'Actuary Contact', inputRef, }: ActuaryFormPropType) => { @@ -38,14 +36,11 @@ export const ActuaryContactFields = ({ return (
- - {isRequired ? 'Required' : 'Optional'} - + Required { await waitFor(() => { expect(screen.getByTestId('state-contacts')).toBeInTheDocument() + expect(screen.getByText('State contacts 1')).toBeInTheDocument() expect(screen.getByLabelText('Name')).toBeInTheDocument() expect(screen.getByLabelText('Title/Role')).toBeInTheDocument() expect(screen.getByLabelText('Email')).toBeInTheDocument() @@ -57,9 +58,10 @@ describe('Contacts', () => { } ) - expect( - screen.getByText(/A state contact is required/) - ).toBeInTheDocument() + const requiredLabels = await screen.findAllByText('Required') + expect(requiredLabels).toHaveLength(1) + const optionalLabels = await screen.queryAllByText('Optional') + expect(optionalLabels).toHaveLength(0) }) it('displays correct form guidance for contract and rates submission', async () => { @@ -75,9 +77,10 @@ describe('Contacts', () => { } ) - expect( - screen.getByText('A state contact is required') - ).toBeInTheDocument() + const requiredLabels = await screen.findAllByText('Required') + expect(requiredLabels).toHaveLength(2) + const optionalLabels = await screen.queryAllByText('Optional') + expect(optionalLabels).toHaveLength(0) expect( screen.getByText('Additional Actuary Contacts') ).toBeInTheDocument() diff --git a/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx b/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx index 1c864b6240..26a7b9b665 100644 --- a/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx +++ b/services/app-web/src/pages/StateSubmission/Contacts/Contacts.tsx @@ -228,10 +228,9 @@ export const Contacts = ({ // Also handles the difference between State Contacts and Actuary Contacts const handleContactLegend = (index: number, contactText: string) => { const count = index + 1 - const required = index ? '' : ' (required)' if (contactText === 'State') { - return `State contacts ${count} ${required}` + return `State contacts ${count}` } if (contactText === 'Actuary') { @@ -297,9 +296,6 @@ export const Contacts = ({ communication about this submission.

State contacts - - A state contact is required - {shouldValidate && ( + + Required + + + Required + {showFieldErrors(`True`) && ( + + Required + {showFieldErrors( errors.contractExecutionStatus ) && ( @@ -575,11 +580,6 @@ export const ContractDetails = ({ {errors.contractExecutionStatus} )} - - Required - Date: Fri, 15 Sep 2023 10:56:07 -0400 Subject: [PATCH 21/23] cypress re-run From 1d374ecc541a4e5868c1c43d4f6c6509f71b4ef5 Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 15 Sep 2023 16:02:18 -0400 Subject: [PATCH 22/23] Add required/optio nal label to the shared package rates fields --- .../PackagesWithSharedRates/PackagesWithSharedRates.tsx | 4 ++++ .../pages/StateSubmission/RateDetails/RateDetails.test.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/PackagesWithSharedRates/PackagesWithSharedRates.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/PackagesWithSharedRates/PackagesWithSharedRates.tsx index cd437ba916..1a885a260b 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/PackagesWithSharedRates/PackagesWithSharedRates.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/PackagesWithSharedRates/PackagesWithSharedRates.tsx @@ -120,6 +120,7 @@ export const PackagesWithSharedRates = ({ name={`${fieldNamePrefix}.hasSharedRateCert`} label="Was this rate certification uploaded to any other submissions?" showError={Boolean(showFieldErrors('hasSharedRateCert'))} + aria-required /> {getIn(values, `${fieldNamePrefix}.hasSharedRateCert`) === @@ -131,6 +132,9 @@ export const PackagesWithSharedRates = ({ Please select the submissions that also contain this rate certification. + + Required + { screen.queryByText(/All fields are required/) ).not.toBeInTheDocument() const requiredLabels = await screen.findAllByText('Required') - expect(requiredLabels).toHaveLength(6) + expect(requiredLabels).toHaveLength(7) const optionalLabels = await screen.queryAllByText('Optional') expect(optionalLabels).toHaveLength(1) }) From 674ed4f29d8d69e63744fcbafb4d03e9f3aed9ce Mon Sep 17 00:00:00 2001 From: pearl-truss Date: Fri, 15 Sep 2023 16:22:42 -0400 Subject: [PATCH 23/23] fix unit test --- .../src/pages/StateSubmission/RateDetails/RateDetails.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx index 016a68bd7b..fad844c1bc 100644 --- a/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx +++ b/services/app-web/src/pages/StateSubmission/RateDetails/RateDetails.test.tsx @@ -105,7 +105,7 @@ describe('RateDetails', () => { screen.queryByText(/All fields are required/) ).not.toBeInTheDocument() const requiredLabels = await screen.findAllByText('Required') - expect(requiredLabels).toHaveLength(7) + expect(requiredLabels).toHaveLength(6) const optionalLabels = await screen.queryAllByText('Optional') expect(optionalLabels).toHaveLength(1) })