added missing fuctionallity

This commit is contained in:
jfrye122
2023-05-14 21:02:09 -04:00
parent be9d285ac9
commit d19bc10865
18 changed files with 397 additions and 87 deletions

View File

@@ -0,0 +1,43 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { FlatList, RefreshControl, StyleSheet, Text, View } from "react-native";
import { Card, DataTable } from "react-native-paper";
import { GET_LINE_TICKET_BY_PK } from "../../graphql/jobs.queries";
import ErrorDisplay from "../error-display/error-display.component";
import { useQuery } from "@apollo/client";
import { connect } from "react-redux";
export function LaborAllocationsTableContainer({ jobId }) {
console.log("LaborAllocationsTableContainer, jobId", jobId);
const { t } = useTranslation();
const { loading, error, data, refetch } = useQuery(GET_LINE_TICKET_BY_PK, {
variables: { id: jobId },
skip: !!!jobId,
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
});
console.log("LaborAllocationsTableContainer, data", data);
if (error) return <ErrorDisplay errorMessage={error.message} />;
return (
<View>
{data ? (
<LaborAllocationsTableContainer
loading={loading}
refetch={refetch}
jobId={jobId}
joblines={data ? data.joblines : []}
timetickets={data ? data.timetickets : []}
adjustments={data ? data.jobs_by_pk.lbr_adjustments : []}
/>
) : null}
</View>
);
}
const localStyles = StyleSheet.create({});
export default connect(null, null)(LaborAllocationsTableContainer);

View File

@@ -243,13 +243,13 @@ headerArea:{
margin:1
},
footertext:{
flex:1, textAlign:'center', textAlignVertical:'center',margin:1
flex:1, textAlign:'center', textAlignVertical:'center',margin:1,paddingBottom:8
},
headertext:{
flex:1, textAlign:'center', textAlignVertical:'center',backgroundColor:'blue',margin:1
flex:1, textAlign:'center', textAlignVertical:'center',margin:1,paddingBottom:8
},
headertextAdjusts:{
flex:1, textAlign:'center', textAlignVertical:'center',backgroundColor:'green',margin:1
flex:1, textAlign:'center', textAlignVertical:'center',margin:1,paddingBottom:8
},