Skip to content

Commit

Permalink
fix web shard icons (#3251)
Browse files Browse the repository at this point in the history
This is so all web tests show using the Chromium icon rather than OS icon.
  • Loading branch information
yjbanov authored Nov 9, 2023
1 parent 9f94c26 commit db39fec
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions dashboard/lib/widgets/task_icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,41 @@ class TaskIcon extends StatelessWidget {
);
}

if (qualifiedTask.task!.toLowerCase().contains('_fuchsia')) {
final String matchedName = qualifiedTask.task!.toLowerCase();
final bool isWebTest = matchedName.contains('_web') || matchedName.contains('web_');
final bool isToolTest = matchedName.contains('_tool') || matchedName.contains('tool_');

if (matchedName.contains('_fuchsia')) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: Image.asset(
'assets/fuchsia.png',
color: blendFilter,
),
);
} else if (qualifiedTask.task!.toLowerCase().contains('_web')) {
} else if (isWebTest && !isToolTest) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: Image.asset(
'assets/chromium.png',
color: blendFilter,
),
);
} else if (qualifiedTask.task!.toLowerCase().contains('_android')) {
} else if (matchedName.contains('_android')) {
return Icon(
Icons.android,
color: blendFilter,
);
} else if (qualifiedTask.task!.toLowerCase().startsWith('linux')) {
} else if (matchedName.startsWith('linux')) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: Image.asset(
'assets/linux.png',
color: blendFilter,
),
);
} else if (qualifiedTask.task!.toLowerCase().startsWith('mac')) {
if (qualifiedTask.task!.toLowerCase().contains('_ios')) {
} else if (matchedName.startsWith('mac')) {
if (matchedName.contains('_ios')) {
return Icon(
Icons.phone_iphone,
color: blendFilter,
Expand All @@ -92,7 +96,7 @@ class TaskIcon extends StatelessWidget {
),
);
}
} else if (qualifiedTask.task!.toLowerCase().startsWith('win')) {
} else if (matchedName.startsWith('win')) {
return Image.asset(
'assets/windows.png',
color: blendFilter,
Expand Down

0 comments on commit db39fec

Please sign in to comment.