From e12838dd5c92aa1b8561c3fa36f48da428246a6f Mon Sep 17 00:00:00 2001 From: thoreyjona Date: Tue, 15 Oct 2024 13:10:56 +0000 Subject: [PATCH 1/2] feat: remove old flags for licenses --- apps/native/app/src/screens/wallet/wallet.tsx | 37 ++++--------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/apps/native/app/src/screens/wallet/wallet.tsx b/apps/native/app/src/screens/wallet/wallet.tsx index 6856dd0fceac..4dd8de8f321d 100644 --- a/apps/native/app/src/screens/wallet/wallet.tsx +++ b/apps/native/app/src/screens/wallet/wallet.tsx @@ -17,7 +17,6 @@ import { useNavigationComponentDidAppear } from 'react-native-navigation-hooks' import illustrationSrc from '../../assets/illustrations/le-retirement-s3.png' import { BottomTabsIndicator } from '../../components/bottom-tabs-indicator/bottom-tabs-indicator' -import { useFeatureFlag } from '../../contexts/feature-flag-provider' import { GenericLicenseType, GenericUserLicense, @@ -30,7 +29,6 @@ import { useConnectivityIndicator } from '../../hooks/use-connectivity-indicator import { usePreferencesStore } from '../../stores/preferences-store' import { isIos } from '../../utils/devices' import { getRightButtons } from '../../utils/get-main-root' -import { isDefined } from '../../utils/is-defined' import { testIDs } from '../../utils/test-ids' import { WalletItem } from './components/wallet-item' @@ -100,13 +98,6 @@ export const WalletScreen: NavigationFunctionComponent = ({ componentId }) => { const { dismiss, dismissed } = usePreferencesStore() const [hiddenContent, setHiddenContent] = useState(isIos) - // Feature flags - const showPassport = useFeatureFlag('isPassportEnabled', false) - const showDisability = useFeatureFlag('isDisabilityFlagEnabled', false) - const showPCard = useFeatureFlag('isPCardEnabled', false) - const showEhic = useFeatureFlag('isEhicEnabled', false) - const showHuntingLicense = useFeatureFlag('isHuntingLicenseEnabled', false) - // Query list of licenses const res = useListLicensesQuery({ variables: { @@ -116,11 +107,11 @@ export const WalletScreen: NavigationFunctionComponent = ({ componentId }) => { GenericLicenseType.AdrLicense, GenericLicenseType.MachineLicense, GenericLicenseType.FirearmLicense, - showDisability ? GenericLicenseType.DisabilityLicense : null, - showPCard ? GenericLicenseType.PCard : null, - showEhic ? GenericLicenseType.Ehic : null, - showHuntingLicense ? GenericLicenseType.HuntingLicense : null, - ].filter(isDefined), + GenericLicenseType.DisabilityLicense, + GenericLicenseType.PCard, + GenericLicenseType.Ehic, + GenericLicenseType.HuntingLicense, + ], }, }, }) @@ -142,24 +133,12 @@ export const WalletScreen: NavigationFunctionComponent = ({ componentId }) => { if (license.status === 'Unknown') { return false } - if (license.type === GenericLicenseType.DisabilityLicense) { - return showDisability - } - if (license.type === GenericLicenseType.PCard) { - return showPCard - } - if (license.type === GenericLicenseType.Ehic) { - return showEhic - } - if (license.type === GenericLicenseType.HuntingLicense) { - return showHuntingLicense - } return true }) } return [] - }, [res, showDisability, showPCard, showEhic, showHuntingLicense]) + }, [res]) // indexing list for spotlight search IOS useEffect(() => { @@ -245,9 +224,9 @@ export const WalletScreen: NavigationFunctionComponent = ({ componentId }) => { return [ ...licenseItems, - ...(showPassport ? resPassport?.data?.getIdentityDocument ?? [] : []), + ...(resPassport?.data?.getIdentityDocument ?? []), ] as FlatListItem[] - }, [licenseItems, resPassport, showPassport, res.loading, res.data]) + }, [licenseItems, resPassport, res.loading, res.data]) // Fix for a bug in react-native-navigation where the large title is not visible on iOS with bottom tabs https://github.com/wix/react-native-navigation/issues/6717 if (hiddenContent) { From fb096830c19fdb58caba93bc77ac67ecbde54db3 Mon Sep 17 00:00:00 2001 From: thoreyjona Date: Tue, 15 Oct 2024 13:12:19 +0000 Subject: [PATCH 2/2] chore: remove child passport flag --- .../app/src/screens/wallet-passport/wallet-passport.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/apps/native/app/src/screens/wallet-passport/wallet-passport.tsx b/apps/native/app/src/screens/wallet-passport/wallet-passport.tsx index 67046dfab026..a1566d76adca 100644 --- a/apps/native/app/src/screens/wallet-passport/wallet-passport.tsx +++ b/apps/native/app/src/screens/wallet-passport/wallet-passport.tsx @@ -23,7 +23,6 @@ import { NavigationFunctionComponent } from 'react-native-navigation' import styled from 'styled-components/native' import IconStatusVerified from '../../assets/icons/valid.png' import IconStatusNonVerified from '../../assets/icons/warning.png' -import { useFeatureFlag } from '../../contexts/feature-flag-provider' import { useGetIdentityDocumentQuery } from '../../graphql/types/schema' import { createNavigationOptionHooks } from '../../hooks/create-navigation-option-hooks' import { useConnectivityIndicator } from '../../hooks/use-connectivity-indicator' @@ -94,10 +93,6 @@ export const WalletPassportScreen: NavigationFunctionComponent<{ useNavigationOptions(componentId) useConnectivityIndicator({ componentId }) const { openBrowser } = useBrowser() - const showChildrenPassport = useFeatureFlag( - 'isChildrenPassportEnabled', - false, - ) const intl = useIntl() const { data, loading, error } = useGetIdentityDocumentQuery({ @@ -217,7 +212,7 @@ export const WalletPassportScreen: NavigationFunctionComponent<{ /> - {showChildrenPassport && childrenPassport?.length > 0 ? ( + {childrenPassport?.length > 0 ? (