Skip to content

Commit d2ab666

Browse files
committed
Fix tag inconsistencies
1 parent fea84e1 commit d2ab666

File tree

19 files changed

+113
-94
lines changed

19 files changed

+113
-94
lines changed

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/Persons/PersonDetail/Qualifications.cshtml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ else
2323
{
2424
@foreach (var professionalStatus in Model.ProfessionalStatuses)
2525
{
26-
var statusTitle = ProfessionalStatusStatusRegistry.GetTitle(professionalStatus.Status).ToUpper();
27-
var statusColor = professionalStatus.Status switch {
28-
RouteToProfessionalStatusStatus.Holds => "green",
29-
RouteToProfessionalStatusStatus.InTraining => "light-blue",
30-
_ => "red"
31-
};
3226
var cardTitle = $"{professionalStatus.RouteToProfessionalStatusType?.ProfessionalStatusType.GetDisplayName()}";
3327

3428
<govuk-summary-card data-testid="[email protected]">
@@ -48,9 +42,18 @@ else
4842
<govuk-summary-list-row>
4943
<govuk-summary-list-row-key>Status</govuk-summary-list-row-key>
5044
<govuk-summary-list-row-value>
51-
<govuk-tag class="govuk-tag--@statusColor">
52-
@statusTitle
53-
</govuk-tag>
45+
@{
46+
var statusColor = professionalStatus.Status switch {
47+
RouteToProfessionalStatusStatus.Holds => TagColor.Green,
48+
RouteToProfessionalStatusStatus.InTraining => TagColor.LightBlue,
49+
RouteToProfessionalStatusStatus.Withdrawn => TagColor.Grey,
50+
RouteToProfessionalStatusStatus.Failed => TagColor.Red,
51+
_ => TagColor.Turquoise
52+
};
53+
}
54+
<tag color="@statusColor">
55+
@ProfessionalStatusStatusRegistry.GetTitle(professionalStatus.Status)
56+
</tag>
5457
</govuk-summary-list-row-value>
5558
</govuk-summary-list-row>
5659
@if (QuestionDriverHelper.FieldRequired(professionalStatus.RouteToProfessionalStatusType!.TrainingStartDateRequired, professionalStatus.Status.GetStartDateRequirement()) != FieldRequirement.NotApplicable)

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/Persons/PersonDetail/Timeline/Events/ApiTrnRequestSupportTaskUpdatedEvent.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<govuk-summary-list-row-value>
9393
@if (applicationUser is not null)
9494
{
95-
<colored-tag>@applicationUser.Name</colored-tag>
95+
<tag color="TagColor.Auto">@applicationUser.Name</tag>
9696
}
9797
else
9898
{

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/Persons/PersonDetail/Timeline/Events/NpqTrnRequestSupportTaskResolvedEvent.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<govuk-summary-list-row-value>
124124
@if (applicationUser is not null)
125125
{
126-
<colored-tag>@applicationUser.Name</colored-tag>
126+
<tag color="TagColor.Auto">@applicationUser.Name</tag>
127127
}
128128
else
129129
{

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/Shared/_PersonDetail.cshtml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,13 @@
6262
<govuk-summary-list-row>
6363
<govuk-summary-list-row-key>Status</govuk-summary-list-row-key>
6464
<govuk-summary-list-row-value use-empty-fallback>
65-
@if (Model.IsActive == true)
65+
@if (Model.IsActive == false)
6666
{
67-
<govuk-tag class="govuk-tag--green">
68-
ACTIVE
69-
</govuk-tag>
67+
<tag color="TagColor.Grey">Deactivated</tag>
7068
}
71-
72-
@if (Model.IsActive == false)
69+
else
7370
{
74-
<govuk-tag class="govuk-tag--red">
75-
DEACTIVATED
76-
</govuk-tag>
71+
<tag color="TagColor.Green">Active</tag>
7772
}
7873
</govuk-summary-list-row-value>
7974
</govuk-summary-list-row>

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/SupportTasks/ApiTrnRequests/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
</th>
7878
<td class="govuk-table__cell" data-testid="email">@result.EmailAddress</td>
7979
<td class="govuk-table__cell" data-testid="requested-on">@result.CreatedOn.ToString(UiDefaults.DateOnlyDisplayFormat)</td>
80-
<td class="govuk-table__cell" data-testid="source"><colored-tag>@result.SourceApplicationName</colored-tag></td>
80+
<td class="govuk-table__cell" data-testid="source"><tag color="TagColor.Auto">@result.SourceApplicationName</tag></td>
8181
</tr>
8282
}
8383
</tbody>

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/SupportTasks/ApiTrnRequests/Resolve/Matches.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
<govuk-summary-list-row-value>
136136
@foreach (var tag in tags)
137137
{
138-
<govuk-tag>@tag</govuk-tag>
138+
<tag>@tag</tag>
139139
}
140140
</govuk-summary-list-row-value>
141141
</govuk-summary-list-row>

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/SupportTasks/IntegrationTransactions/Detail.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,22 @@
131131

132132
@if (result.Duplicate == true)
133133
{
134-
<span class="govuk-tag--orange govuk-!-static-padding-1">Duplicate</span>
134+
<tag color="TagColor.Orange" class="govuk-!-static-padding-1">Duplicate</tag>
135135
}
136136
</td>
137137
<td class="govuk-table__cell"
138138
data-testid="integration-transaction-record:@result.IntegrationTransactionRecordId:status">
139139
@if (result.Status == IntegrationTransactionRecordStatus.Success)
140140
{
141-
<span class="govuk-tag--green govuk-!-static-padding-1">@result.Status.GetDisplayName()</span>
141+
<tag color="TagColor.Green" class="govuk-!-static-padding-1">@result.Status.GetDisplayName()</tag>
142142
}
143143
else @if (result.Status == IntegrationTransactionRecordStatus.Warning)
144144
{
145-
<span class="govuk-tag--yellow govuk-!-static-padding-1">@result.Status.GetDisplayName()</span>
145+
<tag color="TagColor.Yellow" class="govuk-!-static-padding-1">@result.Status.GetDisplayName()</tag>
146146
}
147147
else @if (result.Status == IntegrationTransactionRecordStatus.Failure)
148148
{
149-
<span class="govuk-tag--red govuk-!-static-padding-1">@result.Status.GetDisplayName()</span>
149+
<tag color="TagColor.Red" class="govuk-!-static-padding-1">@result.Status.GetDisplayName()</tag>
150150
}
151151
</td>
152152
</tr>

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/SupportTasks/IntegrationTransactions/Index.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@
9696
data-testid="integration-transaction:@result.IntegrationTransactionId:importstatus">
9797
@if (result.ImportStatus == IntegrationTransactionImportStatus.Success)
9898
{
99-
<span class="govuk-tag--green govuk-!-static-padding-1">@result.ImportStatus.GetDisplayName()</span>
99+
<tag color="TagColor.Green" class="govuk-!-static-padding-1">@result.ImportStatus.GetDisplayName()</tag>
100100
}
101101
else @if (result.ImportStatus == IntegrationTransactionImportStatus.InProgress)
102102
{
103-
<span class="govuk-tag--light-blue govuk-!-static-padding-1">@result.ImportStatus.GetDisplayName()</span>
103+
<tag color="TagColor.Blue" class="govuk-!-static-padding-1">@result.ImportStatus.GetDisplayName()</tag>
104104
}
105105
else
106106
{
107-
<span class="govuk-tag--red govuk-!-static-padding-1">@result.ImportStatus.GetDisplayName()</span>
107+
<tag color="TagColor.Red" class="govuk-!-static-padding-1">@result.ImportStatus.GetDisplayName()</tag>
108108
}
109109
</td>
110110

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/SupportTasks/NpqTrnRequests/Details.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<govuk-summary-list>
2121
<govuk-summary-list-row>
2222
<govuk-summary-list-row-key>Source</govuk-summary-list-row-key>
23-
<govuk-summary-list-row-value use-empty-fallback><colored-tag>@Model.SourceApplicationUserName</colored-tag></govuk-summary-list-row-value>
23+
<govuk-summary-list-row-value use-empty-fallback><tag color="TagColor.Auto">@Model.SourceApplicationUserName</tag></govuk-summary-list-row-value>
2424
</govuk-summary-list-row>
2525
<govuk-summary-list-row>
2626
<govuk-summary-list-row-key>Name</govuk-summary-list-row-key>

TeachingRecordSystem/src/TeachingRecordSystem.SupportUi/Pages/SupportTasks/NpqTrnRequests/Index.cshtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
<tbody class="govuk-table__body">
6969
@foreach (var result in Model.Results)
7070
{
71-
var tagValue = result.PotentialDuplicate.HasValue ? (result.PotentialDuplicate.Value ? "Yes" : "No") : null;
72-
var tagClass = result.PotentialDuplicate.HasValue ? (result.PotentialDuplicate.Value ? "govuk-tag--red" : "govuk-tag--green") : null;
71+
(var tagValue, var tagColor) = result.PotentialDuplicate is true ? ("Yes", TagColor.Yellow) : ("No", TagColor.Green);
7372
<tr class="govuk-table__row" data-testid="task:@result.SupportTaskReference">
7473
<th scope="row" class="govuk-table__header" data-testid="name">
7574
<a href="@LinkGenerator.SupportTasks.NpqTrnRequests.Details(result.SupportTaskReference)" class="govuk-link">
@@ -78,7 +77,7 @@
7877
</th>
7978
<td class="govuk-table__cell" data-testid="email">@result.EmailAddress</td>
8079
<td class="govuk-table__cell" data-testid="requested-on">@result.CreatedOn.ToString(UiDefaults.DateTimeDisplayFormat)</td>
81-
<td class="govuk-table__cell" data-testid="potential-duplicate"><colored-tag class="@tagClass">@tagValue</colored-tag></td>
80+
<td class="govuk-table__cell" data-testid="potential-duplicate"><tag color="@tagColor">@tagValue</tag></td>
8281
</tr>
8382
}
8483
</tbody>

0 commit comments

Comments
 (0)