Display the counter on the Home page and implement the add sanctioned entity functionality#8
Open
lucaslsilva wants to merge 3 commits intoGallagherReDigital:masterfrom
Open
Display the counter on the Home page and implement the add sanctioned entity functionality#8lucaslsilva wants to merge 3 commits intoGallagherReDigital:masterfrom
lucaslsilva wants to merge 3 commits intoGallagherReDigital:masterfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements two requirements for the Gallagher technical interview.
The first one is to display the counter on the Home page. The count should persist when switching between tabs. To achieve this, I created a service that is used by both components. I'm also using the
asyncpipe, so that we don't have to manually subscribe to the Observable in the component.The second requirement is to add a capability to create a sanctioned entity. The name and the domicile fields are required, and we can't have two sanctioned entities with the same name and domicile. Also, the status field is using the Bootstrap switch version 5.1.3. To implement this, I added a new button on the list page that redirects the user to a new page that displays the create form. The validation is done in the front-end without the user having to click on Save. The Save button is disabled if the form is invalid. When the user submits the request, the Save button displays a spinner and is disabled to prevent the user from submitting the form multiple times. If the request succeeds, the user is redirected back to the list, and the new entity should be displayed there. If the request fails, the error message is displayed. A few unit tests were created to test the add component.
Some next steps and improvements were added to the README file.