Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Phoenix LiveView Drag-and-Drop Example #5

Merged
merged 33 commits into from
Nov 3, 2022
Merged

Commits on Oct 19, 2022

  1. Test npm i and examples

    Run the current examples with node
    Add lock package file to gitignore
    SimonLab committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    71872ab View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2022

  1. Create phoenix application

    - Create new phx app
    - Add Tailwind to the phoenix application
    SimonLab committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    c4f9743 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15114b5 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2022

  1. Downgrade Tailwind to use 3.1.8 version

    - hotreload doesn't seem to work with 3.2 so using 3.1.8
    SimonLab committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    0544367 View commit details
    Browse the repository at this point in the history
  2. Add Alpine.js

    Add alpine.js cdn in root file
    Create button using Alpine to test everything still ok
    SimonLab committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    dd85ede View commit details
    Browse the repository at this point in the history
  3. Use phx.gen.live to create items

    Create item schema using phx.gen.live
    SimonLab committed Oct 22, 2022
    Configuration menu
    Copy the full SHA
    17f712e View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2022

  1. Run formatter

    Run mix format
    SimonLab committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    63c7d80 View commit details
    Browse the repository at this point in the history
  2. Create automatically index for item

    Create index when new item created
    SimonLab committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    784ab99 View commit details
    Browse the repository at this point in the history
  3. Use Petal UI component

    Update modal form to create item
    SimonLab committed Oct 23, 2022
    Configuration menu
    Copy the full SHA
    38ccca8 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2022

  1. Update tests

    Update and remove unused tests
    SimonLab committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    01091a4 View commit details
    Browse the repository at this point in the history
  2. Implement drag and drop with vanilla js

    First attempt at drag and drop with vanilla js version
    SimonLab committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    15cd7a0 View commit details
    Browse the repository at this point in the history
  3. Create working example with js

    Drag and drop with javascript
    SimonLab committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    eeba5be View commit details
    Browse the repository at this point in the history
  4. Turn down background color

    use bg-red-100 to see moving item
    SimonLab committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    43ae038 View commit details
    Browse the repository at this point in the history
  5. Define dragstart and dragend events with alpine

    Set background color when an element is moved
    SimonLab committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    2338f73 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2022

  1. First Alpine.js drag and drop version

    Use Alpine.js to drag and drop an item in a list
    SimonLab committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    564d4ce View commit details
    Browse the repository at this point in the history
  2. Add PubSub to notify clients for new item_live

    Use PubSub to listen for the :item_created event
    SimonLab committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    62447c9 View commit details
    Browse the repository at this point in the history
  3. Use Hook to send event from client to LiveView

    When items are sorted (drag and drop finished)
    send event to the LiveView to update the indexes
    SimonLab committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    5f24e67 View commit details
    Browse the repository at this point in the history
  4. Update indexes for items

    Update indexes and notify clients of new order
    SimonLab committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    b3b4db2 View commit details
    Browse the repository at this point in the history
  5. Show drag and drop live on all clients

    - Highlight when an item is currently dragged on all clients
    - Move items on all clients
    - Update indexes
    SimonLab committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    ea93452 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2022

  1. Update tests

    Update tests to match return value from PubSub
    SimonLab committed Oct 29, 2022
    Configuration menu
    Copy the full SHA
    9595d9c View commit details
    Browse the repository at this point in the history
  2. Add initialisation documentation

    Create documentatio on how to setup
    a new Phoenix application using Tailwind, Petal components
    and Alpine.js
    SimonLab committed Oct 29, 2022
    Configuration menu
    Copy the full SHA
    589450f View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2022

  1. Add doc for creating items

    Update drag-and-drop documentation
    - Update templates to use Petal components
    - Update liveView to handle close modal event
    - Update tasks function to save index for item and order by index
    SimonLab committed Oct 30, 2022
    Configuration menu
    Copy the full SHA
    19c1f6a View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2022

  1. Add PubSub documentation

    Add doc for real time UI update when a new item is created
    SimonLab committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    ffd37a6 View commit details
    Browse the repository at this point in the history
  2. Add hightligh documentation

    Describe how to implement the hightligh for the selected items
    during drag-and-drop
    SimonLab committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    3ce989f View commit details
    Browse the repository at this point in the history
  3. Document updating indexes

    Save indexes and dispatch drag-and-drop to clients
    SimonLab committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    6ab7cbe View commit details
    Browse the repository at this point in the history
  4. Fix typos in markdown

    Fix typos
    SimonLab committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    4ac01bb View commit details
    Browse the repository at this point in the history
  5. Final check

    - remove unused Alpine.js x-daat value
    - remove console.log
    - add link in Readme to drag-and-drop.md
    SimonLab committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    163b5f9 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2022

  1. Add screenshots

    Add images to documentation
    SimonLab committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    dfcebaa View commit details
    Browse the repository at this point in the history
  2. Simplify Phoenix app setup

    Remove Tailwind and Petal Components to make the setup easier.
    SimonLab committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    ee7c2ce View commit details
    Browse the repository at this point in the history
  3. Simplify documentation

    Read again the doc and make it easier to follow/implement
    SimonLab committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    5bd6e18 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2022

  1. Update code to match the one in drag-and-drop.md

    Update Phoenix app code to match the one describe in the markdown
    documentation
    SimonLab committed Nov 2, 2022
    Configuration menu
    Copy the full SHA
    1144e64 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2022

  1. Configuration menu
    Copy the full SHA
    863a8ce View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    70d41be View commit details
    Browse the repository at this point in the history