Added google analytics tracking.
This commit is contained in:
@@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { View } from "react-native";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||
import { setCameraJob, setCameraJobId } from "../../redux/app/app.actions";
|
||||
import { selectCurrentCameraJobId } from "../../redux/app/app.selectors";
|
||||
@@ -48,6 +49,7 @@ export function CameraSelectJob({
|
||||
<Picker
|
||||
selectedValue={cameraJobId}
|
||||
onValueChange={(value, idx) => {
|
||||
logImEXEvent("imexmobile_setcamerajobid");
|
||||
setCameraJobId(value);
|
||||
setCameraJob(data.jobs[idx]);
|
||||
}}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { TouchableOpacity } from "react-native-gesture-handler";
|
||||
import Swipeable from "react-native-gesture-handler/Swipeable";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { setCameraJob, setCameraJobId } from "../../redux/app/app.actions";
|
||||
import styles from "../styles";
|
||||
|
||||
@@ -32,6 +33,7 @@ export function JobListItem({ setCameraJob, setCameraJobId, item }) {
|
||||
<TouchableOpacity
|
||||
style={[styles.swipe_view, styles.swipe_view_blue]}
|
||||
onPress={() => {
|
||||
logImEXEvent("imexmobile_setcamerajobid_swipe");
|
||||
setCameraJobId(item.id);
|
||||
setCameraJob(item);
|
||||
navigation.navigate("MediaBrowserTab");
|
||||
@@ -50,6 +52,7 @@ export function JobListItem({ setCameraJob, setCameraJobId, item }) {
|
||||
};
|
||||
|
||||
const onPress = () => {
|
||||
logImEXEvent("imexmobile_view_job_detail");
|
||||
navigation.push("JobDetail", {
|
||||
jobId: item.id,
|
||||
title: item.ro_number || t("general.labels.na"),
|
||||
|
||||
@@ -9,6 +9,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import {
|
||||
selectCurrentCameraJobId,
|
||||
selectDeleteAfterUpload,
|
||||
@@ -51,6 +52,7 @@ export function ImageBrowserScreen({
|
||||
|
||||
async function handleOnSuccess(uri, id) {
|
||||
console.log("Succesful upload!", uri);
|
||||
logImEXEvent("imexmobile_successful_upload");
|
||||
if (deleteAfterUpload) {
|
||||
try {
|
||||
const result = await MediaLibrary.deleteAssetsAsync([id]);
|
||||
@@ -64,6 +66,7 @@ export function ImageBrowserScreen({
|
||||
|
||||
const onDone = async (data) => {
|
||||
console.log("Assets :>> ", data);
|
||||
logImEXEvent("imexmobile_upload_documents", { count: data.length });
|
||||
const actions = [];
|
||||
data.forEach(function (p) {
|
||||
let filename;
|
||||
@@ -205,6 +208,7 @@ const styles = StyleSheet.create({
|
||||
|
||||
function handleOnError(...props) {
|
||||
console.log("HandleOnError", props);
|
||||
logImEXEvent("imexmobile_upload_documents_error", { props });
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, null)(ImageBrowserScreen);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { StyleSheet, Switch, Text, View } from "react-native";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { toggleDeleteAfterUpload } from "../../redux/app/app.actions";
|
||||
import { selectDeleteAfterUpload } from "../../redux/app/app.selectors";
|
||||
|
||||
@@ -29,7 +30,10 @@ export function UploadDeleteSwitch({
|
||||
trackColor={{ false: "#767577", true: "#81b0ff" }}
|
||||
thumbColor={deleteAfterUpload ? "tomato" : "#f4f3f4"}
|
||||
ios_backgroundColor="#3e3e3e"
|
||||
onValueChange={() => toggleDeleteAfterUpload()}
|
||||
onValueChange={() => {
|
||||
logImEXEvent("imexmobile_toggle_delete_after_upload");
|
||||
toggleDeleteAfterUpload();
|
||||
}}
|
||||
value={deleteAfterUpload}
|
||||
/>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user