Files
iNaturalistReactNative/.detoxrc.js
Amanda Bullington bbc5b9d67d MyObservations refactor (#510)
* WIP: very rough start at pulling state up into a container for MyObservations

I made a parallel MyObservations component and container so ObservationViews
can still be used as a working reference, but the ultimate goal here is to
focus MyObservations on presentation, and pull state and other business logic
up into a container component. This should make MyObservations a bit more
testable and clean up a very large and confusing file.

I'm also trying to move away from a generalized representation of observations
on all screens, which is why I want to name it MyObservations and not
ObservationViews. MyObservations has a lot of unique functionality that we
won't need elsewhere, and we can modularize stuff when we need to use it in
multiple places.

* UI updates for header, toolbar, empty component

* Add pressable component and login sheet

* UI improvements; get infinite scroll working

* UI improvements & additions for empty screen & bottom sheet

* Show login sheet when a user presses sync but is not logged in

* Fix backdrop close for AddObsModal

* Move UI elements to MyObservations

* Fix unit tests for MyObservations

* Fix for login sheet

* Set header height to a different height on Android to account for safe area

* Fix failing tests & rerender of user icon in navbar

* Remove scientific name from DisplayTaxonName to match Figma UI

* Set height above toolbar dynamically for sticky toolbar

* Add prop to display or hide second name in DisplayTaxonName

* Use RN styling to style grid view for MyObs flatlist

* Fix failing project obs test

* Create separate ToolbarContainer to separate presentation from logic; fix upload count

* Merge main and show onboarding based on user's total obs count

* Fix display taxon name styling and remove header fade on iOS

* Add header text for 0 observations, logged out state

* Update infinite scroll to 50 obs at a time; make loading wheel show faster

* Add uploaded status to toolbar

* Apply bandaid fix to stop Android from crashing on start

* Start adding new icons to MyObs

* Add circular progress; show upload icons at correct times during upload

* Add disabled props for accessibility state

* Fix tests; update snapshots

* Code cleanup

* Code cleanup & add inaturalist icon

* Fix merge conflict and add icon

* Add inaturalist icon

* Fix navigation to obs list and toolbar status when upload completes

* Move showLoginSheet code to MyObsContainer

* Fix toolbar status text

* Sync toolbar with upload status progress

* Clear toolbar after nav

* Tests passing

* Update e2e test

* Target login button in e2e tests

* Fix failing e2e tests with new testID for login button

* Update button snapshot to include new testID

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-03-14 10:54:33 -07:00

76 lines
2.4 KiB
JavaScript

const { version } = require("./package.json");
const fs = require("fs");
const buildGradle = fs.readFileSync("./android/app/build.gradle", "utf8");
const versionCode = buildGradle.match(/versionCode (\d+)/)[1];
const apkFilenamePrefix = `com.inaturalistreactnative-v${version}+${versionCode}`;
/** @type {Detox.DetoxConfig} */
module.exports = {
testRunner: "jest",
runnerConfig: "e2e/config.json",
skipLegacyWorkersInjection: true,
apps: {
"ios.debug": {
type: "ios.app",
binaryPath:
"ios/build/Build/Products/Debug-iphonesimulator/iNaturalistReactNative.app",
build:
"xcodebuild -workspace ios/iNaturalistReactNative.xcworkspace -scheme iNaturalistReactNative -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
},
"ios.release": {
type: "ios.app",
binaryPath:
"ios/build/Build/Products/Release-iphonesimulator/iNaturalistReactNative.app",
build:
"xcodebuild -workspace ios/iNaturalistReactNative.xcworkspace -scheme iNaturalistReactNative -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
},
"android.debug": {
type: "android.apk",
binaryPath: `android/app/build/outputs/apk/debug/${apkFilenamePrefix}-debug.apk`,
testBinaryPath: `android/app/build/outputs/apk/androidTest/debug/${apkFilenamePrefix}-debug-androidTest.apk`,
build:
"cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
},
"android.release": {
type: "android.apk",
binaryPath: `android/app/build/outputs/apk/release/${apkFilenamePrefix}-release.apk`,
testBinaryPath: `android/app/build/outputs/apk/androidTest/release/${apkFilenamePrefix}-release-androidTest.apk`,
build:
"cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
},
},
devices: {
simulator: {
type: "ios.simulator",
device: {
type: "iPhone 14 Plus",
},
},
emulator: {
type: "android.emulator",
device: {
avdName: "Pixel_5_API_31_AOSP",
},
},
},
configurations: {
"ios.debug": {
device: "simulator",
app: "ios.debug",
},
"ios.release": {
device: "simulator",
app: "ios.release",
},
"android.debug": {
device: "emulator",
app: "android.debug",
},
"android.release": {
device: "emulator",
app: "android.release",
},
},
};