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)),
|
||||
|
||||
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, setTmTicketJobId", setTmTicketJobId);
|
||||
|
||||
@@ -37,12 +37,15 @@ export function ClockedinListItem( {setTmTicketJobId, ticket }) {
|
||||
console.log("ClockedinListItem, jbId: ", jbId);
|
||||
// const te = useRef(jbId);
|
||||
|
||||
const makeNavToTimeTicketClockOff = (jbId,setTmTicketJobId) => (
|
||||
console.log("ClockedinListItem, makeNavToTimeTicketClockOff, setTmTicketJobId :", setTmTicketJobId),
|
||||
console.log("ClockedinListItem, makeNavToTimeTicketClockOff, jobId :", jbId)
|
||||
//,setTmTicketJobId(jbId)
|
||||
|
||||
,navigation.navigate("TimeTicketClockOff")
|
||||
const makeNavToTimeTicketClockOff = () => (
|
||||
console.log(
|
||||
"*** THIS IS THE ONE WE ARE TESTING. ClockedinListItem, makeNavToTimeTicketClockOff, setTmTicketJobId :",
|
||||
setTmTicketJobIdRedux
|
||||
),
|
||||
//console.log("ClockedinListItem, makeNavToTimeTicketClockOff, jobId :", jbId)
|
||||
setTmTicketJobIdRedux(ticket.job.id),
|
||||
//,
|
||||
navigation.navigate("TimeTicketClockOff")
|
||||
);
|
||||
// const onPress = (ticket, setCameraJobId) => {
|
||||
// console.log("ClockedinListItem, onPress called");
|
||||
@@ -72,13 +75,12 @@ export function ClockedinListItem( {setTmTicketJobId, ticket }) {
|
||||
<Card.Content>
|
||||
<Text>
|
||||
Vehicle :
|
||||
{`${ticket.job.v_model_yr || ""} ${
|
||||
ticket.job.v_make_desc || ""
|
||||
} ${ticket.job.v_model_desc || ""}`}
|
||||
{`${ticket.job.v_model_yr || ""} ${ticket.job.v_make_desc || ""} ${
|
||||
ticket.job.v_model_desc || ""
|
||||
}`}
|
||||
</Text>
|
||||
<Text>
|
||||
Clocked In :{" "}
|
||||
<DateTimeFormatter>{ticket.clockon}</DateTimeFormatter>
|
||||
Clocked In : <DateTimeFormatter>{ticket.clockon}</DateTimeFormatter>
|
||||
</Text>
|
||||
<Text>
|
||||
Cost Center :{" "}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { View, Text, FlatList, RefreshControl } from "react-native";
|
||||
import { useQuery } from "@apollo/client";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
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";
|
||||
|
||||
@@ -38,9 +38,9 @@ export function EmployeeClockedInList({ technician }) {
|
||||
);
|
||||
if (loading) return <ActivityIndicator color="dodgerblue" size="large" />;
|
||||
if (error) return <ErrorDisplay errorMessage={error.message} />;
|
||||
|
||||
|
||||
console.log("EmployeeClockedInList, QUERY_ACTIVE_TIME_TICKETS data:", data);
|
||||
// if (data) () => {setTmTicketJobId(data)}
|
||||
// if (data) () => {setTmTicketJobId(data)}
|
||||
|
||||
const onRefresh = async () => {
|
||||
return refetch();
|
||||
@@ -50,13 +50,15 @@ export function EmployeeClockedInList({ technician }) {
|
||||
<View>
|
||||
{data.timetickets.length > 0 ? (
|
||||
<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
|
||||
data={data.timetickets}
|
||||
refreshControl={
|
||||
<RefreshControl refreshing={loading} onRefresh={onRefresh} />
|
||||
}
|
||||
renderItem={(object) => <ClockedinListItem ticket={object.item} />}
|
||||
renderItem={(object) => <ClockedinListItem ticket={object.item} />}
|
||||
// setTmTicketJobId={setTmTicketJobId}
|
||||
/>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user