Skip to content

Latest commit

 

History

History
91 lines (73 loc) · 2.83 KB

LAB.md

File metadata and controls

91 lines (73 loc) · 2.83 KB

Lorem Ipsum Master Detail

Code Wars Challenge

Complete today's Kata.

Lab

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?)

Components

Your app components should be structured as follows:

App
  Header
  Ipsums
    AddIpsum
    IpsumList
        IpsumItem
    Ipsum
        IpsumDetail
        IpsumForm

Component Details

  • 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 of ipsums and a callback function, onSelect
    • passes AddIpsum a callback function onAdd
    • passes Ipsum the ipsum (it's selected data) and an onUpdate callback
  • IpsumList
    • calls the passed onSelect when an ipsum is selected, passing the corresponding object to the onSelect function
    • show name and category
  • 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
  • Ipsum
    • Container for switching between viewer and editor (form)
    • Has "editing" state (data)
    • If ipsum is null displays message to make a selection
    • Passes IpsumDetail the ipsum for display
    • Passes IpsumForm the ipsum to edit, a onCancel callback function, and the onUpdate from Ipsums
  • IpsumDetail
    • gets passed the ipsum

Commits

Work through the tasks incrementally:

  1. Design List
  2. Implement List
  3. Design Detail View
  4. Implement Detail View and Wire to Selected
  5. Design Form for Adding
  6. Implement Form for Adding and Wire to push into data
  7. Add Toggle to Detail View to Show Form
  8. BONUS: Modify Form to Handle Edits (and Cancels)

Build

Include npm test script that runs npm run lint

Rubric

  • 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