63 lines
2.0 KiB
Dart
63 lines
2.0 KiB
Dart
import '../../../state/app/modules/capabilities/bloc/capabilities_state.dart';
|
|
import '../../../state/app/modules/nextcloud_capabilities/bloc/nextcloud_capabilities_state.dart';
|
|
import '../../marianumconnect/queries/get_capabilities/guardian_child.dart';
|
|
import '../demo_persona.dart';
|
|
|
|
/// Demo fixtures for the mobile capability flags — everything granted so the
|
|
/// demo persona sees every feature (incl. push) as available and the timetable
|
|
/// scroll range stays unlimited (null day counts).
|
|
class DemoCapabilities {
|
|
const DemoCapabilities._();
|
|
|
|
static CapabilitiesState state() => const CapabilitiesState(
|
|
viewForeignTimetables: true,
|
|
pushNotifications: true,
|
|
timetablePastDays: null,
|
|
timetableFutureDays: null,
|
|
// Die Demo-Persona ist explizit Schüler — null hieße "Backend kennt das
|
|
// Feld nicht" (siehe CapabilitiesResponse.userType).
|
|
userType: 'STUDENT',
|
|
loaded: true,
|
|
);
|
|
|
|
/// Guardian persona with two children, so the child switcher is visible.
|
|
static CapabilitiesState guardianState() => const CapabilitiesState(
|
|
pushNotifications: true,
|
|
userType: 'PARENT',
|
|
children: [
|
|
GuardianChild(
|
|
id: 'demo-child-1',
|
|
firstName: DemoPersona.studentFirstName,
|
|
lastName: 'Hoffmann',
|
|
className: DemoPersona.className,
|
|
),
|
|
GuardianChild(
|
|
id: 'demo-child-2',
|
|
firstName: 'Jonas',
|
|
lastName: 'Hoffmann',
|
|
className: '6a',
|
|
),
|
|
],
|
|
loaded: true,
|
|
);
|
|
}
|
|
|
|
/// Demo fixtures for the Nextcloud `files_sharing` capabilities — a permissive
|
|
/// "everything enabled, nothing enforced" server profile.
|
|
class DemoNextcloudCapabilities {
|
|
const DemoNextcloudCapabilities._();
|
|
|
|
static NextcloudCapabilitiesState state() => const NextcloudCapabilitiesState(
|
|
apiEnabled: true,
|
|
publicEnabled: true,
|
|
publicMultipleLinks: true,
|
|
publicUploadEnabled: true,
|
|
publicPasswordEnforced: false,
|
|
publicExpireEnabled: false,
|
|
publicExpireEnforced: false,
|
|
groupEnabled: true,
|
|
resharing: true,
|
|
loaded: true,
|
|
);
|
|
}
|