merge(app): land Needs you glyphs
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../../ui/status/run_status_icon.dart';
|
||||
import '../domain/attention_models.dart';
|
||||
|
||||
/// The run status glyph an attention row leads with, as the web's attention
|
||||
/// row: a decision is a waiting run, anything else a failed one.
|
||||
Widget attentionStatusIcon(AttentionEntry entry) {
|
||||
final state = entry.kind == AttentionKind.decision ? 'waiting' : 'failed';
|
||||
return RunStatusIcon(state: state, label: state, size: 22);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'attention_status_icon.dart';
|
||||
import '../domain/attention_models.dart';
|
||||
import 'needs_you_copy.dart';
|
||||
import 'needs_you_keys.dart';
|
||||
@@ -167,14 +168,7 @@ class _AttentionRow extends StatelessWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Icon(
|
||||
entry.kind == AttentionKind.decision
|
||||
? CupertinoIcons.time
|
||||
: CupertinoIcons.exclamationmark_circle,
|
||||
color: entry.kind == AttentionKind.decision
|
||||
? CupertinoColors.systemOrange.resolveFrom(context)
|
||||
: CupertinoColors.systemRed.resolveFrom(context),
|
||||
),
|
||||
child: attentionStatusIcon(entry),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'attention_status_icon.dart';
|
||||
import '../domain/attention_models.dart';
|
||||
import 'needs_you_copy.dart';
|
||||
import 'needs_you_keys.dart';
|
||||
@@ -101,14 +102,8 @@ class MaterialNeedsYouSheet extends StatelessWidget {
|
||||
final entry = rows[index];
|
||||
return ListTile(
|
||||
key: attentionRowKey(entry.key),
|
||||
leading: Icon(
|
||||
entry.kind == AttentionKind.decision
|
||||
? Icons.hourglass_top
|
||||
: Icons.error_outline,
|
||||
color: entry.kind == AttentionKind.decision
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.error,
|
||||
),
|
||||
// The run status glyph, as the web's attention row.
|
||||
leading: attentionStatusIcon(entry),
|
||||
title: Text(entry.label),
|
||||
subtitle: Text(attentionRowDescription(entry)),
|
||||
trailing: IconButton(
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/attention/domain/attention_models.dart';
|
||||
import 'package:pipelines_app/features/attention/ui/needs_you_keys.dart';
|
||||
import 'package:pipelines_app/ui/status/run_status_icon.dart';
|
||||
|
||||
import 'needs_you_test_support.dart';
|
||||
|
||||
@@ -40,6 +41,13 @@ void main() {
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byKey(attentionClearAllKey), findsOneWidget);
|
||||
// Each row leads with the shared run status glyph, as the web's rows.
|
||||
expect(
|
||||
tester
|
||||
.widgetList<RunStatusIcon>(find.byType(RunStatusIcon))
|
||||
.map((icon) => icon.state),
|
||||
unorderedEquals(['failed', 'waiting']),
|
||||
);
|
||||
|
||||
// The browser names each destructive control after the row it removes.
|
||||
expect(attentionDismissName(tester, a), 'Dismiss Ship the release');
|
||||
|
||||
Reference in New Issue
Block a user