@@ -164,14 +166,18 @@ export const ReviewSubmitV2 = (): React.ReactElement => {
- {/* // if the session is expiring, close this modal so the countdown modal can appear
-
*/}
+ />
>
)
diff --git a/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/SubmissionTypeSummarySectionV2.tsx b/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/SubmissionTypeSummarySectionV2.tsx
index 18c70e37ea..bf31fc0259 100644
--- a/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/SubmissionTypeSummarySectionV2.tsx
+++ b/services/app-web/src/pages/StateSubmission/ReviewSubmit/V2/ReviewSubmit/SubmissionTypeSummarySectionV2.tsx
@@ -8,9 +8,8 @@ import {
ContractTypeRecord,
PopulationCoveredRecord,
} from '../../../../../constants/healthPlanPackages'
-import {
- getLastContractSubmission,
-} from '../../../../../gqlHelpers/contractsAndRates'
+import { GenericErrorPage } from '../../../../Errors/GenericErrorPage'
+import { getLatestContractFormData } from '../../../../../gqlHelpers/contractsAndRates'
import { Program, Contract } from '../../../../../gen/gqlClient'
import { usePreviousSubmission } from '../../../../../hooks/usePreviousSubmission'
import { booleanAsYesNoUserValue } from '../../../../../components/Form/FieldYesNo/FieldYesNo'
@@ -37,15 +36,14 @@ export const SubmissionTypeSummarySectionV2 = ({
submissionName,
}: SubmissionTypeSummarySectionV2Props): React.ReactElement => {
const isPreviousSubmission = usePreviousSubmission()
- const contractFormData =
- contract.draftRevision?.formData ||
- getLastContractSubmission(contract)?.contractRevision.formData
+ const contractFormData = getLatestContractFormData(contract)
+ if (!contractFormData) return
const programNames = statePrograms
- .filter((p) => contractFormData?.programIDs.includes(p.id))
+ .filter((p) => contractFormData.programIDs.includes(p.id))
.map((p) => p.name)
const isSubmitted = contract.status === 'SUBMITTED'
- // const isRiskBasedContract = contractFormData.riskBasedContract ===
+
return (
{contractFormData && (
- )}
- {(
-
+ id="submissionType"
+ label="Submission type"
+ explainMissingData={!isSubmitted}
+ children={
+ SubmissionTypeRecord[
+ contractFormData.submissionType
+ ]
+ }
+ />
)}
- {contractFormData && contractFormData?.riskBasedContract !== null && (
+ {
- )}
+ }
+ {contractFormData &&
+ contractFormData.riskBasedContract !== null && (
+
+ )}
{contractFormData && (
+ id="populationCoverage"
+ label="Which populations does this contract action cover?"
+ explainMissingData={!isSubmitted}
+ children={
+ contractFormData.populationCovered &&
+ PopulationCoveredRecord[
+ contractFormData.populationCovered
+ ]
+ }
+ />
)}
@@ -137,11 +136,13 @@ export const SubmissionTypeSummarySectionV2 = ({
{contractFormData && (
+ id="submissionDescription"
+ label="Submission description"
+ explainMissingData={!isSubmitted}
+ children={
+ contractFormData.submissionDescription
+ }
+ />
)}
diff --git a/services/app-web/src/pages/SubmissionSummary/V2/SubmissionSummaryV2.tsx b/services/app-web/src/pages/SubmissionSummary/V2/SubmissionSummaryV2.tsx
new file mode 100644
index 0000000000..0bbcd1d6c5
--- /dev/null
+++ b/services/app-web/src/pages/SubmissionSummary/V2/SubmissionSummaryV2.tsx
@@ -0,0 +1,299 @@
+import {
+ GridContainer,
+ Icon,
+ Link,
+ ModalRef,
+ ModalToggleButton,
+} from '@trussworks/react-uswds'
+import React, { useEffect, useRef, useState } from 'react'
+import { NavLink } from 'react-router-dom'
+import { useAuth } from '../../../contexts/AuthContext'
+import { packageName } from '../../../common-code/healthPlanFormDataType'
+import { ContractDetailsSummarySectionV2 } from '../../StateSubmission/ReviewSubmit/V2/ReviewSubmit/ContractDetailsSummarySectionV2'
+import { ContactsSummarySection } from '../../StateSubmission/ReviewSubmit/V2/ReviewSubmit/ContactsSummarySectionV2'
+import { RateDetailsSummarySectionV2 } from '../../StateSubmission/ReviewSubmit/V2/ReviewSubmit/RateDetailsSummarySectionV2'
+import { SubmissionTypeSummarySectionV2 } from '../../StateSubmission/ReviewSubmit/V2/ReviewSubmit/SubmissionTypeSummarySectionV2'
+import {
+ SubmissionUnlockedBanner,
+ SubmissionUpdatedBanner,
+ DocumentWarningBanner,
+} from '../../../components'
+import { Loading } from '../../../components'
+import { usePage } from '../../../contexts/PageContext'
+import {
+ useFetchContractQuery,
+ UpdateInformation,
+} from '../../../gen/gqlClient'
+import { ErrorForbiddenPage } from '../../Errors/ErrorForbiddenPage'
+import { Error404 } from '../../Errors/Error404Page'
+import { GenericErrorPage } from '../../Errors/GenericErrorPage'
+import styles from '../SubmissionSummary.module.scss'
+import { ChangeHistoryV2 } from '../../../components/ChangeHistory/ChangeHistoryV2'
+import { UnlockSubmitModalV2 } from '../../../components/Modal/V2/UnlockSubmitModalV2'
+import { useLDClient } from 'launchdarkly-react-client-sdk'
+import { featureFlags } from '../../../common-code/featureFlags'
+import { RoutesRecord } from '../../../constants'
+import { useRouteParams } from '../../../hooks'
+
+function UnlockModalButton({
+ disabled,
+ modalRef,
+}: {
+ disabled: boolean
+ modalRef: React.RefObject
+}) {
+ return (
+
+ Unlock submission
+
+ )
+}
+
+export const SubmissionSummaryV2 = (): React.ReactElement => {
+ // Page level state
+ const { updateHeading } = usePage()
+ const modalRef = useRef(null)
+ const [pkgName, setPkgName] = useState(undefined)
+ const [documentError, setDocumentError] = useState(false)
+ const { loggedInUser } = useAuth()
+
+ useEffect(() => {
+ updateHeading({ customHeading: pkgName })
+ }, [pkgName, updateHeading])
+ const { id } = useRouteParams()
+
+ const ldClient = useLDClient()
+ const showQuestionResponse = ldClient?.variation(
+ featureFlags.CMS_QUESTIONS.flag,
+ featureFlags.CMS_QUESTIONS.defaultValue
+ )
+
+ // API requests
+ const {
+ data: fetchContractData,
+ loading: fetchContractLoading,
+ error: fetchContractError,
+ } = useFetchContractQuery({
+ variables: {
+ input: {
+ contractID: id ?? 'unknown-contract',
+ },
+ },
+ })
+ const contract = fetchContractData?.fetchContract.contract
+ if (fetchContractLoading) {
+ return (
+
+
+
+ )
+ } else if (fetchContractError || !contract) {
+ //error handling for a state user that tries to access rates for a different state
+ if (
+ fetchContractError?.graphQLErrors[0]?.extensions?.code ===
+ 'FORBIDDEN'
+ ) {
+ return (
+
+ )
+ } else if (
+ fetchContractError?.graphQLErrors[0]?.extensions?.code ===
+ 'NOT_FOUND'
+ ) {
+ return
+ } else {
+ return
+ }
+ }
+ const isCMSUser = loggedInUser?.role === 'CMS_USER'
+ const submissionStatus = contract.status
+ const statePrograms = contract.state.programs
+ const contractFormData =
+ contract.draftRevision?.formData ||
+ contract.packageSubmissions[0].contractRevision.formData
+ const programIDs = contractFormData.programIDs
+ const programs = statePrograms.filter((program) =>
+ programIDs.includes(program.id)
+ )
+ // set the page heading
+ const name = packageName(
+ contract.stateCode,
+ contract.stateNumber,
+ contractFormData.programIDs,
+ programs
+ )
+ if (pkgName !== name) {
+ setPkgName(name)
+ }
+
+ // Get the correct update info depending on the submission status
+ let updateInfo: UpdateInformation | undefined = undefined
+ if (submissionStatus === 'UNLOCKED' || submissionStatus === 'RESUBMITTED') {
+ updateInfo =
+ (submissionStatus === 'UNLOCKED'
+ ? contract.packageSubmissions[0].submittedRevisions.find(
+ (rev) => rev.unlockInfo
+ )?.unlockInfo
+ : contract.packageSubmissions[0].contractRevision.submitInfo) ||
+ undefined
+ }
+
+ const isContractActionAndRateCertification =
+ contractFormData?.submissionType === 'CONTRACT_AND_RATES'
+
+ const handleDocumentDownloadError = (error: boolean) =>
+ setDocumentError(error)
+
+ const editOrAddMCCRSID = contract.mccrsID
+ ? 'Edit MC-CRS number'
+ : 'Add MC-CRS record number'
+
+ return (
+
+
+ This is the V2 page of the SubmissionSummary
+
+
+ {submissionStatus === 'UNLOCKED' && updateInfo && (
+
+ )}
+
+ {submissionStatus === 'RESUBMITTED' && updateInfo && (
+
+ )}
+
+ {documentError && (
+
+ )}
+
+ {!showQuestionResponse && (
+
+
+ {loggedInUser?.__typename === 'StateUser' ? (
+ Back to state dashboard
+ ) : (
+ Back to dashboard
+ )}
+
+ )}
+
+ {contract && statePrograms && (
+
+ {contract.mccrsID && (
+
+ MC-CRS record number:
+
+ {contract.mccrsID}
+
+
+ )}
+
+ {editOrAddMCCRSID}
+
+
+ ) : undefined
+ }
+ contract={contract}
+ submissionName={name}
+ headerChildComponent={
+ isCMSUser ? (
+
+ ) : undefined
+ }
+ statePrograms={statePrograms}
+ initiallySubmittedAt={contract.initiallySubmittedAt}
+ />
+ )}
+
+ {contract && (
+
+ )}
+
+ {contract &&
+ statePrograms &&
+ isContractActionAndRateCertification && (
+
+ )}
+
+ {contract && }
+
+ {contract && }
+ {contract && (
+
+ )}
+
+
+ )
+}
+
+export type SectionHeaderProps = {
+ header: string
+ submissionName?: boolean
+ href: string
+}
diff --git a/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts b/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts
index 83b77da14f..bc7166e547 100644
--- a/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts
+++ b/services/app-web/src/testHelpers/apolloMocks/contractPackageDataMock.ts
@@ -216,8 +216,10 @@ function mockContractWithLinkedRateDraft(
revisions: [],
state: mockMNState(),
stateNumber: 5,
+ parentContractID: 'foo-baz',
draftRevision: {
id: '123',
+ rateID: '456',
contractRevisions: [],
createdAt: new Date(),
updatedAt: new Date(),
@@ -384,4 +386,4 @@ function mockContractPackageSubmitted(
}
}
-export { mockContractPackageDraft, mockContractPackageSubmitted, mockContractWithLinkedRateDraft }
+export { mockContractPackageDraft, mockContractPackageSubmitted, mockContractWithLinkedRateDraft }
\ No newline at end of file