Skip to content

Commit

Permalink
Merge pull request #86 from hopetambala/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
joseph-mccombs authored Jun 16, 2021
2 parents 46d42dc + 55c2c12 commit a77d48b
Show file tree
Hide file tree
Showing 28 changed files with 41,273 additions and 86 deletions.
Empty file removed 4
Empty file.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [11.7.9](https://github.com/hopetambala/puente-reactnative-collect/compare/v11.7.8...v11.7.9) (2021-06-13)

### [11.7.8](https://github.com/hopetambala/puente-reactnative-collect/compare/v11.7.7...v11.7.8) (2021-06-12)


### Bug fixes

* bug where small androids couldn't find submit button ([1eb5bfe](https://github.com/hopetambala/puente-reactnative-collect/commit/1eb5bfe03386c74ec9155ccb8a001030b58ee363))

### [11.7.7](https://github.com/hopetambala/puente-reactnative-collect/compare/v11.7.6...v11.7.7) (2021-06-12)


### Bug fixes

* legacy __ select options not appending answer from text question ([a14d39f](https://github.com/hopetambala/puente-reactnative-collect/commit/a14d39f982babb55d22650011da13d8ffad5e16e))


### New Features

* adding pushToken to user Object ([4cf3233](https://github.com/hopetambala/puente-reactnative-collect/commit/4cf32332014be2a3054c8e72b02271f0bf8afddd))
* deep link to user in asset and asset forms 🎉 ([46d42dc](https://github.com/hopetambala/puente-reactnative-collect/commit/46d42dc7509ba3d8157a6ac136a1c5372405b8c1))

### [11.7.6](https://github.com/hopetambala/puente-reactnative-collect/compare/v11.7.5...v11.7.6) (2021-06-08)


### New Features

* question for select/multi select options ([7135452](https://github.com/hopetambala/puente-reactnative-collect/commit/713545269a1fa170421c9075e82cc05dac7cd93b))


### Bug fixes

* add credentials object ([432e7b1](https://github.com/hopetambala/puente-reactnative-collect/commit/432e7b12f3feee00f4905cbde60bd6cd09250e95))
* add scrollview to assetcore form ([0e2914a](https://github.com/hopetambala/puente-reactnative-collect/commit/0e2914a1c471be3a4bac26de2fecea0a335d161c))
* ensure textQuestion handled when not present ([e667d2a](https://github.com/hopetambala/puente-reactnative-collect/commit/e667d2a9a0a84357962c5bf58baef94cbe048f24))
* make sure the users credentials are used for the modal ([dbd5f8f](https://github.com/hopetambala/puente-reactnative-collect/commit/dbd5f8fe7e1f2c90a682884d944228945e958cab))
* pincode logs user in correctly ([c0945c9](https://github.com/hopetambala/puente-reactnative-collect/commit/c0945c92eda8f1ba9cf50508c59f97648f5fe43f))
* renaming all incorrectly named credentials as `currentUser` ([b2e7f19](https://github.com/hopetambala/puente-reactnative-collect/commit/b2e7f19aa832541b4886b09da8746523ab28043c))

### [11.7.5](https://github.com/hopetambala/puente-reactnative-collect/compare/v11.7.4...v11.7.5) (2021-05-31)


Expand Down
6 changes: 3 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"android",
"web"
],
"version": "11.7.5",
"version": "11.7.9",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
Expand All @@ -23,7 +23,7 @@
],
"ios": {
"supportsTablet": true,
"buildNumber": "11.7.5",
"buildNumber": "11.7.9",
"infoPlist": {
"NSLocationWhenInUseUsageDescription": "This app uses your location to geo-tag surveys accurately."
},
Expand All @@ -34,7 +34,7 @@
"favicon": "./assets/images/favicon.png"
},
"android": {
"versionCode": 410110705,
"versionCode": 410110709,
"permissions": [
"ACCESS_COARSE_LOCATION",
"ACCESS_FINE_LOCATION",
Expand Down
2 changes: 1 addition & 1 deletion components/AssetSearchBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const AssetSearchbar = ({ setSelectedAsset, surveyingOrganization }) => {
<View>
<Headline style={styles.header}>{I18n.t('assetSearchbar.searchIndividual')}</Headline>
<Searchbar
placeholder="Type Here..."
placeholder={I18n.t('assetSearchbar.placeholder')}
onChangeText={onChangeSearch}
value={query}
/>
Expand Down
14 changes: 10 additions & 4 deletions components/FormikFields/PaperInputPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ const PaperInputPicker = ({
<View key={result.value}>
{result.text === true && result.value === values[formikKey] && (
<View style={stylesDefault} key={result.textKey}>
{result.textQuestion !== undefined && result.textQuestion.length > 0 && (
<Text>{customForm ? result.textQuestion : I18n.t(result.textQuestion)}</Text>
)}
<TextInput
label={customForm ? result.label : I18n.t(result.label)}
onChangeText={handleChange(result.textKey)}
Expand Down Expand Up @@ -300,6 +303,9 @@ const PaperInputPicker = ({
{result.text === true && values[formikKey]
&& values[formikKey].includes(result.value) && (
<View style={stylesDefault} key={result.textKey}>
{result.textQuestion !== undefined && result.textQuestion.length > 0 && (
<Text>{customForm ? result.textQuestion : I18n.t(result.textQuestion)}</Text>
)}
<TextInput
label={customForm ? result.label : I18n.t(result.label)}
onChangeText={handleChange(result.textKey)}
Expand Down Expand Up @@ -341,14 +347,14 @@ const PaperInputPicker = ({
{location === null && (
<PaperButton
onPressEvent={handleLocation}
buttonText="Get Location"
buttonText={I18n.t('paperButton.getLocation')}
/>
)}
{location !== null && (
<View>
<PaperButton
onPressEvent={handleLocation}
buttonText="Get Location Again"
buttonText={I18n.t('paperButton.getLocationAgain')}
/>
<View style={{ marginLeft: 'auto', marginRight: 'auto', flexDirection: 'row' }}>
{
Expand Down Expand Up @@ -448,7 +454,7 @@ const PaperInputPicker = ({
{!cameraVisible && image === null && (
<View>
<Text style={stylesDefault.labelImage}>{translatedLabel}</Text>
<Button onPress={() => setCameraVisible(true)}>Take Photo</Button>
<Button onPress={() => setCameraVisible(true)}>{I18n.t('paperButton.takePhoto')}</Button>
<UseCameraRoll
pictureUris={pictureUris}
setPictureUris={setPictureUris}
Expand All @@ -467,7 +473,7 @@ const PaperInputPicker = ({
setCameraVisible(true);
}}
>
Take Picture
{I18n.t('paperButton.takePhoto')}
</Button>
<UseCameraRoll
pictureUris={pictureUris}
Expand Down
2 changes: 1 addition & 1 deletion components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const Header = ({
<Button onPress={() => setSubmission(null)}>{I18n.t('header.ok')}</Button>
</View>
)}
<Button onPress={navToSettings}>Settings Page</Button>
<Button onPress={navToSettings}>{I18n.t('header.settingsPage')}</Button>
</View>
)}
<IconButton
Expand Down
3 changes: 2 additions & 1 deletion components/MainNavigation/BottomTabNavigator./index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import I18n from 'i18n-js';
import * as React from 'react';

// import DataAnalysis from '../../../domains/DataAnalysis';
Expand Down Expand Up @@ -26,7 +27,7 @@ export default function BottomTabNavigator() {
name="Data_Collection"
component={DataCollection}
options={{
title: 'Data Collection',
title: I18n.t('bottomTab.dataCollection'),
tabBarIcon: ({ focused }) => <TabBarIcon focused={focused} name="md-folder" />,
}}
/>
Expand Down
3 changes: 2 additions & 1 deletion components/Multimedia/CameraRoll/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as ImagePicker from 'expo-image-picker';
import I18n from 'i18n-js';
import React, { useEffect } from 'react';
import { Platform, View } from 'react-native';
import {
Expand Down Expand Up @@ -41,7 +42,7 @@ export default function UseCameraRoll(

return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button onPress={pickImage}>Use image from camera roll</Button>
<Button onPress={pickImage}>{I18n.t('camera.useImage')}</Button>
</View>
);
}
11 changes: 6 additions & 5 deletions components/Multimedia/UseCamera/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Camera } from 'expo-camera';
import I18n from 'i18n-js';
import React, { useEffect, useRef, useState } from 'react';
import {
Dimensions, Image, StyleSheet, TouchableOpacity, View
Expand Down Expand Up @@ -53,7 +54,7 @@ export default function UseCamera(
return <View />;
}
if (hasPermission === false) {
return <Text>No access to camera</Text>;
return <Text>{I18n.t('camera.noAccess')}</Text>;
}
return (
<Portal theme={theme}>
Expand All @@ -67,7 +68,7 @@ export default function UseCamera(
{cameraImage ? (
<>
<Image source={{ uri: cameraImage }} style={{ width: 'auto', height: 400 }} />
<Button onPress={resetPicture}>Retake Picture</Button>
<Button onPress={resetPicture}>{I18n.t('camera.retake')}</Button>
</>
) : (
<>
Expand All @@ -94,7 +95,7 @@ export default function UseCamera(
);
}}
>
<Text style={styles.cameraButtonText}> Flip </Text>
<Text style={styles.cameraButtonText}>{I18n.t('camera.flip')}</Text>
</TouchableOpacity>
<View style={styles.cameraButtonContainer}>
<View style={styles.zoomContainer}>
Expand Down Expand Up @@ -124,11 +125,11 @@ export default function UseCamera(
</View>
</View>
</Camera>
<Button onPress={takePicture}>Take Picture</Button>
<Button onPress={takePicture}>{I18n.t('camera.takePicture')}</Button>
</>
)}
</View>
<Button mode="contained" style={styles.button} onPress={() => setCameraVisible(false)}>Done</Button>
<Button mode="contained" style={styles.button} onPress={() => setCameraVisible(false)}>{I18n.t('camera.done')}</Button>
</Modal>
</Portal>
);
Expand Down
5 changes: 3 additions & 2 deletions components/PushNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const registerForPushNotificationsAsync = async () => {
}
if (finalStatus !== 'granted') {
// alert('Failed to get push token for push notification!');
return;
return '';
}
token = (await Notifications.getExpoPushTokenAsync()).data;
} else {
// alert('Must use physical device for Push Notifications');
return;
return '';
}

// handle notifications when app is in the foreground
Expand All @@ -46,6 +46,7 @@ const registerForPushNotificationsAsync = async () => {
});
}
await checkAppVersionAndSendPush(token);
return token;
};

const checkAppVersionAndSendPush = async (token) => {
Expand Down
2 changes: 1 addition & 1 deletion domains/Auth/PinCode/GetPinCode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const GetPinCode = ({ navigation }) => {
if (connected) {
getData('currentUser')
.then((asyncUser) => {
retrieveSignInFunction(asyncUser.username, asyncUser.password)
retrieveSignInFunction(asyncUser.username, asyncUser.credentials.password)
.then((signedInUser) => {
populateCache(signedInUser);
});
Expand Down
7 changes: 2 additions & 5 deletions domains/Auth/SignIn/ForgotPassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,15 @@ export default function ForgotPassword({ navigation, setForgotPassword }) {
{emailSuccess && (
<View>
<Text style={{ marginHorizontal: 15, fontSize: 18, fontWeight: 'bold' }}>
Your password reset link has been sent to your email. Please
Check your email to change your password.
{I18n.t('signIn.forgotPassword.resetSuccess')}
</Text>
<Button mode="text" theme={theme} onPress={handleSignIn}>Back to Sign in</Button>
</View>
)}
{emailError && (
<View>
<Text style={{ marginHorizontal: 15, fontSize: 18, fontWeight: 'bold' }}>
There was an error sending the password reset link. Please
ensure that you entered your email correctly. You can try again by clicking
the button below. If you believe the email is correct, please contact your manager.
{I18n.t('signIn.forgotPassword.resetError')}
</Text>
<Button style={{ marginTop: 10 }} mode="contained" onPress={() => setEmailError(false)}>Try Again</Button>
</View>
Expand Down
6 changes: 3 additions & 3 deletions domains/Auth/SignIn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ const SignIn = ({ navigation }) => {
});
storeData(usr, 'currentUser');
}
// send push to update app if necessary
await registerForPushNotificationsAsync();
populateCache(usr);
// send push to update app if necessary and retrieve push token
const expoToken = await registerForPushNotificationsAsync();
populateCache(usr, expoToken);
};

const signInAndStore = (connected, values, actions) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from 'react-native-paper';

import PaperButton from '../../../../../../components/Button';
import I18n from '../../../../../../modules/i18n';
import { theme } from '../../../../../../modules/theme';

const PeopleModal = ({
Expand All @@ -28,23 +29,23 @@ const PeopleModal = ({
>
<KeyboardAvoidingView>
<TextInput
label="First Name"
placeholder="Enter First Name"
label={I18n.t('peopleModal.fname')}
placeholder={I18n.t('peopleModal.enterFname')}
onChangeText={(text) => handleInputChange(text, i, 'firstName')}
mode="outlined"
theme={stylesPaper}
style={stylesDefault.label}
/>
<TextInput
label="Last Name"
placeholder="Enter Last Name"
label={I18n.t('peopleModal.lname')}
placeholder={I18n.t('peopleModal.enterLname')}
onChangeText={(text) => handleInputChange(text, i, 'lastName')}
mode="outlined"
theme={stylesPaper}
style={stylesDefault.label}
/>
<TextInput
label="Relationship"
label={I18n.t('peopleModal.relationship')}
onChangeText={(text) => handleInputChange(text, i, 'relationship')}
mode="outlined"
theme={stylesPaper}
Expand All @@ -53,13 +54,13 @@ const PeopleModal = ({
<View>
{people.length !== 1 && (
<PaperButton
buttonText="Remove"
buttonText={I18n.t('peopleModal.remove')}
onPressEvent={() => handleRemoveClick(i)}
/>
)}
{people.length - 1 === i && (
<PaperButton
buttonText="Add"
buttonText={I18n.t('peopleModal.add')}
onPressEvent={handleAddClick}
/>
)}
Expand Down
Loading

0 comments on commit a77d48b

Please sign in to comment.