Skip to content

Commit f372391

Browse files
authored
Merge pull request #468 from OpenPecha/series-enroll-group
fix : group enrollment
2 parents 072cbd8 + 9006679 commit f372391

32 files changed

Lines changed: 1307 additions & 262 deletions

lib/core/config/protected_routes.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ class ProtectedRoutes {
7373
/// The token is sent when the user is authenticated; silently skipped for guests.
7474
static const List<String> optionalPaths = [
7575
'/plans/{planId}/days',
76-
// Authenticated users get joined groups excluded server-side.
7776
'/author/groups',
77+
// Group detail + members: sends auth when logged in so fields like
78+
// `is_group_enrolled` reflect the current user (anonymous GET → false).
79+
'/author/groups/',
7880
];
7981

8082
/// Check if a given path is protected (requires authentication).

lib/core/config/router/app_router.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:flutter_pecha/features/auth/presentation/providers/state_provide
1111
import 'package:flutter_pecha/features/auth/presentation/screens/login_page.dart';
1212
import 'package:flutter_pecha/features/auth/presentation/screens/splash_screen.dart';
1313
import 'package:flutter_pecha/features/calendar/presentation/screens/tibetan_calendar_screen.dart';
14+
import 'package:flutter_pecha/features/group_profile/domain/entities/group_profile.dart';
1415
import 'package:flutter_pecha/features/group_profile/presentation/screens/group_profile_screen.dart';
1516
import 'package:flutter_pecha/features/home/domain/entities/series.dart';
1617
import 'package:flutter_pecha/features/home/presentation/screens/main_navigation_screen.dart';
@@ -204,7 +205,17 @@ final appRouterProvider = Provider<GoRouter>((ref) {
204205
final id = state.pathParameters['id'] ?? '';
205206
final extra = state.extra as Map<String, dynamic>?;
206207
final series = extra?['series'] as Series?;
207-
return SeriesDetailScreen(seriesId: id, series: series);
208+
final groupId = extra?['groupId'] as String?;
209+
final groupType = extra?['groupType'] as GroupType?;
210+
final isGroupEnrolled =
211+
extra?['isGroupEnrolled'] as bool? ?? false;
212+
return SeriesDetailScreen(
213+
seriesId: id,
214+
series: series,
215+
groupId: groupId,
216+
groupType: groupType,
217+
isGroupEnrolled: isGroupEnrolled,
218+
);
208219
},
209220
routes: [
210221
GoRoute(

lib/core/l10n/app_bo.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@
705705
"group_followers": "རྗེས་འབྲང་པ།",
706706
"group_links_title": "འབྲེལ་ཐག",
707707
"group_and_more_links": "དང་འབྲེལ་ཐག་གཞན་ {count}",
708+
"group_practice_with_us": "ང་ཚོ་དང་མཉམ་དུ་སྒོམ་གྱི།",
708709

709710
"share_this_quote": "གསུང་ཚིག་འདི་སྤེལ།",
710711
"shared_from": "སྤེལ་ཁུངས།",

lib/core/l10n/app_en.arb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,9 @@
782782
"group_followers": "followers",
783783
"group_links_title": "Links",
784784
"group_and_more_links": "and {count} more links",
785+
"group_practice_with_us": "Practice with us",
786+
"group_change_practice_title": "Change group practice",
787+
"group_change_practice_message": "You are already practicing this plan with another group. Would you like to change your practice group?",
785788
"@group_and_more_links": {
786789
"placeholders": {
787790
"count": {

lib/core/l10n/app_hi.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@
771771
"group_followers": "अनुयायी",
772772
"group_links_title": "लिंक",
773773
"group_and_more_links": "और {count} और लिंक",
774+
"group_practice_with_us": "हमारे साथ अभ्यास करें",
774775

775776
"share_this_quote": "यह उद्धरण शेयर करें",
776777
"shared_from": "यहाँ से शेयर किया गया",

lib/core/l10n/app_mn.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@
771771
"group_followers": "дагагчид",
772772
"group_links_title": "Холбоосууд",
773773
"group_and_more_links": "болон дахиад {count} холбоос",
774+
"group_practice_with_us": "Бидэнтэй хамт дадлага хий",
774775

775776
"share_this_quote": "Энэ ишлэлийг хуваалцах",
776777
"shared_from": "Хуваалцсан:",

lib/core/l10n/app_ne.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@
771771
"group_followers": "अनुयायीहरू",
772772
"group_links_title": "लिङ्कहरू",
773773
"group_and_more_links": "र अरू {count} लिङ्कहरू",
774+
"group_practice_with_us": "हामीसँग अभ्यास गर्नुहोस्",
774775

775776
"share_this_quote": "यो उद्धरण साझा गर्नुहोस्",
776777
"shared_from": "बाट साझा गरिएको",

lib/core/l10n/app_zh.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@
705705
"group_followers": "位追蹤者",
706706
"group_links_title": "連結",
707707
"group_and_more_links": "及另外 {count} 個連結",
708+
"group_practice_with_us": "與我們一起修行",
708709

709710
"share_this_quote": "分享这句话",
710711
"shared_from": "分享自",

lib/core/l10n/generated/app_localizations.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,24 @@ abstract class AppLocalizations {
29382938
/// **'and {count} more links'**
29392939
String group_and_more_links(int count);
29402940

2941+
/// No description provided for @group_practice_with_us.
2942+
///
2943+
/// In en, this message translates to:
2944+
/// **'Practice with us'**
2945+
String get group_practice_with_us;
2946+
2947+
/// No description provided for @group_change_practice_title.
2948+
///
2949+
/// In en, this message translates to:
2950+
/// **'Change group practice'**
2951+
String get group_change_practice_title;
2952+
2953+
/// No description provided for @group_change_practice_message.
2954+
///
2955+
/// In en, this message translates to:
2956+
/// **'You are already practicing this plan with another group. Would you like to change your practice group?'**
2957+
String get group_change_practice_message;
2958+
29412959
/// No description provided for @share_this_quote.
29422960
///
29432961
/// In en, this message translates to:

lib/core/l10n/generated/app_localizations_bo.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,16 @@ class AppLocalizationsBo extends AppLocalizations {
16231623
return 'དང་འབྲེལ་ཐག་གཞན་ $count';
16241624
}
16251625

1626+
@override
1627+
String get group_practice_with_us => 'ང་ཚོ་དང་མཉམ་དུ་སྒོམ་གྱི།';
1628+
1629+
@override
1630+
String get group_change_practice_title => 'Change group practice';
1631+
1632+
@override
1633+
String get group_change_practice_message =>
1634+
'You are already practicing this plan with another group. Would you like to change your practice group?';
1635+
16261636
@override
16271637
String get share_this_quote => 'གསུང་ཚིག་འདི་སྤེལ།';
16281638

0 commit comments

Comments
 (0)