Waiting Game

March 19th, 2020
waiting

My Part is Done

I've been working on a feature now for a solid week at work, and it's come along nicely. Exactly a week ago last Thursday, I sat down with a couple other people on the team to outline exactly what I was going to be doing, and at the time, it seemed like a daunting task, one I might not be up to. Actually, given the skills I had a week ago, I can say that I wasn't up to it. But, that's not taking into account my learning curve, and it's been a hell of a week for that. Last Wednesday, before I started the project, I took the app that I would be working on and refactored it so it would be more readable for me. To that point, only one developer, my neighbor, had worked on this app, so it wasn't in any kind of shape for a team to work on. In fact, 95% of the code lived in the App.js file, one 1600+ line of a behemoth. There were many, many components, and so I structured it out so that each component had its own file. I took the standalone functions and moved them into their own files as well. This took an afternoon, but at least when I got done with it, I was able to make sense of what I was looking at. Then, I went over to that neighbor of mine, and discussed with him how he thought I should be handling the project. To give you a brief idea, the app that existed was a multi-page form that took in an ID from a quote gotten from a sale and walked the user through providing their address and credit card information, with a confirmation page and a success page at the end. My duty was to create a shortcut where the user would enter the representative's ID and build out the payment without having to require a quote. At first, I had no idea how to wrap my head around this.

payment

After discussing with my neighbor, I gained a much better understanding of the steps I would need to provide and how it would flow. I would have a page where the user would input the ID, it would send off to an API and return the representative's name, ask if that is their rep, and then take them to a page where they would choose their plan. From there, it would take them to another optional form they could fill out to provide a referral, or more than one referral if they wanted. After proceeding past this page, it would take them to the same form that existed before my feature, where they would fill out their address and credit card information. Instead of the price being pulled from the quote, the address would come from the form they filled out to build their plan. Before I even got started, though, my neighbor suggested this would be a great time to change the project over to TypeScript, knowing that I haven't worked with TypeScript before and that it would be a great way for me to learn. We spent about 2 hours last Thursday getting that all moved over, and then I got to work on the actual feature on Friday. It was a process for me, starting with just simply using useState to handle state locally, to moving over the UI state into useReducer with enumerators denoting the different UI states of the app, to now fully relying on useContext. I had used those hooks before, but not much, and it required a lot of learning to get it all rocking, but it's almost fully functional now.

payment

In the last two days, I've just been playing cleanup on the project, getting things in proper order. Yesterday, I handed it over to my neighbor to take a look at, and he came up with a Figma diagram of how each page should look stylistically, so I spent several hours getting all of that fixed up. I now have it looking exactly like he wanted to, and I have to agree with the style he had in mind; it looks clean. I spent the majority of the day today refactoring everything I'd written to be a little more usable and moving different components into their own files. The final bit of this project is to get hooked up to the database in a way that provides the correct information. For that, I'm waiting on my neighbor before I can go any further. There are things in the original app that are just beyond my scope of understanding, and there are things with hooking it up to the database that I couldn't even begin to fathom at this point. But, because of the Coronavirus, everyone else is in a panic to make it possible for their sales representatives to conduct sales calls over video calls, which means rolling out a bunch of stuff to a whole fleet of representatives. It is taking all of their collective efforts to make this happen, and I'm placed in the back of the queue. All I can do is let him know that I could use some assistance, which I have, and to let him know I'm ready whenever he gets the time. I'm hoping he can find that time tomorrow, otherwise I'm going to be a little more insistent. I have nothing else I can really do in the meantime; in fact, I spent the last hour of work reading the React documentation and a tutorial on TypeScript to stay occupied.

Until tomorrow!

Created by Sam Thoyre, © 2019