Skip to content

Display the counter on the Home page and implement the add sanctioned entity functionality#8

Open
lucaslsilva wants to merge 3 commits intoGallagherReDigital:masterfrom
lucaslsilva:master
Open

Display the counter on the Home page and implement the add sanctioned entity functionality#8
lucaslsilva wants to merge 3 commits intoGallagherReDigital:masterfrom
lucaslsilva:master

Conversation

@lucaslsilva
Copy link

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 async pipe, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants