Schedule send
This commit is contained in:
parent
94b70a2509
commit
cdd81fe56d
|
|
@ -47,8 +47,8 @@ abstract class ScheduleItemResponse
|
|||
}
|
||||
|
||||
class ScheduleFields {
|
||||
static const String name = 'name';
|
||||
static const String template = 'template';
|
||||
static const String nextRun = 'next_run';
|
||||
}
|
||||
|
||||
abstract class ScheduleEntity extends Object
|
||||
|
|
@ -137,6 +137,9 @@ abstract class ScheduleEntity extends Object
|
|||
case ScheduleFields.template:
|
||||
response = scheduleA.template.compareTo(scheduleB.template);
|
||||
break;
|
||||
case ScheduleFields.nextRun:
|
||||
response = scheduleA.nextRun.compareTo(scheduleB.nextRun);
|
||||
break;
|
||||
|
||||
default:
|
||||
print('## ERROR: sort by schedule.$sortField is not implemented');
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ List<String> dropdownSchedulesSelector(
|
|||
list.sort((scheduleAId, scheduleBId) {
|
||||
final scheduleA = scheduleMap[scheduleAId];
|
||||
final scheduleB = scheduleMap[scheduleBId];
|
||||
return scheduleA.compareTo(scheduleB, ScheduleFields.name, true);
|
||||
return scheduleA.compareTo(scheduleB, ScheduleFields.template, true);
|
||||
});
|
||||
|
||||
return list;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ abstract class ScheduleUIState extends Object
|
|||
implements Built<ScheduleUIState, ScheduleUIStateBuilder> {
|
||||
factory ScheduleUIState(PrefStateSortField sortField) {
|
||||
return _$ScheduleUIState._(
|
||||
listUIState: ListUIState(sortField?.field ?? ScheduleFields.name,
|
||||
listUIState: ListUIState(sortField?.field ?? ScheduleFields.template,
|
||||
sortAscending: sortField?.ascending),
|
||||
editing: ScheduleEntity(),
|
||||
selectedId: '',
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ class ScheduleScreen extends StatelessWidget {
|
|||
store.dispatch(SortSchedules(value));
|
||||
},
|
||||
sortFields: [
|
||||
ScheduleFields.name,
|
||||
ScheduleFields.template,
|
||||
ScheduleFields.nextRun,
|
||||
],
|
||||
onSelectedState: (EntityState state, value) {
|
||||
store.dispatch(FilterSchedulesByState(state));
|
||||
|
|
|
|||
Loading…
Reference in New Issue