-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1881 from Logflare/fix/switch-teams-prompting-403
fix: prompt user to switch teams on 403
- Loading branch information
Showing
11 changed files
with
120 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<%= render_in "error_container.html", assigns do %> | ||
<div class="col-lg-7"> | ||
<h1>403</h1> | ||
<h2 class="text-white mb-3">Forbidden</h2> | ||
<p>You may need to switch teams to access this resource</p> | ||
<ul class="list-group"> | ||
<li | ||
:for={t <- assigns[:teams] || []} | ||
class={[ | ||
"list-group-item d-flex justify-content-between align-items-center", | ||
if(t.id == @team.id, do: "active"), | ||
"tw-mx-auto tw-w-96" | ||
]} | ||
> | ||
<%= link(t.name, | ||
to: | ||
~p"/profile/switch?#{cond do | ||
t.user_id == @user.id -> %{user_id: t.user_id, redirect_to: @conn.request_path} | ||
true -> tu = Enum.find(t.team_users, &(&1.provider_uid == @user.provider_uid)) | ||
%{user_id: t.user_id, team_user_id: tu.id, redirect_to: @conn.request_path} | ||
end}" | ||
) %> | ||
<small :if={t.id == @team.id} class="badge badge-secondary badge-pill"> | ||
Current | ||
</small> | ||
</li> | ||
</ul> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters