PRJ – 7

Wednesday 12/08: 8AM – 2:30PM

Again, most of the day was spent on being able to print multiple sheets apart from doing two other minor jobs.

I added two input fields and a corresponding redux action/reducer function to the sidebar. Now the user is able to specify which customer the sheets are for and assign a unit number. Both of these values are stored in the redux store to retrieve later when it comes to printing all the sheets. I also added some logic to check what page the user is on to only show the sidebar toggle button on the page where the user can actually add products to the list. I did this by checking if the path started with the intended string using the window.location object.

As I was working I found out that part of the code I added in the past few days wasn’t working as intended. When a user add a products to the list, the button they used to do so should be disabled so they cannot add the same item twice. I thought this was working but found out that it only disables the button when the user adds it, but when they return to the same product later it’s enabled again. I think this is to do with the way I am checking if the product is in the array which is in the store. I am using Array.prototype.includes() but think I might have to switch it to Array.prototype.indexOf() because I think includes() doesn’t work once there are multiple objects in the array.

Leave a comment

Design a site like this with WordPress.com
Get started