As a user, I'd like to see the available Planetary Systems when choosing mission options.
AC
GIVEN a user is on the Missions page
WHEN they click the "View Details" button on the mission
THEN they should see a "System" card with a "View Details" button
AND when they click the "View Details" button
THEN On READ, they should only be able to see the one planetary system attributed to the mission.
Dev Notes
inside the div that will pop up upon clicking the "View Details" button on each mission card, create a div with the id="systemMissions"
in planetSystem.js, create a const systemMissionCard function that will print a card to the div with the id="systemMissions", with an h2 of "Planetary Systems", a planetary system image of the planetary system attached to the mission, and a "View Details" button similar to the format pictured below. Should look something along the lines of:
then export systemMissionCard and import it into missions.js where you will create an event listener at the bottom of the function that prints all missions, which will call systemMissionCard on click of the "View Details" button of each individual mission. Should look similar to:
$(document.body).on('click', '.mission-view-details', systemMissionCard);
finally we need to create a larger card of the full Planetary System details based on targeting the planetSystemId which will be defined as the id of the "View Details" button in the systemMissionCard function above. First, inside the div that will pop up upon clicking the "View Details" button on each mission card, create a div with the id="bigSystem" that we can target and print our big card to :
Now you'll need to create an event listener at the bottom of const systemMissionCard, so that upon clicking class="view-system-details" the bigSystemCard function will be called. Should look something along the lines of:
$(document.body).on('click', '.view-system-details', bigSystemCard);
Finally we want the big card to be able to close so we can go back to the mission details, so we'll need one more event listener to call at the bottom of const systemMissionCard, that upon click of the "X" button in the top right corner of the bigSystemCard, will close out the big card, and reprint the original mission details cards:
const closeBigSystemCard = () => {
$('body').on('click', '.close-system', () => {
utilities.printToDom('bigSystemCard', '');
*insert function that prints all component cards inside the mission after clicking "View Details*
});
};
User Story
As a user, I'd like to see the available Planetary Systems when choosing mission options.
AC
GIVEN a user is on the Missions page WHEN they click the "View Details" button on the mission THEN they should see a "System" card with a "View Details" button AND when they click the "View Details" button THEN On READ, they should only be able to see the one planetary system attributed to the mission.
Dev Notes
id="systemMissions"
const systemMissionCard
function that will print a card to the div with theid="systemMissions"
, with an h2 of "Planetary Systems", a planetary system image of the planetary system attached to the mission, and a "View Details" button similar to the format pictured below. Should look something along the lines of:systemMissionCard
and import it into missions.js where you will create an event listener at the bottom of the function that prints all missions, which will callsystemMissionCard
on click of the "View Details" button of each individual mission. Should look similar to:$(document.body).on('click', '.mission-view-details', systemMissionCard);
systemMissionCard
function above. First, inside the div that will pop up upon clicking the "View Details" button on each mission card, create a div with theid="bigSystem"
that we can target and print our big card to :const systemMissionCard
, so that upon clickingclass="view-system-details"
thebigSystemCard
function will be called. Should look something along the lines of:$(document.body).on('click', '.view-system-details', bigSystemCard);
const systemMissionCard
, that upon click of the "X" button in the top right corner of thebigSystemCard
, will close out the big card, and reprint the original mission details cards: