fix(portal): Fix minor UI issues on API Clients show page (#6955)

- Updated revoke button colors and icons.
- Updated the 'Created By' to use a helper function to get an email
address rather than using the provider_identifier which may be a random
string depending on the type of provider the identity was created under.
- Added a link to the actor that created the API token

### Screenshot of updated view
<img width="1168" alt="Screenshot 2024-10-07 at 1 11 43 PM"
src="https://github.com/user-attachments/assets/80444815-f045-49db-b570-dc9dc58c33d2">

Closes #6269
This commit is contained in:
Brian Manifold
2024-10-08 07:40:40 -07:00
committed by GitHub
parent 42f6106527
commit 928fab3878

View File

@@ -134,8 +134,8 @@ defmodule Web.Settings.ApiClients.Show do
<:action :if={Actors.actor_active?(@actor)}>
<.button_with_confirmation
id="revoke_all_tokens"
style="warning"
icon="hero-lock-open"
style="danger"
icon="hero-trash"
on_confirm="revoke_all_tokens"
>
<:dialog_title>Revoke all API Client Tokens</:dialog_title>
@@ -169,7 +169,12 @@ defmodule Web.Settings.ApiClients.Show do
<%= Cldr.DateTime.Formatter.date(token.expires_at, 1, "en", Web.CLDR, []) %>
</:col>
<:col :let={token} label="created by">
<%= token.created_by_identity.provider_identifier %>
<.link
class={[link_style()]}
navigate={~p"/#{@account}/actors/#{token.created_by_actor_id}"}
>
<%= get_identity_email(token.created_by_identity) %>
</.link>
</:col>
<:col :let={token} label="last used">
<.relative_datetime datetime={token.last_seen_at} />
@@ -180,7 +185,7 @@ defmodule Web.Settings.ApiClients.Show do
<:action :let={token}>
<.button_with_confirmation
id={"revoke_token_#{token.id}"}
style="warning"
style="danger"
icon="hero-trash-solid"
on_confirm="revoke_token"
on_confirm_id={token.id}