Initial Commit: Duty Schedule and Attendance Logbook
This commit is contained in:
@@ -22,6 +22,8 @@ import '../screens/tasks/tasks_list_screen.dart';
|
||||
import '../screens/tickets/ticket_detail_screen.dart';
|
||||
import '../screens/tickets/tickets_list_screen.dart';
|
||||
import '../screens/workforce/workforce_screen.dart';
|
||||
import '../screens/attendance/attendance_screen.dart';
|
||||
import '../screens/whereabouts/whereabouts_screen.dart';
|
||||
import '../widgets/app_shell.dart';
|
||||
import '../screens/teams/teams_screen.dart';
|
||||
import '../theme/m3_motion.dart';
|
||||
@@ -67,6 +69,14 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
if (isReportsRoute && !hasReportsAccess) {
|
||||
return '/tickets';
|
||||
}
|
||||
// Attendance & Whereabouts: not accessible to standard users
|
||||
final isStandardOnly = role == 'standard';
|
||||
final isAttendanceRoute =
|
||||
state.matchedLocation == '/attendance' ||
|
||||
state.matchedLocation == '/whereabouts';
|
||||
if (isAttendanceRoute && isStandardOnly) {
|
||||
return '/dashboard';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
routes: [
|
||||
@@ -157,6 +167,20 @@ final appRouterProvider = Provider<GoRouter>((ref) {
|
||||
child: const WorkforceScreen(),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/attendance',
|
||||
pageBuilder: (context, state) => M3SharedAxisPage(
|
||||
key: state.pageKey,
|
||||
child: const AttendanceScreen(),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/whereabouts',
|
||||
pageBuilder: (context, state) => M3SharedAxisPage(
|
||||
key: state.pageKey,
|
||||
child: const WhereaboutsScreen(),
|
||||
),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/reports',
|
||||
pageBuilder: (context, state) => M3SharedAxisPage(
|
||||
|
||||
Reference in New Issue
Block a user