Skip to content

Commit

Permalink
Merge branch 'main' into add-sending-verify-email-address
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreichardt authored Jun 11, 2024
2 parents ff7b34b + 22e065c commit 63dd0f5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 47 deletions.
3 changes: 2 additions & 1 deletion app/lib/dashboard/bloc/build_lesson_views.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ List<LessonView> _buildSortedViews(

final views = [
for (final lesson in lessons)
if (lesson.getSubstitutionFor(date) is! LessonCanceledSubstitution)
if (lesson.getSubstitutionFor(date).getLessonCanceledSubstitution() ==
null)
_buildLessonView(
lesson,
groupInfo: groupInfoOf(lesson),
Expand Down
6 changes: 5 additions & 1 deletion app/lib/main/run_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ Future<void> runFlutterApp({required Flavor flavor}) async {
// see:
// * https://github.com/flutter/flutter/issues/115158#issuecomment-1319080131
// * https://github.com/gskinnerTeam/flutter-wonderous-app/issues/146
WidgetsFlutterBinding.ensureInitialized().ensureSemantics();
//
// Currently disabled because of:
// https://github.com/flutter/flutter/issues/150020
//
// WidgetsFlutterBinding.ensureInitialized().ensureSemantics();
}

if (PlatformCheck.isWeb) {
Expand Down
6 changes: 4 additions & 2 deletions app/lib/settings/src/subpages/my_profile/my_profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ class _DeleteAccountDialogContentState
];

Future<void> tryToDeleteUser(BuildContext context) async {
if (isEmptyOrNull(password)) {
return;
}

final api = BlocProvider.of<SharezoneContext>(context).api;
final analytics = BlocProvider.of<SharezoneContext>(context).analytics;
final authUser = api.user.authUser!;
Expand Down Expand Up @@ -473,10 +477,8 @@ class _DeleteAccountDialogContentState
onChanged: (s) => setState(() => password = s),
onEditingComplete: () async => tryToDeleteUser(context),
autofocus: false,
style: const TextStyle(color: Colors.black),
decoration: InputDecoration(
labelText: 'Passwort',
labelStyle: const TextStyle(color: Colors.black),
suffixIcon: GestureDetector(
onTap: () {
setState(() {
Expand Down
23 changes: 4 additions & 19 deletions app/lib/timetable/timetable_page/lesson/substitution_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ class _SubstitutionSection extends StatelessWidget {
final locationSubstitution = substitutions.getLocationChangedSubstitution();
final teacherSubstitution = substitutions.getTeacherChangedSubstitution();
final hasUnlocked = context.watch<SubscriptionService>().hasFeatureUnlocked(
SharezonePlusFeature.substitutions,
) ||
!isStableStage;
SharezonePlusFeature.substitutions,
);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand All @@ -44,14 +43,12 @@ class _SubstitutionSection extends StatelessWidget {
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.6),
),
),
// We show the beta chip as long as the update isn't on the stable
// track.
trailing: hasUnlocked ? const _BetaChip() : const SharezonePlusChip(),
trailing: hasUnlocked ? null : const SharezonePlusChip(),
),
if (canceledSubstitution != null)
_LessonCanceledCard(
courseId: lesson.groupID,
createdBy: locationSubstitution!.createdBy,
createdBy: canceledSubstitution.createdBy,
hasPermissionsToManageLessons: hasPermissionsToManageLessons,
),
if (locationSubstitution != null)
Expand Down Expand Up @@ -115,18 +112,6 @@ class _SubstitutionSection extends StatelessWidget {
}
}

class _BetaChip extends StatelessWidget {
const _BetaChip();

@override
Widget build(BuildContext context) {
return Chip(
label: const Text('Beta'),
backgroundColor: Theme.of(context).colorScheme.secondary.withOpacity(0.2),
);
}
}

class _LessonCanceledCard extends StatelessWidget {
const _LessonCanceledCard({
required this.createdBy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:sharezone/groups/src/pages/course/course_edit/design/course_edit_design.dart';
import 'package:sharezone/main/application_bloc.dart';
import 'package:sharezone/main/constants.dart';
import 'package:sharezone/navigation/drawer/sign_out_dialogs/src/sign_out_and_delete_anonymous_user.dart';
import 'package:sharezone/report/page/report_page.dart';
import 'package:sharezone/report/report_icon.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TimetableEntryLesson extends StatelessWidget {
Widget build(BuildContext context) {
final canceledDesign = Design.fromColor(Colors.grey[600]!);
final substitutions = lesson.getSubstitutionFor(date);
final isCanceled = substitutions is LessonCanceledSubstitution;
final isCanceled = substitutions.getLessonCanceledSubstitution() != null;
final design = isCanceled ? canceledDesign : groupInfo?.design;
final newLocation =
substitutions.getLocationChangedSubstitution()?.newLocation;
Expand Down
23 changes: 1 addition & 22 deletions app/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,10 @@
code to be more GDPR friendly (client avoid making a request to a third
party service) -->
<script src="https://unpkg.com/@zxing/[email protected]" type="application/javascript"></script>

<script>
// The value below is injected by flutter build, do not touch.
var serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>

<body>
<script>
window.addEventListener('load', function (ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function (engineInitializer) {
engineInitializer.initializeEngine().then(function (appRunner) {
appRunner.runApp();
});
}
});
});
</script>
<script src="flutter_bootstrap.js" async></script>

<div class="spinner">
<div class="double-bounce1"></div>
Expand Down

0 comments on commit 63dd0f5

Please sign in to comment.