diff --git a/.gitignore b/.gitignore index 4d29575..e0fd9cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# See https://help.github.com/customers/ignoring-files/ for more about ignoring files. # dependencies /node_modules diff --git a/README.md b/README.md index b58e0af..5181fa8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,44 @@ -# Getting Started with Create React App +# Customer List Test Project + +Thanks for taking the time to look at this code test project. This project aims to give a reasonable baseline view of the tools and structure we work with, it is far from perfect and plays fast with some of the rules, but the overall structure looks a lot like something you'd see in an Alinta Energy project. + +This project implements a customer list using a redux store, with a Formik form for adding customers. It is styled using styled-components at the most minimal level; our regular projects use a shared component library (ASG) which handles most elements and layout out of the box. + +The redux store follows the slightly dated pattern of having actions, reducers and types in separate files. This is deliberate as it mirrors many of our existing projects, which were built before Redux Toolkit was available and stable. + +## Setup + +This project is bootstrap from react-create-app which allow you to use any of the [documentation for CRA](https://create-react-app.dev/docs/getting-started). + +### Initial Set up steps: + +- Run `yarn` this will install the needed npm packages and only needs to be run once. +- Run `yarn start` to run the app locally this will open a browser window for the site. +- Run `yarn test` to run the test. The results will display in the terminal window. + +## Tasks + +Please attempt one or more of the following improvement tasks on this project, and then either make a PR for review or submit a zip of the project. + +**Time box yourself to 1 to 2 hours of work.** + +We realise your time is valuable and don't need to see all these issues resolved. Pick a task or area that you excel or are passionate about. Complete as much as you can in the time you choose. We'll review your code in the technical interview, discuss choices you made and anything you'd like to improve if you had the time. + +### Suggested Tasks + +Use one of our suggested tasks or complete your own improvement to the project if you see something we haven't listed. + +- Move the Add new customer, form it takes up a lot of space on mobile. It could move to another page or be hidden in an accordion. +- Add a birthday to the customers. Consider using a date-picker and it's pros and cons. +- Add validation. Currently, the form allows blank customers to be submitted; we only want customers with all fields filled in. Add validation that handles phone numbers in different formats. +- Improve accessibility. Add extra aria for screen readers and ensure users with other disabilities are catered for in the design. +- Convert the customer list to a table. The block layout is hard for users to scan down. +- Add search and sorting. As the list grows, users want to be able to search by name or phone number. +- Add a duplicate customer check. Prevent users from entering users with the same first and last name or phone number. +- Refactor the store; this is an expansive task. You could update the IDs to be unique and convert the customer list to a map to make editing more efficient. Or convert to a Redux Toolkit slices structure. Whatever you do, make sure it improves the implementation. +- Improve the tests. The current tests work as little more than a smoke test. They should be testing the functionality of the form and the delete button at a minimum. + +## Getting Started with Create React App This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). diff --git a/package.json b/package.json index 8d809af..07b580b 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,21 @@ "@types/node": "^12.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", + "@types/react-redux": "^7.1.16", + "@types/react-router-dom": "^5.1.7", + "@types/styled-components": "^5.1.10", + "@types/yup": "^0.29.11", + "formik": "^2.2.9", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-redux": "^7.2.4", + "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", + "redux": "^4.1.0", + "styled-components": "^5.3.0", "typescript": "^4.1.2", - "web-vitals": "^1.0.1" + "web-vitals": "^1.0.1", + "yup": "^0.32.9" }, "scripts": { "start": "react-scripts start", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index a11777c..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/index.html b/public/index.html index aa069f2..e6cc647 100644 --- a/public/index.html +++ b/public/index.html @@ -2,14 +2,14 @@
- - + - -