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/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
import 'attention_status_icon.dart';
|
||||||
import '../domain/attention_models.dart';
|
import '../domain/attention_models.dart';
|
||||||
import 'needs_you_copy.dart';
|
import 'needs_you_copy.dart';
|
||||||
import 'needs_you_keys.dart';
|
import 'needs_you_keys.dart';
|
||||||
@@ -167,14 +168,7 @@ class _AttentionRow extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 4),
|
padding: const EdgeInsets.only(top: 4),
|
||||||
child: Icon(
|
child: attentionStatusIcon(entry),
|
||||||
entry.kind == AttentionKind.decision
|
|
||||||
? CupertinoIcons.time
|
|
||||||
: CupertinoIcons.exclamationmark_circle,
|
|
||||||
color: entry.kind == AttentionKind.decision
|
|
||||||
? CupertinoColors.systemOrange.resolveFrom(context)
|
|
||||||
: CupertinoColors.systemRed.resolveFrom(context),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'attention_status_icon.dart';
|
||||||
import '../domain/attention_models.dart';
|
import '../domain/attention_models.dart';
|
||||||
import 'needs_you_copy.dart';
|
import 'needs_you_copy.dart';
|
||||||
import 'needs_you_keys.dart';
|
import 'needs_you_keys.dart';
|
||||||
@@ -101,14 +102,8 @@ class MaterialNeedsYouSheet extends StatelessWidget {
|
|||||||
final entry = rows[index];
|
final entry = rows[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
key: attentionRowKey(entry.key),
|
key: attentionRowKey(entry.key),
|
||||||
leading: Icon(
|
// The run status glyph, as the web's attention row.
|
||||||
entry.kind == AttentionKind.decision
|
leading: attentionStatusIcon(entry),
|
||||||
? Icons.hourglass_top
|
|
||||||
: Icons.error_outline,
|
|
||||||
color: entry.kind == AttentionKind.decision
|
|
||||||
? theme.colorScheme.primary
|
|
||||||
: theme.colorScheme.error,
|
|
||||||
),
|
|
||||||
title: Text(entry.label),
|
title: Text(entry.label),
|
||||||
subtitle: Text(attentionRowDescription(entry)),
|
subtitle: Text(attentionRowDescription(entry)),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:pipelines_app/features/attention/domain/attention_models.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/features/attention/ui/needs_you_keys.dart';
|
||||||
|
import 'package:pipelines_app/ui/status/run_status_icon.dart';
|
||||||
|
|
||||||
import 'needs_you_test_support.dart';
|
import 'needs_you_test_support.dart';
|
||||||
|
|
||||||
@@ -40,6 +41,13 @@ void main() {
|
|||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
expect(find.byKey(attentionClearAllKey), 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.
|
// The browser names each destructive control after the row it removes.
|
||||||
expect(attentionDismissName(tester, a), 'Dismiss Ship the release');
|
expect(attentionDismissName(tester, a), 'Dismiss Ship the release');
|
||||||
|
|||||||
Reference in New Issue
Block a user