From d1a70fcb9b637f023d8b4cd79e07a1af61692fd4 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 17:47:06 +0530 Subject: [PATCH 01/12] fixed the update status as well as cancel ooo api call --- src/screens/AuthScreen/Util.ts | 2 +- src/screens/HomeScreen/HomeScreenV2.tsx | 7 +++++-- src/screens/ProfileScreen/ProfileScreen.tsx | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/screens/AuthScreen/Util.ts b/src/screens/AuthScreen/Util.ts index cbd70294..9947382e 100644 --- a/src/screens/AuthScreen/Util.ts +++ b/src/screens/AuthScreen/Util.ts @@ -155,6 +155,6 @@ export const formatTimeToUnix = (date) => { const newDate = new Date(date); // Convert the date to Unix Epoch timestamp in seconds - const unixTimestampInSeconds = newDate.getTime() / 1000; + const unixTimestampInSeconds = newDate.getTime(); return unixTimestampInSeconds; }; diff --git a/src/screens/HomeScreen/HomeScreenV2.tsx b/src/screens/HomeScreen/HomeScreenV2.tsx index 97b080c3..5eabac30 100644 --- a/src/screens/HomeScreen/HomeScreenV2.tsx +++ b/src/screens/HomeScreen/HomeScreenV2.tsx @@ -36,7 +36,9 @@ const HomeScreenV2 = (): JSX.Element => { const handleButtonPress = async () => { if (status === 'OOO') { + setIsLoading(true); await cancelOoo(loggedInUserData?.token); + setIsLoading(false); } else { setIsFormVisible((prev) => !prev); } @@ -50,10 +52,11 @@ const HomeScreenV2 = (): JSX.Element => { message: description, state: 'OOO', until: formatTimeToUnix(toDate), - updateAt: formatTimeToUnix(Date.now), + updatedAt: formatTimeToUnix(currentDate), }, }; - await submitOOOForm(data, loggedInUserData?.token); + const res = await submitOOOForm(data, loggedInUserData?.token); + console.log(res); setIsLoading(false); // Clear loading state after API call setIsFormVisible(false); // Hide the form after a successful submission }; diff --git a/src/screens/ProfileScreen/ProfileScreen.tsx b/src/screens/ProfileScreen/ProfileScreen.tsx index b35a7a1a..bd26f9f0 100644 --- a/src/screens/ProfileScreen/ProfileScreen.tsx +++ b/src/screens/ProfileScreen/ProfileScreen.tsx @@ -19,11 +19,11 @@ import UploadImageModalView from '../../components/GalleryModal'; import { AuthContext } from '../../context/AuthContext'; import { ImagePickerResponse } from 'react-native-image-picker'; import Strings from '../../i18n/en'; -import AllContributionsDropdown from './User Data/UserContributions/AllContributions'; import NoteworthyContributionsDropdown from './User Data/UserContributions/NoteWorthyContributions'; import ActiveTaskDropDown from './User Data/UserContributions/ActiveTask'; import UserData from './User Data/UserData'; import { useSelector, useDispatch } from 'react-redux'; +import AllContributionsDropdown from './User Data/UserContributions/AllContributions'; const ProfileScreen = () => { const dispatch = useDispatch(); From d04dcabf860ff17b34ac2a7a780cdb17ef224574 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 18:27:50 +0530 Subject: [PATCH 02/12] fix the build release command --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5395ac0a..a03d9ea1 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -41,7 +41,7 @@ jobs: run: cd android && chmod +x ./gradlew - name: build release - run: cd android && ./gradlew assembleRelease + run: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug - name: list files run: ls -lrt android/app/build/outputs/apk/release From 41394ef532b1bda43bc1b218251974cd7459ad8b Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 18:32:15 +0530 Subject: [PATCH 03/12] fixing pipeline --- .../android-continous-deployment.yml | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/android-continous-deployment.yml b/.github/workflows/android-continous-deployment.yml index 3f7e4f59..93f2f08c 100644 --- a/.github/workflows/android-continous-deployment.yml +++ b/.github/workflows/android-continous-deployment.yml @@ -31,26 +31,6 @@ jobs: - name: Install yarn dependencies run: | yarn install - - - name: Create config file - run: | - cp ./config/config.sample.js ./config/config.js - - - name: Find and Replace clientId - uses: jacobtomlinson/gha-find-replace@v2 - with: - find: '' - replace: ${{ secrets.CLIENT_GITHUB_ID }} - include: 'config/config.js' - regex: true - - - name: Find and Replace clientSecret - uses: jacobtomlinson/gha-find-replace@v2 - with: - find: '' - replace: ${{ secrets.CLIENT_GITHUB_SECRET }} - include: 'config/config.js' - - name: Make Gradlew Executable run: cd android && chmod +x ./gradlew - name: Build Android Release From 57c6547de5b425fcdd7c02adfc3e75781e69cbaf Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 18:43:43 +0530 Subject: [PATCH 04/12] updated list files --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a03d9ea1..c5b8dbbb 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -44,7 +44,7 @@ jobs: run: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug - name: list files - run: ls -lrt android/app/build/outputs/apk/release + run: ls -lrt android/app/build/outputs/apk/debug - name: upload artifact to Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1.2.1 From bca3a6b48f7155a2306e318dd1bfe5e4de312589 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 19:05:20 +0530 Subject: [PATCH 05/12] updated build.gradle --- android/app/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android/app/build.gradle b/android/app/build.gradle index 9ef1d120..17306ba5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -128,6 +128,11 @@ def enableHermes = project.ext.react.get("enableHermes", false); def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") android { + + lintOptions { + checkReleaseBuilds false + } + ndkVersion rootProject.ext.ndkVersion compileSdkVersion rootProject.ext.compileSdkVersion From f3a471a14a984a837c3748c9e30d25066eb04852 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 19:28:33 +0530 Subject: [PATCH 06/12] updated the pipelin yml in which the output file will get stored in assets folder --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c5b8dbbb..0736c790 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -41,7 +41,7 @@ jobs: run: cd android && chmod +x ./gradlew - name: build release - run: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug + run: npx react-native bundle --platform android --dev false --entry-file index.js cd android/app/src/main && mkdir assets --bundle-output index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug - name: list files run: ls -lrt android/app/build/outputs/apk/debug From c7dd18cb9f2d4d33e33446df96df9a17a0c9e303 Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 19:36:35 +0530 Subject: [PATCH 07/12] updated the pipelin yml in which the output file will get stored in assets folder --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 0736c790..acbb7024 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -41,7 +41,7 @@ jobs: run: cd android && chmod +x ./gradlew - name: build release - run: npx react-native bundle --platform android --dev false --entry-file index.js cd android/app/src/main && mkdir assets --bundle-output index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug + run: npx react-native bundle --platform android --dev false --entry-file index.js --assets-dest cd android/app/src/main && mkdir assets --bundle-output index.android.bundle && cd android && ./gradlew assembleDebug - name: list files run: ls -lrt android/app/build/outputs/apk/debug From 72e945f387656a82b2f723167c900abd449f1f0a Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 20:01:27 +0530 Subject: [PATCH 08/12] updated to build assets folder if its not there and run the build release --- .github/workflows/pipeline.yml | 16 +++++++++++++--- package.json | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index acbb7024..7fe90b6c 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -40,11 +40,21 @@ jobs: - name: Make Gradlew Executable run: cd android && chmod +x ./gradlew - - name: build release - run: npx react-native bundle --platform android --dev false --entry-file index.js --assets-dest cd android/app/src/main && mkdir assets --bundle-output index.android.bundle && cd android && ./gradlew assembleDebug + - name: Build assets folder + run: | + cd android/app/src/main && + if [ -d "assets" ]; then + rm -r assets + fi + - name: Build release + run: | + mkdir -p android/app/src/main/assets && + npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && + cd android && + ./gradlew assembleDebug - name: list files - run: ls -lrt android/app/build/outputs/apk/debug + run: ls -lrt android/app/build/outputs/apk/release - name: upload artifact to Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1.2.1 diff --git a/package.json b/package.json index 5967c650..79627c8a 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "format-check": "prettier --check ./src", "format-fix": "prettier --write ./src", "precommit-check": "yarn run format-fix && yarn run lint", - "build": "npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res; cd android ; ./gradlew assembleDebug" + "build-assets-folder": "cd android/app/src/main && if [ -d 'assets' ]; then rm -r assets; fi", + "build": "mkdir -p android/app/src/main/assets && npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug" }, "dependencies": { "@react-native-async-storage/async-storage": "^1.15.16", From 1a126959de1ed0d4b35f59fa05e5f6c8b0730d2d Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 20:12:21 +0530 Subject: [PATCH 09/12] fix listing of files, for now as we dont release keystore will be using debug --- .github/workflows/pipeline.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 7fe90b6c..489a2a7a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -53,8 +53,9 @@ jobs: npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew assembleDebug + - name: list files - run: ls -lrt android/app/build/outputs/apk/release + run: ls -lrt android/app/build/outputs/apk/debug - name: upload artifact to Firebase App Distribution uses: wzieba/Firebase-Distribution-Github-Action@v1.2.1 From de1d8acc47756dc24ace34f0c0f8d9f95891541b Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 20:31:15 +0530 Subject: [PATCH 10/12] fix the uploading artifacts --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 489a2a7a..6aed3a6f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -63,4 +63,4 @@ jobs: appId: ${{secrets.FIREBASE_APP_ID}} token: ${{secrets.FIREBASE_TOKEN}} groups: ${{secrets.GROUPS}} - file: android/app/build/outputs/apk/release/app-release.apk + file: android/app/build/outputs/apk/debug/app-debug.apk From 9335f5a6358d60055c99d4f902b1c3dc221ae76d Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 20:44:46 +0530 Subject: [PATCH 11/12] node incompatibility --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 6aed3a6f..50176633 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -12,7 +12,7 @@ jobs: - name: Use Node.js v14 uses: actions/setup-node@v1 with: - node-version: 16.x + node-version: 12.x - name: Install dependencies run: | From 766a0cd742b2e3132453c00df04224dfed08bb7f Mon Sep 17 00:00:00 2001 From: shreya-mishra Date: Mon, 9 Oct 2023 20:52:00 +0530 Subject: [PATCH 12/12] reverted --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 50176633..6aed3a6f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -12,7 +12,7 @@ jobs: - name: Use Node.js v14 uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 16.x - name: Install dependencies run: |