feat(app): pipeline rows show the last run's status glyph, as the web
This commit is contained in:
@@ -9,6 +9,7 @@ import '../../graph/layout/layout_models.dart';
|
|||||||
import '../../graph/routing/graph_edge_routing.dart';
|
import '../../graph/routing/graph_edge_routing.dart';
|
||||||
import '../../graph/routing/route_models.dart';
|
import '../../graph/routing/route_models.dart';
|
||||||
import '../../graph/widgets/graph_canvas_style.dart';
|
import '../../graph/widgets/graph_canvas_style.dart';
|
||||||
|
import '../../../ui/status/run_status_icon.dart';
|
||||||
import '../pipeline_format.dart';
|
import '../pipeline_format.dart';
|
||||||
import '../pipeline_models.dart';
|
import '../pipeline_models.dart';
|
||||||
import '../pipeline_query.dart';
|
import '../pipeline_query.dart';
|
||||||
@@ -243,8 +244,8 @@ class PipelineListPanel extends StatelessWidget {
|
|||||||
///
|
///
|
||||||
/// Everything printed comes from recorded values: the identity, the stage
|
/// Everything printed comes from recorded values: the identity, the stage
|
||||||
/// count, the configured schedules and the parseable updated time. The run
|
/// count, the configured schedules and the parseable updated time. The run
|
||||||
/// line keeps the web's state word and `row-meta` fragments
|
/// line is the web's status glyph plus its `row-meta` fragments
|
||||||
/// (`Succeeded · 2h ago · 1m 5s · run 42`).
|
/// (`2h ago · 1m 5s · run 42`).
|
||||||
Widget _rowMetadata(
|
Widget _rowMetadata(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
PipelineSummary pipeline,
|
PipelineSummary pipeline,
|
||||||
@@ -261,11 +262,6 @@ class PipelineListPanel extends StatelessWidget {
|
|||||||
? controller.latestRuns[pipeline.id]
|
? controller.latestRuns[pipeline.id]
|
||||||
: null;
|
: null;
|
||||||
final badge = run == null ? null : runBadge(run, now);
|
final badge = run == null ? null : runBadge(run, now);
|
||||||
final runLine = controller.runsLoaded
|
|
||||||
? badge == null
|
|
||||||
? 'no runs recorded'
|
|
||||||
: '${runStateLabel(badge.state)} · ${badge.metaLine}'
|
|
||||||
: null;
|
|
||||||
final shape = pipeline.shape;
|
final shape = pipeline.shape;
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -281,7 +277,29 @@ class PipelineListPanel extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(facts, style: style),
|
Text(facts, style: style),
|
||||||
if (runLine != null && runLine.isNotEmpty) Text(runLine, style: style),
|
// As the web's `row-run`: the coloured status glyph (its tooltip and
|
||||||
|
// accessible name are the state word), then `2d ago · 4m 12s · run 488`.
|
||||||
|
if (controller.runsLoaded && badge == null)
|
||||||
|
Text('no runs recorded', style: style),
|
||||||
|
if (badge != null)
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
RunStatusIcon(
|
||||||
|
state: badge.state,
|
||||||
|
label: runStateLabel(badge.state),
|
||||||
|
size: 14,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
badge.metaLine,
|
||||||
|
style: style,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:pipelines_app/ui/status/run_status_icon.dart';
|
||||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||||
import 'package:pipelines_app/features/pipelines/widgets/pipeline_list_panel.dart';
|
import 'package:pipelines_app/features/pipelines/widgets/pipeline_list_panel.dart';
|
||||||
|
|
||||||
@@ -38,14 +39,17 @@ void main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// The version trails the title line; the recorded facts are one line and
|
// The version trails the title line; the recorded facts are one line and
|
||||||
// the run line keeps the web's state word and fragments.
|
// the run line is the web's status glyph plus its fragments.
|
||||||
expect(find.text('v2'), findsOneWidget);
|
expect(find.text('v2'), findsOneWidget);
|
||||||
expect(
|
expect(
|
||||||
find.text('id 1 · 2 stages · 1 schedule · updated 17 Oct 21:26'),
|
find.text('id 1 · 2 stages · 1 schedule · updated 17 Oct 21:26'),
|
||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
expect(find.textContaining('Succeeded · '), findsOneWidget);
|
final glyphs = tester
|
||||||
expect(find.textContaining('Failed · '), findsOneWidget);
|
.widgetList<RunStatusIcon>(find.byType(RunStatusIcon))
|
||||||
|
.map((icon) => icon.label);
|
||||||
|
expect(glyphs, unorderedEquals(['Succeeded', 'Failed']));
|
||||||
|
expect(find.textContaining('Succeeded'), findsNothing);
|
||||||
expect(find.text('no runs recorded'), findsOneWidget);
|
expect(find.text('no runs recorded'), findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -131,7 +135,12 @@ void main() {
|
|||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
expect(find.text('v2'), findsOneWidget);
|
expect(find.text('v2'), findsOneWidget);
|
||||||
expect(find.textContaining('Succeeded · '), findsOneWidget);
|
expect(
|
||||||
|
find.byWidgetPredicate(
|
||||||
|
(widget) => widget is RunStatusIcon && widget.label == 'Succeeded',
|
||||||
|
),
|
||||||
|
findsOneWidget,
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
debugDefaultTargetPlatformOverride = null;
|
debugDefaultTargetPlatformOverride = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user