Closed maggieisgreene closed 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));
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">×</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>
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 calledgetLivingStaffMembers
isDead
set to falseAdd bootstrap modal to
index.html
-- see code below Next, print the living staff members into a dropdown list in the modals --Assign Member
button is clicked that will pop up open the modal and dynamically print the staff members to a dropdown list inside