Add VIN to vehicle info.

This commit is contained in:
Patrick Fic
2022-08-30 12:40:37 -07:00
parent e25172f0bf
commit 1530a9ea60
3 changed files with 16 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from "react";
import React, { useEffect, useState } from "react";
import {
FlatList,
Image,
@@ -7,16 +7,10 @@ import {
TouchableOpacity,
View,
} from "react-native";
import env from "../../env";
import { DetermineFileType } from "../../util/document-upload.utility";
import MediaCacheOverlay from "../media-cache-overlay/media-cache-overlay.component";
import * as Sentry from "sentry-expo";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import axios from "axios";
import cleanAxios from "../../util/CleanAxios";
import normalizeUrl from "normalize-url";
export default function JobDocumentsLocalComponent({ bodyshop, job }) {
const [previewVisible, setPreviewVisible] = useState(false);
@@ -24,7 +18,6 @@ export default function JobDocumentsLocalComponent({ bodyshop, job }) {
const [imgIndex, setImgIndex] = useState(0);
useEffect(() => {
if (job.id) {
console.log("Getting Photos!");
getPhotos({ bodyshop, jobid: job.id, setImages });
}
}, [job.id, bodyshop]);
@@ -32,7 +25,7 @@ export default function JobDocumentsLocalComponent({ bodyshop, job }) {
const onRefresh = async () => {
return getPhotos({ bodyshop, jobid: job.id, setImages });
};
console.log(images);
return (
<View style={{ flex: 1 }}>
<FlatList
@@ -78,7 +71,6 @@ export default function JobDocumentsLocalComponent({ bodyshop, job }) {
}
async function getPhotos({ bodyshop, jobid, setImages }) {
console.log("In Get Photos", bodyshop.localmediatoken);
const localmediaserverhttp = bodyshop.localmediaserverhttp.trim();
try {
const imagesFetch = await cleanAxios.post(
@@ -88,10 +80,6 @@ async function getPhotos({ bodyshop, jobid, setImages }) {
},
{ headers: { ims_token: bodyshop.localmediatoken } }
);
console.log(
"🚀 ~ file: job-documents-local.component.jsx ~ line 86 ~ imagesFetch",
imagesFetch
);
const normalizedImages = imagesFetch.data
.filter((d) => d.type?.mime?.startsWith("image"))
@@ -110,6 +98,6 @@ async function getPhotos({ bodyshop, jobid, setImages }) {
});
setImages(normalizedImages);
} catch (error) {
console.log("error,", error);
Sentry.Native.captureException(error);
}
}

View File

@@ -58,9 +58,14 @@ export default function JobTombstone({ job, loading, refetch }) {
/>
<DataLabelComponent
label={t("objects.jobs.fields.vehicle")}
content={`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
job.v_model_desc || ""
}`}
content={
<View>
<Text>{`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
job.v_model_desc || ""
}`}</Text>
<Text>{job.v_vin}</Text>
</View>
}
/>
</View>
<View style={localStyles.twoColumnCardColumn}>