NTP-71625 | fix event issues for open map (#1192)
This commit is contained in:
@@ -25,7 +25,11 @@ interface ProfileHeaderProps {
|
|||||||
addressItemRef?: React.RefObject<View>;
|
addressItemRef?: React.RefObject<View>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProfileHeader: React.FC<ProfileHeaderProps> = ({ caseId, showDirections = false, addressItemRef }) => {
|
const ProfileHeader: React.FC<ProfileHeaderProps> = ({
|
||||||
|
caseId,
|
||||||
|
showDirections = false,
|
||||||
|
addressItemRef,
|
||||||
|
}) => {
|
||||||
const caseDetails = useAppSelector((state) => state.allCases?.caseDetails?.[caseId]);
|
const caseDetails = useAppSelector((state) => state.allCases?.caseDetails?.[caseId]);
|
||||||
const { customerName, totalOverdueAmount, paymentStatus, collectionTag, dpdBucket } =
|
const { customerName, totalOverdueAmount, paymentStatus, collectionTag, dpdBucket } =
|
||||||
caseDetails || {};
|
caseDetails || {};
|
||||||
@@ -60,7 +64,10 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({ caseId, showDirections =
|
|||||||
|
|
||||||
const handleOpenMapForAddresses = () => {
|
const handleOpenMapForAddresses = () => {
|
||||||
setIsModalVisible(!isModalVisible);
|
setIsModalVisible(!isModalVisible);
|
||||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ADDRESS_CARD_DIRECTIONS_CLICKED, {});
|
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ADDRESS_CARD_DIRECTIONS_CLICKED, {
|
||||||
|
attempted_at_address: caseDetails?.addressReferenceId,
|
||||||
|
caseId,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -124,6 +131,8 @@ const ProfileHeader: React.FC<ProfileHeaderProps> = ({ caseId, showDirections =
|
|||||||
latitude={caseDetails?.addressLocation?.latitude}
|
latitude={caseDetails?.addressLocation?.latitude}
|
||||||
longitude={caseDetails?.addressLocation?.longitude}
|
longitude={caseDetails?.addressLocation?.longitude}
|
||||||
addressString={caseDetails?.addressString}
|
addressString={caseDetails?.addressString}
|
||||||
|
caseId={caseId}
|
||||||
|
referenceId={caseDetails?.addressReferenceId}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ const AddressListItem: React.FC<AddressListItemProps> = memo(
|
|||||||
>
|
>
|
||||||
<AddressItemHeader
|
<AddressItemHeader
|
||||||
locationDetails={address}
|
locationDetails={address}
|
||||||
|
caseId={caseId}
|
||||||
isOtherAddressView
|
isOtherAddressView
|
||||||
containerStyle={styles.borderBottom0}
|
containerStyle={styles.borderBottom0}
|
||||||
addressItemRef={addressItemRef}
|
addressItemRef={addressItemRef}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const AddressItemHeader = (props: ITopAddressItemHeader) => {
|
|||||||
isSimilarAddressPage = false,
|
isSimilarAddressPage = false,
|
||||||
modalTopOffset,
|
modalTopOffset,
|
||||||
modalRightOffset,
|
modalRightOffset,
|
||||||
|
caseId = '',
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const { pinCode, city, latitude, longitude, rank, visited, locationSubType } =
|
const { pinCode, city, latitude, longitude, rank, visited, locationSubType } =
|
||||||
@@ -58,9 +59,14 @@ const AddressItemHeader = (props: ITopAddressItemHeader) => {
|
|||||||
return Linking.openURL(mapUrl);
|
return Linking.openURL(mapUrl);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOpenMapForAddresses = () => {
|
const handleOpenMapForAddresses = () => {
|
||||||
setIsModalVisible(!isModalVisible);
|
setIsModalVisible(!isModalVisible);
|
||||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ADDRESS_CARD_DIRECTIONS_CLICKED, {});
|
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ADDRESS_CARD_DIRECTIONS_CLICKED, {
|
||||||
|
attempted_at_address: locationDetails?.referenceId,
|
||||||
|
address_rank: rank,
|
||||||
|
caseId
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -117,6 +123,9 @@ const AddressItemHeader = (props: ITopAddressItemHeader) => {
|
|||||||
longitude={locationDetails?.longitude}
|
longitude={locationDetails?.longitude}
|
||||||
addressString={locationDetails?.addressText}
|
addressString={locationDetails?.addressText}
|
||||||
isGeoCoordinatesReliable={locationDetails?.isGeoCoordinatesReliable}
|
isGeoCoordinatesReliable={locationDetails?.isGeoCoordinatesReliable}
|
||||||
|
caseId={caseId}
|
||||||
|
rank={rank}
|
||||||
|
referenceId={locationDetails?.referenceId}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -11,19 +11,27 @@ import { addClickstreamEvent } from '@services/clickstreamEventService';
|
|||||||
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
import { CLICKSTREAM_EVENT_NAMES } from '@common/Constants';
|
||||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag';
|
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag';
|
||||||
|
|
||||||
const OpenMapOptionsPopUp = (props: IOpenMapOptionsPopUpProps) => {
|
|
||||||
const { latitude, longitude, addressString, isGeoCoordinatesReliable } = props;
|
|
||||||
|
|
||||||
|
const OpenMapOptionsPopUp = (props: IOpenMapOptionsPopUpProps) => {
|
||||||
|
const { latitude, longitude, addressString, isGeoCoordinatesReliable, caseId, rank = '', referenceId } = props;
|
||||||
const handleSearchByGeolocation = () => {
|
const handleSearchByGeolocation = () => {
|
||||||
const mapUrl = getGoogleMapUrl(latitude, longitude);
|
const mapUrl = getGoogleMapUrl(latitude, longitude);
|
||||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_LAT_LONG_OPTION_CLICKED, {});
|
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_LAT_LONG_OPTION_CLICKED, {
|
||||||
|
attempted_at_address: referenceId,
|
||||||
|
address_rank: rank,
|
||||||
|
caseId
|
||||||
|
});
|
||||||
if (!mapUrl) return;
|
if (!mapUrl) return;
|
||||||
return Linking.openURL(mapUrl);
|
return Linking.openURL(mapUrl);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSearchByAddressString = () => {
|
const handleSearchByAddressString = () => {
|
||||||
const mapUrl = getGoogleMapUrlForAddressText(addressString);
|
const mapUrl = getGoogleMapUrlForAddressText(addressString);
|
||||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_SEARCH_ADDRESS_OPTION_CLICKED, {});
|
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_SEARCH_ADDRESS_OPTION_CLICKED, {
|
||||||
|
attempted_at_address: referenceId,
|
||||||
|
address_rank: rank,
|
||||||
|
caseId
|
||||||
|
});
|
||||||
if (!mapUrl) return;
|
if (!mapUrl) return;
|
||||||
return Linking.openURL(mapUrl);
|
return Linking.openURL(mapUrl);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,4 +3,7 @@ export interface IOpenMapOptionsPopUpProps {
|
|||||||
longitude: number;
|
longitude: number;
|
||||||
addressString: string;
|
addressString: string;
|
||||||
isGeoCoordinatesReliable?: boolean;
|
isGeoCoordinatesReliable?: boolean;
|
||||||
|
caseId: string;
|
||||||
|
rank?: number;
|
||||||
|
referenceId?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ export interface ITopAddressItemHeader {
|
|||||||
isSimilarAddressPage?: boolean;
|
isSimilarAddressPage?: boolean;
|
||||||
modalTopOffset?: number;
|
modalTopOffset?: number;
|
||||||
modalRightOffset?: number;
|
modalRightOffset?: number;
|
||||||
|
caseId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ITopAddressItemFeedback {
|
export interface ITopAddressItemFeedback {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const OtherAddressItem = (props: IOtherAddressItem) => {
|
|||||||
<View style={styles.container} ref={addressItemRef}>
|
<View style={styles.container} ref={addressItemRef}>
|
||||||
<AddressItemHeader
|
<AddressItemHeader
|
||||||
locationDetails={locationDetails}
|
locationDetails={locationDetails}
|
||||||
|
caseId={caseId}
|
||||||
isOtherAddressView={true}
|
isOtherAddressView={true}
|
||||||
containerStyle={[GenericStyles.pv16]}
|
containerStyle={[GenericStyles.pv16]}
|
||||||
addressItemRef={addressItemRef}
|
addressItemRef={addressItemRef}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const TopAddressSimilarAddresses = (props: ITopAddressSimilarAddresses) => {
|
|||||||
<AddressItemHeader
|
<AddressItemHeader
|
||||||
containerStyle={styles.bottomSheetHeader}
|
containerStyle={styles.bottomSheetHeader}
|
||||||
locationDetails={locationDetails}
|
locationDetails={locationDetails}
|
||||||
|
caseId={caseId}
|
||||||
isOtherAddressView
|
isOtherAddressView
|
||||||
isSimilarAddressPage
|
isSimilarAddressPage
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import { addClickstreamEvent } from '@services/clickstreamEventService';
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Linking, StyleSheet, View } from 'react-native';
|
import { Linking, StyleSheet, View } from 'react-native';
|
||||||
import OpenMapButtonForAddresses from './OpenMapButtonForAddresses';
|
import OpenMapButtonForAddresses from './OpenMapButtonForAddresses';
|
||||||
|
import { RootState } from '@store';
|
||||||
|
import { useAppSelector } from '@hooks';
|
||||||
|
|
||||||
interface IAllocatedAddressDetails {
|
interface IAllocatedAddressDetails {
|
||||||
isCasePaused: boolean;
|
isCasePaused: boolean;
|
||||||
@@ -36,6 +38,7 @@ const AllocatedAddressDetails = (props: IAllocatedAddressDetails) => {
|
|||||||
roadDistance,
|
roadDistance,
|
||||||
} = props;
|
} = props;
|
||||||
const [isModalVisible, setIsModalVisible] = useState(false);
|
const [isModalVisible, setIsModalVisible] = useState(false);
|
||||||
|
const caseDetails = useAppSelector((state: RootState) => state?.allCases?.caseDetails?.[caseId]) || {};
|
||||||
|
|
||||||
const isGeolocation = addressStringType === AddressTabType.GEO_LOCATION;
|
const isGeolocation = addressStringType === AddressTabType.GEO_LOCATION;
|
||||||
|
|
||||||
@@ -57,6 +60,10 @@ const AllocatedAddressDetails = (props: IAllocatedAddressDetails) => {
|
|||||||
|
|
||||||
const handleOpenMapForAddresses = () => {
|
const handleOpenMapForAddresses = () => {
|
||||||
setIsModalVisible(!isModalVisible);
|
setIsModalVisible(!isModalVisible);
|
||||||
|
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_ADDRESS_CARD_DIRECTIONS_CLICKED, {
|
||||||
|
attempted_at_address: caseDetails?.addressReferenceId,
|
||||||
|
caseId,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -101,6 +108,8 @@ const AllocatedAddressDetails = (props: IAllocatedAddressDetails) => {
|
|||||||
latitude={addressLocation?.latitude}
|
latitude={addressLocation?.latitude}
|
||||||
longitude={addressLocation?.longitude}
|
longitude={addressLocation?.longitude}
|
||||||
addressString={addressString as string}
|
addressString={addressString as string}
|
||||||
|
caseId={caseId}
|
||||||
|
referenceId={caseDetails?.addressReferenceId}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user