Skip to content
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

MR-3578 Fix Date Added document date bug #1827

Merged
merged 7 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const DemoListUploadSuccess = (): React.ReactElement => {
await fakeRequest<S3FileData>(true, resolveData)
return
}}
onFileItemsUpdate={() => console.log('Async load complete')}
onFileItemsUpdate={() => console.info('Async load complete')}
isContractOnly={false}
/>
)
Expand All @@ -50,7 +50,7 @@ export const DemoTableUploadSuccess = (): React.ReactElement => {
await fakeRequest<S3FileData>(true, resolveData)
return
}}
onFileItemsUpdate={() => console.log('Async load complete')}
onFileItemsUpdate={() => console.info('Async load complete')}
isContractOnly={false}
/>
)
Expand All @@ -74,7 +74,7 @@ export const DemoListUploadFailure = (): React.ReactElement => {
await fakeRequest<S3FileData>(true, resolveData)
return
}}
onFileItemsUpdate={() => console.log('Async load complete')}
onFileItemsUpdate={() => console.info('Async load complete')}
isContractOnly={false}
/>
)
Expand All @@ -98,7 +98,7 @@ export const DemoTableUploadFailure = (): React.ReactElement => {
await fakeRequest<S3FileData>(true, resolveData)
return
}}
onFileItemsUpdate={() => console.log('Async load complete')}
onFileItemsUpdate={() => console.info('Async load complete')}
isContractOnly={false}
/>
)
Expand All @@ -122,7 +122,7 @@ export const DemoListScanFailure = (): React.ReactElement => {
await fakeRequest<S3FileData>(true, resolveData)
return
}}
onFileItemsUpdate={() => console.log('Async load complete')}
onFileItemsUpdate={() => console.info('Async load complete')}
isContractOnly={false}
/>
)
Expand All @@ -146,7 +146,7 @@ export const DemoTableScanFailure = (): React.ReactElement => {
await fakeRequest<S3FileData>(true, resolveData)
return
}}
onFileItemsUpdate={() => console.log('Async load complete')}
onFileItemsUpdate={() => console.info('Async load complete')}
isContractOnly={false}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
const Template: Story<FieldCheckboxProps> = (args) => (
<Formik
initialValues={{ input1: '' }}
onSubmit={(e) => console.log('submitted')}
onSubmit={(e) => console.info('submitted')}
>
<FieldCheckbox {...args} />
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Template: Story<FieldDropdownProps> = (args) => (
initialValues={{ program: '' }}
validationSchema={schema}
validateOnMount={true}
onSubmit={(e) => console.log('submitted')}
onSubmit={(e) => console.info('submitted')}
>
<FieldDropdown {...args} />
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
const Template: Story<FieldRadioProps> = (args) => (
<Formik
initialValues={{ input1: '' }}
onSubmit={(e) => console.log('submitted')}
onSubmit={(e) => console.info('submitted')}
>
<FieldRadio {...args} />
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Template: Story<TextInputProps> = (args) => (
initialValues={{ submissionDescription: '' }}
validationSchema={schema}
validateOnMount={true}
onSubmit={(e) => console.log('submitted')}
onSubmit={(e) => console.info('submitted')}
>
<FieldTextInput {...args} />
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Template: Story<TextAreaProps> = (args) => (
initialValues={{ submissionDescription: '' }}
validationSchema={schema}
validateOnMount={true}
onSubmit={(e) => console.log('submitted')}
onSubmit={(e) => console.info('submitted')}
>
<FieldTextarea {...args} />
</Formik>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('ContractDetailsSummarySection', () => {

renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={testSubmission}
navigateTo="contract-details"
submissionName="MN-PMAP-0001"
Expand Down Expand Up @@ -66,6 +67,7 @@ describe('ContractDetailsSummarySection', () => {
it('can render state submission on summary page without errors (submission summary behavior)', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={{
...mockStateSubmission(),
status: 'SUBMITTED',
Expand All @@ -91,6 +93,7 @@ describe('ContractDetailsSummarySection', () => {
it('can render all contract details fields', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={mockContractAndRatesDraft()}
navigateTo="contract-details"
submissionName="MN-PMAP-0001"
Expand Down Expand Up @@ -127,6 +130,7 @@ describe('ContractDetailsSummarySection', () => {
it('displays correct effective dates text for base contract', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={mockStateSubmission()}
submissionName="MN-PMAP-0001"
/>
Expand All @@ -137,6 +141,7 @@ describe('ContractDetailsSummarySection', () => {
it('displays correct effective dates text for contract amendment', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={mockContractAndRatesDraft()}
submissionName="MN-PMAP-0001"
/>
Expand Down Expand Up @@ -179,6 +184,7 @@ describe('ContractDetailsSummarySection', () => {
}
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={testSubmission}
submissionName="MN-PMAP-0001"
/>
Expand Down Expand Up @@ -220,6 +226,7 @@ describe('ContractDetailsSummarySection', () => {
it('does not render supporting contract documents table when no documents exist', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={mockContractAndRatesDraft()}
submissionName="MN-PMAP-0001"
/>
Expand All @@ -235,6 +242,7 @@ describe('ContractDetailsSummarySection', () => {
it('does not render download all button when on previous submission', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={mockContractAndRatesDraft()}
submissionName="MN-PMAP-0001"
/>
Expand All @@ -249,6 +257,7 @@ describe('ContractDetailsSummarySection', () => {
it('renders federal authorities for a medicaid contract', async () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={{
...mockContractAndRatesDraft(),
// Add all medicaid federal authorities, as if medicaid contract being unlocked
Expand Down Expand Up @@ -289,6 +298,7 @@ describe('ContractDetailsSummarySection', () => {
it('renders federal authorities for a CHIP contract as expected, removing invalid authorities', async () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{ previousSubmissionDate: '01/01/01' }}
submission={{
...mockContractAndRatesDraft(),
populationCovered: 'CHIP',
Expand Down Expand Up @@ -330,6 +340,9 @@ describe('ContractDetailsSummarySection', () => {
it('renders provisions and MLR references for a medicaid amendment', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={mockContractAndRatesDraft()}
submissionName="MN-PMAP-0001"
/>
Expand All @@ -354,9 +367,7 @@ describe('ContractDetailsSummarySection', () => {
).toBeInTheDocument()

expect(
within(modifiedProvisions).getByText(
/Risk-sharing strategy/
)
within(modifiedProvisions).getByText(/Risk-sharing strategy/)
).toBeInTheDocument()
expect(
within(modifiedProvisions).getByText(
Expand Down Expand Up @@ -425,6 +436,9 @@ describe('ContractDetailsSummarySection', () => {
it('renders provisions and MLR references for a medicaid base contract', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={mockContractAndRatesDraft({
contractType: 'BASE',
})}
Expand All @@ -447,9 +461,7 @@ describe('ContractDetailsSummarySection', () => {
).toBeInTheDocument()

expect(
within(modifiedProvisions).getByText(
/Risk-sharing strategy/
)
within(modifiedProvisions).getByText(/Risk-sharing strategy/)
).toBeInTheDocument()
expect(
within(modifiedProvisions).getByText(
Expand All @@ -475,6 +487,9 @@ describe('ContractDetailsSummarySection', () => {
it('renders provisions with correct MLR references for CHIP amendment', () => {
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={{
...mockContractAndRatesDraft(),
populationCovered: 'CHIP',
Expand Down Expand Up @@ -554,6 +569,9 @@ describe('ContractDetailsSummarySection', () => {
}
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={contractWithUnansweredProvisions}
submissionName="MN-PMAP-0001"
navigateTo="contract-details"
Expand Down Expand Up @@ -602,6 +620,9 @@ describe('ContractDetailsSummarySection', () => {
}
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={contractWithUnansweredProvisions}
submissionName="MN-PMAP-0001"
navigateTo="contract-details"
Expand Down Expand Up @@ -650,6 +671,9 @@ describe('ContractDetailsSummarySection', () => {
}
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={contractWithUnansweredProvisions}
submissionName="MN-PMAP-0001"
/>,
Expand Down Expand Up @@ -701,6 +725,9 @@ describe('ContractDetailsSummarySection', () => {
}
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={contractWithAllUnmodifiedProvisions}
submissionName="MN-PMAP-0001"
navigateTo="contract-details"
Expand Down Expand Up @@ -760,6 +787,9 @@ describe('ContractDetailsSummarySection', () => {
}
renderWithProviders(
<ContractDetailsSummarySection
documentDateLookupTable={{
previousSubmissionDate: '01/01/01',
}}
submission={contractWithAllUnmodifiedProvisions}
submissionName="MN-PMAP-0001"
/>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useEffect, useState } from 'react'
import { DataDetail } from '../../../components/DataDetail'
import { SectionHeader } from '../../../components/SectionHeader'
import { UploadedDocumentsTable } from '../../../components/SubmissionSummarySection'
import { DocumentDateLookupTable } from '../../../pages/SubmissionSummary/SubmissionSummary'
import {
ContractExecutionStatusRecord,
FederalAuthorityRecord,
Expand Down Expand Up @@ -30,11 +29,12 @@ import {
HealthPlanFormDataType,
federalAuthorityKeysForCHIP,
} from '../../../common-code/healthPlanFormDataType'
import { DocumentDateLookupTableType } from '../../../documentHelpers/makeDocumentDateLookupTable'

export type ContractDetailsSummarySectionProps = {
submission: HealthPlanFormDataType
navigateTo?: string
documentDateLookupTable?: DocumentDateLookupTable
documentDateLookupTable: DocumentDateLookupTableType
isCMSUser?: boolean
submissionName: string
}
Expand Down Expand Up @@ -168,23 +168,31 @@ export const ContractDetailsSummarySection = ({
<DoubleColumnGrid>
<DataDetail
id="modifiedProvisions"
label={isBaseContract(submission)? "This contract action includes provisions related to the following" : "This contract action includes new or modified provisions related to the following"}
label={
isBaseContract(submission)
? 'This contract action includes provisions related to the following'
: 'This contract action includes new or modified provisions related to the following'
}
explainMissingData={
provisionsAreInvalid && !isSubmitted(submission)
}
>
{provisionsAreInvalid ? null : (
<DataDetailCheckboxList
list={modifiedProvisions}
dict={getProvisionDictionary(submission) }
dict={getProvisionDictionary(submission)}
displayEmptyList
/>
)}
</DataDetail>

<DataDetail
id="unmodifiedProvisions"
label={isBaseContract(submission)? "This contract action does NOT include provisions related to the following": "This contract action does NOT include new or modified provisions related to the following"}
label={
isBaseContract(submission)
? 'This contract action does NOT include provisions related to the following'
: 'This contract action does NOT include new or modified provisions related to the following'
}
explainMissingData={
provisionsAreInvalid && !isSubmitted(submission)
}
Expand All @@ -203,14 +211,13 @@ export const ContractDetailsSummarySection = ({
<UploadedDocumentsTable
documents={submission.contractDocuments}
documentDateLookupTable={documentDateLookupTable}
isCMSUser={isCMSUser}
caption="Contract"
documentCategory="Contract"
isEditing={isEditing}
/>
<UploadedDocumentsTable
documents={contractSupportingDocuments}
documentDateLookupTable={documentDateLookupTable}
isCMSUser={isCMSUser}
caption="Contract supporting documents"
documentCategory="Contract-supporting"
isSupportingDocuments
Expand Down
Loading
Loading