As a user, I should be able to edit the planetary sector for a mission.
AC
WHEN the mission page loads
THEN each mission should have an edit button
AND when I click that edit button a modal should pop up
AND the modal should have a dropdown menu of planetary sectors
AND I should be able to change the planetary sector
AND I should be able to change the planetary sector
Dev Notes
125
Step 1
Create a file in the data folder called missionPlaneterySectorData.jsimport axios and apiKeys at the top of the file
create a function called getAllPlanetarySectorsgetAllPlanetarySectors makes an axios.get call to /planetarySectorId.json
.then stores response.data as a variable thePlanetarySectors
it then stores these in an empty array called daPlanetarySector
an if statement passes in the daPlanetarySector
uses an Object.keys(thePlanetarySectors).forEach((planetarySectorId)
set the planetarySectorId = to theOccupation[occupationTypeId].id
then use a .push to theOccupation[occupationTypeId].id intodaPlanetarySectorempty array *resolvedaPlanetarySector`
Step 2
*go the printMissions function in theGalaxy and add a <select> tag with an id of sector-btn to the bottom of the domString
Add missionPlanatarySectorComponent.getAllPlanatarySectors beneath the <select> tag
the .then should pass in ((sectors)
on success do a forEach = sectors.ForEach((type)
build a domString with `'
Step 3
*go the updateMission function and add $(#sector-btn).val() to get the value of the button for the planetarySector
User Story
As a user, I should be able to edit the planetary sector for a mission.
AC
WHEN the mission page loads THEN each mission should have an edit button AND when I click that edit button a modal should pop up AND the modal should have a dropdown menu of planetary sectors AND I should be able to change the planetary sector AND I should be able to change the planetary sector
Dev Notes
125
Step 1 Create a file in the data folder called
missionPlaneterySectorData.js
importaxios
andapiKeys
at the top of the file create a function calledgetAllPlanetarySectors
getAllPlanetarySectors
makes an axios.get call to/planetarySectorId.json
response.data
as a variablethePlanetarySectors
daPlanetarySector
daPlanetarySector
Object.keys(thePlanetarySectors).forEach((planetarySectorId)
planetarySectorId
= totheOccupation[occupationTypeId].id
.push
totheOccupation[occupationTypeId].id into
daPlanetarySectorempty array *resolve
daPlanetarySector`Step 2 *go the
printMissions
function in theGalaxy and add a<select>
tag with an id ofsector-btn
to the bottom of thedomString
missionPlanatarySectorComponent.getAllPlanatarySectors
beneath the<select>
tag the .then should pass in ((sectors) on success do a forEach =sectors.ForEach((type)
Step 3 *go the
updateMission
function and add$(
#sector-btn).val()
to get the value of the button for the planetarySector