From 130dac39214908e9afd77ceecf06a46ee1bd74c2 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 20 May 2021 16:14:35 -0700 Subject: [PATCH 1/3] Update env. vars and remove logs. --- app.json | 4 +-- .../screen-media-browser.component.jsx | 30 ++++++++----------- env.js | 1 - util/document-upload.utility.js | 9 ++---- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/app.json b/app.json index 69db046..861d9ec 100644 --- a/app.json +++ b/app.json @@ -8,12 +8,12 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "com.imex.imexmobile", - "buildNumber": "1.0.12", + "buildNumber": "1.0.12-1", "googleServicesFile": "./GoogleService-Info.plist" }, "android": { "package": "com.imex.imexmobile", - "versionCode": 12, + "versionCode": 1001201, "googleServicesFile": "./google-services.json" }, "splash": { diff --git a/components/screen-media-browser/screen-media-browser.component.jsx b/components/screen-media-browser/screen-media-browser.component.jsx index 6149b55..d9c109f 100644 --- a/components/screen-media-browser/screen-media-browser.component.jsx +++ b/components/screen-media-browser/screen-media-browser.component.jsx @@ -52,7 +52,6 @@ export function ImageBrowserScreen({ const client = useApolloClient(); async function handleOnSuccess(uri, id) { - console.log("Succesful upload!", uri); logImEXEvent("imexmobile_successful_upload"); setUploads((prevUploads) => _.omit(prevUploads, uri)); } @@ -77,17 +76,17 @@ export function ImageBrowserScreen({ return (await acc) + info.size; }, 0); - console.log( - "Size of uploaded documents.", - queryData.data.documents_aggregate.aggregate.sum.size, - "Shop Limit", - bodyshop.jobsizelimit, - "Space remaining", - bodyshop.jobsizelimit - - queryData.data.documents_aggregate.aggregate.sum.size, - "Total of uploaded files", - totalOfUploads - ); + // console.log( + // "Size of uploaded documents.", + // queryData.data.documents_aggregate.aggregate.sum.size, + // "Shop Limit", + // bodyshop.jobsizelimit, + // "Space remaining", + // bodyshop.jobsizelimit - + // queryData.data.documents_aggregate.aggregate.sum.size, + // "Total of uploaded files", + // totalOfUploads + // ); if ( bodyshop.jobsizelimit - @@ -108,7 +107,7 @@ export function ImageBrowserScreen({ let filename; //Appears to work for android. //iOS provides the filename, android doe snot. - console.log("pid", p.id); + filename = p.filename || p.uri.split("/").pop(); const result = await handleUpload( { @@ -133,10 +132,7 @@ export function ImageBrowserScreen({ if (deleteAfterUpload) { try { - const result = await MediaLibrary.deleteAssetsAsync( - ret.map((r) => r.mediaId) - ); - console.log("Delete result :>> ", result); + await MediaLibrary.deleteAssetsAsync(ret.map((r) => r.mediaId)); } catch (error) { console.log("Unable to delete picture.", error); } diff --git a/env.js b/env.js index 3993032..f27c4e5 100644 --- a/env.js +++ b/env.js @@ -45,7 +45,6 @@ function getEnvVars() { let env = process.env.NODE_ENV; if (env === null || env === undefined || env === "") return ENV.dev; if (env.indexOf("dev") !== -1) return ENV.dev; - if (env.indexOf("staging") !== -1) return ENV.staging; if (env.indexOf("prod") !== -1) return ENV.prod; else return ENV.prod; } diff --git a/util/document-upload.utility.js b/util/document-upload.utility.js index 79e08bf..ecd8af9 100644 --- a/util/document-upload.utility.js +++ b/util/document-upload.utility.js @@ -57,7 +57,7 @@ export const uploadToCloudinary = async ( tagsArray ? tagsArray.map((tag) => `${tag},`) : "" }`; // let eager = process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS; - console.log("fileType", fileType); + const upload_preset = fileType.startsWith("video") ? "incoming_upload_video" : "incoming_upload"; @@ -134,12 +134,9 @@ export const uploadToCloudinary = async ( if (onError) onError(cloudinaryUploadResponse.statusText); return { success: false, error: cloudinaryUploadResponse.statusText }; } - console.log("mediaId", mediaId); + const imageData = await MediaLibrary.getAssetInfoAsync(mediaId); - console.log( - "🚀 ~ file: document-upload.utility.js ~ line 140 ~ imageData", - imageData.creationTime - ); + //Insert the document with the matching key. const documentInsert = await client.mutate({ mutation: INSERT_NEW_DOCUMENT, From f4b045bc33286e6bd73de91fc9c1c7a7bf6453cc Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 20 May 2021 16:53:00 -0700 Subject: [PATCH 2/3] Additions Channel Testing --- app.json | 2 +- .../screen-settings/screen-settings.component.jsx | 3 ++- env.js | 12 +++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app.json b/app.json index 861d9ec..9acfb58 100644 --- a/app.json +++ b/app.json @@ -8,7 +8,7 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "com.imex.imexmobile", - "buildNumber": "1.0.12-1", + "buildNumber": "1.0.12.1", "googleServicesFile": "./GoogleService-Info.plist" }, "android": { diff --git a/components/screen-settings/screen-settings.component.jsx b/components/screen-settings/screen-settings.component.jsx index a63a490..ddb0fd1 100644 --- a/components/screen-settings/screen-settings.component.jsx +++ b/components/screen-settings/screen-settings.component.jsx @@ -1,7 +1,7 @@ import Constants from "expo-constants"; import React from "react"; import { useTranslation } from "react-i18next"; -import { Button, View } from "react-native"; +import { Button, View, Text } from "react-native"; import { Title } from "react-native-paper"; import { purgeStoredState } from "redux-persist"; import SignOutButton from "../sign-out-button/sign-out-button.component"; @@ -24,6 +24,7 @@ export default function ScreenSettingsComponent() {