patrick fixed calling wrong export
Co-authored-by: Patrick Fic <patrick@thinkimex.com>
This commit is contained in:
@@ -22,10 +22,10 @@ import { useRef } from "react";
|
|||||||
//employeeSignInStart:(idjob) => dispatch(employeeSignInStart(idjob)),
|
//employeeSignInStart:(idjob) => dispatch(employeeSignInStart(idjob)),
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setTmTicketJobId: () => dispatch(setTmTicketJobId({ jobId })),
|
setTmTicketJobIdRedux: (jobId) => dispatch(setTmTicketJobId(jobId)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ClockedinListItem( {setTmTicketJobId, ticket }) {
|
export function ClockedinListItem({ setTmTicketJobIdRedux, ticket }) {
|
||||||
console.log("ClockedinListItem, ticket", ticket);
|
console.log("ClockedinListItem, ticket", ticket);
|
||||||
console.log("ClockedinListItem, setTmTicketJobId", setTmTicketJobId);
|
console.log("ClockedinListItem, setTmTicketJobId", setTmTicketJobId);
|
||||||
|
|
||||||
@@ -37,12 +37,15 @@ export function ClockedinListItem( {setTmTicketJobId, ticket }) {
|
|||||||
console.log("ClockedinListItem, jbId: ", jbId);
|
console.log("ClockedinListItem, jbId: ", jbId);
|
||||||
// const te = useRef(jbId);
|
// const te = useRef(jbId);
|
||||||
|
|
||||||
const makeNavToTimeTicketClockOff = (jbId,setTmTicketJobId) => (
|
const makeNavToTimeTicketClockOff = () => (
|
||||||
console.log("ClockedinListItem, makeNavToTimeTicketClockOff, setTmTicketJobId :", setTmTicketJobId),
|
console.log(
|
||||||
console.log("ClockedinListItem, makeNavToTimeTicketClockOff, jobId :", jbId)
|
"*** THIS IS THE ONE WE ARE TESTING. ClockedinListItem, makeNavToTimeTicketClockOff, setTmTicketJobId :",
|
||||||
//,setTmTicketJobId(jbId)
|
setTmTicketJobIdRedux
|
||||||
|
),
|
||||||
,navigation.navigate("TimeTicketClockOff")
|
//console.log("ClockedinListItem, makeNavToTimeTicketClockOff, jobId :", jbId)
|
||||||
|
setTmTicketJobIdRedux(ticket.job.id),
|
||||||
|
//,
|
||||||
|
navigation.navigate("TimeTicketClockOff")
|
||||||
);
|
);
|
||||||
// const onPress = (ticket, setCameraJobId) => {
|
// const onPress = (ticket, setCameraJobId) => {
|
||||||
// console.log("ClockedinListItem, onPress called");
|
// console.log("ClockedinListItem, onPress called");
|
||||||
@@ -72,13 +75,12 @@ export function ClockedinListItem( {setTmTicketJobId, ticket }) {
|
|||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Text>
|
<Text>
|
||||||
Vehicle :
|
Vehicle :
|
||||||
{`${ticket.job.v_model_yr || ""} ${
|
{`${ticket.job.v_model_yr || ""} ${ticket.job.v_make_desc || ""} ${
|
||||||
ticket.job.v_make_desc || ""
|
ticket.job.v_model_desc || ""
|
||||||
} ${ticket.job.v_model_desc || ""}`}
|
}`}
|
||||||
</Text>
|
</Text>
|
||||||
<Text>
|
<Text>
|
||||||
Clocked In :{" "}
|
Clocked In : <DateTimeFormatter>{ticket.clockon}</DateTimeFormatter>
|
||||||
<DateTimeFormatter>{ticket.clockon}</DateTimeFormatter>
|
|
||||||
</Text>
|
</Text>
|
||||||
<Text>
|
<Text>
|
||||||
Cost Center :{" "}
|
Cost Center :{" "}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { View, Text, FlatList, RefreshControl } from "react-native";
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { ClockedinListItem } from "../time-ticket-items/clockedin-list-item.component";
|
import ClockedinListItem from "../time-ticket-items/clockedin-list-item.component";
|
||||||
|
|
||||||
// import { setTmTicketJobId } from "../../redux/app/app.actions";
|
// import { setTmTicketJobId } from "../../redux/app/app.actions";
|
||||||
|
|
||||||
@@ -38,9 +38,9 @@ export function EmployeeClockedInList({ technician }) {
|
|||||||
);
|
);
|
||||||
if (loading) return <ActivityIndicator color="dodgerblue" size="large" />;
|
if (loading) return <ActivityIndicator color="dodgerblue" size="large" />;
|
||||||
if (error) return <ErrorDisplay errorMessage={error.message} />;
|
if (error) return <ErrorDisplay errorMessage={error.message} />;
|
||||||
|
|
||||||
console.log("EmployeeClockedInList, QUERY_ACTIVE_TIME_TICKETS data:", data);
|
console.log("EmployeeClockedInList, QUERY_ACTIVE_TIME_TICKETS data:", data);
|
||||||
// if (data) () => {setTmTicketJobId(data)}
|
// if (data) () => {setTmTicketJobId(data)}
|
||||||
|
|
||||||
const onRefresh = async () => {
|
const onRefresh = async () => {
|
||||||
return refetch();
|
return refetch();
|
||||||
@@ -50,13 +50,15 @@ export function EmployeeClockedInList({ technician }) {
|
|||||||
<View>
|
<View>
|
||||||
{data.timetickets.length > 0 ? (
|
{data.timetickets.length > 0 ? (
|
||||||
<View>
|
<View>
|
||||||
<Text style={{paddingLeft:12, paddingTop:14}}>You are already clocked in to the following job(s):</Text>
|
<Text style={{ paddingLeft: 12, paddingTop: 14 }}>
|
||||||
|
You are already clocked in to the following job(s):
|
||||||
|
</Text>
|
||||||
<FlatList
|
<FlatList
|
||||||
data={data.timetickets}
|
data={data.timetickets}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
||||||
}
|
}
|
||||||
renderItem={(object) => <ClockedinListItem ticket={object.item} />}
|
renderItem={(object) => <ClockedinListItem ticket={object.item} />}
|
||||||
// setTmTicketJobId={setTmTicketJobId}
|
// setTmTicketJobId={setTmTicketJobId}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user