Fix membership role action and checks under Site Settings > People (#4910)

This commit is contained in:
Adrian Gruntkowski 2024-12-16 19:09:42 +01:00 committed by GitHub
parent 7f3e91e1cc
commit 2938936c4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -127,7 +127,7 @@
:update_role_by_user, :update_role_by_user,
@site.domain, @site.domain,
membership.user.id, membership.user.id,
"admin" "editor"
) )
} }
method="put" method="put"
@ -142,7 +142,7 @@
</p> </p>
</div> </div>
<%= if membership.role == :admin do %> <%= if membership.role == "admin" do %>
<span class="text-indigo-500 group-hover:text-white"> <span class="text-indigo-500 group-hover:text-white">
<svg <svg
class="h-5 w-5" class="h-5 w-5"
@ -182,7 +182,7 @@
</p> </p>
</div> </div>
<%= if membership.role == :viewer do %> <%= if membership.role == "viewer" do %>
<span class="text-indigo-500 group-hover:text-white"> <span class="text-indigo-500 group-hover:text-white">
<svg <svg
class="h-5 w-5" class="h-5 w-5"

View File

@ -68,7 +68,7 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
conn = conn =
post(conn, "/sites/#{site.domain}/memberships/invite", %{ post(conn, "/sites/#{site.domain}/memberships/invite", %{
email: "john.doe@example.com", email: "john.doe@example.com",
role: "admin" role: "editor"
}) })
assert html_response(conn, 200) =~ assert html_response(conn, 200) =~
@ -82,7 +82,7 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
conn = conn =
post(conn, "/sites/#{site.domain}/memberships/invite", %{ post(conn, "/sites/#{site.domain}/memberships/invite", %{
email: "john.doe@example.com", email: "john.doe@example.com",
role: "admin" role: "editor"
}) })
assert conn.status == 404 assert conn.status == 404
@ -164,7 +164,7 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
conn = conn =
post(conn, "/sites/#{site.domain}/memberships/invite", %{ post(conn, "/sites/#{site.domain}/memberships/invite", %{
email: second_member.email, email: second_member.email,
role: "admin" role: "editor"
}) })
assert html_response(conn, 200) =~ assert html_response(conn, 200) =~