Labs Week 5: A Review
Tags: lambdaschool
Published: 2019-04-19 17:43:37

---
title: Labs Week 5: A Review
published: true
description: 
tags: Lambda School
---

<center>And that's a wrap!</center>
<center>[Training Bot](https://www.trainingbot.co)</center>

---

Lambda Labs has been an absolute wonderful experience and I couldn't have asked for a better team to work with.


The last week of our project was all about polishing and getting the app finalized. Last week I thought that this would be a pretty easy week. I was surprised as we went through the week there was more and more work to complete. They either seemed to be small styling issues or a realization that we should have written an entire part of the app another way. I guess that just comes with writing version 1.0 of an app. Just need to get something out the door and then build on it.

---

This week the big item I worked on was setting up our app to disabled the add team member button or save button when editing a team member if the phone number isn't a full 10 digit number. Due to the way I had originally setup the phone number format it I wasn't able to do the validation of the number on the front end. I did enjoy writing the following regex to disable the button if no required phone number was present.

```
  let addDisabled = false;
    if (
      /^$/gm.test(this.state.teamMember.phoneNumber) === true ||
      (/\+1 \(\d{0}/gm.test(this.state.teamMember.phoneNumber) === true &&
        /^\s*(?:\+?(\d{1,3}))?([-. (]*(\d{3})[-. )]*)?((\d{3})[-. ]*(\d{4})(?:[-.x ]*(\d+))?)\S*$/gm.test(this.state.teamMember.phoneNumber) === false)
    ) {
      addDisabled = true;
    }
```

The first part checks to see if the phone number string is empty and if so disabled will be `true`. The second part checks for the form string to be there but empty. The last one checks that all 10 digits have been entered. 

I'm sure there is an easier way to do this and may go back to it later to simplify and get proper phone validation on the front end. Alex was able to get validation for the phone number on the backend so that when they are sent to Twilio it doesn't crash our server.

---

This last week had it's challenges. Looking back though I have a feeling what we experienced was pretty common. We felt really good going into the week and during the week it just felt like one thing after another was cropping up. From styling issue caused by a mix of Material-UI and Styled Components to changing a component key to something that wasn't original that caused a list item to duplicate. I will say that is the first time when mapping over an array a key causing an issue. I think mostly because I either forget to add a key and ignore the warning or the item I'm mapping over includes an id, which this one didn't.

Looking back over the last 5 weeks I'm extremely proud of the work our team put in to making this app. Many learning experiences from reading others code the entire planning process for an application of this scale.

Thanks to Nate for our apps amazing video.

{% youtube bR18ee24Gfk %}

---

<center>[Training Bot](https://www.trainingbot.co)</center>

![Training Bot](https://thepracticaldev.s3.amazonaws.com/i/6w6gnma59wupyt1e7zl4.png)

---

GitHub PR's

{% github https://github.com/training-bot/labs11-trainingBot-FE/pull/155 %}
{% github https://github.com/training-bot/labs11-trainingBot-FE/pull/144 %}
{% github https://github.com/training-bot/labs11-trainingBot-FE/pull/137 %}
{% github https://github.com/training-bot/labs11-trainingBot-FE/pull/136 %}

---

GitHub Repo

{% github training-bot/labs11-trainingBot-FE %}
{% github training-bot/labs11-trainingBot-BE %}