Kaynağa Gözat

resolve merge

cdmoss 2 yıl önce
ebeveyn
işleme
44b07caa93

+ 2 - 8
ios/Podfile.lock

@@ -20,7 +20,7 @@ PODS:
     - ExpoModulesCore
   - EXManifests (0.2.2):
     - EXJSONUtils
-  - EXNotifications (0.13.3):
+  - EXNotifications (0.15.2):
     - ExpoModulesCore
   - Expo (43.0.3):
     - ExpoModulesCore
@@ -424,8 +424,6 @@ PODS:
     - TensorFlowLiteSwift/Core (= 2.3.0)
   - TensorFlowLiteSwift/Core (2.3.0):
     - TensorFlowLiteC (= 2.3.0)
-  - UMTaskManagerInterface (7.0.3):
-    - ExpoModulesCore
   - Yoga (1.14.0)
 
 DEPENDENCIES:
@@ -506,7 +504,6 @@ DEPENDENCIES:
   - RNScreens (from `../node_modules/react-native-screens`)
   - RNSha256 (from `../node_modules/react-native-sha256`)
   - RNSVG (from `../node_modules/react-native-svg`)
-  - UMTaskManagerInterface (from `../node_modules/unimodules-task-manager-interface/ios`)
   - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
 
 SPEC REPOS:
@@ -671,8 +668,6 @@ EXTERNAL SOURCES:
     :path: "../node_modules/react-native-sha256"
   RNSVG:
     :path: "../node_modules/react-native-svg"
-  UMTaskManagerInterface:
-    :path: "../node_modules/unimodules-task-manager-interface/ios"
   Yoga:
     :path: "../node_modules/react-native/ReactCommon/yoga"
 
@@ -689,7 +684,7 @@ SPEC CHECKSUMS:
   EXJSONUtils: f515cf71710855d7ba5bfc6752af3b9a6f6aad01
   EXKeepAwake: 8aa32396a5972d26e75e538603aad0f032396503
   EXManifests: 50e42e01335df4e54109dee7be5a91bfd37347db
-  EXNotifications: 4a2beb5a2a7292ba64165413811b7c495bcb1297
+  EXNotifications: ea9fc56d27d1fee229489c5d8f452c7f367c237e
   Expo: 5316c3ecdc34eb0cad340d01dc8beec97c7e879e
   ExpoModulesCore: a9a9bf32b2da35cd9b7299c80790c03a91ac7d15
   EXRandom: 64c954ae24619b8d0c18ff46aa96401e98efc977
@@ -760,7 +755,6 @@ SPEC CHECKSUMS:
   Spokestack-iOS: 090ed0e757276f2407beec82fa851ec3e408b5b9
   TensorFlowLiteC: 51f50caf5777f740a70e2c1a5dbdc149e7aeb50b
   TensorFlowLiteSwift: fb152cc1eec36b25b03a23c07f5d58113170af58
-  UMTaskManagerInterface: 5654c50e68af11b19b9d05452bacf23d19b3f30f
   Yoga: e6ecf3fa25af9d4c87e94ad7d5d292eedef49749
 
 PODFILE CHECKSUM: 36a2eb9184cd7de694ef4e992701e848c207fffb

+ 3 - 2
ios/cnpmobile.xcodeproj/project.pbxproj

@@ -442,7 +442,7 @@
 				INFOPLIST_FILE = cnpmobile/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
-				MARKETING_VERSION = 0.1.6;
+				MARKETING_VERSION = 0.1.8;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -471,10 +471,11 @@
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
 				DEVELOPMENT_TEAM = HK88UHWMF2;
+				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = cnpmobile/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
-				MARKETING_VERSION = 0.1.6;
+				MARKETING_VERSION = 0.1.8;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 4 - 2
src/components/Map/Panels/LandmarkDetailsPanel/CommentsContainer.tsx

@@ -7,7 +7,7 @@
 
 import { FontAwesome } from "@expo/vector-icons";
 import React, { MutableRefObject } from "react";
-import { FlatList, Keyboard, ListRenderItem, StyleSheet, Text, TextInput, View } from "react-native";
+import { FlatList, Keyboard, ListRenderItem, StyleSheet, Text, TextInput, View, ScrollView } from "react-native";
 import { useAuth } from "../../../../data/Auth/AuthContext";
 import { LMComment } from "../../../../data/comments";
 import { MainTabsNavigationProp } from "../../../../navigation/MainTabsNavigator";
@@ -29,6 +29,7 @@ interface CommentsContainerProps {
     addComment: () => void
     commentListRef: MutableRefObject<FlatList>
     commentTextInputRef: MutableRefObject<TextInput>
+    mainScrollRef: MutableRefObject<ScrollView>
     setKeyboardOpened: (state: boolean) => void
     keyboardOpened: boolean
     authNavigation: MainTabsNavigationProp
@@ -93,7 +94,8 @@ export const CommentsContainer: React.FC<CommentsContainerProps> = (props) => {
                 onChangeText={props.commentBeingEdited ? value => props.setCommentBeingEdited({...props.commentBeingEdited, content: value}) : value => props.setNewComment(value)} 
                 value={props.commentBeingEdited ? props.commentBeingEdited.content : props.newCommentId}
                 placeholderTextColor="gray" 
-                style={{padding: 10, flex: 5}}
+                style={{padding: 15, paddingTop: 15, flex: 5}}
+                onFocus={() => props.mainScrollRef.current.scrollToEnd()}
                 multiline={true} />
             {props.newCommentId || props.commentBeingEdited ? 
             <View style={{alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', flex: 1}}>

+ 4 - 2
src/components/Map/Panels/LandmarkDetailsPanel/DetailsBody.tsx

@@ -7,7 +7,7 @@
 
 import { FontAwesome } from "@expo/vector-icons";
 import { useNavigationState } from "@react-navigation/native";
-import React, { MutableRefObject, useEffect, useState } from "react";
+import React, { MutableRefObject, useEffect, useRef, useState } from "react";
 import { FlatList, Image, ScrollView, StyleSheet, Text, TextInput, View } from "react-native";
 import Picker from "react-native-picker-select";
 import { QueryStatus } from "react-query";
@@ -61,6 +61,7 @@ export const DetailsBody: React.FC<DetailsBodyProps> = (props) => {
 
     const navigationState = useNavigationState(state => state)
     const [currentRoute, setCurrentRoute] = useState<string>()
+    const mainScrollRef = useRef<ScrollView>()
     useEffect(() => {
         const currentRouteIndex = navigationState?.routes[0]?.state?.index
         const currentRouteName = navigationState?.routes[0]?.state?.routeNames[currentRouteIndex]
@@ -129,7 +130,7 @@ export const DetailsBody: React.FC<DetailsBodyProps> = (props) => {
     }
 
     return (
-        <ScrollView nestedScrollEnabled={true} contentContainerStyle={{justifyContent: 'space-between'}} style={{flex: 1, marginHorizontal: 20}}>
+        <ScrollView ref={mainScrollRef} nestedScrollEnabled={true} contentContainerStyle={{justifyContent: 'space-between'}} style={{flex: 1, marginHorizontal: 20}}>
             {props.editingEnabled ?
             <>
                 <LandmarkTypePickerContainer />
@@ -150,6 +151,7 @@ export const DetailsBody: React.FC<DetailsBodyProps> = (props) => {
                 setKeyboardOpened={props.setKeyboardOpened}
                 keyboardOpened={props.keyboardOpened}
                 comments={props.comments}
+                mainScrollRef={mainScrollRef}
                 focusComment={props.focusComment}
                 focusedCommentId={props.focusedCommentId}
                 commentListRef={props.commentListRef}

+ 3 - 3
src/components/Map/Panels/LandmarkDetailsPanel/LandmarkDetails.tsx

@@ -7,8 +7,7 @@
 
 import { FontAwesome } from "@expo/vector-icons";
 import React, { memo, useEffect, useRef, useState } from "react";
-import { ActivityIndicator, Alert, Dimensions, FlatList, Image, Keyboard, Platform, SafeAreaView, StyleSheet, Text, TextInput, TouchableOpacity, View } from "react-native";
-import { ScrollView } from "react-native-gesture-handler";
+import { ScrollView, ActivityIndicator, Alert, Dimensions, FlatList, Image, Keyboard, Platform, SafeAreaView, StyleSheet, Text, TextInput, TouchableOpacity, View } from "react-native";
 import Modal from 'react-native-modal';
 import { LMComment, useAddComment, useDeleteComment, useEditComment, useLandmarkComments } from "../../../../data/comments";
 import { Landmark, useAddLandmarkPhoto, useDeleteLandmark, useDeleteLandmarkPhoto, useEditLandmark, useLandmark, useRateLandmark } from "../../../../data/landmarks";
@@ -109,6 +108,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
      * Holds a reference to the Flatlist containing the comments.
      */
     const commentListRef = useRef<FlatList>();
+    const mainScrollRef = useRef<ScrollView>();
     /**
      * Holds a reference to the text input for posting a new comment
      */
@@ -366,7 +366,7 @@ const LandmarkDetails: React.FC<LandmarkDetailsProps> = ({authNavigation, landma
                         </TouchableOpacity>
                         <IconButton style={{alignSelf: 'flex-end', marginBottom: 20}} icon="trash" color="white" size={25} onPress={() => tryDeletePhoto(landmarkQuery?.data?.landmark?.photos[selectedImage].id)}/>
                     </View>
-                    <ScrollView style={{width: '100%', }}>
+                    <ScrollView style={{width: '100%', }} ref={mainScrollRef}>
                         <Image style={{resizeMode: 'contain', alignSelf: 'center', height: Dimensions.get('window').height * .9, width: getWindowWidth()}} source={{uri: 'data:image/png;base64,' + landmarkQuery?.data?.landmark?.photos[selectedImage].image_b64}}/> 
                     </ScrollView>
                 </View>

+ 9 - 1
src/components/Profile/Registration/RegisterMain.tsx

@@ -41,6 +41,13 @@ export interface RegisterFormValues {
   weight?: string;
 }
 
+export const stepMessages: {[stepNum: number]: string} = {
+  1: "Let's start with some basic account information",
+  2: "Next, we'll have you set a password.",
+  3: "Will you be using a Sagitta?",
+  4: "Lastly, pick a photo you'd like everyone to get to know you by."
+}
+
 /**
  * The main registration component. Acts as a backdrop for all intermediate registration steps. 
  * **Note: The registration components make heavy use of a library called Formik in order to created validated forms. It's recommended to check out the docs for that 
@@ -133,7 +140,8 @@ export const RegisterMain : React.FC<RegisterProps> = ({navigation}) => {
       <View>{
         step == 1 ? <RegisterCredentials setFormValues={setFormValues} formValues={formValues} changeStep={changeStep}/> : 
         step == 2 ? <RegisterPassword setFormValues={setFormValues} formValues={formValues} changeStep={changeStep}/> : 
-        step == 3 ? <RegisterMeasurements setFormValues={setFormValues} formValues={formValues} changeStep={changeStep}/> : 
+        // TODO: when sagitta gets integrated
+        // step == 3 ? <RegisterMeasurements setFormValues={setFormValues} formValues={formValues} changeStep={changeStep}/> : 
         step == 4 ? <RegisterImage setFormValues={setFormValues} formValues={formValues} changeStep={changeStep} /> :
         step == 5 ? <PrimaryButton style={{marginTop: 30}} text="Okay" onPress={finish} /> : null}
       </View>

+ 2 - 2
src/components/Profile/Registration/RegistrationSteps/RegisterCredential.tsx

@@ -12,7 +12,7 @@ import 'react-native-get-random-values';
 import { Text } from 'react-native-paper';
 import { RegisterCredsValues, useValidation } from '../../../../utils/RegistrationUtils';
 import { PrimaryButton } from '../../../Buttons';
-import { RegisterStepProps } from '../RegisterMain';
+import { RegisterStepProps, stepMessages } from '../RegisterMain';
 
 /**
  * This component displays a form for the new user's email and password to-be.
@@ -31,7 +31,7 @@ const RegisterCredentials: React.FC<RegisterStepProps> = ({changeStep, setFormVa
     const next = (newFormValues: RegisterCredsValues) => {
       setFormValues({...formValues, email: newFormValues.email, username: newFormValues.username});
       console.log("[Registration]: Registration form values updated")
-      changeStep(2, "Next, we'll have you set a password.");
+      changeStep(2, stepMessages[2]);
     }
   
     return (

+ 3 - 3
src/components/Profile/Registration/RegistrationSteps/RegisterImage.tsx

@@ -10,7 +10,7 @@ import React, { useState } from 'react';
 import { Image, TouchableOpacity, View } from 'react-native';
 import 'react-native-get-random-values';
 import { ActivityIndicator, Text } from 'react-native-paper';
-import { RegisterStepProps } from '../RegisterMain';
+import { RegisterStepProps, stepMessages } from '../RegisterMain';
 import {useAuth} from '../../../../data/Auth/AuthContext'
 import {Separator} from '../../../Separator'
 import {PrimaryButton, SecondaryButton} from '../../../Buttons'
@@ -40,7 +40,7 @@ const RegisterImage: React.FC<RegisterStepProps> = ({changeStep, formValues}) =>
      */ 
   const back = () => {
     console.log("[Registration]: Registration form values updated")
-    changeStep(3, "Will you be using a Sagitta?")
+    changeStep(2, stepMessages[2])
   }
 
   /**
@@ -121,7 +121,7 @@ const RegisterImage: React.FC<RegisterStepProps> = ({changeStep, formValues}) =>
         <View style={{margin: 20}}>
           <Separator color="lightgray" />
           <PrimaryButton text="Register" onPress={register} style={{marginVertical: 20}} />
-          <SecondaryButton text="Back" onPress={back} style={{marginBottom: 20}} />
+          <SecondaryButton text="Previous" onPress={back} style={{marginBottom: 20}} />
         </View> 
       </View>
       : 

+ 4 - 4
src/components/Profile/Registration/RegistrationSteps/RegisterPassword.tsx

@@ -12,7 +12,7 @@ import 'react-native-get-random-values';
 import { Text } from 'react-native-paper';
 import { useValidation } from '../../../../utils/RegistrationUtils';
 import { PrimaryButton, SecondaryButton } from '../../../Buttons';
-import { RegisterStepProps } from '../RegisterMain';
+import { RegisterStepProps, stepMessages } from '../RegisterMain';
 
 export interface PasswordValues {
   password: string;
@@ -28,11 +28,11 @@ const RegisterPassword: React.FC<RegisterStepProps> = ({changeStep, setFormValue
 
   const next = (newFormValues: PasswordValues) => {
     setFormValues({...formValues, password: newFormValues.password, confirmPassword: newFormValues.confirmPassword});
-    changeStep(3, "Will you be using a Sagitta?");
+    changeStep(4, stepMessages[4]);
   }
   
   const back = () => {
-    changeStep(1, "Let's start with some basic account information");
+    changeStep(1, stepMessages[1]);
   }
 
   return (
@@ -60,7 +60,7 @@ const RegisterPassword: React.FC<RegisterStepProps> = ({changeStep, setFormValue
                     onBlur={handleBlur('confirmPassword')} />
                   {errors.confirmPassword && touched.confirmPassword ? <Text style={PasswordFormStyles.errorText}>{errors.confirmPassword}</Text> : null}
                   <PrimaryButton style={{marginTop: 30}} onPress={handleSubmit as any} text="Next"/>
-                  <SecondaryButton onPress={back} text="Back"/>
+                  <SecondaryButton onPress={back} text="Previous"/>
               </View>
             )}
       </Formik>

+ 2 - 4
src/data/Auth/AuthContext.tsx

@@ -203,7 +203,7 @@ export const AuthContextProvider: React.FC = ({children}) => {
     useEffect(() => {
         if (alert) {
             LOGGING.log("SYSTEM", 'info', "Showing alert")
-            let buttons = [{text: alert.callbackButtonText ? alert.callbackButtonText : 'OK', onPress: alert.callback}, alert.callbackButtonText ? {text: 'Cancel'} : null]
+            let buttons = [{text: alert.callbackButtonText ? alert.callbackButtonText : 'OK', onPress: alert.callback}, {text: 'Cancel', onPress: () => console.log('canceled')}]
             const alertTitle = alert.title
             Alert.alert(alertTitle, alert.message, buttons)
             setAlert(undefined)
@@ -393,8 +393,6 @@ export const AuthContextProvider: React.FC = ({children}) => {
                 await setAccessTokenAsync(refreshResponseData.access_token);
 
                 console.info('Successfully refreshed access token.')
-
-                setAlert({title: 'Login timeout', message: "It looks like you've been away for awhile! We were able to log you back in.", callback: () => {}, type: 'success'})
             }
             catch (error) {
                 setAlert({
@@ -448,7 +446,7 @@ export const AuthContextProvider: React.FC = ({children}) => {
                 setAlert({
                     title: 'Heads up',
                     message: "It looks like you added some landmarks before creating an account, so those landmarks are now owned by your newly created account.", 
-                    callback: () => {},
+                    callback: () => LOGGING.log('AUTH', 'info', 'Notifying user of converted landmarks'),
                     type: 'warning'
                 })
             }

+ 0 - 1
src/utils/RequestUtils.ts

@@ -14,6 +14,5 @@
 export const API_URL = 'https://app.clicknpush.ca'
 //export const API_URL = 'http://192.168.1.64:8000'   // Chase
 //export const API_URL = 'http://192.168.0.22:8000'       // Eric
-//export const API_URL = 'https://app.clicknpush.ca'
 
 // export const API_URL = Config.API_URL