From 53e3f080fbf489d18c86fc42f3b58d07abbddef2 Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Mon, 23 Dec 2024 17:02:33 -0500 Subject: [PATCH 1/4] ios and android both sork in 'run' branch Signed-off-by: Jian Wang --- packages/legacy/app/ios/Podfile.lock | 2 +- packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/legacy/app/ios/Podfile.lock b/packages/legacy/app/ios/Podfile.lock index cc581d2b0d..a2ede9f588 100644 --- a/packages/legacy/app/ios/Podfile.lock +++ b/packages/legacy/app/ios/Podfile.lock @@ -810,4 +810,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 91c24b25407631a4023c96a168470f60d473e28f -COCOAPODS: 1.13.0 +COCOAPODS: 1.15.2 diff --git a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj index 0218196526..e3e3197b1e 100644 --- a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj +++ b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj @@ -649,6 +649,7 @@ OTHER_LDFLAGS = ( "$(inherited)", " ", + "-Wl -ld_classic ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -717,6 +718,7 @@ OTHER_LDFLAGS = ( "$(inherited)", " ", + "-Wl -ld_classic ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; From 15f5fecae6a454048e87d25098800a6266573c3c Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Mon, 23 Dec 2024 23:32:10 -0500 Subject: [PATCH 2/4] New CONFIG boolean field 'disableContactsInSettings' (default false) to remove the Contacts section in Settings rows, added test case for this feature Signed-off-by: Jian Wang --- packages/legacy/core/App/container-impl.ts | 1 + packages/legacy/core/App/screens/Settings.tsx | 7 +++- packages/legacy/core/App/types/config.ts | 1 + .../core/__tests__/screens/Settings.test.tsx | 36 +++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/packages/legacy/core/App/container-impl.ts b/packages/legacy/core/App/container-impl.ts index f8d6eb84cf..3afd86ac69 100644 --- a/packages/legacy/core/App/container-impl.ts +++ b/packages/legacy/core/App/container-impl.ts @@ -60,6 +60,7 @@ export const defaultConfig: Config = { supportedLanguages: [Locales.en, Locales.fr, Locales.ptBr], showPreface: false, disableOnboardingSkip: false, + disableContactsInSettings: false, whereToUseWalletUrl: 'https://example.com', showScanHelp: true, showScanButton: true, diff --git a/packages/legacy/core/App/screens/Settings.tsx b/packages/legacy/core/App/screens/Settings.tsx index eb80c5fbe8..1141841382 100644 --- a/packages/legacy/core/App/screens/Settings.tsx +++ b/packages/legacy/core/App/screens/Settings.tsx @@ -35,7 +35,7 @@ const Settings: React.FC = ({ navigation }) => { const [store, dispatch] = useStore() const developerOptionCount = useRef(0) const { SettingsTheme, TextTheme, ColorPallet, Assets } = useTheme() - const [{ settings, enableTours, enablePushNotifications }, historyEnabled] = useServices([ + const [{ settings, enableTours, enablePushNotifications, disableContactsInSettings }, historyEnabled] = useServices([ TOKENS.CONFIG, TOKENS.HISTORY_ENABLED, ]) @@ -167,6 +167,11 @@ const Settings: React.FC = ({ navigation }) => { }, ...(settings || []), ] + + // Remove the Contact section from Setting per TOKENS.CONFIG + if ("true" === `${disableContactsInSettings}`) { + settingsSections.shift(); + } // add optional push notifications menu to settings if (enablePushNotifications) { diff --git a/packages/legacy/core/App/types/config.ts b/packages/legacy/core/App/types/config.ts index f3d537cdc6..e8317aab6e 100644 --- a/packages/legacy/core/App/types/config.ts +++ b/packages/legacy/core/App/types/config.ts @@ -35,6 +35,7 @@ export interface Config { contactHideList?: string[] contactDetailsOptions?: ContactDetailsOptionsParams credentialHideList?: string[] + disableContactsInSettings?: boolean } export interface HistoryEventsLoggerConfig { diff --git a/packages/legacy/core/__tests__/screens/Settings.test.tsx b/packages/legacy/core/__tests__/screens/Settings.test.tsx index 1c03a55247..0650517132 100644 --- a/packages/legacy/core/__tests__/screens/Settings.test.tsx +++ b/packages/legacy/core/__tests__/screens/Settings.test.tsx @@ -1,12 +1,16 @@ import { useNavigation } from '@react-navigation/native' import { render } from '@testing-library/react-native' import React from 'react' +import { container } from 'tsyringe' import { StoreContext } from '../../App' import Settings from '../../App/screens/Settings' import { testIdWithKey } from '../../App/utils/testable' import { testDefaultState } from '../contexts/store' import { BasicAppContext } from '../helpers/app' +import { CustomBasicAppContext } from '../helpers/app' +import { TOKENS } from '../../App/container-api' +import { MainContainer } from '../../App/container-impl' describe('Settings Screen', () => { beforeEach(() => { @@ -127,4 +131,36 @@ describe('Settings Screen', () => { const proofButton = tree.getByTestId(testIdWithKey('ProofRequests')) expect(proofButton).not.toBeNull() }) + + test('If disableContactsInSettings is true, the Contacts section is not shown', async () => { + const customState = { + ...testDefaultState, + preferences: { + ...testDefaultState.preferences, + developerModeEnabled: true, + walletName: 'My Wallet', + }, + } + + const context = new MainContainer(container.createChildContainer()).init() + const config = context.resolve(TOKENS.CONFIG) + context.container.registerInstance(TOKENS.CONFIG, { ...config, disableContactsInSettings: true}) + + const tree = render( + { + return + }, + ]} + > + + + + + ) + const contactsSection = tree.queryByTestId(testIdWithKey('Contacts')) + expect(contactsSection).toBeNull() + }) }) From 1e70172a6acf43d7f469eb936e463788a57c0508 Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Mon, 30 Dec 2024 10:39:00 -0500 Subject: [PATCH 3/4] Restore the ios local building env files; refactor the conditional statement matching the boolean type Signed-off-by: Jian Wang --- packages/legacy/app/ios/Podfile.lock | 2 +- packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj | 4 +--- packages/legacy/core/App/screens/Settings.tsx | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/legacy/app/ios/Podfile.lock b/packages/legacy/app/ios/Podfile.lock index a2ede9f588..4536971827 100644 --- a/packages/legacy/app/ios/Podfile.lock +++ b/packages/legacy/app/ios/Podfile.lock @@ -810,4 +810,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 91c24b25407631a4023c96a168470f60d473e28f -COCOAPODS: 1.15.2 +COCOAPODS: 1.13.0 \ No newline at end of file diff --git a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj index e3e3197b1e..260c4fd920 100644 --- a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj +++ b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj @@ -649,7 +649,6 @@ OTHER_LDFLAGS = ( "$(inherited)", " ", - "-Wl -ld_classic ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -718,7 +717,6 @@ OTHER_LDFLAGS = ( "$(inherited)", " ", - "-Wl -ld_classic ", ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -759,4 +757,4 @@ /* End XCConfigurationList section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; -} +} \ No newline at end of file diff --git a/packages/legacy/core/App/screens/Settings.tsx b/packages/legacy/core/App/screens/Settings.tsx index 1141841382..2fd4f952ce 100644 --- a/packages/legacy/core/App/screens/Settings.tsx +++ b/packages/legacy/core/App/screens/Settings.tsx @@ -169,7 +169,7 @@ const Settings: React.FC = ({ navigation }) => { ] // Remove the Contact section from Setting per TOKENS.CONFIG - if ("true" === `${disableContactsInSettings}`) { + if (disableContactsInSettings) { settingsSections.shift(); } From 0a31c97ebe861cb0516e435a9553e82efb4212be Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Fri, 3 Jan 2025 01:45:39 -0500 Subject: [PATCH 4/4] Reload the original file 'Podfile.lock' and 'project.pbxproj' from upstream to fix the file EOF issue Signed-off-by: Jian Wang --- packages/legacy/app/ios/Podfile.lock | 2 +- packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/legacy/app/ios/Podfile.lock b/packages/legacy/app/ios/Podfile.lock index 4536971827..cc581d2b0d 100644 --- a/packages/legacy/app/ios/Podfile.lock +++ b/packages/legacy/app/ios/Podfile.lock @@ -810,4 +810,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 91c24b25407631a4023c96a168470f60d473e28f -COCOAPODS: 1.13.0 \ No newline at end of file +COCOAPODS: 1.13.0 diff --git a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj index 260c4fd920..0218196526 100644 --- a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj +++ b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj @@ -757,4 +757,4 @@ /* End XCConfigurationList section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; -} \ No newline at end of file +}