From 72bcbbea0257926b7d0afcb1042afd8c0732988b Mon Sep 17 00:00:00 2001 From: Omar Selo Date: Wed, 5 Jul 2023 14:09:52 +0300 Subject: [PATCH] Better match figma design --- frontend/lib/models/test_execution.dart | 10 +++---- .../lib/ui/dashboard/dashboard_header.dart | 30 ++++++++++++------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/frontend/lib/models/test_execution.dart b/frontend/lib/models/test_execution.dart index b3c28f88..d14606a2 100644 --- a/frontend/lib/models/test_execution.dart +++ b/frontend/lib/models/test_execution.dart @@ -23,16 +23,16 @@ class TestExecution with _$TestExecution { } enum TestExecutionStatus { + @JsonValue('FAILED') + failed, @JsonValue('NOT_STARTED') notStarted, + @JsonValue('NOT_TESTED') + notTested, @JsonValue('IN_PROGRESS') inProgress, @JsonValue('PASSED') - passed, - @JsonValue('FAILED') - failed, - @JsonValue('NOT_TESTED') - notTested; + passed; String get name { switch (this) { diff --git a/frontend/lib/ui/dashboard/dashboard_header.dart b/frontend/lib/ui/dashboard/dashboard_header.dart index db16e595..11bec876 100644 --- a/frontend/lib/ui/dashboard/dashboard_header.dart +++ b/frontend/lib/ui/dashboard/dashboard_header.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import 'package:intersperse/intersperse.dart'; +import 'package:yaru/yaru.dart'; +import 'package:yaru_icons/yaru_icons.dart'; -import '../../models/test_execution.dart'; import '../spacing.dart'; class DashboardHeader extends StatelessWidget { @@ -29,15 +29,23 @@ class DashboardHeader extends StatelessWidget { style: Theme.of(context).textTheme.headlineLarge, ), const SizedBox(height: Spacing.level4), - Row( - children: TestExecutionStatus.values - .map( - (status) => - _LegendEntry(icon: status.icon, text: status.name), - ) - .toList() - .intersperse(const SizedBox(width: Spacing.level4)) - .toList(), + const Row( + children: [ + _LegendEntry( + icon: Icon(YaruIcons.error, color: YaruColors.red), + text: 'Failed', + ), + SizedBox(width: Spacing.level4), + _LegendEntry( + icon: Icon(YaruIcons.information), + text: 'No result', + ), + SizedBox(width: Spacing.level4), + _LegendEntry( + icon: Icon(YaruIcons.ok, color: YaruColors.success), + text: 'Passed', + ), + ], ), ], ),