Finalize 1.7.0. All uploads working.

This commit is contained in:
Patrick Fic
2025-06-02 14:18:13 -07:00
parent d23f0e4c6f
commit 491f0e1a3b
5 changed files with 116 additions and 15 deletions

View File

@@ -16,7 +16,6 @@
"ios": { "ios": {
"supportsTablet": true, "supportsTablet": true,
"bundleIdentifier": "com.imex.imexmobile", "bundleIdentifier": "com.imex.imexmobile",
"googleServicesFile": "./GoogleService-Info.plist", "googleServicesFile": "./GoogleService-Info.plist",
"entitlements": { "entitlements": {
"aps-environment": "development" "aps-environment": "development"
@@ -29,7 +28,6 @@
}, },
"android": { "android": {
"package": "com.imex.imexmobile", "package": "com.imex.imexmobile",
"googleServicesFile": "./google-services.json", "googleServicesFile": "./google-services.json",
"permissions": [ "permissions": [
"android.permission.READ_EXTERNAL_STORAGE", "android.permission.READ_EXTERNAL_STORAGE",
@@ -89,7 +87,16 @@
} }
], ],
"expo-localization", "expo-localization",
"expo-font" "expo-font",
[
"expo-build-properties",
{
"android": {
"minSdkVersion": 25
}
}
],
"@logrocket/react-native"
] ]
} }
} }

View File

@@ -27,6 +27,8 @@ import ScreenSettingsComponent from "../screen-settings/screen-settings.componen
import ScreenSignIn from "../screen-sign-in/screen-sign-in.component"; import ScreenSignIn from "../screen-sign-in/screen-sign-in.component";
import ScreenSplash from "../screen-splash/screen-splash.component"; import ScreenSplash from "../screen-splash/screen-splash.component";
import { SplitFactory } from "@splitsoftware/splitio-react-native"; import { SplitFactory } from "@splitsoftware/splitio-react-native";
import * as Updates from 'expo-updates';
import LogRocket from '@logrocket/react-native';
const ActiveJobStack = createNativeStackNavigator(); const ActiveJobStack = createNativeStackNavigator();
const MoreStack = createNativeStackNavigator(); const MoreStack = createNativeStackNavigator();
@@ -161,6 +163,13 @@ export function ScreenMainComponent({
checkUserSession(); checkUserSession();
}, [checkUserSession]); }, [checkUserSession]);
useEffect(() => {
LogRocket.init('idt6oy/imex-mobile', {
updateId: Updates.isEmbeddedLaunch ? null : Updates.updateId,
expoChannel: Updates.channel,
});
}, []);
useEffect(() => { useEffect(() => {
if (bodyshop && bodyshop.imexshopid) { if (bodyshop && bodyshop.imexshopid) {
splitClient = SplitFactory({ splitClient = SplitFactory({

82
package-lock.json generated
View File

@@ -11,6 +11,7 @@
"@apollo/client": "^3.12.11", "@apollo/client": "^3.12.11",
"@babel/preset-env": "7.26.8", "@babel/preset-env": "7.26.8",
"@expo/vector-icons": "^14.0.4", "@expo/vector-icons": "^14.0.4",
"@logrocket/react-native": "^1.52.2",
"@react-native-async-storage/async-storage": "1.23.1", "@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/cli-debugger-ui": "^15.1.3", "@react-native-community/cli-debugger-ui": "^15.1.3",
"@react-native-community/datetimepicker": "8.2.0", "@react-native-community/datetimepicker": "8.2.0",
@@ -28,6 +29,7 @@
"expo": "~52.0.46", "expo": "~52.0.46",
"expo-application": "~6.0.2", "expo-application": "~6.0.2",
"expo-av": "~15.0.2", "expo-av": "~15.0.2",
"expo-build-properties": "~0.13.3",
"expo-constants": "~17.0.5", "expo-constants": "~17.0.5",
"expo-dev-client": "~5.0.20", "expo-dev-client": "~5.0.20",
"expo-device": "~7.0.3", "expo-device": "~7.0.3",
@@ -5099,6 +5101,23 @@
"@jridgewell/sourcemap-codec": "^1.4.14" "@jridgewell/sourcemap-codec": "^1.4.14"
} }
}, },
"node_modules/@logrocket/react-native": {
"version": "1.52.2",
"resolved": "https://registry.npmjs.org/@logrocket/react-native/-/react-native-1.52.2.tgz",
"integrity": "sha512-5feLSonnPhr1zdExwknY28nvrr1dw6XsUGqx9OdEArsM/CTDaQaSXwXg+B3nj8VVCcCje8Ihc7ZgiboPJAEUtw==",
"license": "MIT",
"peerDependencies": {
"expo": ">=45.0.0",
"expo-build-properties": "*",
"react": "*",
"react-native": ">=0.60.0-rc.0 <1.0.x"
},
"peerDependenciesMeta": {
"expo": {
"optional": true
}
}
},
"node_modules/@nodelib/fs.scandir": { "node_modules/@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -9354,6 +9373,53 @@
} }
} }
}, },
"node_modules/expo-build-properties": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/expo-build-properties/-/expo-build-properties-0.13.3.tgz",
"integrity": "sha512-gw7AYP+YF50Gr912BedelRDTfR4GnUEn9p5s25g4nv0hTJGWpBZdCYR5/Oi2rmCHJXxBqhPjxzV7JRh72fntLg==",
"license": "MIT",
"dependencies": {
"ajv": "^8.11.0",
"semver": "^7.6.0"
},
"peerDependencies": {
"expo": "*"
}
},
"node_modules/expo-build-properties/node_modules/ajv": {
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/epoberezkin"
}
},
"node_modules/expo-build-properties/node_modules/json-schema-traverse": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
"license": "MIT"
},
"node_modules/expo-build-properties/node_modules/semver": {
"version": "7.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
"integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/expo-constants": { "node_modules/expo-constants": {
"version": "17.0.8", "version": "17.0.8",
"resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-17.0.8.tgz", "resolved": "https://registry.npmjs.org/expo-constants/-/expo-constants-17.0.8.tgz",
@@ -9933,6 +9999,22 @@
"resolved": "https://registry.npmjs.org/fast-loops/-/fast-loops-1.1.3.tgz", "resolved": "https://registry.npmjs.org/fast-loops/-/fast-loops-1.1.3.tgz",
"integrity": "sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g==" "integrity": "sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g=="
}, },
"node_modules/fast-uri": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
"integrity": "sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fastify"
},
{
"type": "opencollective",
"url": "https://opencollective.com/fastify"
}
],
"license": "BSD-3-Clause"
},
"node_modules/fastq": { "node_modules/fastq": {
"version": "1.17.1", "version": "1.17.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",

View File

@@ -19,6 +19,7 @@
"@apollo/client": "^3.12.11", "@apollo/client": "^3.12.11",
"@babel/preset-env": "7.26.8", "@babel/preset-env": "7.26.8",
"@expo/vector-icons": "^14.0.4", "@expo/vector-icons": "^14.0.4",
"@logrocket/react-native": "^1.52.2",
"@react-native-async-storage/async-storage": "1.23.1", "@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/cli-debugger-ui": "^15.1.3", "@react-native-community/cli-debugger-ui": "^15.1.3",
"@react-native-community/datetimepicker": "8.2.0", "@react-native-community/datetimepicker": "8.2.0",
@@ -36,12 +37,14 @@
"expo": "~52.0.46", "expo": "~52.0.46",
"expo-application": "~6.0.2", "expo-application": "~6.0.2",
"expo-av": "~15.0.2", "expo-av": "~15.0.2",
"expo-build-properties": "~0.13.3",
"expo-constants": "~17.0.5", "expo-constants": "~17.0.5",
"expo-dev-client": "~5.0.20", "expo-dev-client": "~5.0.20",
"expo-device": "~7.0.3", "expo-device": "~7.0.3",
"expo-file-system": "~18.0.10", "expo-file-system": "~18.0.10",
"expo-font": "~13.0.3", "expo-font": "~13.0.3",
"expo-image-manipulator": "~13.0.6", "expo-image-manipulator": "~13.0.6",
"expo-image-picker": "~16.0.6",
"expo-images-picker": "^2.5.1", "expo-images-picker": "^2.5.1",
"expo-localization": "~16.0.1", "expo-localization": "~16.0.1",
"expo-media-library": "~17.0.6", "expo-media-library": "~17.0.6",
@@ -89,8 +92,7 @@
"redux-logger": "^3.0.6", "redux-logger": "^3.0.6",
"redux-persist": "^6.0.0", "redux-persist": "^6.0.0",
"redux-saga": "^1.3.0", "redux-saga": "^1.3.0",
"reselect": "^5.1.1", "reselect": "^5.1.1"
"expo-image-picker": "~16.0.6"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.26.8", "@babel/core": "^7.26.8",

View File

@@ -18,13 +18,13 @@ export const handleUpload = async (ev, context) => {
const { mediaId, onError, onSuccess, onProgress } = ev; const { mediaId, onError, onSuccess, onProgress } = ev;
const { bodyshop, jobId } = context; const { bodyshop, jobId } = context;
try { try {
const imageData = await MediaLibrary.getAssetInfoAsync(mediaId); const imageData = await MediaLibrary.getAssetInfoAsync(mediaId);
const imageUri = imageData.localUri || imageData.uri
const newFile = await ( const newFile = await (
await fetch(imageData.localUri || imageData.uri) await fetch(imageUri)
).blob(); ).blob();
let extension = imageData.localUri.split(".").pop(); let extension = imageData.filename.split(".").pop();
//Default to Cloudinary in case of split treatment errors. //Default to Cloudinary in case of split treatment errors.
let destination = let destination =
@@ -33,10 +33,10 @@ export const handleUpload = async (ev, context) => {
let key = let key =
destination === "imgproxy" destination === "imgproxy"
? `${bodyshop.id}/${jobId}/${replaceAccents( ? `${bodyshop.id}/${jobId}/${replaceAccents(
imageData.filename || imageData.uri.split("/").pop() imageData.filename || imageUri.split("/").pop()
).replace(/[^A-Z0-9]+/gi, "_")}-${new Date().getTime()}.${extension}` ).replace(/[^A-Z0-9]+/gi, "_")}-${new Date().getTime()}.${extension}`
: `${bodyshop.id}/${jobId}/${( : `${bodyshop.id}/${jobId}/${(
imageData.filename || imageData.uri.split("/").pop() imageData.filename || imageUri.split("/").pop()
).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`; ).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`;
const res = const res =
@@ -82,14 +82,14 @@ export const handleUpload = async (ev, context) => {
export const handleUploadImgproxy = async (ev, context) => { export const handleUploadImgproxy = async (ev, context) => {
const { mediaId, onError, onSuccess, onProgress } = ev; const { mediaId, onError, onSuccess, onProgress } = ev;
const { bodyshop, jobId } = context; const { bodyshop, jobId } = context;
const imageData = await MediaLibrary.getAssetInfoAsync(mediaId); const imageData = await MediaLibrary.getAssetInfoAsync(mediaId);
const imageUri = imageData.localUri || imageData.uri
const newFile = await ( const newFile = await (
await fetch(imageData.localUri || imageData.uri) await fetch(imageUri)
).blob(); ).blob();
let extension = imageData.localUri.split(".").pop(); let extension = imageUri.split(".").pop();
let key = `${bodyshop.id}/${jobId}/${( let key = `${bodyshop.id}/${jobId}/${(
imageData.filename || imageData.uri.split("/").pop() imageData.filename || imageUri.split("/").pop()
).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`; ).replace(/\.[^/.]+$/, "")}-${new Date().getTime()}`;
const res = await uploadToImgproxy( const res = await uploadToImgproxy(
@@ -158,6 +158,7 @@ export const uploadToImgproxy = async (
xhr.setRequestHeader("Content-Type", fileType); xhr.setRequestHeader("Content-Type", fileType);
xhr.upload.onprogress = (event) => { xhr.upload.onprogress = (event) => {
console.log("*** ~ awaitnewPromise ~ event:", event);
if (onProgress && event.lengthComputable) { if (onProgress && event.lengthComputable) {
onProgress({ percent: event.loaded / event.total, loaded: event.loaded }); onProgress({ percent: event.loaded / event.total, loaded: event.loaded });
} }
@@ -171,7 +172,7 @@ export const uploadToImgproxy = async (
} }
}; };
xhr.onerror = () => { xhr.onerror = (req, event) => {
reject(new Error("Network error")); reject(new Error("Network error"));
}; };