diff --git a/.DS_Store b/.DS_Store index 097b747a..31ef8af3 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 70fbcd94..fd22ac2f 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -8,7 +8,29 @@ jobs: build: runs-on: [macos-arm64] steps: - - name: Run Fastlane + - name: Checkout + uses: actions/checkout@v2 + + - name: Unlock login keychain run: | + security unlock-keychain -p "$KEYCHAIN_PASSWORD" /Users/gitea_runner_ci/Library/Keychains/login.keychain-db + env: + KEYCHAIN_PASSWORD: EeChahboo9Ei + + - name: Flutter build + run: | + flutter clean + flutter pub get + flutter pub upgrade + flutter pub run build_runner build --delete-conflicting-outputs cd ios - fastlane beta \ No newline at end of file + pod update + fastlane beta + env: + LANG: en_US.UTF-8 + LC_ALL: en_US.UTF-8 + MATCH_PASSWORD: EeChahboo9Ei + MATCH_GIT_URL: http://gitea.office.local:3000/mso7nueh/fastlane + FASTLANE_USER: eatvio2023@icloud.com + FASTLANE_PASSWORD: EeChahboo9Ei + FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: iqsm-pfxm-bpmg-nkry \ No newline at end of file diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 8c247e87..20ee9c53 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -104,14 +104,27 @@ jobs: - name: Test run: flutter test + - name: Create key.properties file + run: | + cat > android/key.properties < android/app/my-release-key.jks + - name: Build apk - run: flutter build apk --profile + run: flutter build apk --release - name: Rename and move apk run: | TIMESTAMP=$(TZ=Europe/Moscow date +'%Y-%m-%d-%H-%M') APK_NAME="eatvio_app_${TIMESTAMP}.apk" - mv build/app/outputs/flutter-apk/app-profile.apk $APK_NAME + mv build/app/outputs/flutter-apk/app-release.apk $APK_NAME echo "APK build finished $APK_NAME" echo "APK_NAME=$APK_NAME" >> $GITHUB_ENV diff --git a/ios/Gemfile b/ios/Gemfile new file mode 100644 index 00000000..7a118b49 --- /dev/null +++ b/ios/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c2ccb23a..2ebee285 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -386,10 +386,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; - DEVELOPMENT_TEAM = ""; + CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 9; + DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -409,7 +409,7 @@ MARKETING_VERSION = 1.0.50; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -536,10 +536,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; - DEVELOPMENT_TEAM = ""; + CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 9; + DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -559,7 +559,7 @@ MARKETING_VERSION = 1.0.50; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -574,10 +574,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 7; - DEVELOPMENT_TEAM = ""; + CODE_SIGN_IDENTITY = "Apple Distribution: ITVIO, OOO (VL68C36HYS)"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 9; + DEVELOPMENT_TEAM = VL68C36HYS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -597,7 +597,7 @@ MARKETING_VERSION = 1.0.50; PRODUCT_BUNDLE_IDENTIFIER = com.eatvioapp.app; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.eatvioapp.app 1747050044"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index b6470ce4..eada9fab 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - $(FLUTTER_BUILD_NUMBER) + 9 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/ios/fastlane/.env.default b/ios/fastlane/.env.default new file mode 100644 index 00000000..49b144e2 --- /dev/null +++ b/ios/fastlane/.env.default @@ -0,0 +1,2 @@ +FASTLANE_USER=eatvio2023@icloud.com +FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD=iqsm-pfxm-bpmg-nkry \ No newline at end of file diff --git a/ios/fastlane/Appfile b/ios/fastlane/Appfile new file mode 100644 index 00000000..b36199d4 --- /dev/null +++ b/ios/fastlane/Appfile @@ -0,0 +1,8 @@ +app_identifier("com.eatvioapp.app") # The bundle identifier of your app +apple_id("eatvio2023@icloud.com") # Your Apple Developer Portal username + +itc_team_id("126794592") # App Store Connect Team ID +team_id("VL68C36HYS") # Developer Portal Team ID + +# For more information about the Appfile, see: +# https://docs.fastlane.tools/advanced/#appfile diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile new file mode 100644 index 00000000..4073b355 --- /dev/null +++ b/ios/fastlane/Fastfile @@ -0,0 +1,26 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + +default_platform(:ios) + +platform :ios do + desc "Push a new beta build to TestFlight" + lane :beta do + match(type: "appstore") + increment_build_number(xcodeproj: "Runner.xcodeproj") + build_app(workspace: "Runner.xcworkspace", scheme: "Runner", export_method: "app-store", codesigning_identity: "Apple Distribution") + upload_to_testflight + end +end diff --git a/ios/fastlane/README.md b/ios/fastlane/README.md new file mode 100644 index 00000000..891747df --- /dev/null +++ b/ios/fastlane/README.md @@ -0,0 +1,32 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +## iOS + +### ios beta + +```sh +[bundle exec] fastlane ios beta +``` + +Push a new beta build to TestFlight + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/ios/fastlane/report.xml b/ios/fastlane/report.xml new file mode 100644 index 00000000..c86e2b65 --- /dev/null +++ b/ios/fastlane/report.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/features/feed/models/comment_model.dart b/lib/features/feed/models/comment_model.dart index 1fbcb145..258bbd17 100644 --- a/lib/features/feed/models/comment_model.dart +++ b/lib/features/feed/models/comment_model.dart @@ -20,6 +20,7 @@ class Comment with _$Comment { const factory Comment({ @JsonKey(name: "id") required int id, @JsonKey(name: "author_name") required String authorName, + @JsonKey(name: "author_slug") required String authorSlug, @JsonKey(name: "author_profile_icon") required String authorProfileIcon, @JsonKey(name: "body") required String body, @JsonKey(name: "children_comments") required List childrenComments, diff --git a/lib/features/feed/presentation/widgets/comments_widget.dart b/lib/features/feed/presentation/widgets/comments_widget.dart index 338e4f5a..b12b691e 100644 --- a/lib/features/feed/presentation/widgets/comments_widget.dart +++ b/lib/features/feed/presentation/widgets/comments_widget.dart @@ -1,10 +1,15 @@ +import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/utils/date_time_utils.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; import 'package:eatvio_app/features/feed/models/comment_model.dart'; +import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/comments_cubit/comments_cubit.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:eatvio_app/core/theme/theme_helper.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:go_router/go_router.dart'; enum CommentSourceType { blogPost, recipe, diet, plan } @@ -59,10 +64,23 @@ class _CommentsWidgetState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - CircleAvatar( - foregroundImage: NetworkImage(comment.authorProfileIcon), - backgroundImage: const AssetImage('assets/images/no_avatar.png'), - radius: radius, + GestureDetector( + onTap: () { + GoRouter.of(context).pushNamed( + 'profileScreen', + extra: Author( + authorSlug: comment.authorSlug, + authorName: comment.authorName, + authorProfileIcon: comment.authorProfileIcon, + authorIsMe: (sl().state as ProfileAvatarStateLoaded).profile.slug == comment.authorSlug ? true : false, + ), + ); + }, + child: CircleAvatar( + foregroundImage: NetworkImage(comment.authorProfileIcon), + backgroundImage: const AssetImage('assets/images/no_avatar.png'), + radius: radius, + ), ), const SizedBox(width: 8), Column( diff --git a/lib/features/feed/presentation/widgets/consultant_widget.dart b/lib/features/feed/presentation/widgets/consultant_widget.dart index 061bc0db..5246d348 100644 --- a/lib/features/feed/presentation/widgets/consultant_widget.dart +++ b/lib/features/feed/presentation/widgets/consultant_widget.dart @@ -1,6 +1,9 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:eatvio_app/core/const.dart'; +import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/theme/theme_helper.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; +import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_state.dart'; import 'package:eatvio_app/features/feed/models/diets_pagination_model.dart'; import 'package:eatvio_app/features/feed/models/feed_consultant_model.dart'; import 'package:eatvio_app/features/profile/models/badge_model.dart'; @@ -26,7 +29,7 @@ class ConsultantWidget extends StatelessWidget { authorSlug: consultant.slug, authorName: consultant.name, authorProfileIcon: consultant.photo, - authorIsMe: false, + authorIsMe: (sl().state as ProfileAvatarStateLoaded).profile.slug == consultant.slug ? true : false, ), ); }, diff --git a/lib/features/profile/presentation/pages/profile_screen.dart b/lib/features/profile/presentation/pages/profile_screen.dart index e127d68c..df96f608 100644 --- a/lib/features/profile/presentation/pages/profile_screen.dart +++ b/lib/features/profile/presentation/pages/profile_screen.dart @@ -66,7 +66,7 @@ class _ProfileScreenState extends State { @override void initState() { super.initState(); - widget.author == null ? profileCubit.getMyProfile() : profileCubit.getProfileBySlug(widget.author!.authorSlug); + widget.author == null || widget.author!.authorIsMe ? profileCubit.getMyProfile() : profileCubit.getProfileBySlug(widget.author!.authorSlug); } @override @@ -89,11 +89,11 @@ class _ProfileScreenState extends State { } isFirstFetch = false; } - return widget.author == null ? _myProfileScreen(state) : _profileScreen(state); + return widget.author == null || widget.author!.authorIsMe ? _myProfileScreen(state) : _profileScreen(state); } else if (state is ProfileStateError) { return DataErrorWidget( onReload: () async { - widget.author == null ? await profileCubit.getMyProfile() : await profileCubit.getProfileBySlug(widget.author!.authorSlug); + widget.author == null || widget.author!.authorIsMe ? await profileCubit.getMyProfile() : await profileCubit.getProfileBySlug(widget.author!.authorSlug); }, ); } else { @@ -393,7 +393,7 @@ class _ProfileScreenState extends State { ), ), Text( - widget.author == null ? 'Редактировать' : '', + widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '', style: const TextStyle( color: Color(0xFF2F80ED), fontSize: 16, @@ -478,7 +478,7 @@ class _ProfileScreenState extends State { ), ), Text( - widget.author == null ? 'Редактировать' : '', + widget.author == null || widget.author!.authorIsMe ? 'Редактировать' : '', style: const TextStyle( color: Color(0xFF2F80ED), fontSize: 16, @@ -955,12 +955,12 @@ class _ProfileScreenState extends State { value: 'view', child: Text('Посмотреть'), ), - if (widget.author == null) + if (widget.author == null || widget.author!.authorIsMe) const PopupMenuItem( value: 'replace', child: Text('Заменить'), ), - if (widget.author == null) + if (widget.author == null || widget.author!.authorIsMe) const PopupMenuItem( value: 'delete', child: Text('Удалить'), diff --git a/pubspec.yaml b/pubspec.yaml index 46ddf5d1..1b99db27 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: eatvio_app description: A new Flutter project. -version: 1.0.51+6 +version: 1.1.1+1 publish_to: 'none' environment: