Closed mariabrock closed 4 years ago
CREATE functionality works, but the "Add Data" button should only display when the user is logged in. Newly added data should display at the top of the page.
Add this as the first statement under addSectors
in sectors.js:
e.stopImmediatePropagation();
Move event listener to the very end of the displayAllSectors
function, as the displayAllSectors
function will be called upon login AND logout, and thus the CRUD buttons will only print after logging in:
$('#save-button').on('click', addNewSector);
User Story
As a user, I should be able to add a Planetary Sector.
AC
WHEN I click on the
Add Data
button THEN I should see a modal that has a form nested inside it AND I can enter information about a new sector AND when I click the create/save button there will be a new entry added to the databaseDev Notes
*this satisfies the
CREATE
component of C.R.U.D.Wireframe
Add Data
buttonModal and Form
for styling please reference the Imperial style guide below
the modal should be on
index.html
, and remain hidden until called for.the event listener for the
Add Data
button should look something like this:$('#sectors').on('click', '.print-sector', buildSector);
createNewSector
insectors.js
createNewSector
will add a new entry in the JSON in firebase to be accessedthe
createNewSector
function should add your new data entry to the list of sectors that can be selected