feat(app): register the saved-schedule list under Settings at /schedules
This commit is contained in:
@@ -4,7 +4,7 @@ part 'app_route_codec.dart';
|
|||||||
///
|
///
|
||||||
/// The set mirrors [AppDestination] but stays free of widget imports so the
|
/// The set mirrors [AppDestination] but stays free of widget imports so the
|
||||||
/// parser and serialiser can be exercised without a Flutter host.
|
/// parser and serialiser can be exercised without a Flutter host.
|
||||||
enum AppRouteKind { pipelines, runs, chat, search, settings, templates }
|
enum AppRouteKind { pipelines, runs, chat, search, settings, templates, schedules }
|
||||||
|
|
||||||
/// One page route: a destination plus the detail, pane and query it opens.
|
/// One page route: a destination plus the detail, pane and query it opens.
|
||||||
///
|
///
|
||||||
@@ -51,6 +51,9 @@ class AppRoute {
|
|||||||
/// not a fifth tab, so Back returns to Settings.
|
/// not a fifth tab, so Back returns to Settings.
|
||||||
static const templates = AppRoute(AppRouteKind.templates);
|
static const templates = AppRoute(AppRouteKind.templates);
|
||||||
|
|
||||||
|
/// The saved-schedule list, a Settings sub-page on `/schedules`.
|
||||||
|
static const schedules = AppRoute(AppRouteKind.schedules);
|
||||||
|
|
||||||
static const run = _RunRouteFactory();
|
static const run = _RunRouteFactory();
|
||||||
|
|
||||||
/// One chat session, or the chat list when [id] is not a session id.
|
/// One chat session, or the chat list when [id] is not a session id.
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ String _routePath(AppRoute route) => switch (route.kind) {
|
|||||||
AppRouteKind.search => '/search',
|
AppRouteKind.search => '/search',
|
||||||
AppRouteKind.settings => '/settings',
|
AppRouteKind.settings => '/settings',
|
||||||
AppRouteKind.templates => _templatesPath(route),
|
AppRouteKind.templates => _templatesPath(route),
|
||||||
|
AppRouteKind.schedules => '/schedules',
|
||||||
};
|
};
|
||||||
|
|
||||||
String _pipelinePath(AppRoute route) {
|
String _pipelinePath(AppRoute route) {
|
||||||
@@ -91,6 +92,7 @@ AppRoute _parseRoute(String location) {
|
|||||||
'search' when segments.length == 1 => AppRoute.search,
|
'search' when segments.length == 1 => AppRoute.search,
|
||||||
'settings' => _settingsRoute(segments),
|
'settings' => _settingsRoute(segments),
|
||||||
'templates' => _templatesRoute(segments),
|
'templates' => _templatesRoute(segments),
|
||||||
|
'schedules' when segments.length == 1 => AppRoute.schedules,
|
||||||
_ => AppRoute.pipelines,
|
_ => AppRoute.pipelines,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,12 +31,14 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
required this.cupertino,
|
required this.cupertino,
|
||||||
this.searchBuilder,
|
this.searchBuilder,
|
||||||
this.templatesBuilder,
|
this.templatesBuilder,
|
||||||
|
this.schedulesBuilder,
|
||||||
AppRoute initial = AppRoute.pipelines,
|
AppRoute initial = AppRoute.pipelines,
|
||||||
}) : _route = initial,
|
}) : _route = initial,
|
||||||
_searchReturn = initial.kind == AppRouteKind.search
|
_searchReturn = initial.kind == AppRouteKind.search
|
||||||
? AppRoute.pipelines
|
? AppRoute.pipelines
|
||||||
: initial,
|
: initial,
|
||||||
_templatesReturn = initial.kind == AppRouteKind.templates
|
_templatesReturn = initial.kind == AppRouteKind.templates
|
||||||
|
|| initial.kind == AppRouteKind.schedules
|
||||||
? AppRoute.settings
|
? AppRoute.settings
|
||||||
: initial;
|
: initial;
|
||||||
|
|
||||||
@@ -46,6 +48,7 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
/// shell keeps the Settings destination mounted underneath and its state is
|
/// shell keeps the Settings destination mounted underneath and its state is
|
||||||
/// restored when this page closes.
|
/// restored when this page closes.
|
||||||
final Widget Function(BuildContext context)? templatesBuilder;
|
final Widget Function(BuildContext context)? templatesBuilder;
|
||||||
|
final Widget Function(BuildContext context)? schedulesBuilder;
|
||||||
|
|
||||||
/// The Search page above the shell. Search is transient chrome, not a fifth
|
/// The Search page above the shell. Search is transient chrome, not a fifth
|
||||||
/// tab: the shell stays mounted underneath so closing restores its loaded
|
/// tab: the shell stays mounted underneath so closing restores its loaded
|
||||||
@@ -64,6 +67,7 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
static const _pageKey = ValueKey<String>('pipelines-shell');
|
static const _pageKey = ValueKey<String>('pipelines-shell');
|
||||||
static const _searchPageKey = ValueKey<String>('app-search');
|
static const _searchPageKey = ValueKey<String>('app-search');
|
||||||
static const _templatesPageKey = ValueKey<String>('app-templates');
|
static const _templatesPageKey = ValueKey<String>('app-templates');
|
||||||
|
static const _schedulesPageKey = ValueKey<String>('app-schedules');
|
||||||
|
|
||||||
AppRoute _route;
|
AppRoute _route;
|
||||||
|
|
||||||
@@ -79,6 +83,9 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
|
|
||||||
bool get templatesOpen => _route.kind == AppRouteKind.templates;
|
bool get templatesOpen => _route.kind == AppRouteKind.templates;
|
||||||
|
|
||||||
|
/// The saved-schedule list page, opened above Settings.
|
||||||
|
bool get schedulesOpen => _route.kind == AppRouteKind.schedules;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
AppRoute get currentConfiguration => _route;
|
AppRoute get currentConfiguration => _route;
|
||||||
|
|
||||||
@@ -96,9 +103,10 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final searching = searchOpen && searchBuilder != null;
|
final searching = searchOpen && searchBuilder != null;
|
||||||
final templates = templatesOpen && templatesBuilder != null;
|
final templates = templatesOpen && templatesBuilder != null;
|
||||||
|
final schedules = schedulesOpen && schedulesBuilder != null;
|
||||||
final shellRoute = searching
|
final shellRoute = searching
|
||||||
? _searchReturn
|
? _searchReturn
|
||||||
: templates
|
: templates || schedules
|
||||||
? _templatesReturn
|
? _templatesReturn
|
||||||
: _route;
|
: _route;
|
||||||
return Navigator(
|
return Navigator(
|
||||||
@@ -108,6 +116,7 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
// Templates is a Settings sub-page: the shell stays mounted underneath,
|
// Templates is a Settings sub-page: the shell stays mounted underneath,
|
||||||
// so closing restores Settings exactly as it was left.
|
// so closing restores Settings exactly as it was left.
|
||||||
if (templates) _page(_templatesPageKey, templatesBuilder!(context)),
|
if (templates) _page(_templatesPageKey, templatesBuilder!(context)),
|
||||||
|
if (schedules) _page(_schedulesPageKey, schedulesBuilder!(context)),
|
||||||
// Search is a transient full-screen mode, so a full-screen dialog gives
|
// Search is a transient full-screen mode, so a full-screen dialog gives
|
||||||
// the standard Close/Cancel action instead of a Back chevron.
|
// the standard Close/Cancel action instead of a Back chevron.
|
||||||
if (searching)
|
if (searching)
|
||||||
@@ -116,6 +125,7 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
onDidRemovePage: (page) {
|
onDidRemovePage: (page) {
|
||||||
if (page.key == _searchPageKey) closeSearch();
|
if (page.key == _searchPageKey) closeSearch();
|
||||||
if (page.key == _templatesPageKey) closeTemplates();
|
if (page.key == _templatesPageKey) closeTemplates();
|
||||||
|
if (page.key == _schedulesPageKey) closeSchedules();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -133,6 +143,19 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
goTo(AppRoute.settings);
|
goTo(AppRoute.settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Open the saved-schedule list above Settings. Back restores the same
|
||||||
|
/// Settings screen instance, like Templates.
|
||||||
|
void openSchedules() {
|
||||||
|
if (schedulesOpen) return;
|
||||||
|
_templatesReturn = AppRoute.settings;
|
||||||
|
goTo(AppRoute.schedules);
|
||||||
|
}
|
||||||
|
|
||||||
|
void closeSchedules() {
|
||||||
|
if (!schedulesOpen) return;
|
||||||
|
goTo(AppRoute.settings);
|
||||||
|
}
|
||||||
|
|
||||||
/// Open Search above the current destination; its route carries the browser
|
/// Open Search above the current destination; its route carries the browser
|
||||||
/// history entry, and close/back returns to what was open before.
|
/// history entry, and close/back returns to what was open before.
|
||||||
void openSearch() {
|
void openSearch() {
|
||||||
@@ -164,6 +187,10 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
|||||||
closeSearch();
|
closeSearch();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (schedulesOpen) {
|
||||||
|
closeSchedules();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (templatesOpen) {
|
if (templatesOpen) {
|
||||||
closeTemplates();
|
closeTemplates();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import 'app_session.dart';
|
|||||||
import 'chat_destination.dart';
|
import 'chat_destination.dart';
|
||||||
import 'pipelines_destination.dart';
|
import 'pipelines_destination.dart';
|
||||||
import 'runs_destination.dart';
|
import 'runs_destination.dart';
|
||||||
|
import 'schedules_destination.dart';
|
||||||
import 'search_destination.dart';
|
import 'search_destination.dart';
|
||||||
import 'server_endpoint.dart';
|
import 'server_endpoint.dart';
|
||||||
import 'templates_destination.dart';
|
import 'templates_destination.dart';
|
||||||
@@ -99,6 +100,7 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
|||||||
onPopToChat: () => _delegate.goTo(AppRoute.chat),
|
onPopToChat: () => _delegate.goTo(AppRoute.chat),
|
||||||
searchBuilder: _buildSearch,
|
searchBuilder: _buildSearch,
|
||||||
templatesBuilder: _buildTemplates,
|
templatesBuilder: _buildTemplates,
|
||||||
|
schedulesBuilder: _buildSchedules,
|
||||||
builder: _buildShell,
|
builder: _buildShell,
|
||||||
);
|
);
|
||||||
_config = RouterConfig<AppRoute>(
|
_config = RouterConfig<AppRoute>(
|
||||||
@@ -163,6 +165,13 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
|||||||
|
|
||||||
/// The Templates page above Settings. Closing it restores the same Settings
|
/// The Templates page above Settings. Closing it restores the same Settings
|
||||||
/// screen instance, so an edited field or an open connection state survives.
|
/// 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(
|
Widget _buildTemplates(BuildContext context) => TemplatesDestination(
|
||||||
session: _session,
|
session: _session,
|
||||||
server: widget.server,
|
server: widget.server,
|
||||||
@@ -225,6 +234,7 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
|||||||
initialEndpoint: _session.endpoint,
|
initialEndpoint: _session.endpoint,
|
||||||
embedded: true,
|
embedded: true,
|
||||||
onOpenTemplates: _delegate.openTemplates,
|
onOpenTemplates: _delegate.openTemplates,
|
||||||
|
onOpenSchedules: _delegate.openSchedules,
|
||||||
notifications: _notifications,
|
notifications: _notifications,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -237,8 +247,9 @@ class _PipelinesAppState extends State<PipelinesApp> {
|
|||||||
// Search is a transient page above the shell; it never becomes a tab.
|
// Search is a transient page above the shell; it never becomes a tab.
|
||||||
AppRouteKind.search => AppDestination.pipelines,
|
AppRouteKind.search => AppDestination.pipelines,
|
||||||
AppRouteKind.settings => AppDestination.settings,
|
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.templates => AppDestination.settings,
|
||||||
|
AppRouteKind.schedules => AppDestination.settings,
|
||||||
};
|
};
|
||||||
|
|
||||||
AppRoute _routeOf(AppDestination destination) => switch (destination) {
|
AppRoute _routeOf(AppDestination destination) => switch (destination) {
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../features/schedules/data/schedules_repository.dart';
|
||||||
|
import '../features/schedules/ui/list/schedule_list_controller.dart';
|
||||||
|
import '../features/schedules/ui/list/schedule_list_view.dart';
|
||||||
|
import '../ui/adaptive/host.dart';
|
||||||
|
import 'app_session.dart';
|
||||||
|
import 'server_endpoint.dart';
|
||||||
|
|
||||||
|
/// The saved-schedule list above Settings.
|
||||||
|
///
|
||||||
|
/// It is read-only: opening a row asks the composition to show the owning
|
||||||
|
/// pipeline's Summary, where the landed section owns create/edit/pause/delete.
|
||||||
|
/// The list never saves, pauses or deletes anything itself.
|
||||||
|
class SchedulesDestination extends StatefulWidget {
|
||||||
|
const SchedulesDestination({
|
||||||
|
super.key,
|
||||||
|
required this.session,
|
||||||
|
required this.server,
|
||||||
|
required this.onBack,
|
||||||
|
required this.onOpenPipeline,
|
||||||
|
});
|
||||||
|
|
||||||
|
final AppSession session;
|
||||||
|
final ServerEndpoint server;
|
||||||
|
final VoidCallback onBack;
|
||||||
|
final ValueChanged<int> onOpenPipeline;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SchedulesDestination> createState() => _SchedulesDestinationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SchedulesDestinationState extends State<SchedulesDestination> {
|
||||||
|
late final SchedulesController _controller;
|
||||||
|
final TextEditingController _search = TextEditingController();
|
||||||
|
final ScrollController _scroll = ScrollController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_controller = SchedulesController(
|
||||||
|
repository: SchedulesRepository(widget.session.gateway),
|
||||||
|
);
|
||||||
|
unawaited(_controller.refresh());
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(SchedulesDestination oldWidget) {
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
if (oldWidget.session.gateway != widget.session.gateway) {
|
||||||
|
// A different server lists different schedules; re-read through the same
|
||||||
|
// controller so the screen is never shown with the old server's rows.
|
||||||
|
unawaited(_controller.refresh());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
_search.dispose();
|
||||||
|
_scroll.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final cupertino = usesCupertinoHost(context);
|
||||||
|
final page = _page(cupertino);
|
||||||
|
return AnimatedBuilder(
|
||||||
|
animation: widget.session,
|
||||||
|
builder: (context, _) => page,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _page(bool cupertino) {
|
||||||
|
final body = _body(cupertino);
|
||||||
|
if (cupertino) {
|
||||||
|
return CupertinoPageScaffold(
|
||||||
|
navigationBar: CupertinoNavigationBar(
|
||||||
|
leading: CupertinoButton(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
onPressed: widget.onBack,
|
||||||
|
child: const Icon(CupertinoIcons.back, semanticLabel: 'Back'),
|
||||||
|
),
|
||||||
|
middle: const Text('Schedules'),
|
||||||
|
),
|
||||||
|
child: SafeArea(child: body),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: IconButton(
|
||||||
|
onPressed: widget.onBack,
|
||||||
|
icon: const Icon(Icons.arrow_back, semanticLabel: 'Back'),
|
||||||
|
),
|
||||||
|
title: const Text('Schedules'),
|
||||||
|
),
|
||||||
|
body: body,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _body(bool cupertino) {
|
||||||
|
if (!widget.session.everConnected) {
|
||||||
|
return const Center(child: Text('Connect to the server to see schedules.'));
|
||||||
|
}
|
||||||
|
return SchedulesListView(
|
||||||
|
controller: _controller,
|
||||||
|
searchController: _search,
|
||||||
|
scrollController: _scroll,
|
||||||
|
cupertino: cupertino,
|
||||||
|
onOpen: (schedule) {
|
||||||
|
final id = schedule.pipelineId;
|
||||||
|
if (id != null) widget.onOpenPipeline(id);
|
||||||
|
},
|
||||||
|
onRefresh: () => _controller.refresh(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,4 +10,5 @@ abstract final class SettingsKeys {
|
|||||||
static const workspace = ValueKey<String>('settings.workspace');
|
static const workspace = ValueKey<String>('settings.workspace');
|
||||||
static const saveWorkspace = ValueKey<String>('settings.saveWorkspace');
|
static const saveWorkspace = ValueKey<String>('settings.saveWorkspace');
|
||||||
static const templates = ValueKey<String>('settings.templates');
|
static const templates = ValueKey<String>('settings.templates');
|
||||||
|
static const schedules = ValueKey<String>('settings.schedules');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'settings_keys.dart';
|
||||||
|
import 'settings_theme.dart';
|
||||||
|
|
||||||
|
/// The Settings entry to the saved-schedule list.
|
||||||
|
///
|
||||||
|
/// The row only opens the route; the list's own controller performs the single
|
||||||
|
/// `list_schedules` read, exactly like the Templates entry.
|
||||||
|
const String settingsSchedulesLabel = 'Browse schedules';
|
||||||
|
const String settingsSchedulesSecondary =
|
||||||
|
'Saved run configurations for every pipeline.';
|
||||||
|
|
||||||
|
class SettingsSchedulesSection extends StatelessWidget {
|
||||||
|
const SettingsSchedulesSection({super.key, required this.onOpen});
|
||||||
|
|
||||||
|
final VoidCallback onOpen;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (usesCupertinoControls(context)) {
|
||||||
|
return CupertinoListSection.insetGrouped(
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
children: <Widget>[
|
||||||
|
CupertinoListTile(
|
||||||
|
key: SettingsKeys.schedules,
|
||||||
|
title: const Text(settingsSchedulesLabel),
|
||||||
|
subtitle: const Text(settingsSchedulesSecondary),
|
||||||
|
trailing: const CupertinoListTileChevron(),
|
||||||
|
onTap: onOpen,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Card(
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
child: ListTile(
|
||||||
|
key: SettingsKeys.schedules,
|
||||||
|
title: const Text(settingsSchedulesLabel),
|
||||||
|
subtitle: const Text(settingsSchedulesSecondary),
|
||||||
|
trailing: const Icon(Icons.chevron_right),
|
||||||
|
onTap: onOpen,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ import 'settings_controller.dart';
|
|||||||
import 'settings_controls.dart';
|
import 'settings_controls.dart';
|
||||||
import 'settings_layout.dart';
|
import 'settings_layout.dart';
|
||||||
import 'settings_notifications_section.dart';
|
import 'settings_notifications_section.dart';
|
||||||
|
import 'settings_schedules_section.dart';
|
||||||
import 'settings_sections.dart';
|
import 'settings_sections.dart';
|
||||||
import 'settings_store.dart';
|
import 'settings_store.dart';
|
||||||
import 'settings_templates_section.dart';
|
import 'settings_templates_section.dart';
|
||||||
@@ -31,6 +32,7 @@ class SettingsScreen extends StatefulWidget {
|
|||||||
this.ping,
|
this.ping,
|
||||||
this.embedded = false,
|
this.embedded = false,
|
||||||
this.onOpenTemplates,
|
this.onOpenTemplates,
|
||||||
|
this.onOpenSchedules,
|
||||||
this.notifications,
|
this.notifications,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,6 +55,9 @@ class SettingsScreen extends StatefulWidget {
|
|||||||
/// without a dead row that would go nowhere.
|
/// without a dead row that would go nowhere.
|
||||||
final VoidCallback? onOpenTemplates;
|
final VoidCallback? onOpenTemplates;
|
||||||
|
|
||||||
|
/// Opens the saved-schedule list above Settings.
|
||||||
|
final VoidCallback? onOpenSchedules;
|
||||||
|
|
||||||
/// The app-level notification capability; absent in connection-only fixtures.
|
/// The app-level notification capability; absent in connection-only fixtures.
|
||||||
final NotificationController? notifications;
|
final NotificationController? notifications;
|
||||||
|
|
||||||
@@ -141,6 +146,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
controller: widget.notifications!,
|
controller: widget.notifications!,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
if (widget.onOpenSchedules != null) ...<Widget>[
|
||||||
|
const SizedBox(height: settingsSectionGap),
|
||||||
|
const _SectionTitle('Schedules'),
|
||||||
|
const SizedBox(height: settingsTitleGap),
|
||||||
|
SettingsSchedulesSection(onOpen: widget.onOpenSchedules!),
|
||||||
|
],
|
||||||
if (widget.onOpenTemplates != null) ...<Widget>[
|
if (widget.onOpenTemplates != null) ...<Widget>[
|
||||||
const SizedBox(height: settingsSectionGap),
|
const SizedBox(height: settingsSectionGap),
|
||||||
const _SectionTitle('Templates'),
|
const _SectionTitle('Templates'),
|
||||||
|
|||||||
@@ -246,4 +246,11 @@ void main() {
|
|||||||
expect(AppRoute(AppRouteKind.pipelines, pipelineId: 0).path, '/pipelines');
|
expect(AppRoute(AppRouteKind.pipelines, pipelineId: 0).path, '/pipelines');
|
||||||
expect(AppRoute(AppRouteKind.runs, runId: 0).path, '/runs');
|
expect(AppRoute(AppRouteKind.runs, runId: 0).path, '/runs');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('the saved-schedule list is a Settings sub-page URL', () {
|
||||||
|
expect(AppRoute.schedules.path, '/schedules');
|
||||||
|
expect(AppRoute.parse('/schedules'), AppRoute.schedules);
|
||||||
|
// Unknown deeper paths still resolve to the default list.
|
||||||
|
expect(AppRoute.parse('/schedules/1'), AppRoute.pipelines);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user