Schedule reports

This commit is contained in:
Hillel Coren 2024-01-22 14:01:31 +02:00
parent ac35e9c031
commit 3a9745ae72
4 changed files with 32 additions and 1 deletions

View File

@ -49,7 +49,7 @@ class EntityPresenter {
isNarrow) { isNarrow) {
return name; return name;
} else { } else {
return '$type $name'; return '$type: $name';
} }
} }

View File

@ -545,6 +545,15 @@ class ReportsScreen extends StatelessWidget {
}, },
), ),
), ),
SizedBox(width: kGutterWidth),
Expanded(
child: AppButton(
label: localization.schedule,
onPressed: () {
viewModel.onSchedulePressed(context);
},
),
),
], ],
), ),
), ),

View File

@ -251,6 +251,27 @@ class _ScheduleEditState extends State<ScheduleEdit> {
child: child:
Text(localization.lookup('$importType')))) Text(localization.lookup('$importType'))))
.toList()), .toList()),
AppDropdownButton<DateRange>(
labelText: localization.dateRange,
blankValue: null,
value: parameters.dateRange!.isNotEmpty
? DateRange.valueOf(
toCamelCase(parameters.dateRange!))
: null,
onChanged: (dynamic value) {
viewModel.onChanged(schedule.rebuild((b) => b
..parameters.dateRange =
(value as DateRange).snakeCase));
},
items: DateRange.values
.where((value) => value != DateRange.custom)
.map((dateRange) => DropdownMenuItem<DateRange>(
child: Text(localization
.lookup(dateRange.toString())),
value: dateRange,
))
.toList(),
),
], ],
), ),
] else if (schedule.template == ] else if (schedule.template ==

View File

@ -100,6 +100,7 @@ class _ScheduleViewState extends State<ScheduleView> {
: '${schedule.remainingCycles}', : '${schedule.remainingCycles}',
localization.report: localization.report:
localization.lookup(schedule.parameters.reportName), localization.lookup(schedule.parameters.reportName),
localization.dateRange: localization.lookup(parameters.dateRange),
}) })
], ],
), ),