Skip to content

Commit

Permalink
Remove Sharezone Wrapped (#1700)
Browse files Browse the repository at this point in the history
Since few users opened Sharezone Wrapped in the end, we want to remove
the code for now, as we are unsure if we're going to be using it next
year. If so, we can re-add it anyways.
  • Loading branch information
Jonas-Sander authored Aug 10, 2024
1 parent a7f414f commit 6280c8f
Show file tree
Hide file tree
Showing 25 changed files with 13 additions and 2,051 deletions.
10 changes: 0 additions & 10 deletions app/assets/icons/graduation-cap.svg

This file was deleted.

2 changes: 1 addition & 1 deletion app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ SPEC CHECKSUMS:
GTMSessionFetcher: 8000756fc1c19d2e5697b90311f7832d2e33f6cd
image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
integration_test: 13825b8a9334a850581300559b8839134b124670
leveldb-library: e8eadf9008a61f9e1dde3978c086d2b6d9b9dc28
libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
Expand Down
7 changes: 1 addition & 6 deletions app/lib/dashboard/tips/dashboard_tip_system.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:bloc_base/bloc_base.dart';
import 'package:rxdart/rxdart.dart';
import 'package:sharezone/dashboard/tips/cache/dashboard_tip_cache.dart';
import 'package:sharezone/dashboard/tips/models/rate_our_app_tip.dart';
import 'package:sharezone/dashboard/tips/models/wrapped_tip.dart';
import 'package:sharezone/navigation/logic/navigation_bloc.dart';
import 'package:sharezone/settings/src/bloc/user_tips_bloc.dart';

Expand All @@ -37,16 +36,12 @@ class DashboardTipSystem extends BlocBase {
UserTipsBloc userTipsBloc,
) {
final rateOurAppTip = RateOurAppTip(cache);
final wrappedTip =
SharezoneWrappedTip(cache, userTipsBloc.streamAccountCreatedOn());

final tips = [rateOurAppTip, wrappedTip];
final tips = [rateOurAppTip];

return CombineLatestStream(tips.map((tip) => tip.shouldShown()).toList(),
(streamValues) {
final showRateOurAppCard = streamValues[0];
final showWrappedTip = streamValues[1];
if (showWrappedTip) return wrappedTip;
if (showRateOurAppCard) return rateOurAppTip;
return null;
});
Expand Down
57 changes: 0 additions & 57 deletions app/lib/dashboard/tips/models/wrapped_tip.dart

This file was deleted.

3 changes: 1 addition & 2 deletions app/lib/main/plugin_initializations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ class PluginInitializations {
'firebase_messaging_vapid_key':
'BNT7Da6B6wi-mUBcGrt-9HxeIJZsPTsPpmR8cae_LhgJPcSFb5j0T8o-r-oFV1xAtXVXfRPIZlgUJR3tx8mLbbA',
'stripe_checkout_session_function_url':
'https://europe-west1-sharezone-c2bd8.cloudfunctions.net/createStripeCheckoutSession',
'show_sz_wrapped_23_24': true,
'https://europe-west1-sharezone-c2bd8.cloudfunctions.net/createStripeCheckoutSession'
});

try {
Expand Down
3 changes: 0 additions & 3 deletions app/lib/main/sharezone_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import 'package:sharezone/settings/src/subpages/notification.dart';
import 'package:sharezone/settings/src/subpages/theme/theme_page.dart';
import 'package:sharezone/settings/src/subpages/timetable/timetable_settings_page.dart';
import 'package:sharezone/settings/src/subpages/web_app.dart';
import 'package:sharezone/sharezone_wrapped/sharezone_wrapped_page.dart';
import 'package:sharezone/sharezone_v2/sz_v2_announcement_dialog.dart';
import 'package:sharezone/support/support_page.dart';
import 'package:sharezone/timetable/timetable_add/timetable_add_page.dart';
Expand Down Expand Up @@ -205,8 +204,6 @@ class _SharezoneAppState extends State<SharezoneApp>
ICalLinksDialog.tag: (context) => const ICalLinksDialog(),
CreateTermPage.tag: (context) => const CreateTermPage(),
GradesDialog.tag: (context) => const GradesDialog(),
SharezoneWrappedPage.tag: (context) =>
const SharezoneWrappedPage(),
},
navigatorKey: navigationService.navigatorKey,
),
Expand Down
20 changes: 1 addition & 19 deletions app/lib/main/sharezone_bloc_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import 'package:http/http.dart' as http;
import 'package:key_value_store/in_memory_key_value_store.dart';
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
import 'package:remote_configuration/remote_configuration.dart';
import 'package:sharezone/account/account_page_bloc_factory.dart';
import 'package:sharezone/account/change_data_bloc.dart';
import 'package:sharezone/account/type_of_user_bloc.dart';
Expand Down Expand Up @@ -116,8 +115,6 @@ import 'package:sharezone/sharezone_plus/page/sharezone_plus_page_controller.dar
import 'package:sharezone/sharezone_plus/subscription_service/is_buying_enabled.dart';
import 'package:sharezone/sharezone_plus/subscription_service/revenue_cat_sharezone_plus_service.dart';
import 'package:sharezone/sharezone_plus/subscription_service/subscription_service.dart';
import 'package:sharezone/sharezone_wrapped/sharezone_wrapped_controller.dart';
import 'package:sharezone/sharezone_wrapped/sharezone_wrapped_repository.dart';
import 'package:sharezone/support/support_page_controller.dart';
import 'package:sharezone/timetable/src/bloc/timetable_bloc.dart';
import 'package:sharezone/timetable/src/models/lesson_length/lesson_length_cache.dart';
Expand Down Expand Up @@ -351,9 +348,6 @@ class _SharezoneBlocProvidersState extends State<SharezoneBlocProviders> {
create: (context) => api.user.authUserStream,
initialData: null,
),
Provider<RemoteConfiguration>(
create: (context) => widget.blocDependencies.remoteConfiguration,
),
ChangeNotifierProvider(
create: (context) => SharezonePlusPageController(
buyingFlagApi: BuyingEnabledApi(client: http.Client()),
Expand Down Expand Up @@ -487,19 +481,7 @@ class _SharezoneBlocProvidersState extends State<SharezoneBlocProviders> {
courseMemberAccessor:
FirestoreCourseMemberAccessor(api.references.firestore),
),
),
Provider(
create: (context) => SharezoneWrappedController(
repository: SharezoneWrappedRepository(
firestore: firestore,
userId: api.userId,
connectionsGateway: api.connectionsGateway,
clock: clock,
),
crashAnalytics: crashAnalytics,
analytics: analytics,
),
),
)
];

mainBlocProviders = <BlocProvider>[
Expand Down
28 changes: 6 additions & 22 deletions app/lib/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import 'package:analytics/analytics.dart';
import 'package:bloc_provider/bloc_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'package:remote_configuration/remote_configuration.dart';
import 'package:sharezone/legal/terms_of_service/terms_of_service_page.dart';
import 'package:sharezone/main/application_bloc.dart';
import 'package:sharezone/navigation/logic/navigation_bloc.dart';
Expand All @@ -21,13 +19,11 @@ import 'package:sharezone/settings/src/subpages/changelog_page.dart';
import 'package:sharezone/settings/src/subpages/notification.dart';
import 'package:sharezone/settings/src/subpages/about/about_page.dart';
import 'package:sharezone/settings/src/subpages/theme/theme_page.dart';
import 'package:sharezone/sharezone_wrapped/sharezone_wrapped_page.dart';
import 'package:sharezone/support/support_page.dart';
import 'package:sharezone/settings/src/subpages/timetable/timetable_settings_page.dart';
import 'package:sharezone/settings/src/subpages/web_app.dart';
import 'package:sharezone/legal/privacy_policy/privacy_policy_page.dart';
import 'package:platform_check/platform_check.dart';
import 'package:sharezone/widgets/limited_chip.dart';
import 'package:sharezone_utils/launch_link.dart';
import 'package:sharezone_widgets/sharezone_widgets.dart';

Expand Down Expand Up @@ -149,38 +145,29 @@ class _LegalSection extends StatelessWidget {
class _AppSettingsSection extends StatelessWidget {
@override
Widget build(BuildContext context) {
final remoteConfig = context.read<RemoteConfiguration>();
final showWrapped = remoteConfig.getBool('show_sz_wrapped_23_24');
return _SettingsSection(
return const _SettingsSection(
title: 'App-Einstellungen',
children: <Widget>[
const _SettingsOption(
_SettingsOption(
title: "Mein Konto",
icon: Icon(Icons.account_circle),
tag: MyProfilePage.tag,
),
const _SettingsOption(
_SettingsOption(
title: "Benachrichtigungen",
icon: Icon(Icons.notifications_active),
tag: NotificationPage.tag,
),
const _SettingsOption(
_SettingsOption(
title: "Erscheinungsbild",
icon: Icon(Icons.color_lens),
tag: ThemePage.tag,
),
const _SettingsOption(
_SettingsOption(
title: "Stundenplan",
icon: Icon(Icons.access_time),
tag: TimetableSettingsPage.tag,
),
if (showWrapped)
const _SettingsOption(
title: "Schuljahr 23/24 Sharezone Wrapped",
icon: Icon(Icons.fast_rewind),
tag: SharezoneWrappedPage.tag,
trailing: LimitedChip(),
)
)
],
);
}
Expand Down Expand Up @@ -262,13 +249,11 @@ class _SettingsOption extends StatelessWidget {
this.icon,
this.onTap,
this.tag,
this.trailing,
});

final String? title;
final Widget? icon;
final GestureTapCallback? onTap;
final Widget? trailing;
final String? tag;

@override
Expand All @@ -277,7 +262,6 @@ class _SettingsOption extends StatelessWidget {
title: Text(title!),
leading: icon,
onTap: onTap ?? () => Navigator.pushNamed(context, tag!),
trailing: trailing,
);
}
}
4 changes: 0 additions & 4 deletions app/lib/settings/src/bloc/user_tips_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class UserTipsBloc extends BlocBase {
return _userGateway.userStream.map((user) => user?.userTipData);
}

Stream<DateTime?> streamAccountCreatedOn() {
return _userGateway.userStream.map((user) => user?.createdOn);
}

void enableUserTip(UserTipKey tipKey) {
_updateUserTip(tipKey, true);
}
Expand Down
Loading

0 comments on commit 6280c8f

Please sign in to comment.