Skip to content

Commit bf29c8c

Browse files
TD-3542 putting the validations in the viewmodels
1 parent b492564 commit bf29c8c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

DigitalLearningSolutions.Web/ViewModels/Supervisor/EnrolDelegateSummaryViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ public class EnrolDelegateSummaryViewModel
1212
public string SupervisorRoleName { get; set; }
1313
public int SupervisorRoleCount { get; set; }
1414
public bool AllowSupervisorRoleSelection { get; set; }
15+
public bool HasSupervisorRoles => !string.IsNullOrWhiteSpace(SupervisorRoleName);
1516
}
1617
}

DigitalLearningSolutions.Web/Views/Supervisor/SelectDelegateSupervisorRoleSummary.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<partial name="Shared/_StaffDetails" model="Model.Item1.SupervisorDelegateDetail" />
4848
</div>
4949
</details>
50-
@if (string.IsNullOrWhiteSpace(Model.Item1.SupervisorRoleName))
50+
@if (!Model.Item1.HasSupervisorRoles)
5151
{
5252
<p>No supervisor roles have been configured for this self assessment.</p>
5353
}

0 commit comments

Comments
 (0)