-
Notifications
You must be signed in to change notification settings - Fork 1
HEEDLS-554 View delegate page - delegate info #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ibrahimmunir14
merged 15 commits into
master
from
HEEDLS-554-view-delegate-page-delegate-info
Jul 19, 2021
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
b3153a0
HEEDLS-554 Create ViewDelegate controller; configure manage button on…
ibrahimmunir14 a26fa01
HEEDLS-554 Create ViewDelegate blank page with navbar and breadcrumbs
ibrahimmunir14 baab933
HEEDLS-554 Implement GetDelegateUserCardById method
ibrahimmunir14 e7714bd
HEEDLS-554 Extract delegate info into DelegateInfoViewModel
ibrahimmunir14 3925df6
HEEDLS-554 Display delegate info and tags on View Delegate page
ibrahimmunir14 bfd10f5
HEEDLS-554 Display buttons on ViewDelegate page based on active status
ibrahimmunir14 e47b871
HEEDLS-554 Display hyphen to indicate no value for optional DelegateU…
ibrahimmunir14 ba628e3
HEEDLS-554 Fix SearchableDelegateVM tests; add ViewDelegateVM and Del…
ibrahimmunir14 5696200
HEEDLS-554 Remove unneeded row/col divs from ViewDelegates page
ibrahimmunir14 a5d564a
HEEDLS-554 Do not match admin when getting DelegateUserCard if admin …
ibrahimmunir14 0870398
HEEDLS-554 Add visually hidden text to indicate fields with no value;…
ibrahimmunir14 6db5dcf
HEEDLS-554 Move Deactivate account button to new line
ibrahimmunir14 101d324
HEEDLS-554 Update delegate-admin linking condition in GetDelegateUser…
ibrahimmunir14 35446da
HEEDLS-554 Use dash and visually hidden text to indicate no value for…
ibrahimmunir14 fe4a1f8
HEEDLS-554 Create SummaryFieldValue component and use in summary tabl…
ibrahimmunir14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
....Web.Tests/ViewModels/TrackingSystem/Delegates/AllDelegates/DelegateInfoViewModelTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| namespace DigitalLearningSolutions.Web.Tests.ViewModels.TrackingSystem.Delegates.AllDelegates | ||
| { | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using DigitalLearningSolutions.Data.Models.User; | ||
| using DigitalLearningSolutions.Web.ViewModels.Common; | ||
| using DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Delegates; | ||
| using FluentAssertions; | ||
| using NUnit.Framework; | ||
|
|
||
| public class DelegateInfoViewModelTests | ||
| { | ||
| private readonly List<CustomFieldViewModel> customFields = new List<CustomFieldViewModel>(); | ||
|
|
||
| [Test] | ||
| public void DelegateInfoViewModel_sets_reg_date_string_correctly() | ||
| { | ||
| // Given | ||
| var date = new DateTime(2021, 05, 13); | ||
| var user = new DelegateUserCard { DateRegistered = date }; | ||
|
|
||
| // When | ||
| var model = new DelegateInfoViewModel(user, customFields); | ||
|
|
||
| // Then | ||
| model.RegistrationDate.Should().Be("13/05/2021"); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
....Web.Tests/ViewModels/TrackingSystem/Delegates/AllDelegates/ViewDelegateViewModelTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| namespace DigitalLearningSolutions.Web.Tests.ViewModels.TrackingSystem.Delegates.AllDelegates | ||
| { | ||
| using System.Collections.Generic; | ||
| using DigitalLearningSolutions.Data.Models.User; | ||
| using DigitalLearningSolutions.Web.ViewModels.Common; | ||
| using DigitalLearningSolutions.Web.ViewModels.TrackingSystem.Delegates; | ||
| using FluentAssertions; | ||
| using NUnit.Framework; | ||
|
|
||
| public class ViewDelegateViewModelTests | ||
| { | ||
| private readonly List<CustomFieldViewModel> customFields = new List<CustomFieldViewModel>(); | ||
|
|
||
| [Test] | ||
| public void ViewDelegateViewModel_sets_active_tag_name_correctly() | ||
| { | ||
| // Given | ||
| var activeUser = new DelegateUserCard { Active = true }; | ||
| var inactiveUser = new DelegateUserCard { Active = false }; | ||
|
|
||
| // When | ||
| var activeModel = new ViewDelegateViewModel(new DelegateInfoViewModel(activeUser, customFields)); | ||
| var inactiveModel = new ViewDelegateViewModel(new DelegateInfoViewModel(inactiveUser, customFields)); | ||
|
|
||
| // Then | ||
| activeModel.ActiveTagName.Should().Be("Active"); | ||
| inactiveModel.ActiveTagName.Should().Be("Inactive"); | ||
| } | ||
|
|
||
| [Test] | ||
| public void ViewDelegateViewModel_sets_password_tag_name_correctly() | ||
| { | ||
| // Given | ||
| var pwSetUser = new DelegateUserCard { Password = "pw" }; | ||
| var pwNotSetUser = new DelegateUserCard { Password = null }; | ||
|
|
||
| // When | ||
| var pwSetModel = new ViewDelegateViewModel(new DelegateInfoViewModel(pwSetUser, customFields)); | ||
| var pwNotSetModel = new ViewDelegateViewModel(new DelegateInfoViewModel(pwNotSetUser, customFields)); | ||
|
|
||
| // Then | ||
| pwSetModel.PasswordTagName.Should().Be("Password set"); | ||
| pwNotSetModel.PasswordTagName.Should().Be("Password not set"); | ||
| } | ||
|
|
||
| [Test] | ||
| public void ViewDelegateViewModel_sets_regstatus_tag_name_correctly() | ||
| { | ||
| // Given | ||
| var selfRegUser = new DelegateUserCard { SelfReg = true, ExternalReg = false }; | ||
| var selfRegExternalUser = new DelegateUserCard { SelfReg = true, ExternalReg = true }; | ||
| var centreRegUser = new DelegateUserCard { SelfReg = false }; | ||
|
|
||
| // When | ||
| var selfRegModel = new ViewDelegateViewModel(new DelegateInfoViewModel(selfRegUser, customFields)); | ||
| var selfRegExternalModel = | ||
| new ViewDelegateViewModel(new DelegateInfoViewModel(selfRegExternalUser, customFields)); | ||
| var centreRegModel = | ||
| new ViewDelegateViewModel(new DelegateInfoViewModel(centreRegUser, customFields)); | ||
|
|
||
| // Then | ||
| selfRegModel.RegStatusTagName.Should().Be("Self registered"); | ||
| selfRegExternalModel.RegStatusTagName.Should().Be("Self registered (External)"); | ||
| centreRegModel.RegStatusTagName.Should().Be("Registered by centre"); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.