From 1f714b3bc2a812e6141987084a7446546fb77a61 Mon Sep 17 00:00:00 2001 From: Username1548 Date: Wed, 6 Aug 2025 20:29:56 +0700 Subject: [PATCH 1/6] feat(diary): fixed commenting of diary --- .../diary/presentation/bloc/diary_cubit.dart | 58 +++++++------------ 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/lib/features/diary/presentation/bloc/diary_cubit.dart b/lib/features/diary/presentation/bloc/diary_cubit.dart index 1bbfbbc7..8f8c8a0a 100644 --- a/lib/features/diary/presentation/bloc/diary_cubit.dart +++ b/lib/features/diary/presentation/bloc/diary_cubit.dart @@ -136,15 +136,7 @@ class DiaryCubit extends Cubit { final fifthMeal = MealModel(id: 0, time: '0', typeNumber: 5, satiety: 0, mood: 0, portions: fifthMealPortions ?? [], photos: []); emit( DiaryState.loadedTomorrowWithDiet( - diary: diaryDay.copyWith( - meals: [ - firstMeal, - secondMeal, - thirdMeal, - fourthMeal, - fifthMeal, - ], - ), + diary: diaryDay.copyWith(meals: [firstMeal, secondMeal, thirdMeal, fourthMeal, fifthMeal]), selectedDay: selectedDay, selectedMeal: selectedMeal, ), @@ -156,7 +148,7 @@ class DiaryCubit extends Cubit { Future fetchDiary([bool needLoading = false, int? diaryId, int? currentDay]) async { this.diaryId ??= diaryId; - + final isConsultantView = this.diaryId != null; if (needLoading) { emit(const DiaryState.loading()); selectedMeal = 1; @@ -180,7 +172,8 @@ class DiaryCubit extends Cubit { String? planName; if (diaryDay.chosenPlanId != null) { final chosenPlanModel = await chatRepository.getChosenPlan(id: diaryDay.chosenPlanId!); - if (diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented) { + if (isConsultantView && + (diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented)) { await diaryRepository.viewCommentOfDiaryDayByConsultant(diaryId: diaryDay.id); } consultantReview = await diaryRepository.getDiaryComments(planId: diaryDay.chosenPlanId!, diaryId: diaryDay.id); @@ -192,24 +185,26 @@ class DiaryCubit extends Cubit { final isDiaryFinished = diaryDay.typeOfDiary.diaryState == DiaryStateEnum.finished || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayFinished; - final isDiaryCommented = diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented || + final isDiaryCommented = + diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.reviewedByUser; emit( DiaryState.loaded( - diary: diaryDay, - nutrition: nutrition, - selectedDay: selectedDay, - selectedMeal: selectedMeal, - isConsultantView: this.diaryId != null, - consultantReview: consultantReview, - isDiaryFinished: isDiaryFinished, - isDiaryCommented: isDiaryCommented, - chosenPlanCurrentDay: currentPlanDay, - chosenPlanDuration: planDuration, - chosenPlanName: planName, - isMoodEnabled: isMoodEnabled, - isWakeUpAndRetireEnabled: isWakeUpAndRetireTimeEnabled), + diary: diaryDay, + nutrition: nutrition, + selectedDay: selectedDay, + selectedMeal: selectedMeal, + isConsultantView: isConsultantView, + consultantReview: consultantReview, + isDiaryFinished: isDiaryFinished, + isDiaryCommented: isDiaryCommented, + chosenPlanCurrentDay: currentPlanDay, + chosenPlanDuration: planDuration, + chosenPlanName: planName, + isMoodEnabled: isMoodEnabled, + isWakeUpAndRetireEnabled: isWakeUpAndRetireTimeEnabled, + ), ); } catch (e, st) { log(e.toString(), stackTrace: st); @@ -217,17 +212,8 @@ class DiaryCubit extends Cubit { } } - Future finishDiaryDay({ - required int diaryId, - required String wakeUp, - required String retire, - }) async { - await diaryRepository.finishDiaryDay( - diaryId: diaryId, - wakeUp: wakeUp, - retire: retire, - comment: comment.isEmpty ? null : comment, - ); + Future finishDiaryDay({required int diaryId, required String wakeUp, required String retire}) async { + await diaryRepository.finishDiaryDay(diaryId: diaryId, wakeUp: wakeUp, retire: retire, comment: comment.isEmpty ? null : comment); await fetchDiary(); } From 7e7f8bfb034f49819637bbb0637add2df3b6bfee Mon Sep 17 00:00:00 2001 From: Username1548 Date: Wed, 6 Aug 2025 20:36:50 +0700 Subject: [PATCH 2/6] fix --- lib/features/diary/presentation/bloc/diary_cubit.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/features/diary/presentation/bloc/diary_cubit.dart b/lib/features/diary/presentation/bloc/diary_cubit.dart index 8f8c8a0a..6e6f8891 100644 --- a/lib/features/diary/presentation/bloc/diary_cubit.dart +++ b/lib/features/diary/presentation/bloc/diary_cubit.dart @@ -172,7 +172,7 @@ class DiaryCubit extends Cubit { String? planName; if (diaryDay.chosenPlanId != null) { final chosenPlanModel = await chatRepository.getChosenPlan(id: diaryDay.chosenPlanId!); - if (isConsultantView && + if (!isConsultantView && (diaryDay.typeOfDiary.diaryState == DiaryStateEnum.lastDayCommented || diaryDay.typeOfDiary.diaryState == DiaryStateEnum.commented)) { await diaryRepository.viewCommentOfDiaryDayByConsultant(diaryId: diaryDay.id); } From 1305e678179a9daec70e1f85038145be78f061c3 Mon Sep 17 00:00:00 2001 From: Username1548 Date: Thu, 7 Aug 2025 18:10:58 +0700 Subject: [PATCH 3/6] feat(env): added env loading to ci/cd --- .gitea/workflows/test-flight-cd.yaml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 4320ecc5..c1244bd9 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -11,6 +11,30 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Checkout env repository + uses: actions/checkout@v2 + with: + repository: mso7nueh/eatvio_app_env + path: env_repo + token: ${{ vars.MSO7NUEH_TOKEN }} + ref: main + + - name: Copy .env file + run: | + mkdir -p env + cp env_repo/.env env/.env + + - name: Load environment variables from .env + run: | + set -a + source env/.env + set +a + # Export all variables to GITHUB_ENV + while IFS= read -r line; do + if [[ $line =~ ^[A-Za-z_][A-Za-z0-9_]*= ]]; then + echo "$line" >> $GITHUB_ENV + fi + done < env/.env - name: Unlock login keychain run: | @@ -36,4 +60,4 @@ jobs: MATCH_GIT_URL: http://gitea.office.local:3000/mso7nueh/fastlane FASTLANE_USER: eatvio2023@icloud.com FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ vars.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }} - API_APPSTORE_KEY: ${{ vars.API_APPSTORE_KEY }} \ No newline at end of file + API_APPSTORE_KEY: ${{ vars.API_APPSTORE_KEY }} From f9b63f3401e9565e061d5fc2b05b34c7a11b3fb4 Mon Sep 17 00:00:00 2001 From: Username1548 Date: Thu, 7 Aug 2025 18:20:26 +0700 Subject: [PATCH 4/6] version update --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- ios/Runner/Info.plist | 2 +- pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 9a27847e..14890f55 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -396,7 +396,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 66; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -546,7 +546,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 66; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -584,7 +584,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 64; + CURRENT_PROJECT_VERSION = 66; DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 2341e63f..65ea6c40 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 64 + 66 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/pubspec.yaml b/pubspec.yaml index 0154d606..a3560aec 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: eatvio_app description: A new Flutter project. -version: 1.2.6+64 +version: 1.2.6+66 publish_to: 'none' environment: From 905559b1f006de37c6328aa3df1e85b4edd7a70a Mon Sep 17 00:00:00 2001 From: Username1548 Date: Thu, 7 Aug 2025 19:06:27 +0700 Subject: [PATCH 5/6] feat(fastlane): changed fastlane build uploading --- ios/fastlane/Fastfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index d9653264..de31023b 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -28,6 +28,8 @@ platform :ios do xcargs: "--dart-define=HIDE_PLANS=true" ) app_store_connect_api_key(key_id: "325JS9JCZH", issuer_id: "dfa27d1d-2bb8-4d4d-847e-0b32f9b880b3", key_filepath: "./AuthKey.p8") - upload_to_testflight + upload_to_testflight( + use_legacy_upload: false + ) end end From 6fa7beb070ef040ca4bf9858b92941742bb18264 Mon Sep 17 00:00:00 2001 From: Username1548 Date: Thu, 7 Aug 2025 19:23:12 +0700 Subject: [PATCH 6/6] reverted changes --- ios/fastlane/Fastfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index de31023b..d9653264 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -28,8 +28,6 @@ platform :ios do xcargs: "--dart-define=HIDE_PLANS=true" ) app_store_connect_api_key(key_id: "325JS9JCZH", issuer_id: "dfa27d1d-2bb8-4d4d-847e-0b32f9b880b3", key_filepath: "./AuthKey.p8") - upload_to_testflight( - use_legacy_upload: false - ) + upload_to_testflight end end