From 537a19aea33c0d65301ebe0b6ecfff592e277382 Mon Sep 17 00:00:00 2001 From: Ken-ichi Ueda Date: Thu, 12 Dec 2024 16:30:31 -0800 Subject: [PATCH 1/6] chore: update fastlane to 2.226.0 --- Gemfile.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7c8b3a2d8..2298ad900 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,16 +26,16 @@ GEM ast (2.4.2) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.996.0) - aws-sdk-core (3.211.0) + aws-partitions (1.1022.0) + aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.95.0) + aws-sdk-kms (1.96.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.169.0) + aws-sdk-s3 (1.176.1) aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -125,7 +125,7 @@ GEM faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.225.0) + fastlane (2.226.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -165,7 +165,7 @@ GEM tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) + xcpretty (~> 0.4.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) ffi (1.17.0) fourflusher (2.3.1) @@ -208,13 +208,13 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.7) + http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.8.3) i18n (1.14.6) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.7.5) + json (2.9.0) jwt (2.9.3) base64 language_server-protocol (3.17.0.3) @@ -233,7 +233,7 @@ GEM nokogiri (1.15.6) mini_portile2 (~> 2.8.2) racc (~> 1.4) - optparse (0.5.0) + optparse (0.6.0) os (1.1.4) parallel (1.26.3) parser (3.3.6.0) @@ -251,7 +251,7 @@ GEM uber (< 0.2.0) retriable (3.1.2) rexml (3.3.9) - rouge (2.0.7) + rouge (3.28.0) rubocop (1.68.0) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -299,8 +299,8 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.4.0) rexml (>= 3.3.6, < 4.0) - xcpretty (0.3.0) - rouge (~> 2.0.7) + xcpretty (0.4.0) + rouge (~> 3.28.0) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) From 7dd5693c17e2e83ec5f5a8abe5b884c5720d7f4f Mon Sep 17 00:00:00 2001 From: Ken-ichi Ueda Date: Fri, 13 Dec 2024 09:12:52 -0800 Subject: [PATCH 2/6] fix: don't show error when user cancels Sign in with Apple --- src/components/LoginSignUp/LoginForm.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/LoginSignUp/LoginForm.tsx b/src/components/LoginSignUp/LoginForm.tsx index 279d112b7..49e4f2ecb 100644 --- a/src/components/LoginSignUp/LoginForm.tsx +++ b/src/components/LoginSignUp/LoginForm.tsx @@ -1,4 +1,4 @@ -import { appleAuth, AppleButton } from "@invertase/react-native-apple-authentication"; +import { appleAuth, AppleButton, AppleError } from "@invertase/react-native-apple-authentication"; import { RouteProp, useNavigation, useRoute } from "@react-navigation/native"; import classnames from "classnames"; import { @@ -42,6 +42,10 @@ type ParamList = { LoginFormParams: LoginFormParams } +interface AppleAuthError { + code: AppleError; +} + const APPLE_BUTTON_STYLE = { maxWidth: 500, height: 45, // You must specify a height @@ -68,6 +72,10 @@ async function signInWithApple( realm: Realm ) { requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL] } ); } catch ( appleAuthRequestError ) { + if ( ( appleAuthRequestError as AppleAuthError ).code === appleAuth.Error.CANCELED ) { + // The user canceled sign in, no need to log + return false; + } logger.error( "Apple auth request failed", appleAuthRequestError ); showSignInWithAppleFailed(); return false; From 03feee9bf319a951248da5c1c01ee020a2ce7585 Mon Sep 17 00:00:00 2001 From: Yaron Budowski Date: Sun, 15 Dec 2024 02:45:19 +0900 Subject: [PATCH 3/6] Fix #2323 - view taxon observations from explore screen by tapping on taxon --- src/components/Explore/TaxonGridItem.tsx | 32 +++++++++++++++++-- .../SharedComponents/INatIcon/index.tsx | 29 +++++++++++------ src/providers/ExploreContext.tsx | 2 ++ 3 files changed, 52 insertions(+), 11 deletions(-) diff --git a/src/components/Explore/TaxonGridItem.tsx b/src/components/Explore/TaxonGridItem.tsx index 73d413159..78c8ba9f2 100644 --- a/src/components/Explore/TaxonGridItem.tsx +++ b/src/components/Explore/TaxonGridItem.tsx @@ -1,23 +1,31 @@ import { useNavigation, useRoute } from "@react-navigation/native"; import ObsImagePreview from "components/ObservationsFlashList/ObsImagePreview"; -import { Body4, DisplayTaxonName } from "components/SharedComponents"; +import { Body4, DisplayTaxonName, INatIcon } from "components/SharedComponents"; import SpeciesSeenCheckmark from "components/SharedComponents/SpeciesSeenCheckmark"; import { Pressable, View } from "components/styledComponents"; +import { + EXPLORE_ACTION, + useExplore +} from "providers/ExploreContext.tsx"; import type { Node } from "react"; import React from "react"; import Photo from "realmModels/Photo"; import { accessibleTaxonName } from "sharedHelpers/taxon"; import { useCurrentUser, useFontScale, useTranslation } from "sharedHooks"; +import colors from "styles/tailwindColors"; interface Props { count: number; showSpeciesSeenCheckmark: boolean; style?: Object; + setCurrentExploreView: Function, // I guess this is expecting an API response and not a RealmTaxon taxon: { default_photo: Object; iconic_taxon_name: string; id: number; + preferred_common_name: string; + name: string; }; } @@ -25,8 +33,10 @@ const TaxonGridItem = ( { count, showSpeciesSeenCheckmark = false, style, - taxon + taxon, + setCurrentExploreView }: Props ): Node => { + const { dispatch } = useExplore( ); const navigation = useNavigation( ); const { t } = useTranslation( ); const currentUser = useCurrentUser( ); @@ -72,6 +82,24 @@ const TaxonGridItem = ( { )} + {count && ( + { + dispatch( { + type: EXPLORE_ACTION.CHANGE_TAXON, + taxon, + taxonId: taxon?.id, + taxonName: taxon?.preferred_common_name || taxon?.name + } ); + setCurrentExploreView( "observations" ); + }} + > + + + )} + {count && ( ( - -); + testID, name, color, size, dropShadow +}: Props ) => { + const style = dropShadow + ? { + shadowOpacity: 2, + textShadowRadius: 4, + textShadowOffset: { width: 2, height: 2 } + } + : null; + return ( + + ); +}; export default INatIcon; diff --git a/src/providers/ExploreContext.tsx b/src/providers/ExploreContext.tsx index 1b6fe9c47..bb39d8b96 100644 --- a/src/providers/ExploreContext.tsx +++ b/src/providers/ExploreContext.tsx @@ -230,6 +230,8 @@ type Action = {type: EXPLORE_ACTION.RESET} | { type: EXPLORE_ACTION.CHANGE_TAXON, taxon: { id: number } | null, + taxonId: number, + taxonName: string, storedState: State } | { type: EXPLORE_ACTION.FILTER_BY_ICONIC_TAXON_UNKNOWN } From 3eb0f54f7d433e583ea29505d4da7c915969ce90 Mon Sep 17 00:00:00 2001 From: Yaron Budowski Date: Sun, 15 Dec 2024 02:59:27 +0900 Subject: [PATCH 4/6] Revert "fix: don't show error when user cancels Sign in with Apple" This reverts commit 7dd5693c17e2e83ec5f5a8abe5b884c5720d7f4f. --- src/components/LoginSignUp/LoginForm.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/components/LoginSignUp/LoginForm.tsx b/src/components/LoginSignUp/LoginForm.tsx index 49e4f2ecb..279d112b7 100644 --- a/src/components/LoginSignUp/LoginForm.tsx +++ b/src/components/LoginSignUp/LoginForm.tsx @@ -1,4 +1,4 @@ -import { appleAuth, AppleButton, AppleError } from "@invertase/react-native-apple-authentication"; +import { appleAuth, AppleButton } from "@invertase/react-native-apple-authentication"; import { RouteProp, useNavigation, useRoute } from "@react-navigation/native"; import classnames from "classnames"; import { @@ -42,10 +42,6 @@ type ParamList = { LoginFormParams: LoginFormParams } -interface AppleAuthError { - code: AppleError; -} - const APPLE_BUTTON_STYLE = { maxWidth: 500, height: 45, // You must specify a height @@ -72,10 +68,6 @@ async function signInWithApple( realm: Realm ) { requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL] } ); } catch ( appleAuthRequestError ) { - if ( ( appleAuthRequestError as AppleAuthError ).code === appleAuth.Error.CANCELED ) { - // The user canceled sign in, no need to log - return false; - } logger.error( "Apple auth request failed", appleAuthRequestError ); showSignInWithAppleFailed(); return false; From c235b6b39d27ac6bc7ddd5bcad50beee3ee46ece Mon Sep 17 00:00:00 2001 From: Yaron Budowski Date: Sun, 15 Dec 2024 03:00:10 +0900 Subject: [PATCH 5/6] Revert "Revert "fix: don't show error when user cancels Sign in with Apple"" This reverts commit 3eb0f54f7d433e583ea29505d4da7c915969ce90. --- src/components/LoginSignUp/LoginForm.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/LoginSignUp/LoginForm.tsx b/src/components/LoginSignUp/LoginForm.tsx index 279d112b7..49e4f2ecb 100644 --- a/src/components/LoginSignUp/LoginForm.tsx +++ b/src/components/LoginSignUp/LoginForm.tsx @@ -1,4 +1,4 @@ -import { appleAuth, AppleButton } from "@invertase/react-native-apple-authentication"; +import { appleAuth, AppleButton, AppleError } from "@invertase/react-native-apple-authentication"; import { RouteProp, useNavigation, useRoute } from "@react-navigation/native"; import classnames from "classnames"; import { @@ -42,6 +42,10 @@ type ParamList = { LoginFormParams: LoginFormParams } +interface AppleAuthError { + code: AppleError; +} + const APPLE_BUTTON_STYLE = { maxWidth: 500, height: 45, // You must specify a height @@ -68,6 +72,10 @@ async function signInWithApple( realm: Realm ) { requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL] } ); } catch ( appleAuthRequestError ) { + if ( ( appleAuthRequestError as AppleAuthError ).code === appleAuth.Error.CANCELED ) { + // The user canceled sign in, no need to log + return false; + } logger.error( "Apple auth request failed", appleAuthRequestError ); showSignInWithAppleFailed(); return false; From b8ca839080deb719899646ac59156045e3b9ad44 Mon Sep 17 00:00:00 2001 From: Yaron Budowski Date: Sun, 15 Dec 2024 03:01:17 +0900 Subject: [PATCH 6/6] Revert "Fix #2323 - view taxon observations from explore screen by tapping on taxon" This reverts commit 03feee9bf319a951248da5c1c01ee020a2ce7585. --- src/components/Explore/TaxonGridItem.tsx | 32 ++----------------- .../SharedComponents/INatIcon/index.tsx | 29 ++++++----------- src/providers/ExploreContext.tsx | 2 -- 3 files changed, 11 insertions(+), 52 deletions(-) diff --git a/src/components/Explore/TaxonGridItem.tsx b/src/components/Explore/TaxonGridItem.tsx index 78c8ba9f2..73d413159 100644 --- a/src/components/Explore/TaxonGridItem.tsx +++ b/src/components/Explore/TaxonGridItem.tsx @@ -1,31 +1,23 @@ import { useNavigation, useRoute } from "@react-navigation/native"; import ObsImagePreview from "components/ObservationsFlashList/ObsImagePreview"; -import { Body4, DisplayTaxonName, INatIcon } from "components/SharedComponents"; +import { Body4, DisplayTaxonName } from "components/SharedComponents"; import SpeciesSeenCheckmark from "components/SharedComponents/SpeciesSeenCheckmark"; import { Pressable, View } from "components/styledComponents"; -import { - EXPLORE_ACTION, - useExplore -} from "providers/ExploreContext.tsx"; import type { Node } from "react"; import React from "react"; import Photo from "realmModels/Photo"; import { accessibleTaxonName } from "sharedHelpers/taxon"; import { useCurrentUser, useFontScale, useTranslation } from "sharedHooks"; -import colors from "styles/tailwindColors"; interface Props { count: number; showSpeciesSeenCheckmark: boolean; style?: Object; - setCurrentExploreView: Function, // I guess this is expecting an API response and not a RealmTaxon taxon: { default_photo: Object; iconic_taxon_name: string; id: number; - preferred_common_name: string; - name: string; }; } @@ -33,10 +25,8 @@ const TaxonGridItem = ( { count, showSpeciesSeenCheckmark = false, style, - taxon, - setCurrentExploreView + taxon }: Props ): Node => { - const { dispatch } = useExplore( ); const navigation = useNavigation( ); const { t } = useTranslation( ); const currentUser = useCurrentUser( ); @@ -82,24 +72,6 @@ const TaxonGridItem = ( { )} - {count && ( - { - dispatch( { - type: EXPLORE_ACTION.CHANGE_TAXON, - taxon, - taxonId: taxon?.id, - taxonName: taxon?.preferred_common_name || taxon?.name - } ); - setCurrentExploreView( "observations" ); - }} - > - - - )} - {count && ( { - const style = dropShadow - ? { - shadowOpacity: 2, - textShadowRadius: 4, - textShadowOffset: { width: 2, height: 2 } - } - : null; - return ( - - ); -}; + testID, name, color, size +}: Props ) => ( + +); export default INatIcon; diff --git a/src/providers/ExploreContext.tsx b/src/providers/ExploreContext.tsx index bb39d8b96..1b6fe9c47 100644 --- a/src/providers/ExploreContext.tsx +++ b/src/providers/ExploreContext.tsx @@ -230,8 +230,6 @@ type Action = {type: EXPLORE_ACTION.RESET} | { type: EXPLORE_ACTION.CHANGE_TAXON, taxon: { id: number } | null, - taxonId: number, - taxonName: string, storedState: State } | { type: EXPLORE_ACTION.FILTER_BY_ICONIC_TAXON_UNKNOWN }