feat(app): register the saved-schedule list under Settings at /schedules
This commit is contained in:
@@ -19,6 +19,7 @@ import 'app_session.dart';
|
||||
import 'chat_destination.dart';
|
||||
import 'pipelines_destination.dart';
|
||||
import 'runs_destination.dart';
|
||||
import 'schedules_destination.dart';
|
||||
import 'search_destination.dart';
|
||||
import 'server_endpoint.dart';
|
||||
import 'templates_destination.dart';
|
||||
@@ -99,6 +100,7 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
||||
onPopToChat: () => _delegate.goTo(AppRoute.chat),
|
||||
searchBuilder: _buildSearch,
|
||||
templatesBuilder: _buildTemplates,
|
||||
schedulesBuilder: _buildSchedules,
|
||||
builder: _buildShell,
|
||||
);
|
||||
_config = RouterConfig<AppRoute>(
|
||||
@@ -163,6 +165,13 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
||||
|
||||
/// The Templates page above Settings. Closing it restores the same Settings
|
||||
/// screen instance, so an edited field or an open connection state survives.
|
||||
Widget _buildSchedules(BuildContext context) => SchedulesDestination(
|
||||
session: _session,
|
||||
server: widget.server,
|
||||
onBack: _delegate.closeSchedules,
|
||||
onOpenPipeline: (id) => _delegate.goTo(AppRoute.pipeline(id)),
|
||||
);
|
||||
|
||||
Widget _buildTemplates(BuildContext context) => TemplatesDestination(
|
||||
session: _session,
|
||||
server: widget.server,
|
||||
@@ -225,6 +234,7 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
||||
initialEndpoint: _session.endpoint,
|
||||
embedded: true,
|
||||
onOpenTemplates: _delegate.openTemplates,
|
||||
onOpenSchedules: _delegate.openSchedules,
|
||||
notifications: _notifications,
|
||||
),
|
||||
},
|
||||
@@ -237,8 +247,9 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
||||
// Search is a transient page above the shell; it never becomes a tab.
|
||||
AppRouteKind.search => AppDestination.pipelines,
|
||||
AppRouteKind.settings => AppDestination.settings,
|
||||
// Templates is a Settings sub-page, not a fifth tab.
|
||||
// Templates and Schedules are Settings sub-pages, not a fifth tab.
|
||||
AppRouteKind.templates => AppDestination.settings,
|
||||
AppRouteKind.schedules => AppDestination.settings,
|
||||
};
|
||||
|
||||
AppRoute _routeOf(AppDestination destination) => switch (destination) {
|
||||
|
||||
Reference in New Issue
Block a user