As a User when I navigate to the My Rooms page I should see all of the rooms on nice bootstrap cards
As a User I should be able to add a new room to the rooms collection
As a User I should be able to click a button that navigates me to a single-view of the room
As a User I should be able to click a button that opens a pre-populated form on a modal that allows me to edit the details of the room
As a User I should be able to click a button to delete a specific room from the collection
AC
WHEN the page loads all the rooms should be displayed on cards
THEN I should be able to click a button that opens a modal to add a new room to the collection
AND I should be able to click a button to delete a specific room
AND I should be able to press a button to edit the details of a specific room via a pre-populated modal
AND I should be able to click a button that will navigate me to a single-view of each room
Dev Notes
[ ] Create a roomData.js that imports axios and the apiKeys
[ ] Create the baseUrl variable the way we normally do
[ ] Create functions within this file that do the following things:
getRoomsByUid
getSingleRoom
postRoom
deleteRoom
export all of these functions
[ ] In the RoomContainer component set the state of plants to an empty array, then create a function called getRooms that will call the getRoomsByUid from roomData.js then set the state
[ ] Create a componentDidMount() function and call this.getRooms
[ ] inside the render make a variable called buildRoomCards that maps over the plants in state and creates `
[ ] Inside the return make a button that opens a modal form for adding a new plant
[ ] inside the return make a <div className="d-flex flex-wrap"> and them call {buildRoomCards}
[ ] Inside the MyRooms component establish the prop-types, import the roomShape
[ ] Define the props and links inside the render
[ ] Make a bootstrap list card that has a delete button at the top, displays the name of the room, Number of windows, Sun direction, and hours of sunlight
[ ] The card should also have two buttons, one that links to the single-view for the room that displays all the plants in the room and another that links to a modal for editing
User Story
As a User when I navigate to the My Rooms page I should see all of the rooms on nice bootstrap cards
As a User I should be able to add a new room to the rooms collection
As a User I should be able to click a button that navigates me to a single-view of the room
As a User I should be able to click a button that opens a pre-populated form on a modal that allows me to edit the details of the room
As a User I should be able to click a button to delete a specific room from the collection
AC
WHEN the page loads all the rooms should be displayed on cards THEN I should be able to click a button that opens a modal to add a new room to the collection AND I should be able to click a button to delete a specific room AND I should be able to press a button to edit the details of a specific room via a pre-populated modal AND I should be able to click a button that will navigate me to a single-view of each room
Dev Notes
[ ] Create a
roomData.js
that imports axios and the apiKeys[ ] Create the
baseUrl
variable the way we normally do[ ] Create functions within this file that do the following things:
getRoomsByUid
getSingleRoom
postRoom
deleteRoom
export all of these functions
[ ] In the
RoomContainer
component set the state of plants to an empty array, then create a function calledgetRooms
that will call thegetRoomsByUid
fromroomData.js
then set the state[ ] Create a
componentDidMount()
function and callthis.getRooms
[ ] inside the render make a variable called
buildRoomCards
that maps over the plants in state and creates `[ ] Inside the return make a button that opens a modal form for adding a new plant
[ ] inside the return make a
<div className="d-flex flex-wrap">
and them call{buildRoomCards}
[ ] Inside the
MyRooms
component establish the prop-types, import theroomShape
[ ] Define the props and links inside the render
[ ] Make a bootstrap list card that has a delete button at the top, displays the name of the room, Number of windows, Sun direction, and hours of sunlight
[ ] The card should also have two buttons, one that links to the single-view for the room that displays all the plants in the room and another that links to a modal for editing