WHEN I am logged in
AND on the missions dashboard
THEN there should be a button to add a mission
AND when clicked
THEN a modal should pop up
AND allow you to enter in a planetary sector and date
DEV NOTES
[ ] create a new component/file called addNewMission.js
[ ] create a modal in addNewMission.js
[ ] add a button under the mission title in missions.js file in buildAllMissions with id="add-new-missions-btn"
[ ] use a font awesome plus icon and add new mission
[ ] add an event listener to the new button
[ ] the event listener should call a function called newMissionForm
[ ] create a function in addMissionForm called newMissionForm
[ ] build out an html bootstrap form using the domString variable
[ ] it should have as many inputs as keys in the object, title appropriately
[ ] it should have a submit button at the bottom
[ ] the submit button has an event listener attached that calls a function named saveNewMission
[ ] in missions.js create the function saveNewMission
[ ] create addMission function in missionsData.js
[ ] uses an axios.post() to send to database
[ ] back in saveNewMission function - takes eas a parameter
[ ] use e.preventDefault()
[ ] then call addMission function
[ ] .catch() should console.error and comment and the error
[ ] .then() should create an object called newMission with as many key:value pairs as there are
[ ] keys in the original seed data, plus the uid key that calls the getMyUid function
[ ] should then call the buildAllMissions function
USER STORY
As a user, I should be able to add a mission.
AC
WHEN I am logged in AND on the missions dashboard THEN there should be a button to add a mission AND when clicked THEN a modal should pop up AND allow you to enter in a planetary sector and date
DEV NOTES
addNewMission.js
addNewMission.js
missions.js
file inbuildAllMissions
withid="add-new-missions-btn"
newMissionForm
addMissionForm
callednewMissionForm
domString
variablesaveNewMission
missions.js
create the functionsaveNewMission
addMission
function inmissionsData.js
axios.post()
to send to databasesaveNewMission
function - takese
as a parametere.preventDefault()
addMission
functionnewMission
with as many key:value pairs as there arebuildAllMissions
function