diff --git a/src/components/form/components/GeolocationAddress.tsx b/src/components/form/components/GeolocationAddress.tsx index 4b4756e7..5437a3de 100644 --- a/src/components/form/components/GeolocationAddress.tsx +++ b/src/components/form/components/GeolocationAddress.tsx @@ -204,9 +204,9 @@ const GeolocationAddress: React.FC = ({ {showSimilarGeolocationsCTA ? : null} - {address?.sourceAddress ? ( + {address?.addressString ? ( - {address?.sourceAddress} + {address?.addressString} ) : null} {!isFeedbackView ? ( diff --git a/src/screens/addressGeolocation/constant.ts b/src/screens/addressGeolocation/constant.ts index 6d4b3315..e12e2c9a 100644 --- a/src/screens/addressGeolocation/constant.ts +++ b/src/screens/addressGeolocation/constant.ts @@ -35,6 +35,11 @@ export enum AddressGeolocationTabEnum { GEOLOCATION = 'geolocation', } +export enum AddressTabType { + META_ADDRESS = 'META_ADDRESS', + GEO_LOCATION = 'GEO_LOCATION', +} + export interface IAddressGeolocation { route: { params: { diff --git a/src/screens/addressGeolocation/index.tsx b/src/screens/addressGeolocation/index.tsx index a1cd8520..7232b01b 100644 --- a/src/screens/addressGeolocation/index.tsx +++ b/src/screens/addressGeolocation/index.tsx @@ -39,7 +39,12 @@ const PAGE_TITLE = 'All addresses'; const AddressGeolocation: React.FC = ({ route: routeParams }) => { const { - params: { loanAccountNumber, customerReferenceId, caseId, tab }, + params: { + loanAccountNumber, + customerReferenceId, + caseId, + tab = AddressGeolocationTabEnum.ADDRESS, + }, } = routeParams; const { addressGeolocation, isLoading } = useAppSelector((state: RootState) => ({ diff --git a/src/screens/caseDetails/ViewAddressSection.tsx b/src/screens/caseDetails/ViewAddressSection.tsx index 04dda0d2..d7807e80 100644 --- a/src/screens/caseDetails/ViewAddressSection.tsx +++ b/src/screens/caseDetails/ViewAddressSection.tsx @@ -11,7 +11,7 @@ import { RootState } from '@store'; import React from 'react'; import { StyleSheet, View } from 'react-native'; import { CaseDetailStackEnum } from './CaseDetailStack'; -import { AddressGeolocationTabEnum } from '@screens/addressGeolocation/constant'; +import { AddressGeolocationTabEnum, AddressTabType } from '@screens/addressGeolocation/constant'; interface IViewAddressSection { caseId: string; @@ -19,7 +19,17 @@ interface IViewAddressSection { const ViewAddressSection = ({ caseId }: IViewAddressSection) => { const caseDetail = useAppSelector((state: RootState) => state.allCases.caseDetails[caseId]) || {}; - const { addressString, loanAccountNumber, customerReferenceId, addressSourceText = AddressGeolocationTabEnum.ADDRESS } = caseDetail; + const { addressString, loanAccountNumber, customerReferenceId, addressStringType } = caseDetail; + + const getTabName = () => { + if (addressStringType === AddressTabType.META_ADDRESS) { + return AddressGeolocationTabEnum.ADDRESS; + } + if (addressStringType === AddressTabType.GEO_LOCATION) { + return AddressGeolocationTabEnum.GEOLOCATION; + } + return AddressGeolocationTabEnum.ADDRESS; + }; const viewAllAddressHandler = () => { addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_VIEW_ADDRESSES_CLICKED, { @@ -29,7 +39,7 @@ const ViewAddressSection = ({ caseId }: IViewAddressSection) => { loanAccountNumber, customerReferenceId, caseId, - tab: addressSourceText + tab: getTabName(), }; navigateToScreen(CaseDetailStackEnum.ADDRESS_GEO, commonParams); }; diff --git a/src/screens/caseDetails/interface.ts b/src/screens/caseDetails/interface.ts index 5eb11964..3ecf6523 100644 --- a/src/screens/caseDetails/interface.ts +++ b/src/screens/caseDetails/interface.ts @@ -255,7 +255,7 @@ export interface IGeolocation { clusterLabels: string[]; clusterId: string; minTimestamp: string; - sourceAddress?: string; + addressString?: string; } export interface EmploymentDetails { employmentType: string; @@ -313,7 +313,7 @@ export interface CaseDetail { geolocations?: IGeolocation[]; employmentDetail?: EmploymentDetails; unpaidDays?: number; - addressSourceText?: string; + addressStringType?: string; } export interface AddressesGeolocationPayload {