Fusion debug
This commit is contained in:
@@ -18,7 +18,6 @@ import 'package:flutter_flow_chart/flutter_flow_chart.dart';
|
||||
import 'package:oc_front/widgets/inputs/shallow_text_input.dart';
|
||||
import 'package:oc_front/core/models/shared_workspace_local.dart';
|
||||
import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
|
||||
import 'package:oc_front/core/services/specialized_services/check_service.dart';
|
||||
import 'package:oc_front/core/services/specialized_services/workflow_service.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
@@ -40,9 +39,8 @@ class SchedulerFormsWidget extends StatefulWidget {
|
||||
@override SchedulerFormsWidgetState createState() => SchedulerFormsWidgetState();
|
||||
}
|
||||
class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
CheckService check = CheckService();
|
||||
WorflowService check = WorflowService();
|
||||
void save(List<GlobalKey<FormFieldState>> formKeys) {
|
||||
print("save");
|
||||
widget.error = null;
|
||||
widget.errorEndDate = null;
|
||||
widget.errorCron = null;
|
||||
@@ -63,6 +61,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
dash.error = "You need to link each processing element to a compute element";
|
||||
}
|
||||
}
|
||||
print("qdjqksdn ${dash.error}");
|
||||
if (dash.error != null) {
|
||||
showAlertBanner( context, () {}, AlertAlertBannerChild(text: dash.error.toString()),// <-- Put any widget here you want!
|
||||
alertBannerLocation: AlertBannerLocation.bottom,);
|
||||
@@ -72,6 +71,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
for (var k in formKeys) {
|
||||
if (k.currentState != null) {
|
||||
if (!k.currentState!.validate()) {
|
||||
print("bwak");
|
||||
return;
|
||||
} else { k.currentState!.save();}
|
||||
}
|
||||
@@ -84,7 +84,14 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
}
|
||||
}
|
||||
Duration durationBefore = widget.schedule.start!.difference(DateTime.now().toUtc()) + Duration(seconds: 5);
|
||||
widget._schedulerService.schedule(context, widget.item.id ?? "", widget.schedule.serialize(), {}).then((value) {
|
||||
print("qdjqksdn ${widget.item.id}");
|
||||
widget._schedulerService.schedule(context, widget.item.id ?? "", widget.schedule.serialize(), {}).catchError( (e) {
|
||||
print("THERE2");
|
||||
setState(() {
|
||||
widget.error = e.toString();
|
||||
});
|
||||
}).then((value) {
|
||||
print("THERE");
|
||||
setState(() { widget.valid = true; });
|
||||
Future.delayed(durationBefore, () {
|
||||
try {
|
||||
@@ -110,7 +117,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
} else {
|
||||
e = widget.schedule.end!.toUtc().toIso8601String();
|
||||
}
|
||||
check.search(context, [widget.item.id ?? "", s.substring(0, 19), e.substring(0, 19)], {}).then(
|
||||
check.check(context, [widget.item.id ?? "", s.substring(0, 19), e.substring(0, 19)], {}).then(
|
||||
(v) {
|
||||
if (v.data == null) { return; }
|
||||
widget.booking = v.data!.isAvailable;
|
||||
@@ -494,12 +501,11 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
onTap: () { PermsService.getPerm(Perms.WORKFLOW_BOOKING) ? checkBooking(formKeys, null) : null;
|
||||
}, child: Container( margin: const EdgeInsets.only(bottom: 5, left: 10, right: 10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(color: widget.booking == null ? (
|
||||
PermsService.getPerm(Perms.WORKFLOW_BOOKING) && PermsService.getPerm(Perms.WORKFLOW_EDIT) ? Colors.black : Colors.grey) : (
|
||||
border: Border.all(color: widget.booking == null ? Colors.black : (
|
||||
widget.booking == true ? Colors.green : redColor), width: 1)),
|
||||
width: 200, height: 30,
|
||||
child: Icon( Icons.verified_outlined,
|
||||
color: widget.booking == null ? Colors.black : (widget.booking == true ? Colors.green : redColor)),
|
||||
color: widget.booking == null ? Colors.black : (widget.booking == true ? Colors.green : redColor)),
|
||||
))
|
||||
): Container(),
|
||||
PermsService.getPerm(Perms.WORKFLOW_BOOKING) ? Tooltip( message: "book", child: InkWell( mouseCursor: SystemMouseCursors.click,
|
||||
@@ -507,7 +513,7 @@ class SchedulerFormsWidgetState extends State<SchedulerFormsWidget> {
|
||||
setState(() { save(formKeys); });
|
||||
}, child: Container( margin: const EdgeInsets.only(top: 5, bottom: 10, left: 10, right: 10),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(5),
|
||||
border: Border.all(color: dash.error != null ? Colors.red : ( PermsService.getPerm(Perms.WORKFLOW_BOOKING) ?(widget.valid ? Colors.green : Colors.black) : Colors.grey ))),
|
||||
border: Border.all(color: dash.error != null ? Colors.red : (widget.valid ? Colors.green : Colors.black) )),
|
||||
width: 200, height: 30,
|
||||
child: Icon(Icons.schedule_send, color: dash.error != null ? Colors.red : (widget.valid ? Colors.green : Colors.black)),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user