As a user, I should be able to add a Planetary System.
AC
GIVEN the user is logged in and visits the Planetary System page
THEN they should see a Planetary System Module div where all the planetary systems and details are listed
AND on centered over the Planetary System div will be an "Add Planetary System" button
THEN when they click the button, a modal pops up where you can enter the new planetary system details
AND upon completing the form and clicking a "Submit" button in the modal, the new planetary system will be added to the database and subsequently reprint the planetary system cards so the new card will show up along with the pre-existing ones
Dev Notes
create function in foodData.js in your data folder that will use axios.post to update your Firebase database with a new food item:
Create a const systemModal function in planetSystems.js that will print a modal with or without prepopulated values for each key value pair, using a ternary function that will be shared by the "Add Data" button and "Edit" button on each card. The printed modal will populate when you click the "Add System" button on the page. Should look something along the lines of:
the addNewSystem function will then be imported and called in planetSystem.js under the function const addNewPlanetSystem which will take the values of the input form on the modal and create a new object for your database:
Create a click event listener at the bottom of const createSystemCards. The event listener will be attached to the submit button by id, and will pass the addNewPlanetSystem above on click of the "submit" button:
$('#submit').on('click', addNewPlanetSystem);
User Story
As a user, I should be able to add a Planetary System.
AC
GIVEN the user is logged in and visits the Planetary System page THEN they should see a Planetary System Module div where all the planetary systems and details are listed AND on centered over the Planetary System div will be an "Add Planetary System" button THEN when they click the button, a modal pops up where you can enter the new planetary system details AND upon completing the form and clicking a "Submit" button in the modal, the new planetary system will be added to the database and subsequently reprint the planetary system cards so the new card will show up along with the pre-existing ones
Dev Notes
const systemModal
function in planetSystems.js that will print a modal with or without prepopulated values for each key value pair, using a ternary function that will be shared by the "Add Data" button and "Edit" button on each card. The printed modal will populate when you click the "Add System" button on the page. Should look something along the lines of:const addNewPlanetSystem
which will take the values of the input form on the modal and create a new object for your database:const createSystemCards
. The event listener will be attached to the submit button by id, and will pass theaddNewPlanetSystem
above on click of the "submit" button:$('#submit').on('click', addNewPlanetSystem);