From fbe2a6b4d5d13656394d673d1763c1159824bb93 Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 15:25:21 +0700 Subject: [PATCH 1/8] Timeout 5sec for /apis/memberships/subscriptions/portal --- lib/common/injector.dart | 7 +++++++ lib/service/iap_service.dart | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/common/injector.dart b/lib/common/injector.dart index a70472dc8..7a9e2c676 100644 --- a/lib/common/injector.dart +++ b/lib/common/injector.dart @@ -103,6 +103,8 @@ import 'package:web3dart/web3dart.dart'; final injector = GetIt.instance; final testnetInjector = GetIt.asNewInstance(); +const iapApiTimeout5secInstanceName = 'iapApiTimeout5sec'; + Future setupLogger() async { await FileLogger.initializeLogging(); @@ -212,6 +214,11 @@ Future setupInjector() async { injector.registerLazySingleton(() => ChatAuthService(injector())); injector.registerLazySingleton( () => IAPApi(authenticatedDio, baseUrl: Environment.autonomyAuthURL)); + + injector.registerLazySingleton( + () => IAPApi(dio, baseUrl: Environment.autonomyAuthURL), + instanceName: iapApiTimeout5secInstanceName); + injector.registerLazySingleton( () => UserApi(dio, baseUrl: Environment.autonomyAuthURL)); diff --git a/lib/service/iap_service.dart b/lib/service/iap_service.dart index 6237a7d6e..254497670 100644 --- a/lib/service/iap_service.dart +++ b/lib/service/iap_service.dart @@ -375,7 +375,9 @@ class IAPServiceImpl implements IAPService { @override Future getStripeUrl() async { try { - final res = await injector().portalUrl() as Map; + final res = + await injector(instanceName: iapApiTimeout5secInstanceName) + .portalUrl() as Map; return res['url'] as String; } catch (error) { log.warning('Error when getting stripe portal url: $error'); From 076397f715cd0e17f618c2db6a735ea17eabb965 Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 15:39:51 +0700 Subject: [PATCH 2/8] make exhibition as default --- lib/screen/feralfile_home/feralfile_home.dart | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/screen/feralfile_home/feralfile_home.dart b/lib/screen/feralfile_home/feralfile_home.dart index d623a0294..bdd7fcb20 100644 --- a/lib/screen/feralfile_home/feralfile_home.dart +++ b/lib/screen/feralfile_home/feralfile_home.dart @@ -26,9 +26,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; enum FeralfileHomeTab { - featured, - artworks, exhibitions, + artworks, + featured, artists, curators, rAndD; @@ -127,7 +127,7 @@ class FeralfileHomePageState extends State super.initState(); _canvasDeviceBloc = injector.get(); context.read().add(FeralFileHomeFetchDataEvent()); - _selectedIndex = FeralfileHomeTab.featured.index; + _selectedIndex = FeralfileHomeTab.exhibitions.index; } Widget _castButton(BuildContext context, List featuredArtworks) { @@ -234,13 +234,14 @@ class FeralfileHomePageState extends State final numberFormater = NumberFormat('#,###', 'en_US'); return [ Item( - id: FeralfileHomeTab.featured.index.toString(), - title: 'featured'.tr(), - subtitle: state.featuredArtworks != null - ? numberFormater.format(state.featuredArtworks!.length) + id: FeralfileHomeTab.exhibitions.index.toString(), + title: 'exhibitions'.tr(), + subtitle: state.exploreStatisticsData != null + ? numberFormater + .format(state.exploreStatisticsData!.totalExhibition) : '-', onSelected: () { - _selectTab(FeralfileHomeTab.featured); + _selectTab(FeralfileHomeTab.exhibitions); }, ), Item( @@ -254,14 +255,13 @@ class FeralfileHomePageState extends State }, ), Item( - id: FeralfileHomeTab.exhibitions.index.toString(), - title: 'exhibitions'.tr(), - subtitle: state.exploreStatisticsData != null - ? numberFormater - .format(state.exploreStatisticsData!.totalExhibition) + id: FeralfileHomeTab.featured.index.toString(), + title: 'featured'.tr(), + subtitle: state.featuredArtworks != null + ? numberFormater.format(state.featuredArtworks!.length) : '-', onSelected: () { - _selectTab(FeralfileHomeTab.exhibitions); + _selectTab(FeralfileHomeTab.featured); }, ), Item( From 2de5f42f5ec82b2f80923d63a31bbf8c770c08b1 Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 15:45:14 +0700 Subject: [PATCH 3/8] chat with feralfile --- lib/screen/customer_support/support_thread_page.dart | 2 +- lib/screen/onboarding_page.dart | 3 ++- lib/util/constants.dart | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/screen/customer_support/support_thread_page.dart b/lib/screen/customer_support/support_thread_page.dart index c49dd2bae..31bec184c 100644 --- a/lib/screen/customer_support/support_thread_page.dart +++ b/lib/screen/customer_support/support_thread_page.dart @@ -222,7 +222,7 @@ class _SupportThreadPageState extends State { }); } case NewIssueFromAnnouncementPayload: - _reportIssueType = ReportIssueType.Announcement; + _reportIssueType = ReportIssueType.ChatWithFeralfile; case DetailIssuePayload: _reportIssueType = (payload as DetailIssuePayload).reportIssueType; _status = payload.status; diff --git a/lib/screen/onboarding_page.dart b/lib/screen/onboarding_page.dart index c43a8bdcc..2df796184 100644 --- a/lib/screen/onboarding_page.dart +++ b/lib/screen/onboarding_page.dart @@ -167,7 +167,8 @@ class _OnboardingPageState extends State } Future _loginProcess() async { - final isSupportPasskey = await _passkeyService.isPassKeyAvailable(); + final isSupportPasskey = false; + await _passkeyService.isPassKeyAvailable(); if (!isSupportPasskey) { log.info('Passkey is not supported. Login with address'); await injector().migrateAccount(() async { diff --git a/lib/util/constants.dart b/lib/util/constants.dart index a880d230f..cf3482951 100644 --- a/lib/util/constants.dart +++ b/lib/util/constants.dart @@ -286,9 +286,10 @@ class ReportIssueType { static const Exception = 'exception'; static const Announcement = 'announcement'; static const MerchandiseIssue = 'merchandise postcard'; + static const ChatWithFeralfile = 'chat with Feral File'; static List get getList => - [Bug, Exception, Announcement, MerchandiseIssue]; + [Bug, Exception, Announcement, MerchandiseIssue, ChatWithFeralfile]; static List get getSuggestList => [Bug]; @@ -298,6 +299,8 @@ class ReportIssueType { return 'Report a bug'; case Announcement: return 'announcement'.tr(); + case ChatWithFeralfile: + return 'chat_with_feralfile'.tr(); case MerchandiseIssue: return 'Merchandise issue'; case Bug: From acfca775da33d25f9b371c57764bdf3a1d31419c Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 16:02:38 +0700 Subject: [PATCH 4/8] tap on close issue --- lib/model/additional_data/additional_data.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model/additional_data/additional_data.dart b/lib/model/additional_data/additional_data.dart index 65cd7acb9..e10efcc6a 100644 --- a/lib/model/additional_data/additional_data.dart +++ b/lib/model/additional_data/additional_data.dart @@ -41,7 +41,7 @@ class AdditionalData { return defaultAdditionalData; } return CsViewThread( - issueId: issueId, + issueId: issueId.toString(), notificationType: notificationType, announcementContentId: announcementContentId, ); From 70953f9be65d80ef731da407ba072b1bced23474 Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 16:49:43 +0700 Subject: [PATCH 5/8] Update artist website --- .../alumni_details/alumni_details_page.dart | 16 ++++++++++------ lib/util/feralfile_alumni_ext.dart | 14 ++++++++++++++ lib/view/alumni_widget.dart | 15 +++++++++------ lib/view/ff_exhibition_participants.dart | 6 +++--- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/lib/screen/alumni_details/alumni_details_page.dart b/lib/screen/alumni_details/alumni_details_page.dart index 74a482635..d6ddda07a 100644 --- a/lib/screen/alumni_details/alumni_details_page.dart +++ b/lib/screen/alumni_details/alumni_details_page.dart @@ -200,12 +200,16 @@ class _AlumniDetailsPageState extends State { height: 24, ), ], - if (alumni.website != null && alumni.website!.isNotEmpty) ...[ - _alumniUrl(context, alumni.website!), - const SizedBox( - height: 12, - ), - ], + if (alumni.websiteUrl.isNotEmpty) + ...alumni.websiteUrl + .map((url) => [ + _alumniUrl(context, url), + const SizedBox( + height: 12, + ) + ]) + .expand((element) => element), + if (alumni.instagramUrl != null && alumni.instagramUrl!.isNotEmpty) ...[ _alumniUrl(context, alumni.instagramUrl!, title: 'instagram'.tr()), const SizedBox( diff --git a/lib/util/feralfile_alumni_ext.dart b/lib/util/feralfile_alumni_ext.dart index 8bca98ffe..0ea92250b 100644 --- a/lib/util/feralfile_alumni_ext.dart +++ b/lib/util/feralfile_alumni_ext.dart @@ -10,6 +10,20 @@ extension AlumniAccountExt on AlumniAccount { ? getFFUrl(avatarURI!) : null; + List get websiteUrl { + final listRawWebsite = + website?.split('&').map((e) => e.trim()).where((e) => e.isNotEmpty) ?? + []; + final listWebsite = listRawWebsite.map((e) { + if (e.startsWith('http')) { + return e; + } + + return 'http://$e'; + }).toList(); + return listWebsite; + } + String? get instagramUrl { final instagramID = socialNetworks?.instagramID; if (instagramID == null || instagramID.isEmpty) { diff --git a/lib/view/alumni_widget.dart b/lib/view/alumni_widget.dart index 4acc6c64d..b5c83c8eb 100644 --- a/lib/view/alumni_widget.dart +++ b/lib/view/alumni_widget.dart @@ -117,12 +117,15 @@ class AlumniProfile extends StatelessWidget { height: 24, ), ], - if (alumni.website != null && alumni.website!.isNotEmpty) ...[ - _alumniUrl(context, alumni.website!), - const SizedBox( - height: 12, - ), - ], + if (alumni.websiteUrl.isNotEmpty) + ...alumni.websiteUrl + .map((url) => [ + _alumniUrl(context, url), + const SizedBox( + height: 12, + ) + ]) + .expand((element) => element), if (alumni.instagramUrl != null && alumni.instagramUrl!.isNotEmpty) ...[ _alumniUrl(context, alumni.instagramUrl!, title: 'Instagram'), const SizedBox( diff --git a/lib/view/ff_exhibition_participants.dart b/lib/view/ff_exhibition_participants.dart index 0296cd937..d925e8dba 100644 --- a/lib/view/ff_exhibition_participants.dart +++ b/lib/view/ff_exhibition_participants.dart @@ -38,13 +38,13 @@ List exhibitionParticipantSpans(List participants) { .openFeralFileCuratorPage(alumni.slug!) : injector() .openFeralFileArtistPage(alumni.slug!)); - } else if (alumni.website != null) { - await launchUrl(Uri.parse(alumni.website!)); + } else if (alumni.websiteUrl.isNotEmpty) { + await launchUrl(Uri.parse(alumni.websiteUrl.first)); } }, text: alumni.displayAlias, style: TextStyle( - decoration: alumni.slug != null || alumni.website != null + decoration: alumni.slug != null || alumni.websiteUrl.isNotEmpty ? TextDecoration.underline : TextDecoration.none, ), From f4235e9698ab8ed32ca50b58e0ca480953264092 Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 17:47:12 +0700 Subject: [PATCH 6/8] Update Asset --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index f8f48b3db..8981babdc 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit f8f48b3dbe3309205eee577924fc1308acc3e216 +Subproject commit 8981babdce1dd1af67c985bc4951d14ad7fa27c1 From fa79e14cf2b80c92ba2aa775780fa4849441e1e3 Mon Sep 17 00:00:00 2001 From: PuPha Date: Tue, 5 Nov 2024 17:48:10 +0700 Subject: [PATCH 7/8] Update --- lib/screen/onboarding_page.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/screen/onboarding_page.dart b/lib/screen/onboarding_page.dart index 2df796184..c43a8bdcc 100644 --- a/lib/screen/onboarding_page.dart +++ b/lib/screen/onboarding_page.dart @@ -167,8 +167,7 @@ class _OnboardingPageState extends State } Future _loginProcess() async { - final isSupportPasskey = false; - await _passkeyService.isPassKeyAvailable(); + final isSupportPasskey = await _passkeyService.isPassKeyAvailable(); if (!isSupportPasskey) { log.info('Passkey is not supported. Login with address'); await injector().migrateAccount(() async { From 0bc24603b13d669a085b1aaed7490c09d69fcf8b Mon Sep 17 00:00:00 2001 From: PuPha Date: Wed, 6 Nov 2024 09:45:57 +0700 Subject: [PATCH 8/8] remove text announcement --- lib/model/announcement/announcement.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/model/announcement/announcement.dart b/lib/model/announcement/announcement.dart index 89633a616..f27dfc7d2 100644 --- a/lib/model/announcement/announcement.dart +++ b/lib/model/announcement/announcement.dart @@ -1,4 +1,5 @@ import 'package:autonomy_flutter/model/customer_support.dart'; +import 'package:easy_localization/easy_localization.dart'; class Announcement extends ChatThread { final String announcementContentId; @@ -27,7 +28,7 @@ class Announcement extends ChatThread { bool get isExpired => DateTime.now().isAfter(endedAt); @override - String getListTitle() => 'Announcement'; + String getListTitle() => 'chat_with_feralfile'.tr(); @override bool isUnread() => false;