Skip to content

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo0807 committed Jun 21, 2024
2 parents b7198bd + 4c878a1 commit 1dd6cb1
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 103 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: CI
on:
workflow_dispatch:
push:
pull_request:
branches:
- main
- develop
release:
types: [published]

Expand Down
1 change: 0 additions & 1 deletion demo/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ defmodule Demo.MixProject do
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.1"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.2"},
{:phoenix_live_view, "~> 0.20.0"},
{:phoenix_live_dashboard, "~> 0.8"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
Expand Down
17 changes: 9 additions & 8 deletions demo/mix.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"gettext": "mix gettext.extract --merge"
},
"devDependencies": {
"@sentry/browser": "^8.9.2",
"@sentry/browser": "^8.10.0",
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.13",
"alpinejs": "^3.14.0",
"alpinejs": "^3.14.1",
"esbuild": "^0.21.5",
"lodash": "^4.17.21",
"npm-run-all": "^4.1.5",
Expand Down
148 changes: 74 additions & 74 deletions demo/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -267,76 +267,76 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@sentry-internal/browser-utils@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-8.9.2.tgz#36b077fcb1a4ee8f2ed67437b2d9030c4e9e7586"
integrity sha512-2A0A6TnfzFDvYCRWS9My3t+JKG6KlslhyaN35BTiOTlYDauEekyJP7BFFyeTJXCHm2BQgI8aRZhBKm+oR9QuYw==
dependencies:
"@sentry/core" "8.9.2"
"@sentry/types" "8.9.2"
"@sentry/utils" "8.9.2"

"@sentry-internal/feedback@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-8.9.2.tgz#0afa4c630820b49125ad4b9ad2b38db10de81134"
integrity sha512-v04Q+08ohwautwmiDfK5hI+nFW2B/IYhBz7pZM9x1srkwmNA69XOFyo5u34TeVHhYOPbMM2Ubs0uNEcSWHgbbQ==
dependencies:
"@sentry/core" "8.9.2"
"@sentry/types" "8.9.2"
"@sentry/utils" "8.9.2"

"@sentry-internal/replay-canvas@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-8.9.2.tgz#76ff2302f7dd6e3870a34b656e6b9b34e9275c18"
integrity sha512-vu9TssSjO+XbZjnoyYxMrBI4KgXG+zyqw3ThfPqG6o7O0BGa54fFwtZiMdGq/BHz017FuNiEz4fgtzuDd4gZJQ==
dependencies:
"@sentry-internal/replay" "8.9.2"
"@sentry/core" "8.9.2"
"@sentry/types" "8.9.2"
"@sentry/utils" "8.9.2"

"@sentry-internal/replay@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-8.9.2.tgz#35460590a4be71ba050fd49de95e3f8b0f27e50f"
integrity sha512-YPnrnXJd6mJpJspJ8pI8hd1KTMOxw+BARP5twiDwXlij1RTotwnNoX9UGaSm+ZPTexPD++6Zyp6xQf4vKKP3yg==
dependencies:
"@sentry-internal/browser-utils" "8.9.2"
"@sentry/core" "8.9.2"
"@sentry/types" "8.9.2"
"@sentry/utils" "8.9.2"

"@sentry/browser@^8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-8.9.2.tgz#4cfd63449f0038718b5435a4537f3d11123a396b"
integrity sha512-jI5XY4j8Sa+YteokI+4SW+A/ErZxPDnspjvV3dm5pIPWvEFhvDyXWZSepqaoqwo3L7fdkRMzXY8Bi4T7qDVMWg==
dependencies:
"@sentry-internal/browser-utils" "8.9.2"
"@sentry-internal/feedback" "8.9.2"
"@sentry-internal/replay" "8.9.2"
"@sentry-internal/replay-canvas" "8.9.2"
"@sentry/core" "8.9.2"
"@sentry/types" "8.9.2"
"@sentry/utils" "8.9.2"

"@sentry/core@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.9.2.tgz#af0f2ec25b88da5467cf327d2ffcd555323c30e6"
integrity sha512-ixm8NISFlPlEo3FjSaqmq4nnd13BRHoafwJ5MG+okCz6BKGZ1SexEggP42/QpGvDprUUHnfncG6WUMgcarr1zA==
dependencies:
"@sentry/types" "8.9.2"
"@sentry/utils" "8.9.2"

"@sentry/types@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.9.2.tgz#d143383fc35552d9f153042cc6d56c5ee8ec2fa6"
integrity sha512-+LFOyQGl+zk5SZRGZD2MEURf7i5RHgP/mt3s85Rza+vz8M211WJ0YsjkIGUJFSY842nged5QLx4JysLaBlLymg==

"@sentry/utils@8.9.2":
version "8.9.2"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.9.2.tgz#58b003d9c1302f61192e7c99ea42bf1cd5cad7f7"
integrity sha512-A4srR9mEBFdVXwSEKjQ94msUbVkMr8JeFiEj9ouOFORw/Y/ux/WV2bWVD/ZI9wq0TcTNK8L1wBgU8UMS5lIq3A==
dependencies:
"@sentry/types" "8.9.2"
"@sentry-internal/browser-utils@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-8.10.0.tgz#a4a2384d14152593402bded19c068ba5d95a7a9a"
integrity sha512-Hdqv8KfQDCj7H92ft2walDwCiyaTxgegHnR4ZtCI8NQR0hqdU/PzIKashTwc+Ho6OAQtdy/HNqhcHEznuBNW3A==
dependencies:
"@sentry/core" "8.10.0"
"@sentry/types" "8.10.0"
"@sentry/utils" "8.10.0"

"@sentry-internal/feedback@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-8.10.0.tgz#31afdc59be6a500eadebcc4603e0ebec7942cd16"
integrity sha512-pzc4s5X6wvY0BMQBFAMObQBjRKiKzoF2APD5H5eBcxkX8deIykjm8VC8mgpVpxYm6mfjytvgpZyPpZ6KgpRt9Q==
dependencies:
"@sentry/core" "8.10.0"
"@sentry/types" "8.10.0"
"@sentry/utils" "8.10.0"

"@sentry-internal/replay-canvas@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-8.10.0.tgz#a1ac59d13ff12d497e7eea0727c488a572772941"
integrity sha512-M4yM8ZqtsW1wER7jNpGq019jmhn/RkcmdIyWksRpBSvRppZRf0yR9dbVhdO/oBL8DB3fDTbv8Qtd/oXlkj/i+Q==
dependencies:
"@sentry-internal/replay" "8.10.0"
"@sentry/core" "8.10.0"
"@sentry/types" "8.10.0"
"@sentry/utils" "8.10.0"

"@sentry-internal/replay@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-8.10.0.tgz#05be6548ffe3e8497a9efc4bf65be2ad0ab85ff6"
integrity sha512-MISdD0Q0sVcQELHbYSH5SuKHlrI8RFvmU6aNcjWEoKxhd4Vzr126h98naVPoo7WOOI0e7Fd0Lrn/59wNI4AJxQ==
dependencies:
"@sentry-internal/browser-utils" "8.10.0"
"@sentry/core" "8.10.0"
"@sentry/types" "8.10.0"
"@sentry/utils" "8.10.0"

"@sentry/browser@^8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-8.10.0.tgz#ccf42a70d72edb58cc7d1030fd4d4bcc7b2bf999"
integrity sha512-6yGax6vUNV28cANMJCTrLFrGTvvgC0h4k+lzjrgstCf1k+CNQmodXDyWcRzbL4im5DTH4jF74ZAYpqrptloxJw==
dependencies:
"@sentry-internal/browser-utils" "8.10.0"
"@sentry-internal/feedback" "8.10.0"
"@sentry-internal/replay" "8.10.0"
"@sentry-internal/replay-canvas" "8.10.0"
"@sentry/core" "8.10.0"
"@sentry/types" "8.10.0"
"@sentry/utils" "8.10.0"

"@sentry/core@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.10.0.tgz#033661288a5ac9f4e6cd7583cf068bec4403dbe0"
integrity sha512-NzrFqYsEHMd4TYYYxOvf+f+Z02u0nt12cIYYN9pOM3xBLKR+ORs7jhVnN0cB/H2yqtmtBaIzSehk/M/qUXFJGw==
dependencies:
"@sentry/types" "8.10.0"
"@sentry/utils" "8.10.0"

"@sentry/types@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.10.0.tgz#47119cb121cba38cc3654e7b79ac9014235132a9"
integrity sha512-6kgh6NqgQHcnnD7dOe3THcVkzv2nor/f94x3odmPShN2AWBfPRprHZZsLTjh/3aC7l76V2nfuQ4wgRvwsddTWw==

"@sentry/utils@8.10.0":
version "8.10.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.10.0.tgz#0947188bafdd343fffd9554de3604fdde4818ff7"
integrity sha512-tQPgB7lX1XqbEw2EXvWNsBQlmG+yJHVhBKKDPy5HZMjuTP3zlpVdP6NF87qwonmdtFNHxdrKbfOVRiLx71/JwA==
dependencies:
"@sentry/types" "8.10.0"

"@tailwindcss/forms@^0.5.7":
version "0.5.7"
Expand Down Expand Up @@ -412,10 +412,10 @@ ajv@^8.0.1:
require-from-string "^2.0.2"
uri-js "^4.2.2"

alpinejs@^3.14.0:
version "3.14.0"
resolved "https://registry.yarnpkg.com/alpinejs/-/alpinejs-3.14.0.tgz#f882fa6dcd524f30f2383949d2c0ed2fdb0c9750"
integrity sha512-YCWF95PMJqePe9ll6KMyDt/nLhh2R7RhqBf4loEmLzIskcHque4Br/9UgAa6cw13H0Cm3FM9e1hzDwP5z5wlDA==
alpinejs@^3.14.1:
version "3.14.1"
resolved "https://registry.yarnpkg.com/alpinejs/-/alpinejs-3.14.1.tgz#549e056c3b75e57c0f23076a13cde09da684ba0a"
integrity sha512-ICar8UsnRZAYvv/fCNfNeKMXNoXGUfwHrjx7LqXd08zIP95G2d9bAOuaL97re+1mgt/HojqHsfdOLo/A5LuWgQ==
dependencies:
"@vue/reactivity" "~3.1.1"

Expand Down
4 changes: 2 additions & 2 deletions lib/backpex/fields/has_many_through.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ defmodule Backpex.Fields.HasManyThrough do

import Ecto.Query
import Backpex.HTML.Layout, only: [modal: 1]
import Phoenix.HTML.Form, only: [inputs_for: 2, hidden_inputs_for: 1]
import PhoenixHTMLHelpers.Form, only: [hidden_inputs_for: 1]

alias Backpex.LiveResource
alias Ecto.Changeset
Expand Down Expand Up @@ -504,7 +504,7 @@ defmodule Backpex.Fields.HasManyThrough do
|> Enum.map(& &1.data.id)
end

inputs_for(form, association.pivot.field)
form.impl.to_form(form.source, form, association.pivot.field, [])
|> Enum.filter(fn item ->
!Enum.member?(deleted_ids, item.data.id)
end)
Expand Down
10 changes: 5 additions & 5 deletions lib/backpex/html/layout.ex
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ defmodule Backpex.HTML.Layout do
@doc type: :component
attr(:flash, :map,
required: true,
doc: "flash map that will be passed to `Phoenix.LiveView.Helpers.live_flash/2`"
doc: "flash map that will be passed to `Phoenix.Flash.get/2`"
)

def flash_messages(assigns) do
~H"""
<div
:if={live_flash(@flash, :info) && live_flash(@flash, :info) != ""}
:if={Phoenix.Flash.get(@flash, :info) && Phoenix.Flash.get(@flash, :info) != ""}
class="alert my-4 bg-blue-100 text-sm text-blue-800"
phx-value-key="info"
>
<Heroicons.information_circle class="h-5 w-5" />
<span>
<%= live_flash(@flash, :info) %>
<%= Phoenix.Flash.get(@flash, :info) %>
</span>
<div>
<button
Expand All @@ -153,13 +153,13 @@ defmodule Backpex.HTML.Layout do
</div>
<div
:if={live_flash(@flash, :error) && live_flash(@flash, :error) != ""}
:if={Phoenix.Flash.get(@flash, :error) && Phoenix.Flash.get(@flash, :error) != ""}
class="alert my-4 bg-red-100 text-sm text-red-800"
phx-value-key="error"
>
<Heroicons.x_circle class="h-5 w-5" />
<span>
<%= live_flash(@flash, :error) %>
<%= Phoenix.Flash.get(@flash, :error) %>
</span>
<div>
<button
Expand Down
2 changes: 1 addition & 1 deletion lib/backpex/live_components/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ defmodule Backpex.FormComponent do
socket
|> assign(:show_form_errors, false)
|> put_flash_message(result)
|> push_redirect(to: return_to)
|> push_navigate(to: return_to)

{:noreply, socket}

Expand Down
2 changes: 1 addition & 1 deletion lib/backpex/live_resource.ex
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ defmodule Backpex.LiveResource do
# redirect with updated query options
options = Map.put(query_options, :filters, default_filter_options)
to = Router.get_path(socket, __MODULE__, params, :index, options)
push_redirect(socket, to: to)
push_navigate(socket, to: to)
else
socket
end
Expand Down
4 changes: 2 additions & 2 deletions lib/backpex/resource.ex
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ defmodule Backpex.Resource do
* `action` (optional, default `:validate`): An atom indicating the action to be performed on the changeset.
"""
def change(item, attrs, changeset_function, assigns, assocs \\ [], target \\ nil, action \\ :validate) do
item
|> LiveResource.call_changeset_function(changeset_function, attrs, assigns, target)
Ecto.Changeset.change(item)
|> put_assocs(assocs)
|> LiveResource.call_changeset_function(changeset_function, attrs, assigns, target)
|> Map.put(:action, action)
end

Expand Down
5 changes: 3 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Backpex.MixProject do
use Mix.Project

@version "0.3.2"
@version "0.4.0"
@source_url "https://github.com/naymspace/backpex"

def project do
Expand Down Expand Up @@ -36,7 +36,8 @@ defmodule Backpex.MixProject do
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.0"},
{:phoenix_html, "~> 4.1.1"},
{:phoenix_html_helpers, "~> 1.0"},
{:phoenix_live_view, "~> 0.20.0"},
{:floki, ">= 0.30.0"},
{:gettext, "~> 0.18"},
Expand Down
Loading

0 comments on commit 1dd6cb1

Please sign in to comment.