From 9cf457a903355f9f878a7fcb37af4a89e430707b Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 12 Dec 2022 12:55:46 +0530 Subject: [PATCH 1/2] remove feature flag --- lib/core/constants.dart | 1 - lib/services/feature_flag_service.dart | 17 ------- lib/ui/sharing/manage_links_widget.dart | 64 +++++++++++-------------- 3 files changed, 27 insertions(+), 55 deletions(-) diff --git a/lib/core/constants.dart b/lib/core/constants.dart index 9e93172c6..e2a51b0a6 100644 --- a/lib/core/constants.dart +++ b/lib/core/constants.dart @@ -44,7 +44,6 @@ const supportEmail = 'support@ente.io'; class FFDefault { static const bool enableStripe = true; static const bool disableCFWorker = false; - static const bool enableCollect = false; } const kDefaultProductionEndpoint = 'https://api.ente.io'; diff --git a/lib/services/feature_flag_service.dart b/lib/services/feature_flag_service.dart index 8a583a458..47517d183 100644 --- a/lib/services/feature_flag_service.dart +++ b/lib/services/feature_flag_service.dart @@ -62,18 +62,6 @@ class FeatureFlagService { } } - bool enableCollect() { - if (isInternalUserOrDebugBuild()) { - return true; - } - try { - return _getFeatureFlags().enableCollect; - } catch (e) { - _logger.severe(e); - return FFDefault.enableCollect; - } - } - bool isInternalUserOrDebugBuild() { final String? email = Configuration.instance.getEmail(); return (email != null && email.endsWith("@ente.io")) || kDebugMode; @@ -97,24 +85,20 @@ class FeatureFlags { static FeatureFlags defaultFlags = FeatureFlags( disableCFWorker: FFDefault.disableCFWorker, enableStripe: FFDefault.enableStripe, - enableCollect: FFDefault.enableCollect, ); final bool disableCFWorker; final bool enableStripe; - final bool enableCollect; FeatureFlags({ required this.disableCFWorker, required this.enableStripe, - required this.enableCollect, }); Map toMap() { return { "disableCFWorker": disableCFWorker, "enableStripe": enableStripe, - "enableCollect": enableCollect, }; } @@ -127,7 +111,6 @@ class FeatureFlags { return FeatureFlags( disableCFWorker: json["disableCFWorker"] ?? FFDefault.disableCFWorker, enableStripe: json["enableStripe"] ?? FFDefault.enableStripe, - enableCollect: json["enableCollect"] ?? FFDefault.enableCollect, ); } } diff --git a/lib/ui/sharing/manage_links_widget.dart b/lib/ui/sharing/manage_links_widget.dart index a75003c44..17b5c81a6 100644 --- a/lib/ui/sharing/manage_links_widget.dart +++ b/lib/ui/sharing/manage_links_widget.dart @@ -10,7 +10,6 @@ import 'package:flutter_sodium/flutter_sodium.dart'; import 'package:photos/ente_theme_data.dart'; import 'package:photos/models/collection.dart'; import 'package:photos/services/collections_service.dart'; -import 'package:photos/services/feature_flag_service.dart'; import 'package:photos/theme/colors.dart'; import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/common/dialogs.dart'; @@ -59,41 +58,6 @@ class _ManageSharedLinkWidgetState extends State { Widget build(BuildContext context) { final enteColorScheme = getEnteColorScheme(context); final PublicURL url = widget.collection?.publicURLs?.firstOrNull; - final enableCollectFeature = FeatureFlagService.instance.enableCollect(); - final Widget collect = enableCollectFeature - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - MenuItemWidget( - captionedTextWidget: const CaptionedTextWidget( - title: "Allow adding photos", - ), - alignCaptionedTextToLeft: true, - menuItemColor: getEnteColorScheme(context).fillFaint, - pressedColor: getEnteColorScheme(context).fillFaint, - trailingWidget: Switch.adaptive( - value: widget - .collection.publicURLs?.firstOrNull?.enableCollect ?? - false, - onChanged: (value) async { - await _updateUrlSettings( - context, - {'enableCollect': value}, - ); - - setState(() {}); - }, - ), - ), - const MenuSectionDescriptionWidget( - content: - "Allow people with the link to also add photos to the shared " - "album.", - ), - const SizedBox(height: 24) - ], - ) - : const SizedBox.shrink(); return Scaffold( backgroundColor: Theme.of(context).backgroundColor, appBar: AppBar( @@ -110,7 +74,33 @@ class _ManageSharedLinkWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - collect, + MenuItemWidget( + captionedTextWidget: const CaptionedTextWidget( + title: "Allow adding photos", + ), + alignCaptionedTextToLeft: true, + menuItemColor: getEnteColorScheme(context).fillFaint, + pressedColor: getEnteColorScheme(context).fillFaint, + trailingWidget: Switch.adaptive( + value: widget.collection.publicURLs?.firstOrNull?.enableCollect ?? + false, + onChanged: (value) async { + await _updateUrlSettings( + context, + {'enableCollect': value}, + ); + + setState(() {}); + }, + ), + ), + const MenuSectionDescriptionWidget( + content: + "Allow people with the link to also add photos to the shared " + "album.", + ), + const SizedBox(height: 24) + ], MenuItemWidget( alignCaptionedTextToLeft: true, captionedTextWidget: CaptionedTextWidget( From 0a0df1f0bd3d15e1f4decf78ef96e233ef221bd3 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Mon, 12 Dec 2022 12:58:14 +0530 Subject: [PATCH 2/2] bump version to 0.6.74+394 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7864ef723..f42c53a18 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ description: ente photos application # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.6.72+392 +version: 0.6.74+394 environment: sdk: '>=2.17.0 <3.0.0'