From 1a3e39b6efc0d3c54346853979e59ee950886598 Mon Sep 17 00:00:00 2001 From: Vijay Date: Wed, 7 Jun 2023 12:10:14 +0530 Subject: [PATCH] feat(INJI-94): [Vijay] Environment Agnostics Basic Implementation Issue Link: https://mosip.atlassian.net/browse/INJI-94 --- .env | 5 +- .github/workflows/android-custom-build.yml | 1 + .github/workflows/ios-build.yml | 1 + components/EditableListItem.tsx | 31 +++++++- components/VcDetails.tsx | 17 +++++ components/ui/themes/DefaultTheme.ts | 4 + components/ui/themes/PurpleTheme.ts | 4 + locales/ara.json | 2 + locales/en.json | 2 + locales/fil.json | 2 + locales/hin.json | 2 + locales/kan.json | 2 + locales/tam.json | 2 + machines/app.ts | 34 ++++++++- machines/app.typegen.ts | 7 +- machines/settings.ts | 71 +++++++++++++++++- machines/settings.typegen.ts | 87 +++++++++++++--------- machines/vcItem.ts | 3 +- screens/Profile/ProfileScreen.tsx | 10 +++ screens/Profile/ProfileScreenController.ts | 17 +++++ shared/commonprops/commonProps.ts | 6 +- shared/constants.ts | 4 +- shared/storage.ts | 8 ++ types/react-native-dotenv/index.d.ts | 5 ++ types/vc.ts | 1 + 25 files changed, 277 insertions(+), 51 deletions(-) diff --git a/.env b/.env index d58987cb..833c0552 100644 --- a/.env +++ b/.env @@ -1,10 +1,13 @@ # after making changes to the env file, ensure to start the bundler (or the project) with a --reset-cache # eg . npm build android:newlogic --reset-cache -MIMOTO_HOST=https://api.qa-1201-b2.mosip.net +MIMOTO_HOST=https://api.qatriple.mosip.net #MIMOTO_HOST=http://mock.mimoto.newlogic.dev GOOGLE_NEARBY_MESSAGES_API_KEY= #Application Theme can be ( orange | purple ) APPLICATION_THEME=orange +#environment can be changed if it is toggled +CREDENTIAL_REGISTRY_EDIT=false + USE_BLE_SHARE=true diff --git a/.github/workflows/android-custom-build.yml b/.github/workflows/android-custom-build.yml index 2e9a08b3..5ad86a66 100644 --- a/.github/workflows/android-custom-build.yml +++ b/.github/workflows/android-custom-build.yml @@ -78,6 +78,7 @@ jobs: MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} FIREBASE_SECRET: ${{ secrets.GPG_SECRET }} APPLICATION_THEME: ${{ github.event.inputs.theme }} + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} - name: Upload Artifact uses: actions/upload-artifact@v3.1.1 with: diff --git a/.github/workflows/ios-build.yml b/.github/workflows/ios-build.yml index 07f9e2fd..a34ef6d1 100644 --- a/.github/workflows/ios-build.yml +++ b/.github/workflows/ios-build.yml @@ -72,6 +72,7 @@ jobs: SLACK_URL: '${{ secrets.SLACK_WEBHOOK_DEVOPS }}' MATCH_PASSWORD: '${{ secrets.INJI_IOS_MATCH_PASSWORD }}' APPLICATION_THEME: ${{ github.event.inputs.theme }} + CREDENTIAL_REGISTRY_EDIT: ${{ github.event.inputs.registry_edit }} MIMOTO_HOST: ${{ github.event.inputs.backendServiceUrl }} TESTFLIGHT_INTERNAL_TESTERS_GROUP: ${{ github.event.inputs.internal-testers }} TESTFLIGHT_BETA_APP_DESCRIPTION: ${{ github.event.inputs.buildDescription }} diff --git a/components/EditableListItem.tsx b/components/EditableListItem.tsx index 6815f11c..97a5a0b1 100644 --- a/components/EditableListItem.tsx +++ b/components/EditableListItem.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { Dimensions, I18nManager } from 'react-native'; import { Icon, ListItem, Overlay, Input } from 'react-native-elements'; import { Text, Column, Row, Button } from './ui'; @@ -9,6 +9,13 @@ export const EditableListItem: React.FC = (props) => { const { t } = useTranslation('common'); const [isEditing, setIsEditing] = useState(false); const [newValue, setNewValue] = useState(props.value); + const [overlayOpened, setOverlayOpened] = useState(true); + + useEffect(() => { + if (props.credentialRegistryError === 'success') { + closePopup(); + } + }, [props.credentialRegistryError]); return ( = (props) => { {props.label} + {props.value} - {props.value} + = (props) => { textAlign: I18nManager.isRTL ? 'right' : 'left', }} /> + {props.credentialRegistryError === 'error' && ( + + please try again after sometime... + + )} + {props.credentialRegistryError === 'success' && + overlayOpened && + closePopup()}