Skip to content

Commit

Permalink
Finish Orders for Admin and Customers (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
marka2g authored Sep 12, 2023
1 parent 4e6685f commit 8afa0a4
Show file tree
Hide file tree
Showing 32 changed files with 4,490 additions and 63 deletions.
2 changes: 2 additions & 0 deletions .iex.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ alias BikeShop.Carts
alias BikeShop.Carts.Core.HandleCarts
alias BikeShop.Carts.Data.Cart
alias BikeShop.Carts.Server.CartSessionServer
alias BikeShop.Orders
alias BikeShop.Orders.Order
alias BikeShopWeb.Middleware.CartSession
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ __Demo BikeShop Built with Phoenix LiveView__
>2. [dialyxir](https://github.com/jeremyjh/dialyxir) - elixir dialyxir
>3. [excoveralls](https://github.com/parroty/excoveralls) - code coverage tool
>4. [mix_test_watch](https://github.com/lpil/mix-test.watch) - continuous test runner
>5. [libcluster](https://github.com/bitwalker/libcluster) - provides a mechanism for automatically forming clusters of Erlang nodes
>5. [libcluster](https://github.com/bitwalker/libcluster) - provides a mechanism for automatically forming clusters of Erlang nodes

## ToDo

-[ ] cart icon quantity - `handle_info` update cart isn't working. may need pub/sub
6 changes: 2 additions & 4 deletions assets/js/hooks.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import CartSession from "./hooks/cartSession";
// import LoadMoreProducts from "./hooks/loadMoreProducts";
// import Drag from "./hooks/drag";
import Drag from "./hooks/drag";

let Hooks = {
CartSession: CartSession,
// LoadMoreProducts: LoadMoreProducts,
// Drag: Drag,
Drag: Drag,
};

export default Hooks;
23 changes: 23 additions & 0 deletions assets/js/hooks/drag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Sortable from "../../vendor/sortable";

const Drag = {
mounted() {
const hook = this;
const selector = "#" + hook.el.id;
const el = document.getElementById(hook.el.id);

new Sortable(el, {
group: "shared",
draggable: ".draggable",
onEnd: function (evt) {
hook.pushEventTo(selector, "dropped", {
old_status: evt.from.id,
new_status: evt.to.id,
order_id: evt.item.id,
});
},
});
},
};

export default Drag;
Loading

0 comments on commit 8afa0a4

Please sign in to comment.