From 71818758045c5517a4eb7b21b44cf056c48adb01 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 12 Aug 2022 13:57:01 +0300 Subject: [PATCH] Dashboard overview --- lib/redux/dashboard/dashboard_actions.dart | 2 - lib/redux/dashboard/dashboard_reducer.dart | 3 -- lib/redux/dashboard/dashboard_state.dart | 4 -- lib/redux/dashboard/dashboard_state.g.dart | 50 ++++++---------------- lib/ui/dashboard/dashboard_panels.dart | 10 ----- 5 files changed, 12 insertions(+), 57 deletions(-) diff --git a/lib/redux/dashboard/dashboard_actions.dart b/lib/redux/dashboard/dashboard_actions.dart index efc381cce..57b6e9ca6 100644 --- a/lib/redux/dashboard/dashboard_actions.dart +++ b/lib/redux/dashboard/dashboard_actions.dart @@ -21,7 +21,6 @@ class UpdateDashboardSettings implements PersistUI { this.currencyId, this.includeTaxes, this.groupBy, - this.showCurrentPeriod, this.showPreviousPeriod, this.showTotal, this.totalFields, @@ -33,7 +32,6 @@ class UpdateDashboardSettings implements PersistUI { String currencyId; bool includeTaxes; String groupBy; - bool showCurrentPeriod; bool showPreviousPeriod; bool showTotal; BuiltList totalFields; diff --git a/lib/redux/dashboard/dashboard_reducer.dart b/lib/redux/dashboard/dashboard_reducer.dart index c02e79ea0..9cf2bec60 100644 --- a/lib/redux/dashboard/dashboard_reducer.dart +++ b/lib/redux/dashboard/dashboard_reducer.dart @@ -65,9 +65,6 @@ DashboardUISettings dashboardSettingsReducer( return state.rebuild((b) => b..currencyId = action.currencyId); } else if (action.groupBy != null) { return state.rebuild((b) => b..groupBy = action.groupBy); - } else if (action.showCurrentPeriod != null) { - return state - .rebuild((b) => b..showCurrentPeriod = action.showCurrentPeriod); } else if (action.showPreviousPeriod != null) { return state .rebuild((b) => b..showPreviousPeriod = action.showPreviousPeriod); diff --git a/lib/redux/dashboard/dashboard_state.dart b/lib/redux/dashboard/dashboard_state.dart index 443272800..652799506 100644 --- a/lib/redux/dashboard/dashboard_state.dart +++ b/lib/redux/dashboard/dashboard_state.dart @@ -56,7 +56,6 @@ abstract class DashboardUISettings currencyId: kCurrencyAll, includeTaxes: true, groupBy: kReportGroupDay, - showCurrentPeriod: true, showPreviousPeriod: false, showTotal: true, numberFieldsPerRow: 2, @@ -111,8 +110,6 @@ abstract class DashboardUISettings String get groupBy; - bool get showCurrentPeriod; - bool get showPreviousPeriod; bool get showTotal; @@ -156,7 +153,6 @@ abstract class DashboardUISettings ..groupBy = kReportGroupDay ..showTotal = true ..showPreviousPeriod = false - ..showCurrentPeriod = true ..numberFieldsPerRow = 2 ..totalFields.replace(BuiltList()); diff --git a/lib/redux/dashboard/dashboard_state.g.dart b/lib/redux/dashboard/dashboard_state.g.dart index f1bfef065..cfb17e229 100644 --- a/lib/redux/dashboard/dashboard_state.g.dart +++ b/lib/redux/dashboard/dashboard_state.g.dart @@ -128,9 +128,6 @@ class _$DashboardUISettingsSerializer 'groupBy', serializers.serialize(object.groupBy, specifiedType: const FullType(String)), - 'showCurrentPeriod', - serializers.serialize(object.showCurrentPeriod, - specifiedType: const FullType(bool)), 'showPreviousPeriod', serializers.serialize(object.showPreviousPeriod, specifiedType: const FullType(bool)), @@ -206,10 +203,6 @@ class _$DashboardUISettingsSerializer result.groupBy = serializers.deserialize(value, specifiedType: const FullType(String)) as String; break; - case 'showCurrentPeriod': - result.showCurrentPeriod = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - break; case 'showPreviousPeriod': result.showPreviousPeriod = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool; @@ -410,8 +403,6 @@ class _$DashboardUISettings extends DashboardUISettings { @override final String groupBy; @override - final bool showCurrentPeriod; - @override final bool showPreviousPeriod; @override final bool showTotal; @@ -436,7 +427,6 @@ class _$DashboardUISettings extends DashboardUISettings { this.currencyId, this.includeTaxes, this.groupBy, - this.showCurrentPeriod, this.showPreviousPeriod, this.showTotal, this.numberFieldsPerRow, @@ -464,8 +454,6 @@ class _$DashboardUISettings extends DashboardUISettings { includeTaxes, 'DashboardUISettings', 'includeTaxes'); BuiltValueNullFieldError.checkNotNull( groupBy, 'DashboardUISettings', 'groupBy'); - BuiltValueNullFieldError.checkNotNull( - showCurrentPeriod, 'DashboardUISettings', 'showCurrentPeriod'); BuiltValueNullFieldError.checkNotNull( showPreviousPeriod, 'DashboardUISettings', 'showPreviousPeriod'); BuiltValueNullFieldError.checkNotNull( @@ -500,7 +488,6 @@ class _$DashboardUISettings extends DashboardUISettings { currencyId == other.currencyId && includeTaxes == other.includeTaxes && groupBy == other.groupBy && - showCurrentPeriod == other.showCurrentPeriod && showPreviousPeriod == other.showPreviousPeriod && showTotal == other.showTotal && numberFieldsPerRow == other.numberFieldsPerRow && @@ -525,25 +512,20 @@ class _$DashboardUISettings extends DashboardUISettings { $jc( $jc( $jc( - $jc( - 0, - dateRange - .hashCode), - customStartDate + 0, + dateRange .hashCode), - customEndDate + customStartDate .hashCode), - enableComparison - .hashCode), - compareDateRange.hashCode), - compareCustomStartDate - .hashCode), - compareCustomEndDate.hashCode), - offset.hashCode), - currencyId.hashCode), - includeTaxes.hashCode), - groupBy.hashCode), - showCurrentPeriod.hashCode), + customEndDate.hashCode), + enableComparison.hashCode), + compareDateRange.hashCode), + compareCustomStartDate.hashCode), + compareCustomEndDate.hashCode), + offset.hashCode), + currencyId.hashCode), + includeTaxes.hashCode), + groupBy.hashCode), showPreviousPeriod.hashCode), showTotal.hashCode), numberFieldsPerRow.hashCode), @@ -564,7 +546,6 @@ class _$DashboardUISettings extends DashboardUISettings { ..add('currencyId', currencyId) ..add('includeTaxes', includeTaxes) ..add('groupBy', groupBy) - ..add('showCurrentPeriod', showCurrentPeriod) ..add('showPreviousPeriod', showPreviousPeriod) ..add('showTotal', showTotal) ..add('numberFieldsPerRow', numberFieldsPerRow) @@ -627,11 +608,6 @@ class DashboardUISettingsBuilder String get groupBy => _$this._groupBy; set groupBy(String groupBy) => _$this._groupBy = groupBy; - bool _showCurrentPeriod; - bool get showCurrentPeriod => _$this._showCurrentPeriod; - set showCurrentPeriod(bool showCurrentPeriod) => - _$this._showCurrentPeriod = showCurrentPeriod; - bool _showPreviousPeriod; bool get showPreviousPeriod => _$this._showPreviousPeriod; set showPreviousPeriod(bool showPreviousPeriod) => @@ -670,7 +646,6 @@ class DashboardUISettingsBuilder _currencyId = $v.currencyId; _includeTaxes = $v.includeTaxes; _groupBy = $v.groupBy; - _showCurrentPeriod = $v.showCurrentPeriod; _showPreviousPeriod = $v.showPreviousPeriod; _showTotal = $v.showTotal; _numberFieldsPerRow = $v.numberFieldsPerRow; @@ -715,7 +690,6 @@ class DashboardUISettingsBuilder currencyId: BuiltValueNullFieldError.checkNotNull(currencyId, 'DashboardUISettings', 'currencyId'), includeTaxes: BuiltValueNullFieldError.checkNotNull(includeTaxes, 'DashboardUISettings', 'includeTaxes'), groupBy: BuiltValueNullFieldError.checkNotNull(groupBy, 'DashboardUISettings', 'groupBy'), - showCurrentPeriod: BuiltValueNullFieldError.checkNotNull(showCurrentPeriod, 'DashboardUISettings', 'showCurrentPeriod'), showPreviousPeriod: BuiltValueNullFieldError.checkNotNull(showPreviousPeriod, 'DashboardUISettings', 'showPreviousPeriod'), showTotal: BuiltValueNullFieldError.checkNotNull(showTotal, 'DashboardUISettings', 'showTotal'), numberFieldsPerRow: BuiltValueNullFieldError.checkNotNull(numberFieldsPerRow, 'DashboardUISettings', 'numberFieldsPerRow'), diff --git a/lib/ui/dashboard/dashboard_panels.dart b/lib/ui/dashboard/dashboard_panels.dart index a9aa82199..929f0fd4f 100644 --- a/lib/ui/dashboard/dashboard_panels.dart +++ b/lib/ui/dashboard/dashboard_panels.dart @@ -318,16 +318,6 @@ class _DashboardPanelsState extends State { items: items, ), ), - CheckboxListTile( - value: settings.showCurrentPeriod, - onChanged: (value) { - store.dispatch(UpdateDashboardSettings( - showCurrentPeriod: value)); - setState(() {}); - }, - title: Text(localization.currentPeriod), - controlAffinity: ListTileControlAffinity.leading, - ), CheckboxListTile( value: settings.showPreviousPeriod, onChanged: (value) {