From 1311b0f8e7b6a6e312e1a4bd226e559309c7f0d4 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 16 Aug 2023 12:48:54 -0700 Subject: [PATCH] Remove time tickets from bottom tab navigation, and update version for production deployment. --- app.json | 21 +- components/Modals/JobSearchAndSelectModal.jsx | 210 +-- .../camera-select-job.component.jsx | 6 +- .../screen-main/screen-main.component.jsx | 30 +- package.json | 52 +- yarn.lock | 1147 +++++++++++++---- 6 files changed, 1086 insertions(+), 380 deletions(-) diff --git a/app.json b/app.json index 3d10074..3a0fd27 100644 --- a/app.json +++ b/app.json @@ -4,7 +4,7 @@ "slug": "rome-mobile", "version": "1.5.0", "extra": { - "expover": "2", + "expover": "3", "eas": { "projectId": "df105e21-a07f-4425-af10-2200a7704a48" } @@ -14,7 +14,7 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "com.rome.mobile", - "buildNumber": "2", + "buildNumber": "3", "googleServicesFile": "./GoogleService-Info.plist", "infoPlist": { "NSPhotoLibraryUsageDescription": "Allow $(PRODUCT_NAME) to access your photos.", @@ -23,7 +23,7 @@ }, "android": { "package": "com.rome.mobile", - "versionCode": 2, + "versionCode": 3, "googleServicesFile": "./google-services.json", "permissions": [ "android.permission.READ_EXTERNAL_STORAGE", @@ -47,14 +47,13 @@ "favicon": "./assets/RomeIcon.png", "config": { "firebase": { - "apiKey": "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU", - "authDomain": "imex-prod.firebaseapp.com", - "databaseURL": "https://imex-prod.firebaseio.com", - "projectId": "imex-prod", - "storageBucket": "imex-prod.appspot.com", - "messagingSenderId": "253497221485", - "appId": "1:253497221485:web:9b65736a635a45ce227a64", - "measurementId": "G-96694D66L2" + "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", + "authDomain": "rome-prod-1.firebaseapp.com", + "projectId": "rome-prod-1", + "storageBucket": "rome-prod-1.appspot.com", + "messagingSenderId": "147786367145", + "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", + "measurementId": "G-G8Z9DRHTZS" } } }, diff --git a/components/Modals/JobSearchAndSelectModal.jsx b/components/Modals/JobSearchAndSelectModal.jsx index 2b55159..eccb318 100644 --- a/components/Modals/JobSearchAndSelectModal.jsx +++ b/components/Modals/JobSearchAndSelectModal.jsx @@ -2,13 +2,20 @@ import { useLazyQuery, useQuery } from "@apollo/client"; import { Ionicons } from "@expo/vector-icons"; import React from "react"; import { useTranslation } from "react-i18next"; -import { FlatList, RefreshControl, Text, View } from "react-native"; +import { + FlatList, + Keyboard, + KeyboardAvoidingView, + RefreshControl, + Text, + View, +} from "react-native"; import { Button, List, Modal, Portal, Searchbar } from "react-native-paper"; import { connect } from "react-redux"; import { SEARCH_JOBS_FOR_AUTOCOMPLETE } from "../../graphql/jobs.queries"; import ErrorDisplay from "../error-display/error-display.component"; import _ from "lodash"; -import { useCallback,useRef, useEffect } from "react"; +import { useCallback, useRef, useEffect } from "react"; const useIsMounted = () => { const isMounted = useRef(false); @@ -23,7 +30,6 @@ const useIsMounted = () => { }; export function JobSearchAndSelectModal(props) { - const { t } = useTranslation(); const jobSrchNotExported = props?.notExported !== undefined ? props.notExported : true; @@ -35,7 +41,7 @@ export function JobSearchAndSelectModal(props) { const jobSrchCurrentValue = props?.currentValue !== undefined ? props.currentValue - : { id:"temp", ro_number:t("selectjobid.labels.noselection") }; + : { id: "temp", ro_number: t("selectjobid.labels.noselection") }; const jobSrchOnSetCurrentValue = props?.onSetCurrentValue !== undefined ? props.onSetCurrentValue @@ -50,7 +56,8 @@ export function JobSearchAndSelectModal(props) { const hideModal = () => setVisible(false); const [searchQuery, { loading, error, data, refetch }] = useLazyQuery( - SEARCH_JOBS_FOR_AUTOCOMPLETE,{fetchPolicy: "cache-and-network",} + SEARCH_JOBS_FOR_AUTOCOMPLETE, + { fetchPolicy: "cache-and-network" } ); if (error) return ; const onRefresh = async () => { @@ -61,8 +68,10 @@ export function JobSearchAndSelectModal(props) { search: searchText, }); }; - const search = (v) => {if (v && v !== "") searchQuery(v);}; - const searchDebouncer = useCallback(_.debounce(search, 1000),[]); + const search = (v) => { + if (v && v !== "") searchQuery(v); + }; + const searchDebouncer = useCallback(_.debounce(search, 1000), []); const onChangeSearch = (query) => { setSearchText(query); searchDebouncer({ @@ -87,104 +96,109 @@ export function JobSearchAndSelectModal(props) { }, []); useEffect(() => { - setTimeout(() => { - if (visible) { - setFocus(); - } - }, 300); + setTimeout(() => { + if (visible) { + setFocus(); + } + }, 300); }, [visible, isMounted]); return ( <> - - - + + - - - - - } - data={data?.search_jobs} - keyExtractor={(item) => item.id} - renderItem={(object) => ( - { - jobSrchOnSetCurrentValue(object.item); - hideModal(); - setSearchText(""); - }} - left={() => { - if (object.item.id !== jobSrchCurrentValue?.id) return null; - return ( - - ); - }} - titleStyle={{ - ...(object.item.id === jobSrchCurrentValue?.id - ? { color: "dodgerblue" } - : {}), - }} - title={`${ - object.item.ro_number ? `${object.item.ro_number} ` : `` - }${object.item.ownr_fn || ""} ${object.item.ownr_ln || ""}${ - object.item.v_model_yr ? `- ${object.item.v_model_yr}` : "" - }${ - object.item.v_make_desc ? `- ${object.item.v_make_desc}` : "" - }${ - object.item.v_model_desc - ? `- ${object.item.v_model_desc}` - : "" - }`} - key={object.item.id} + + + - )} - ListEmptyComponent={ - - {t("selectjobid.labels.nodata")} - - } - /> - - + + + } + data={data?.search_jobs} + keyExtractor={(item) => item.id} + renderItem={(object) => ( + { + jobSrchOnSetCurrentValue(object.item); + hideModal(); + setSearchText(""); + }} + left={() => { + if (object.item.id !== jobSrchCurrentValue?.id) return null; + return ( + + ); + }} + titleStyle={{ + ...(object.item.id === jobSrchCurrentValue?.id + ? { color: "dodgerblue" } + : {}), + }} + title={`${ + object.item.ro_number ? `${object.item.ro_number} ` : `` + }${object.item.ownr_fn || ""} ${object.item.ownr_ln || ""}${ + object.item.v_model_yr ? `- ${object.item.v_model_yr}` : "" + }${ + object.item.v_make_desc + ? `- ${object.item.v_make_desc}` + : "" + }${ + object.item.v_model_desc + ? `- ${object.item.v_model_desc}` + : "" + }`} + key={object.item.id} + /> + )} + ListEmptyComponent={ + + {t("selectjobid.labels.nodata")} + + } + /> + + + +