TP-000 | Code Refcatore + Clickstream Added
This commit is contained in:
@@ -133,8 +133,8 @@ def reactNativeArchitectures() {
|
||||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
||||
}
|
||||
|
||||
def VERSION_CODE = 100
|
||||
def VERSION_NAME = "2.5.5"
|
||||
def VERSION_CODE = 103
|
||||
def VERSION_NAME = "2.5.8"
|
||||
|
||||
android {
|
||||
ndkVersion rootProject.ext.ndkVersion
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "AV_APP",
|
||||
"version": "2.5.5",
|
||||
"version": "2.5.8",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android:dev": "yarn move:dev && react-native run-android",
|
||||
|
||||
@@ -662,6 +662,11 @@ export const CLICKSTREAM_EVENT_NAMES = {
|
||||
name: 'FA_NEARBY_CASE_CLICKED',
|
||||
description: 'FA_NEARBY_CASE_CLICKED',
|
||||
},
|
||||
|
||||
FA_SNAPSHOT_LISTENER: {
|
||||
name: 'FA_SNAPSHOT_LISTENER',
|
||||
description: 'FA_SNAPSHOT_LISTENER',
|
||||
},
|
||||
} as const;
|
||||
|
||||
export enum MimeType {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { type RootState } from '../store/store';
|
||||
import { useAppDispatch, useAppSelector } from '.';
|
||||
import { setLoading, updateCaseDetailsFirestore } from '../reducer/allCasesSlice';
|
||||
import { type CaseDetail } from '../screens/caseDetails/interface';
|
||||
import { FirestoreUpdateTypes } from '../common/Constants';
|
||||
import { CLICKSTREAM_EVENT_NAMES, FirestoreUpdateTypes } from '../common/Constants';
|
||||
import { toast } from '../../RN-UI-LIB/src/components/toast';
|
||||
import { updateAvTemplateData, updateCollectionTemplateData } from '../reducer/caseReducer';
|
||||
import { type ILockData, MY_CASE_ITEM, setLockData, VisitPlanStatus } from '../reducer/userSlice';
|
||||
@@ -18,6 +18,8 @@ import { ToastMessages } from '../screens/allCases/constants';
|
||||
import { setForceUninstallData } from '../reducer/metadataSlice';
|
||||
import { logError } from '../components/utlis/errorUtils';
|
||||
import { type GenericFunctionArgs } from '../common/GenericTypes';
|
||||
import { addClickstreamEvent } from '@services/clickstreamEventService';
|
||||
import analytics from '@react-native-firebase/analytics';
|
||||
|
||||
export interface CaseUpdates {
|
||||
updateType: string;
|
||||
@@ -201,9 +203,20 @@ const useFirestoreUpdates = () => {
|
||||
const subscribeToDoc = (successCb: GenericFunctionArgs, collectionPath: string) =>
|
||||
firestore()
|
||||
.doc(collectionPath)
|
||||
.onSnapshot(successCb, (err) => {
|
||||
handleError(err, collectionPath);
|
||||
});
|
||||
.onSnapshot(
|
||||
async () => {
|
||||
successCb();
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_SNAPSHOT_LISTENER, {
|
||||
snapshot_path: collectionPath,
|
||||
});
|
||||
await analytics().logEvent('snapshot_listener', {
|
||||
snapshot_path: collectionPath,
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
handleError(err, collectionPath);
|
||||
}
|
||||
);
|
||||
|
||||
const subscribeToCases = () => {
|
||||
let refId = user?.referenceId;
|
||||
|
||||
@@ -97,10 +97,23 @@ const CaseItem: React.FC<ICaseItemProps> = ({
|
||||
case NEARBY_CASES: {
|
||||
return (
|
||||
<Pressable onPress={navigateToNearbyCases}>
|
||||
<View style={styles.nearByCasesContainer}>
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.row,
|
||||
GenericStyles.alignCenter,
|
||||
GenericStyles.spaceBetween,
|
||||
getShadowStyle(2),
|
||||
GenericStyles.ph12,
|
||||
GenericStyles.pv12,
|
||||
GenericStyles.br8,
|
||||
GenericStyles.mt16,
|
||||
GenericStyles.mb12,
|
||||
GenericStyles.whiteBackground,
|
||||
]}
|
||||
>
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter]}>
|
||||
<LocationIcon />
|
||||
<Text style={styles.nearByCasesText}>View nearby cases</Text>
|
||||
<Text style={[styles.nearByCasesText, GenericStyles.pl4]}>View nearby cases</Text>
|
||||
</View>
|
||||
<ArrowRightOutlineIcon fillColor={COLORS.BACKGROUND.LIGHT} />
|
||||
</View>
|
||||
@@ -130,20 +143,7 @@ const styles = StyleSheet.create({
|
||||
paddingBottom: 6,
|
||||
paddingHorizontal: 2,
|
||||
},
|
||||
nearByCasesContainer: {
|
||||
...GenericStyles.row,
|
||||
...GenericStyles.alignCenter,
|
||||
...GenericStyles.spaceBetween,
|
||||
...getShadowStyle(2),
|
||||
...GenericStyles.ph12,
|
||||
...GenericStyles.pv12,
|
||||
...GenericStyles.br8,
|
||||
...GenericStyles.mt16,
|
||||
...GenericStyles.mb12,
|
||||
...GenericStyles.whiteBackground,
|
||||
},
|
||||
nearByCasesText: {
|
||||
...GenericStyles.pl4,
|
||||
color: COLORS.TEXT.DARK,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user