nss-evening-cohort-10 / nutshell-jurassic-world

7 stars 3 forks source link

Scheduling - Get Employee List for Assignment #137

Closed maggieisgreene closed 4 years ago

maggieisgreene commented 4 years ago

User Story

As a user, I should see a list of all living staff members in the modal that pops up to assign a staff member.

AC

WHEN the user clicks on Assign Member on the Schedule page THEN a modal should pop up with a dropdown list of all living staff members.

Dev Notes

Inside of the staffData.js, create a new function called getLivingStaffMembers

maggieisgreene commented 4 years ago
staffData.getLivingStaffMembers()
.then((staffMembers) => {
let domstring = '';
domstring += `
<div class="form-group">
   <label for="exampleFormControlSelect1">Select Staff Member</label>
      <select class="form-control" id="exampleFormControlSelect1">`;
      livingStaff.forEach((member) => {
        domString += `<option value="${member.id}">${member.name}</option>`;
      });
      domString += `
      </select>
</div>
`;
utilities.printToDom('assignStaffModal', domstring);
})
.catch((error) => console.error(error));
maggieisgreene commented 4 years ago

Bootstrap Modal Code

<div class="modal fade" id="assignStaffModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Assign Member</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <form id="livingStaffMembers">
          </form>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-light" id="add-new-vendor-staff">Assign</button>
        </div>
      </div>
    </div>
  </div>