Dashboard overview

This commit is contained in:
Hillel Coren 2022-08-12 13:57:01 +03:00
parent d12ccee003
commit 7181875804
5 changed files with 12 additions and 57 deletions

View File

@ -21,7 +21,6 @@ class UpdateDashboardSettings implements PersistUI {
this.currencyId, this.currencyId,
this.includeTaxes, this.includeTaxes,
this.groupBy, this.groupBy,
this.showCurrentPeriod,
this.showPreviousPeriod, this.showPreviousPeriod,
this.showTotal, this.showTotal,
this.totalFields, this.totalFields,
@ -33,7 +32,6 @@ class UpdateDashboardSettings implements PersistUI {
String currencyId; String currencyId;
bool includeTaxes; bool includeTaxes;
String groupBy; String groupBy;
bool showCurrentPeriod;
bool showPreviousPeriod; bool showPreviousPeriod;
bool showTotal; bool showTotal;
BuiltList<String> totalFields; BuiltList<String> totalFields;

View File

@ -65,9 +65,6 @@ DashboardUISettings dashboardSettingsReducer(
return state.rebuild((b) => b..currencyId = action.currencyId); return state.rebuild((b) => b..currencyId = action.currencyId);
} else if (action.groupBy != null) { } else if (action.groupBy != null) {
return state.rebuild((b) => b..groupBy = action.groupBy); 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) { } else if (action.showPreviousPeriod != null) {
return state return state
.rebuild((b) => b..showPreviousPeriod = action.showPreviousPeriod); .rebuild((b) => b..showPreviousPeriod = action.showPreviousPeriod);

View File

@ -56,7 +56,6 @@ abstract class DashboardUISettings
currencyId: kCurrencyAll, currencyId: kCurrencyAll,
includeTaxes: true, includeTaxes: true,
groupBy: kReportGroupDay, groupBy: kReportGroupDay,
showCurrentPeriod: true,
showPreviousPeriod: false, showPreviousPeriod: false,
showTotal: true, showTotal: true,
numberFieldsPerRow: 2, numberFieldsPerRow: 2,
@ -111,8 +110,6 @@ abstract class DashboardUISettings
String get groupBy; String get groupBy;
bool get showCurrentPeriod;
bool get showPreviousPeriod; bool get showPreviousPeriod;
bool get showTotal; bool get showTotal;
@ -156,7 +153,6 @@ abstract class DashboardUISettings
..groupBy = kReportGroupDay ..groupBy = kReportGroupDay
..showTotal = true ..showTotal = true
..showPreviousPeriod = false ..showPreviousPeriod = false
..showCurrentPeriod = true
..numberFieldsPerRow = 2 ..numberFieldsPerRow = 2
..totalFields.replace(BuiltList<String>()); ..totalFields.replace(BuiltList<String>());

View File

@ -128,9 +128,6 @@ class _$DashboardUISettingsSerializer
'groupBy', 'groupBy',
serializers.serialize(object.groupBy, serializers.serialize(object.groupBy,
specifiedType: const FullType(String)), specifiedType: const FullType(String)),
'showCurrentPeriod',
serializers.serialize(object.showCurrentPeriod,
specifiedType: const FullType(bool)),
'showPreviousPeriod', 'showPreviousPeriod',
serializers.serialize(object.showPreviousPeriod, serializers.serialize(object.showPreviousPeriod,
specifiedType: const FullType(bool)), specifiedType: const FullType(bool)),
@ -206,10 +203,6 @@ class _$DashboardUISettingsSerializer
result.groupBy = serializers.deserialize(value, result.groupBy = serializers.deserialize(value,
specifiedType: const FullType(String)) as String; specifiedType: const FullType(String)) as String;
break; break;
case 'showCurrentPeriod':
result.showCurrentPeriod = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
case 'showPreviousPeriod': case 'showPreviousPeriod':
result.showPreviousPeriod = serializers.deserialize(value, result.showPreviousPeriod = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool; specifiedType: const FullType(bool)) as bool;
@ -410,8 +403,6 @@ class _$DashboardUISettings extends DashboardUISettings {
@override @override
final String groupBy; final String groupBy;
@override @override
final bool showCurrentPeriod;
@override
final bool showPreviousPeriod; final bool showPreviousPeriod;
@override @override
final bool showTotal; final bool showTotal;
@ -436,7 +427,6 @@ class _$DashboardUISettings extends DashboardUISettings {
this.currencyId, this.currencyId,
this.includeTaxes, this.includeTaxes,
this.groupBy, this.groupBy,
this.showCurrentPeriod,
this.showPreviousPeriod, this.showPreviousPeriod,
this.showTotal, this.showTotal,
this.numberFieldsPerRow, this.numberFieldsPerRow,
@ -464,8 +454,6 @@ class _$DashboardUISettings extends DashboardUISettings {
includeTaxes, 'DashboardUISettings', 'includeTaxes'); includeTaxes, 'DashboardUISettings', 'includeTaxes');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
groupBy, 'DashboardUISettings', 'groupBy'); groupBy, 'DashboardUISettings', 'groupBy');
BuiltValueNullFieldError.checkNotNull(
showCurrentPeriod, 'DashboardUISettings', 'showCurrentPeriod');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
showPreviousPeriod, 'DashboardUISettings', 'showPreviousPeriod'); showPreviousPeriod, 'DashboardUISettings', 'showPreviousPeriod');
BuiltValueNullFieldError.checkNotNull( BuiltValueNullFieldError.checkNotNull(
@ -500,7 +488,6 @@ class _$DashboardUISettings extends DashboardUISettings {
currencyId == other.currencyId && currencyId == other.currencyId &&
includeTaxes == other.includeTaxes && includeTaxes == other.includeTaxes &&
groupBy == other.groupBy && groupBy == other.groupBy &&
showCurrentPeriod == other.showCurrentPeriod &&
showPreviousPeriod == other.showPreviousPeriod && showPreviousPeriod == other.showPreviousPeriod &&
showTotal == other.showTotal && showTotal == other.showTotal &&
numberFieldsPerRow == other.numberFieldsPerRow && numberFieldsPerRow == other.numberFieldsPerRow &&
@ -523,7 +510,6 @@ class _$DashboardUISettings extends DashboardUISettings {
$jc( $jc(
$jc( $jc(
$jc( $jc(
$jc(
$jc( $jc(
$jc( $jc(
0, 0,
@ -531,19 +517,15 @@ class _$DashboardUISettings extends DashboardUISettings {
.hashCode), .hashCode),
customStartDate customStartDate
.hashCode), .hashCode),
customEndDate customEndDate.hashCode),
.hashCode), enableComparison.hashCode),
enableComparison
.hashCode),
compareDateRange.hashCode), compareDateRange.hashCode),
compareCustomStartDate compareCustomStartDate.hashCode),
.hashCode),
compareCustomEndDate.hashCode), compareCustomEndDate.hashCode),
offset.hashCode), offset.hashCode),
currencyId.hashCode), currencyId.hashCode),
includeTaxes.hashCode), includeTaxes.hashCode),
groupBy.hashCode), groupBy.hashCode),
showCurrentPeriod.hashCode),
showPreviousPeriod.hashCode), showPreviousPeriod.hashCode),
showTotal.hashCode), showTotal.hashCode),
numberFieldsPerRow.hashCode), numberFieldsPerRow.hashCode),
@ -564,7 +546,6 @@ class _$DashboardUISettings extends DashboardUISettings {
..add('currencyId', currencyId) ..add('currencyId', currencyId)
..add('includeTaxes', includeTaxes) ..add('includeTaxes', includeTaxes)
..add('groupBy', groupBy) ..add('groupBy', groupBy)
..add('showCurrentPeriod', showCurrentPeriod)
..add('showPreviousPeriod', showPreviousPeriod) ..add('showPreviousPeriod', showPreviousPeriod)
..add('showTotal', showTotal) ..add('showTotal', showTotal)
..add('numberFieldsPerRow', numberFieldsPerRow) ..add('numberFieldsPerRow', numberFieldsPerRow)
@ -627,11 +608,6 @@ class DashboardUISettingsBuilder
String get groupBy => _$this._groupBy; String get groupBy => _$this._groupBy;
set groupBy(String groupBy) => _$this._groupBy = 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 _showPreviousPeriod;
bool get showPreviousPeriod => _$this._showPreviousPeriod; bool get showPreviousPeriod => _$this._showPreviousPeriod;
set showPreviousPeriod(bool showPreviousPeriod) => set showPreviousPeriod(bool showPreviousPeriod) =>
@ -670,7 +646,6 @@ class DashboardUISettingsBuilder
_currencyId = $v.currencyId; _currencyId = $v.currencyId;
_includeTaxes = $v.includeTaxes; _includeTaxes = $v.includeTaxes;
_groupBy = $v.groupBy; _groupBy = $v.groupBy;
_showCurrentPeriod = $v.showCurrentPeriod;
_showPreviousPeriod = $v.showPreviousPeriod; _showPreviousPeriod = $v.showPreviousPeriod;
_showTotal = $v.showTotal; _showTotal = $v.showTotal;
_numberFieldsPerRow = $v.numberFieldsPerRow; _numberFieldsPerRow = $v.numberFieldsPerRow;
@ -715,7 +690,6 @@ class DashboardUISettingsBuilder
currencyId: BuiltValueNullFieldError.checkNotNull(currencyId, 'DashboardUISettings', 'currencyId'), currencyId: BuiltValueNullFieldError.checkNotNull(currencyId, 'DashboardUISettings', 'currencyId'),
includeTaxes: BuiltValueNullFieldError.checkNotNull(includeTaxes, 'DashboardUISettings', 'includeTaxes'), includeTaxes: BuiltValueNullFieldError.checkNotNull(includeTaxes, 'DashboardUISettings', 'includeTaxes'),
groupBy: BuiltValueNullFieldError.checkNotNull(groupBy, 'DashboardUISettings', 'groupBy'), groupBy: BuiltValueNullFieldError.checkNotNull(groupBy, 'DashboardUISettings', 'groupBy'),
showCurrentPeriod: BuiltValueNullFieldError.checkNotNull(showCurrentPeriod, 'DashboardUISettings', 'showCurrentPeriod'),
showPreviousPeriod: BuiltValueNullFieldError.checkNotNull(showPreviousPeriod, 'DashboardUISettings', 'showPreviousPeriod'), showPreviousPeriod: BuiltValueNullFieldError.checkNotNull(showPreviousPeriod, 'DashboardUISettings', 'showPreviousPeriod'),
showTotal: BuiltValueNullFieldError.checkNotNull(showTotal, 'DashboardUISettings', 'showTotal'), showTotal: BuiltValueNullFieldError.checkNotNull(showTotal, 'DashboardUISettings', 'showTotal'),
numberFieldsPerRow: BuiltValueNullFieldError.checkNotNull(numberFieldsPerRow, 'DashboardUISettings', 'numberFieldsPerRow'), numberFieldsPerRow: BuiltValueNullFieldError.checkNotNull(numberFieldsPerRow, 'DashboardUISettings', 'numberFieldsPerRow'),

View File

@ -318,16 +318,6 @@ class _DashboardPanelsState extends State<DashboardPanels> {
items: items, items: items,
), ),
), ),
CheckboxListTile(
value: settings.showCurrentPeriod,
onChanged: (value) {
store.dispatch(UpdateDashboardSettings(
showCurrentPeriod: value));
setState(() {});
},
title: Text(localization.currentPeriod),
controlAffinity: ListTileControlAffinity.leading,
),
CheckboxListTile( CheckboxListTile(
value: settings.showPreviousPeriod, value: settings.showPreviousPeriod,
onChanged: (value) { onChanged: (value) {