diff --git a/VAMobile/e2e/tests/utils.ts b/VAMobile/e2e/tests/utils.ts
index dc9ed7f3cd9..fdc41116f81 100644
--- a/VAMobile/e2e/tests/utils.ts
+++ b/VAMobile/e2e/tests/utils.ts
@@ -55,7 +55,6 @@ export const CommonE2eIdConstants = {
START_NEW_MESSAGE_BUTTON_ID: 'startNewMessageButtonTestID',
PRESCRIPTION_REFILL_BUTTON_TEXT: 'Start refill request',
HOME_ACTIVITY_HEADER_TEXT: 'Activity',
- CLAIM_PHASE_TOGGLE_TEXT: 'claimPhaseExpansion',
IN_APP_REVIEW_TOGGLE_TEXT: 'inAppReview',
CALL_VA_PHONE_NUMBER_ID: 'CallVATestID',
CALL_VA_TTY_PHONE_NUMBER_ID: 'CallTTYTestID',
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetails/ClaimDetails.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetails/ClaimDetails.test.tsx
deleted file mode 100644
index a8c009e7b77..00000000000
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetails/ClaimDetails.test.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import React from 'react'
-
-import { screen } from '@testing-library/react-native'
-
-import { context, mockNavProps, render } from 'testUtils'
-
-import ClaimDetails from './ClaimDetails'
-
-context('ClaimDetails', () => {
- beforeEach(() => {
- const props = mockNavProps({
- claim: {
- id: '600156928',
- type: 'evss_claims',
- attributes: {
- dateFiled: '2019-06-06',
- minEstDate: '2019-10-02',
- maxEstDate: '2019-12-11',
- phaseChangeDate: '2019-06-22',
- open: true,
- waiverSubmitted: false,
- documentsNeeded: true,
- developmentLetterSent: true,
- decisionLetterSent: true,
- phase: 3,
- everPhaseBack: false,
- currentPhaseBack: false,
- requestedDecision: false,
- claimType: 'Compensation',
- updatedAt: '2020-12-07T20:37:12.041Z',
- contentionList: ['Hearing Loss (Increase)'],
- vaRepresentative: 'AMERICAN LEGION',
- eventsTimeline: [
- {
- type: 'never_received_from_you_list',
- trackedItemId: 255455,
- description: 'New & material evidence needed - denied SC previously (PTSD)',
- displayName: 'Request 42',
- overdue: false,
- status: 'NO_LONGER_REQUIRED',
- uploaded: false,
- uploadsAllowed: false,
- openedDate: undefined,
- requestedDate: '2019-07-09',
- receivedDate: undefined,
- closedDate: '2019-08-08',
- suspenseDate: undefined,
- documents: [],
- uploadDate: '2019-08-08',
- date: '2019-08-08',
- },
- ],
- },
- },
- })
-
- render()
- })
-
- it('renders claim details', () => {
- expect(screen.getByText('Claim type')).toBeTruthy()
- expect(screen.getByText('Compensation')).toBeTruthy()
- expect(screen.getByText("What you've claimed")).toBeTruthy()
- expect(screen.getByText('Hearing Loss (Increase)')).toBeTruthy()
- expect(screen.getByText('Date received')).toBeTruthy()
- expect(screen.getByText('June 06, 2019')).toBeTruthy()
- expect(screen.getByText('Your representative for VA claims')).toBeTruthy()
- expect(screen.getByText('AMERICAN LEGION')).toBeTruthy()
- })
-})
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetails/ClaimDetails.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetails/ClaimDetails.tsx
deleted file mode 100644
index 4e6e1b862c6..00000000000
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetails/ClaimDetails.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import React from 'react'
-import { useTranslation } from 'react-i18next'
-
-import { ClaimData } from 'api/types'
-import { Box, TextArea, TextView, VABulletList } from 'components'
-import { NAMESPACE } from 'constants/namespaces'
-import { a11yLabelVA } from 'utils/a11yLabel'
-import { formatDateMMMMDDYYYY } from 'utils/formattingUtils'
-
-type ClaimDetailsProps = {
- claim: ClaimData
-}
-
-function ClaimDetails({ claim }: ClaimDetailsProps) {
- const { t } = useTranslation(NAMESPACE.COMMON)
- const { attributes } = claim
-
- const formattedDateFiled = formatDateMMMMDDYYYY(attributes?.dateFiled || '')
-
- return (
-
-
-
- )
-}
-
-export default ClaimDetails
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx
index 106b7966f41..a55b634cb3d 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.test.tsx
@@ -30,7 +30,6 @@ context('ClaimDetailsScreen', () => {
featureFlag: boolean = false,
claim?: Partial,
): void => {
- when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(featureFlag)
when(featureEnabled).calledWith('submitEvidenceExpansion').mockReturnValue(featureFlag)
let queriesData: QueriesData | undefined
if (claim) {
@@ -93,19 +92,7 @@ context('ClaimDetailsScreen', () => {
renderWithData(ClaimTypeConstants.ACTIVE, false, {
...claimData,
})
- await waitFor(() =>
- expect(screen.getByTestId('Step 1 of 5. completed. Claim received June 6, 2019')).toBeTruthy(),
- )
- })
-
- it('should display the ClaimDetails component', async () => {
- renderWithData(ClaimTypeConstants.ACTIVE, false, {
- ...claimData,
- })
- await waitFor(() => fireEvent.press(screen.getByText('Details')))
- await waitFor(() => fireEvent.press(screen.getByText('Details')))
-
- await waitFor(() => expect(screen.getByText('Claim type')).toBeTruthy())
+ await waitFor(() => expect(screen.getByTestId('Step 1 of 8. Claim received. Complete.')).toBeTruthy())
})
it('should display the Files component', async () => {
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx
index 2addf59ad21..00c2a44e74c 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimDetailsScreen.tsx
@@ -42,7 +42,6 @@ import { featureEnabled } from 'utils/remoteConfig'
import { screenContentAllowed } from 'utils/waygateConfig'
import NeedHelpData from '../NeedHelpData/NeedHelpData'
-import ClaimDetails from './ClaimDetails/ClaimDetails'
import ClaimFiles from './ClaimFiles/ClaimFiles'
import ClaimStatus from './ClaimStatus/ClaimStatus'
@@ -57,10 +56,7 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
const { t } = useTranslation(NAMESPACE.COMMON)
const scrollViewRef = useRef(null)
const navigateTo = useRouteNavigation()
- const controlLabels = [
- t('claimDetails.status'),
- featureEnabled('claimPhaseExpansion') ? t('files') : t('claimDetails.details'),
- ]
+ const controlLabels = [t('claimDetails.status'), t('files')]
const [selectedTab, setSelectedTab] = useState(0)
const { claimID, claimType } = route.params
@@ -90,7 +86,6 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
}, [attributes]),
) //force a rerender due to react query updating data
- const claimPhaseExpansionFlag = featureEnabled('claimPhaseExpansion')
const submitEvidenceExpansionFlag = featureEnabled('submitEvidenceExpansion')
useBeforeNavBackListener(navigation, () => {
@@ -123,15 +118,13 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
useEffect(() => {
if (claimType === ClaimTypeConstants.ACTIVE && claim) {
- if (claimPhaseExpansionFlag) {
- if (count > 0 && !claim.attributes.waiverSubmitted) {
- logAnalyticsEvent(Events.vama_claim_file_request(claimID))
- } else if (submitEvidenceExpansionFlag && claim.attributes.open && count >= 0) {
- logAnalyticsEvent(Events.vama_claim_submit_ev(claimID))
- }
+ if (count > 0 && !claim.attributes.waiverSubmitted) {
+ logAnalyticsEvent(Events.vama_claim_file_request(claimID))
+ } else if (submitEvidenceExpansionFlag && claim.attributes.open && count >= 0) {
+ logAnalyticsEvent(Events.vama_claim_submit_ev(claimID))
}
}
- }, [claimType, claimPhaseExpansionFlag, submitEvidenceExpansionFlag, count, claim, claimID])
+ }, [claimType, submitEvidenceExpansionFlag, count, claim, claimID])
// Track how long user maintains focus on this screen
useFocusEffect(
@@ -229,37 +222,35 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
)
}
- if (claimPhaseExpansionFlag) {
- if (count > 0 && !claim?.attributes?.waiverSubmitted) {
- const buttonProps: ButtonProps = {
- buttonType: ButtonVariants.Primary,
- label: t('claimPhase.fileRequests.button.label'),
- a11yHint: t('claimPhase.fileRequests.button.a11yHint'),
- onPress: fileRequestsPress,
- }
- const alertProps: AlertProps = {
- variant: 'warning',
- header: t('claimPhase.youHaveFileRequest', { count }),
- primaryButton: buttonProps,
- expandable: false,
- }
- return (
-
-
-
- )
- } else if (submitEvidenceExpansionFlag && attributes?.open) {
- const buttonProps: ButtonProps = {
- buttonType: ButtonVariants.Primary,
- label: t('claimDetails.submitEvidence'),
- onPress: submitEvidencePress,
- }
- return (
-
-
-
- )
+ if (count > 0 && !claim?.attributes?.waiverSubmitted) {
+ const buttonProps: ButtonProps = {
+ buttonType: ButtonVariants.Primary,
+ label: t('claimPhase.fileRequests.button.label'),
+ a11yHint: t('claimPhase.fileRequests.button.a11yHint'),
+ onPress: fileRequestsPress,
+ }
+ const alertProps: AlertProps = {
+ variant: 'warning',
+ header: t('claimPhase.youHaveFileRequest', { count }),
+ primaryButton: buttonProps,
+ expandable: false,
}
+ return (
+
+
+
+ )
+ } else if (submitEvidenceExpansionFlag && attributes?.open) {
+ const buttonProps: ButtonProps = {
+ buttonType: ButtonVariants.Primary,
+ label: t('claimDetails.submitEvidence'),
+ onPress: submitEvidencePress,
+ }
+ return (
+
+
+
+ )
}
return <>>
}
@@ -347,8 +338,7 @@ function ClaimDetailsScreen({ navigation, route }: ClaimDetailsScreenProps) {
scrollViewRef={scrollViewRef}
/>
)}
- {claim && selectedTab === 1 && !featureEnabled('claimPhaseExpansion') && }
- {claim && selectedTab === 1 && featureEnabled('claimPhaseExpansion') && }
+ {claim && selectedTab === 1 && }
{renderActiveClosedClaimStatusHelpLink()}
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx
index 273553ccf5d..486ea61d24b 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.test.tsx
@@ -4,8 +4,7 @@ import { ScrollView } from 'react-native'
import { screen } from '@testing-library/react-native'
import { ClaimType } from 'constants/claims'
-import { context, mockNavProps, render, when } from 'testUtils'
-import { featureEnabled } from 'utils/remoteConfig'
+import { context, mockNavProps, render } from 'testUtils'
import { claim } from '../../claimData'
import ClaimStatus from './ClaimStatus'
@@ -19,9 +18,6 @@ jest.mock('utils/hooks', () => {
}
})
-jest.mock('utils/remoteConfig')
-when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(true)
-
context('ClaimStatus', () => {
const defaultMaxEstDate = '2019-12-11'
const initializeTestInstance = (maxEstDate: string, claimType: ClaimType): void => {
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.tsx
index 508e0190be2..a8f5f29fd84 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimStatus.tsx
@@ -1,23 +1,16 @@
-import React, { RefObject, useRef } from 'react'
+import React, { RefObject } from 'react'
import { useTranslation } from 'react-i18next'
import { ScrollView } from 'react-native'
-import { Button } from '@department-of-veterans-affairs/mobile-component-library'
-
import { useAuthorizedServices } from 'api/authorizedServices/getAuthorizedServices'
import { useDecisionLetters } from 'api/decisionLetters'
import { ClaimData } from 'api/types'
import { Box, TextArea, TextView, VABulletList } from 'components'
-import { Events } from 'constants/analytics'
import { ClaimType, ClaimTypeConstants } from 'constants/claims'
import { NAMESPACE } from 'constants/namespaces'
-import { logAnalyticsEvent } from 'utils/analytics'
-import { formatDateMMMMDDYYYY } from 'utils/formattingUtils'
-import { useRouteNavigation } from 'utils/hooks'
import { featureEnabled } from 'utils/remoteConfig'
import ClaimTimeline from './ClaimTimeline/ClaimTimeline'
-import DEPRECATED_ClaimTimeline from './ClaimTimeline/DEPRECATED_ClaimTimeline'
import ClosedClaimStatusDetails from './ClosedClaimInfo/ClosedClaimStatusDetails'
import EstimatedDecisionDate from './EstimatedDecisionDate/EstimatedDecisionDate'
@@ -38,10 +31,8 @@ type ClaimStatusProps = {
*/
function ClaimStatus({ claim, claimType, scrollIsEnabled, scrollViewRef }: ClaimStatusProps) {
const { t } = useTranslation(NAMESPACE.COMMON)
- const navigateTo = useRouteNavigation()
const { data: userAuthorizedServices } = useAuthorizedServices()
const { data: decisionLetterData } = useDecisionLetters()
- const sentEvent = useRef(false)
const letterIsDownloadable = Boolean(
featureEnabled('decisionLettersWaygate') &&
@@ -59,7 +50,7 @@ function ClaimStatus({ claim, claimType, scrollIsEnabled, scrollViewRef }: Claim
return (
- {claim && featureEnabled('claimPhaseExpansion') && (
+ {claim && (
)}
- {claim && !featureEnabled('claimPhaseExpansion') && (
-
- )}
{false && }
- {featureEnabled('claimPhaseExpansion') && (
-
- )}
-
- )
- }
-
- return <>>
- }
-
- function deprecated_renderClosedClaimStatusDetails() {
- const isClosedClaim = claimType === ClaimTypeConstants.CLOSED
-
- if (isClosedClaim) {
- const completedEvent = claim?.attributes?.eventsTimeline.find((element) => element.type === 'completed')
- if (!completedEvent || !completedEvent.date) {
- return <>>
- }
-
- const onPress = () => {
- logAnalyticsEvent(Events.vama_ddl_status_click())
- navigateTo('ClaimLettersScreen')
- }
-
- const claimDecidedOn = t('claimDetails.weDecidedYourClaimOn', { date: formatDateMMMMDDYYYY(completedEvent.date) })
- let letterAvailable = t('claimDetails.decisionLetterMailed')
- let showButton = false
-
- if (letterIsDownloadable) {
- letterAvailable = t('claimDetails.youCanDownload')
- showButton = true
- if (!sentEvent.current) {
- logAnalyticsEvent(Events.vama_ddl_button_shown())
- sentEvent.current = true
- }
- }
-
- return (
-
@@ -140,11 +79,7 @@ function ClaimStatus({ claim, claimType, scrollIsEnabled, scrollViewRef }: Claim
return (
{renderActiveClaimStatusDetails()}
- {featureEnabled('claimPhaseExpansion') ? (
-
- ) : (
- deprecated_renderClosedClaimStatusDetails()
- )}
+
)
}
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx
index d95c4e4e2c6..128a9f4378a 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimPhase.test.tsx
@@ -3,8 +3,7 @@ import { ScrollView } from 'react-native'
import { fireEvent, screen } from '@testing-library/react-native'
-import { context, render, when } from 'testUtils'
-import { featureEnabled } from 'utils/remoteConfig'
+import { context, render } from 'testUtils'
import { claim } from '../../../claimData'
import ClaimPhase, { ClaimPhaseProps } from './ClaimPhase'
@@ -18,9 +17,6 @@ jest.mock('utils/hooks', () => {
}
})
-jest.mock('utils/remoteConfig')
-when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(true)
-
context('ClaimPhase', () => {
const initializeTestInstance = (phase: number, current: number, isDisabilityClaim: boolean) => {
const claimTypeCode = isDisabilityClaim ? '010LCOMP' : '290AUTOIDES'
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx
index c8a140b51a1..8eed628eaaf 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.test.tsx
@@ -3,15 +3,11 @@ import { ScrollView } from 'react-native'
import { screen } from '@testing-library/react-native'
-import { context, render, when } from 'testUtils'
-import { featureEnabled } from 'utils/remoteConfig'
+import { context, render } from 'testUtils'
import { claim } from '../../../claimData'
import ClaimTimeline from './ClaimTimeline'
-jest.mock('utils/remoteConfig')
-when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(true)
-
context('ClaimTimeline', () => {
const { attributes, id } = claim
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.tsx
index 5d566060cf1..d1049cbca53 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/ClaimTimeline.tsx
@@ -4,11 +4,9 @@ import { ScrollView } from 'react-native'
import { ClaimAttributesData } from 'api/types'
import { Box } from 'components'
import theme from 'styles/themes/standardTheme'
-import { getUserPhase, isDisabilityCompensationClaim, needItemsFromVet } from 'utils/claims'
-import { featureEnabled } from 'utils/remoteConfig'
+import { isDisabilityCompensationClaim, needItemsFromVet } from 'utils/claims'
import ClaimPhase from './ClaimPhase'
-import DEPRECATED_ClaimPhase from './DEPRECATED_ClaimPhase'
export type ClaimTimelineProps = {
/** attributes object from ClaimData */
@@ -26,7 +24,7 @@ function ClaimTimeline({ attributes, claimID, scrollIsEnabled, scrollViewRef }:
// need to check and see if there is a warning box above and adjust margins accordingly
const mt = itemsNeededFromVet ? 0 : theme.dimensions.condensedMarginBetween
- const is8Steps = featureEnabled('claimPhaseExpansion') && isDisabilityCompensationClaim(attributes.claimTypeCode)
+ const is8Steps = isDisabilityCompensationClaim(attributes.claimTypeCode)
const claimStepList = is8Steps ? [1, 2, 3, 4, 5, 6, 7, 8] : [1, 2, 3, 4, 5]
return (
@@ -36,26 +34,16 @@ function ClaimTimeline({ attributes, claimID, scrollIsEnabled, scrollViewRef }:
borderTopWidth={theme.dimensions.borderWidth}
mt={mt}
mb={theme.dimensions.condensedMarginBetween}>
- {claimStepList.map((phase) =>
- featureEnabled('claimPhaseExpansion') ? (
-
- ) : (
-
- ),
- )}
+ {claimStepList.map((phase) => (
+
+ ))}
)
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/DEPRECATED_ClaimPhase.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/DEPRECATED_ClaimPhase.tsx
deleted file mode 100644
index 5e02075fe22..00000000000
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/DEPRECATED_ClaimPhase.tsx
+++ /dev/null
@@ -1,165 +0,0 @@
-import React, { ReactNode, useEffect } from 'react'
-import { useTranslation } from 'react-i18next'
-
-import { Button } from '@department-of-veterans-affairs/mobile-component-library'
-import { DateTime } from 'luxon'
-
-import { ClaimAttributesData, ClaimEventData } from 'api/types'
-import { AccordionCollapsible, Box, TextView } from 'components'
-import { Events } from 'constants/analytics'
-import { NAMESPACE } from 'constants/namespaces'
-import { a11yLabelVA } from 'utils/a11yLabel'
-import { logAnalyticsEvent } from 'utils/analytics'
-import { groupTimelineActivity, needItemsFromVet, numberOfItemsNeedingAttentionFromVet } from 'utils/claims'
-import { sortByDate } from 'utils/common'
-import { useRouteNavigation, useTheme } from 'utils/hooks'
-
-import PhaseIndicator from './PhaseIndicator'
-
-/**
- * takes the events array, sorts is and returns the latest updated date
- * @param events - events array from the claim attributes
- * @param phase - phase that this component is rendering for
- * @returns a string representing the date that this phase was last updated
- */
-const updatedLast = (events: ClaimEventData[], phase: number): string => {
- const phases = groupTimelineActivity(events)
- const currentPhase = (phases[`${phase}`] as unknown as Array<{ [key: string]: string }>) || []
- sortByDate(currentPhase, 'date', true)
-
- const lastUpdate = currentPhase.length > 0 && currentPhase[0]?.date
- return lastUpdate
- ? DateTime.fromISO(lastUpdate).toLocaleString({ year: 'numeric', month: 'long', day: 'numeric' })
- : ''
-}
-
-/**
- * props for ClaimPhase components
- */
-export type ClaimPhaseProps = {
- /** phase number of the current indicator */
- phase: number
- /** phase that the current claim is on */
- current: number
- /** attributes object from ClaimData */
- attributes: ClaimAttributesData
- /** given claims ID */
- claimID: string
-}
-
-/**
- * Component for rendering each phase of a claim's lifetime.
- */
-function DEPRECATED_ClaimPhase({ phase, current, attributes, claimID }: ClaimPhaseProps) {
- const { t } = useTranslation(NAMESPACE.COMMON)
- const theme = useTheme()
- const navigateTo = useRouteNavigation()
- const { condensedMarginBetween, standardMarginBetween } = theme.dimensions
- const { eventsTimeline } = attributes
-
- const phaseLessThanEqualToCurrent = phase <= current
- const heading = t(`claimPhase.5step.heading.phase${phase}`)
- const updatedLastDate = phaseLessThanEqualToCurrent ? updatedLast(eventsTimeline, phase) : ''
- const showClaimFileUploadBtn = needItemsFromVet(attributes) && !attributes.waiverSubmitted
-
- useEffect(() => {
- if (phase === 3 && current === 3 && showClaimFileUploadBtn) {
- logAnalyticsEvent(Events.vama_claim_file_request(claimID))
- }
- }, [phase, current, showClaimFileUploadBtn, claimID])
-
- const getPhaseHeader = (): ReactNode => {
- return (
-
-
-
-
- {heading}
-
- {phaseLessThanEqualToCurrent && {updatedLastDate}}
-
-
- )
- }
-
- const getPhaseExpandedContent = (): ReactNode => {
- return (
-
-
- {detailsText}
-
-
- )
- }
-
- let status = ''
-
- if (phase === current) {
- status = t('claimPhase.heading.a11y.current')
- } else if (phase < current) {
- status = t('claimPhase.heading.a11y.completed')
- }
-
- let testID = `${t('claimPhase.heading.a11y.stepOf5', { step: phase })} ${status} ${heading}`
-
- if (phaseLessThanEqualToCurrent) {
- testID = `${testID} ${updatedLastDate}`
- }
-
- const count = numberOfItemsNeedingAttentionFromVet(eventsTimeline || [])
-
- const detailsText = t(`claimPhase.5step.details.phase${phase}`)
- const detailsA11yLabel = phase === 1 ? a11yLabelVA(t('claimPhase.5step.details.phase1')) : detailsText
- const youHaveFileRequestsText = t('claimPhase.youHaveFileRequest', { count })
-
- const accordionPress = (isExpanded: boolean | undefined) => {
- logAnalyticsEvent(
- Events.vama_claim_details_exp(
- claimID,
- attributes.claimType,
- phase,
- isExpanded || false,
- attributes.phaseChangeDate || '',
- attributes.dateFiled,
- attributes.phase,
- ),
- )
- }
-
- const fileRequestsPress = () => {
- logAnalyticsEvent(Events.vama_claim_review(claimID, attributes.claimType, count))
- navigateTo('FileRequest', { claimID, undefined })
- }
-
- return (
-
- {phase === 3 && showClaimFileUploadBtn && (
-
-
- {youHaveFileRequestsText}
-
-
-
-
-
- )}
-
- )
-}
-
-export default DEPRECATED_ClaimPhase
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/DEPRECATED_ClaimTimeline.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/DEPRECATED_ClaimTimeline.tsx
deleted file mode 100644
index d05eeeee4b7..00000000000
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimDetailsScreen/ClaimStatus/ClaimTimeline/DEPRECATED_ClaimTimeline.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import React, { useCallback, useState } from 'react'
-import { useTranslation } from 'react-i18next'
-
-import { useFocusEffect } from '@react-navigation/native'
-
-import { ClaimAttributesData } from 'api/types'
-import { AlertWithHaptics, Box } from 'components'
-import { NAMESPACE } from 'constants/namespaces'
-import theme from 'styles/themes/standardTheme'
-import { a11yLabelVA } from 'utils/a11yLabel'
-import { getUserPhase, needItemsFromVet, numberOfItemsNeedingAttentionFromVet } from 'utils/claims'
-
-import DEPRECATED_ClaimPhase from './DEPRECATED_ClaimPhase'
-
-type ClaimTimelineProps = {
- /** attributes object from ClaimData */
- attributes: ClaimAttributesData
- /** given claims ID */
- claimID: string
-}
-
-function DEPRECATED_ClaimTimeline({ attributes, claimID }: ClaimTimelineProps) {
- const { t } = useTranslation(NAMESPACE.COMMON)
-
- const [count, setCount] = useState(0)
- const itemsNeededFromVet = needItemsFromVet(attributes)
- // need to check and see if there is a warning box above and adjust margins accordingly
- const mt = itemsNeededFromVet ? 0 : theme.dimensions.condensedMarginBetween
-
- useFocusEffect(
- useCallback(() => {
- setCount(numberOfItemsNeedingAttentionFromVet(attributes.eventsTimeline || []))
- }, [attributes]),
- ) //force a rerender due to react query updating data
-
- return (
-
- {itemsNeededFromVet && !attributes.waiverSubmitted && (
-
-
-
- )}
-
- {[1, 2, 3, 4, 5].map((phase) => (
-
- ))}
-
-
- )
-}
-
-export default DEPRECATED_ClaimTimeline
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/ClaimsAndAppealsListView.test.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/ClaimsAndAppealsListView.test.tsx
index c7bd3080aec..df7b186b09e 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/ClaimsAndAppealsListView.test.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/ClaimsAndAppealsListView.test.tsx
@@ -8,13 +8,9 @@ import { ClaimType } from 'constants/claims'
import { LARGE_PAGE_SIZE } from 'constants/common'
import * as api from 'store/api'
import { QueriesData, context, mockNavProps, render, when } from 'testUtils'
-import { featureEnabled } from 'utils/remoteConfig'
import ClaimsAndAppealsListView from './ClaimsAndAppealsListView'
-jest.mock('utils/remoteConfig')
-when(featureEnabled).calledWith('claimPhaseExpansion').mockReturnValue(true)
-
const mockNavigationSpy = jest.fn()
jest.mock('utils/hooks', () => {
const original = jest.requireActual('utils/hooks')
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/DEPRECATED_ClaimsAndAppealsListView.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/DEPRECATED_ClaimsAndAppealsListView.tsx
deleted file mode 100644
index 9bf797b3db2..00000000000
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsAndAppealsListView/DEPRECATED_ClaimsAndAppealsListView.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-import React, { RefObject, useEffect, useState } from 'react'
-import { useTranslation } from 'react-i18next'
-import { ScrollView } from 'react-native'
-
-import { useAuthorizedServices } from 'api/authorizedServices/getAuthorizedServices'
-import { useClaimsAndAppeals } from 'api/claimsAndAppeals'
-import { useDecisionLetters } from 'api/decisionLetters'
-import { ClaimOrAppeal, ClaimOrAppealConstants, ClaimsAndAppealsList } from 'api/types'
-import {
- Box,
- DefaultList,
- DefaultListItemObj,
- LabelTagTypeConstants,
- LoadingComponent,
- Pagination,
- PaginationProps,
- TextLine,
-} from 'components'
-import { ClaimType } from 'constants/claims'
-import { NAMESPACE } from 'constants/namespaces'
-import { getTestIDFromTextLines } from 'utils/accessibility'
-import { capitalizeWord, formatDateMMMMDDYYYY } from 'utils/formattingUtils'
-import { useRouteNavigation, useTheme } from 'utils/hooks'
-import { featureEnabled } from 'utils/remoteConfig'
-
-import NoClaimsAndAppeals from '../NoClaimsAndAppeals/NoClaimsAndAppeals'
-
-type ClaimsAndAppealsListProps = {
- claimType: ClaimType
- scrollViewRef: RefObject
-}
-
-function DEPRECATED_ClaimsAndAppealsListView({ claimType, scrollViewRef }: ClaimsAndAppealsListProps) {
- const { t } = useTranslation(NAMESPACE.COMMON)
- const theme = useTheme()
- const navigateTo = useRouteNavigation()
- const [page, setPage] = useState(1)
- const [previousClaimType, setClaimType] = useState(claimType)
- const { data: claimsAndAppealsListPayload, isLoading: loadingClaimsAndAppeals } = useClaimsAndAppeals(claimType)
- const { data: userAuthorizedServices } = useAuthorizedServices()
- const { data: decisionLetterData } = useDecisionLetters()
- const [claimsToShow, setClaimsToShow] = useState>([])
-
- const claimsAndAppeals = claimsAndAppealsListPayload?.data
- const pageMetaData = claimsAndAppealsListPayload?.meta.pagination
- const { perPage, totalEntries } = {
- perPage: 10,
- totalEntries: pageMetaData?.totalEntries || 0,
- }
-
- useEffect(() => {
- const claimsList = claimsAndAppeals?.slice((page - 1) * perPage, page * perPage)
- setClaimsToShow(claimsList || [])
- }, [claimsAndAppeals, page, perPage])
-
- useEffect(() => {
- if (previousClaimType !== claimType) {
- setClaimType(claimType)
- setPage(1)
- }
- }, [claimType, previousClaimType])
-
- const getBoldTextDisplayed = (type: ClaimOrAppeal, displayTitle: string, updatedAtDate: string): string => {
- const formattedUpdatedAtDate = formatDateMMMMDDYYYY(updatedAtDate)
-
- switch (type) {
- case ClaimOrAppealConstants.claim:
- return t('claims.claimFor', { displayTitle: displayTitle?.toLowerCase(), date: formattedUpdatedAtDate })
- case ClaimOrAppealConstants.appeal:
- return t('claims.appealFor', { displayTitle: capitalizeWord(displayTitle), date: formattedUpdatedAtDate })
- }
-
- return ''
- }
-
- const onClaimDetails = (id: string) => {
- navigateTo('ClaimDetailsScreen', { claimID: id, claimType })
- }
-
- const onAppealDetails = (id: string) => {
- navigateTo('AppealDetailsScreen', { appealID: id })
- }
-
- const getListItemVals = (): Array => {
- const listItems: Array = []
- claimsToShow?.forEach((claimAndAppeal, index) => {
- const { type, attributes, id } = claimAndAppeal
-
- const formattedDateFiled = formatDateMMMMDDYYYY(attributes.dateFiled)
- const textLines: Array = [
- { text: getBoldTextDisplayed(type, attributes.displayTitle, attributes.updatedAt), variant: 'MobileBodyBold' },
- { text: t('claimDetails.receivedOn', { date: formattedDateFiled }) },
- ]
-
- if (
- featureEnabled('decisionLettersWaygate') &&
- userAuthorizedServices?.decisionLetters &&
- attributes.decisionLetterSent &&
- (decisionLetterData?.data.length || 0) > 0
- ) {
- const margin = theme.dimensions.condensedMarginBetween
- textLines.push({
- text: t('claims.decisionLetterReady'),
- textTag: { labelType: LabelTagTypeConstants.tagBlue },
- mt: margin,
- mb: margin,
- })
- }
-
- const position = (page - 1) * perPage + index + 1
- const a11yValue = t('listPosition', { position, total: totalEntries })
- listItems.push({
- textLines,
- a11yValue,
- onPress: () => (type === ClaimOrAppealConstants.claim ? onClaimDetails(id) : onAppealDetails(id)),
- testId: getTestIDFromTextLines(textLines),
- })
- })
-
- return listItems
- }
-
- if (claimsAndAppeals?.length === 0) {
- return
- }
-
- if (loadingClaimsAndAppeals) {
- return
- }
-
- const yourClaimsAndAppealsHeader = t('claims.youClaimsAndAppeals', { claimType: claimType.toLowerCase() })
-
- const paginationProps: PaginationProps = {
- onNext: () => {
- setPage(page + 1)
- scrollViewRef.current?.scrollTo({ x: 0, y: 0, animated: false })
- },
- onPrev: () => {
- setPage(page - 1)
- scrollViewRef.current?.scrollTo({ x: 0, y: 0, animated: false })
- },
- totalEntries: totalEntries,
- pageSize: perPage,
- page,
- tab: claimType.toLowerCase(),
- }
-
- return (
-
-
-
-
-
-
- )
-}
-
-export default DEPRECATED_ClaimsAndAppealsListView
diff --git a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsHistoryScreen/ClaimsHistoryScreen.tsx b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsHistoryScreen/ClaimsHistoryScreen.tsx
index ed04b36e65e..00f027a17fc 100644
--- a/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsHistoryScreen/ClaimsHistoryScreen.tsx
+++ b/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/ClaimsHistoryScreen/ClaimsHistoryScreen.tsx
@@ -22,7 +22,6 @@ import { featureEnabled } from 'utils/remoteConfig'
import { screenContentAllowed } from 'utils/waygateConfig'
import ClaimsAndAppealsListView from '../ClaimsAndAppealsListView/ClaimsAndAppealsListView'
-import DEPRECATED_ClaimsAndAppealsListView from '../ClaimsAndAppealsListView/DEPRECATED_ClaimsAndAppealsListView'
import NoClaimsAndAppealsAccess from '../NoClaimsAndAppealsAccess/NoClaimsAndAppealsAccess'
type IClaimsHistoryScreen = StackScreenProps
@@ -164,11 +163,7 @@ function ClaimsHistoryScreen({ navigation }: IClaimsHistoryScreen) {
{serviceErrorAlert()}
{!claimsAndAppealsServiceErrors && (
- {featureEnabled('claimPhaseExpansion') ? (
-
- ) : (
-
- )}
+
)}
diff --git a/VAMobile/src/utils/claims.tsx b/VAMobile/src/utils/claims.tsx
index 8b007179f92..aabef110f77 100644
--- a/VAMobile/src/utils/claims.tsx
+++ b/VAMobile/src/utils/claims.tsx
@@ -5,7 +5,7 @@ import { Asset, ImagePickerResponse } from 'react-native-image-picker/src/types'
import { ActionSheetOptions } from '@expo/react-native-action-sheet'
import { TFunction } from 'i18next'
-import { ClaimAttributesData, ClaimEventData, ClaimPhaseData, FILE_REQUEST_STATUS, FILE_REQUEST_TYPE } from 'api/types'
+import { ClaimAttributesData, ClaimEventData, FILE_REQUEST_STATUS, FILE_REQUEST_TYPE } from 'api/types'
import { Box, BoxProps, TextView, VAIcon } from 'components'
import { Events } from 'constants/analytics'
import { DISABILITY_COMPENSATION_CLAIM_TYPE_CODES, MAX_NUM_PHOTOS } from 'constants/claims'
@@ -85,66 +85,6 @@ export const getUserPhase = (phase: number): number => {
return phase - 3
}
-/** gets the correct date from each item in an event timeline */
-const getItemDate = (item: ClaimEventData): string => {
- if (item.receivedDate) {
- return item.receivedDate
- } else if (item.documents && item.documents.length) {
- return item.documents[item.documents.length - 1].uploadDate
- } else if (item.type === 'other_documents_list' && item.uploadDate) {
- return item.uploadDate
- }
-
- return item.date ? item.date : ''
-}
-
-/** checks to see if this is an event that kicks off a phase that is tracked or if it falls in the middle phases
- * that we roll into phase 3
- */
-const isEventOrPrimaryPhase = (event: ClaimEventData): boolean => {
- if (event.type === 'phase_entered' && event.phase) {
- return event.phase <= 3 || event.phase >= 7
- }
-
- return !!getItemDate(event)
-}
-
-/** takse a string that is in the event timeline as 'phase2' and returns a number to represent the phase */
-const getPhaseNumber = (phase: string): number => {
- return parseInt(phase.replace('phase', ''), 10)
-}
-
-/** groups claim events by phase */
-export const groupTimelineActivity = (events: ClaimEventData[]): ClaimPhaseData => {
- const phases: { [key: string]: ClaimEventData[] } = {}
- let activity: ClaimEventData[] = []
- const phaseEvents = events
- .map((event) => {
- if (event.type.startsWith('phase')) {
- return {
- type: 'phase_entered',
- phase: getPhaseNumber(event.type) + 1,
- date: event.date,
- } as ClaimEventData
- }
- return event
- })
- .filter(isEventOrPrimaryPhase)
- phaseEvents.forEach((event) => {
- if (event.type.startsWith('phase') && event.phase) {
- activity.push(event)
- phases[`${getUserPhase(event.phase)}`] = activity
- activity = []
- } else {
- activity.push(event)
- }
- })
- if (activity.length > 0) {
- phases[1] = activity
- }
- return phases
-}
-
/**
* Returns true if the given file type is a jpeg, jpg, gif, txt, pdf, or bmp file
*
diff --git a/VAMobile/src/utils/remoteConfig.test.ts b/VAMobile/src/utils/remoteConfig.test.ts
index 28ed8e6458f..50638eb5dac 100644
--- a/VAMobile/src/utils/remoteConfig.test.ts
+++ b/VAMobile/src/utils/remoteConfig.test.ts
@@ -20,7 +20,6 @@ jest.mock('@react-native-firebase/remote-config', () => () => ({
const mockOverrides = {
appointmentRequests: true,
cernerTrueForDemo: false,
- claimPhaseExpansion: true,
decisionLettersWaygate: false,
haptics: false,
homeScreenPrefetch: false,
diff --git a/VAMobile/src/utils/remoteConfig.ts b/VAMobile/src/utils/remoteConfig.ts
index bcca00c2fc7..7884f072486 100644
--- a/VAMobile/src/utils/remoteConfig.ts
+++ b/VAMobile/src/utils/remoteConfig.ts
@@ -18,7 +18,6 @@ export let overrideRemote = false
export type FeatureToggleType =
| 'appointmentRequests'
| 'cernerTrueForDemo'
- | 'claimPhaseExpansion'
| 'decisionLettersWaygate'
| 'haptics'
| 'homeScreenPrefetch'
@@ -37,7 +36,6 @@ export type FeatureToggleType =
type FeatureToggleValues = {
appointmentRequests: boolean
cernerTrueForDemo: boolean
- claimPhaseExpansion: boolean
decisionLettersWaygate: boolean
haptics: boolean
homeScreenPrefetch: boolean
@@ -57,7 +55,6 @@ type FeatureToggleValues = {
export const defaults: FeatureToggleValues = {
appointmentRequests: false,
cernerTrueForDemo: false,
- claimPhaseExpansion: true,
decisionLettersWaygate: true,
haptics: true,
homeScreenPrefetch: true,