Complete today's Kata.
Create a ipsum viewer/editor that:
- Displays a lists of ipsum's and when an ipsum is clicked, it populates a detail view with full information.
- Add an input form and button for a title that adds a new ipsum and makes it the selected item.
- BONUS: The Detail has an edit button that toggles to a form and allows editing. Includes sample text in html
(BONUS: Can you get the detail to switch to edit mode?)
Your app components should be structured as follows:
App
Header
Ipsums
AddIpsum
IpsumList
IpsumItem
Ipsum
IpsumDetail
IpsumForm
App
- Top Level Component
Header
- Logo and Title
Ipsums
- owns the "ipsum list" state (data, use your
ipsumApi
service)- adds and updates need to be done in this component!
- owns the "selected" state (initially
null
) - passes
IpsumList
list ofipsums
and a callback function,onSelect
- passes
AddIpsum
a callback functiononAdd
- passes
Ipsum
theipsum
(it'sselected
data) and anonUpdate
callback
- owns the "ipsum list" state (data, use your
IpsumList
- calls the passed
onSelect
when an ipsum is selected, passing the corresponding object to theonSelect
function - show name and category
- calls the passed
IpsumForm
- Form for creating or updating an
ipsum
- gets passed an
onAdd
callback called for add and edit when form submitted - gets passed the
ipsum
if updating - Has own state for managing data being updated (copy in data function when editing)
- Only show "cancel" button when updating. Calls
onCancel
when cancel button clicked
- Form for creating or updating an
Ipsum
- Container for switching between viewer and editor (form)
- Has "editing" state (data)
- If
ipsum
isnull
displays message to make a selection - Passes IpsumDetail the
ipsum
for display - Passes IpsumForm the
ipsum
to edit, aonCancel
callback function, and theonUpdate
fromIpsums
IpsumDetail
- gets passed the
ipsum
- gets passed the
Work through the tasks incrementally:
- Design List
- Implement List
- Design Detail View
- Implement Detail View and Wire to Selected
- Design Form for Adding
- Implement Form for Adding and Wire to push into data
- Add Toggle to Detail View to Show Form
- BONUS: Modify Form to Handle Edits (and Cancels)
Include npm
test
script that runs npm run lint
- Follows prescribed project and component structure and organization 1pt
- Ipsum list 2pt
- Shows selected detail view 3pts
- Switch edit/view modes (including cancel and post-update) BONUS
- Add Ipsum 2pt
- Edit Form BONUS
- Updates Ipsum BONUS
- Integration: Feature/Functionality correct/works 2pts