Skip to content

Commit

Permalink
Merge branch 'v2.17.1' into v2.17.0a
Browse files Browse the repository at this point in the history
  • Loading branch information
jtklein committed Jan 8, 2025
2 parents c0719d6 + a4859df commit 10582c9
Show file tree
Hide file tree
Showing 100 changed files with 1,032 additions and 1,883 deletions.
9 changes: 5 additions & 4 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = {
config: "e2e/jest.config.js",
},
jest: {
setupTimeout: 120000,
setupTimeout: 900000,
teardownTimeout: 900000,
},
},
apps: {
Expand All @@ -27,16 +28,16 @@ module.exports = {
simulator: {
type: "ios.simulator",
device: {
type: "iPhone 14 Plus",
type: "iPhone 15 Pro",
},
},
},
configurations: {
"ios.sim.debug": {
"ios.debug": {
device: "simulator",
app: "ios.debug",
},
"ios.sim.release": {
"ios.release": {
device: "simulator",
app: "ios.release",
},
Expand Down
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ labels: ''
assignees: ''

---
**Is this an AR camera feature?**
If so, please head to [react-native-inat-camera](https://github.com/inaturalist/react-native-inat-camera) library and fill out a feature request there.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
2. Build locally to a device or simulator by running `npm run ios` or `npm run android`

## Manual Linking
Most third-party libraries use autolinking as of [React Native 0.60.0](https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked). Any exceptions are listed in the `react-native.config.js` file. Currently, [react-native-inat-camera](https://github.com/inaturalist/react-native-inat-camera) on Android is manually linked.
Most third-party libraries use autolinking as of [React Native 0.60.0](https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked). Any exceptions are listed in the `react-native.config.js` file.

## Tests
We currently have three kinds of tests:
Expand Down
2 changes: 0 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ android {
}

dependencies {
implementation project(':react-native-inat-camera')

// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- the following permissions replaces READ_EXTERNAL_STORAGE in Android 13 -->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>

<application
android:name="org.inaturalist.seek.MainApplication"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader

import org.inaturalist.inatcamera.nativecamera.INatCameraViewPackage

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
add(INatCameraViewPackage())
}

override fun getJSMainModuleName(): String = "index"
Expand Down
2 changes: 0 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
rootProject.name = 'Seek'
include ':@react-native-camera-roll_camera-roll'
project(':@react-native-camera-roll_camera-roll').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-camera-roll/camera-roll/android')
include ':react-native-inat-camera'
project(':react-native-inat-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-inat-camera/android')
include ':react-native-check-app-install'
project(':react-native-check-app-install').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-check-app-install/android')
include ':RNSendIntentModule', ':app'
Expand Down
3 changes: 2 additions & 1 deletion assets/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ const icons: Icons = {
iNat_valueprop_bullet_2: require( "./icons/icon-cv-green.webp" ),
iNat_valueprop_bullet_3: require( "./icons/icon-obs-green.webp" ),
iNat_valueprop_bullet_4: require( "./icons/icon-person-green.webp" ),
noProfilePhoto: require( "./icons/img-inatlogin-nophoto.webp" )
noProfilePhoto: require( "./icons/img-inatlogin-nophoto.webp" ),
gallery: require( "./icons/icon-gallery.webp" )
};

export default icons;
Binary file added assets/icons/icon-gallery.webp
Binary file not shown.
Binary file added assets/icons/[email protected]
Binary file not shown.
Binary file added assets/icons/[email protected]
Binary file not shown.
2 changes: 1 addition & 1 deletion components/About/AboutScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const AboutScreen = (): Node => {
<Image source={logos.iNat} />
<View style={viewStyles.marginSmall} />
<StyledText style={[baseTextStyles.bodyBold, textStyles.boldText]}>{i18n.t( "about.seek_designed_by" )}</StyledText>
<StyledText style={[baseTextStyles.body, textStyles.text]}>{i18n.t( "about.inat_team_credits_4" )}</StyledText>
<StyledText style={[baseTextStyles.body, textStyles.text]}>{i18n.t( "about.inat_team_credits_5" )}</StyledText>
<View style={viewStyles.marginSmall} />
<StyledText style={[baseTextStyles.body, textStyles.text]}>{i18n.t( "about.support_from" )}</StyledText>
<View style={viewStyles.block} />
Expand Down
214 changes: 0 additions & 214 deletions components/Camera/ARCamera/ARCamera.e2e-mock.js

This file was deleted.

6 changes: 5 additions & 1 deletion components/Camera/ARCamera/ARCamera.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ import {
rotatePhotoPatch,
rotationTempPhotoPatch
} from "../../../utility/visionCameraPatches";
import { checkCameraPermissions, checkSavePermissions } from "../../../utility/androidHelpers.android";
import {
checkCameraPermissions,
checkSavePermissions
} from "../../../utility/androidHelpers.android";
import { savePostingSuccess } from "../../../utility/loginHelpers";
import { dirModel, dirTaxonomy } from "../../../utility/dirStorage";
import { createTimestamp } from "../../../utility/dateHelpers";
Expand Down Expand Up @@ -457,6 +460,7 @@ const ARCamera = ( ): Node => {
takePicture={takePicture}
cameraLoaded={cameraLoaded.value}
filterByTaxonId={filterByTaxonId}
setIsActive={setIsActive}
/>
)
}
Expand Down
20 changes: 7 additions & 13 deletions components/Camera/ARCamera/ARCameraHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,21 @@ interface Prediction {
}

interface Props {
ranks: {
[key: string]: {
taxon_id: number;
name: string;
}[];
};
prediction: Prediction;
}

const ARCameraHeader = ( { ranks, prediction }: Props ) => {
const ARCameraHeader = ( { prediction }: Props ) => {
const { isLandscape } = useAppOrientation( );
const rankToRender = ranks ? Object.keys( ranks )[0] || null : prediction?.rank || null;
const rankToRender = prediction?.rank || null;
const [commonName, setCommonName] = useState<string | void | null>( null );
const settings = useFetchUserSettings( );
const scientificNames = settings?.scientificNames;
const showScientificName = scientificNames || !commonName;

let id = null;
let id: number | null = null;

if ( rankToRender && !scientificNames ) {
id = ranks ? ranks[rankToRender][0].taxon_id : prediction?.taxon_id;
id = prediction?.taxon_id;
} else {
id = null;
}
Expand Down Expand Up @@ -107,11 +101,11 @@ const ARCameraHeader = ( { ranks, prediction }: Props ) => {
return null;
};

const scientificName = ranks ? ranks[rankToRender][0].name : prediction?.name;
const scientificName = prediction?.name;
return (
<View style={viewStyles.header}>
{( ( ranks || prediction ) && rankToRender ) && (
<View style={setTaxonomicRankBubbleColor( )}>
{( prediction && rankToRender ) && (
<View testID="headerPrediction" style={setTaxonomicRankBubbleColor( )}>
<View style={viewStyles.greenButton}>
<GreenRectangle
text={i18n.t( rankDict[rankToRender] )}
Expand Down
Loading

0 comments on commit 10582c9

Please sign in to comment.