nss-evening-cohort-10 / nutshell-star-destroyer

0 stars 1 forks source link

Planetary System Mission: Create #81

Open ConnorSullivan10 opened 4 years ago

ConnorSullivan10 commented 4 years ago

User Story

As a user, I should be able to add a Planetary System to a Mission.

AC

GIVEN the user is on the Missions page AND they click the "Add Mission" button THEN they should be able to add a Planetary System to the new Mission by entering it into the input form of the modal that pops up on click of the "Add Mission" button

Dev Notes

<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropdown button
  </button>
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
  </div>
</div>
const buildDropdownSelection = () => new Promise((resolve, reject) => {
  let bigBoardString = '';
smash.getAllPlanetarySystemById(mission.planetaryID);
    .then((planetSystem) => {
      planets.forEach((planetSystem) => {
        bigBoardString += `<a class="dropdown-item" href="#" data-boardID="${planetSystem.id}">${planetSystem.name}</a>`;
      });
      resolve(bigBoardString);
    })
    .catch((error) => reject(error));
});
 buildDropdownSelection()
    .then((resolve) => {
      boardSelections = resolve;
    });

<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="dropdownMenuButton">${boardSelections}</div>