mirror of
https://github.com/we-promise/sure.git
synced 2026-09-05 23:01:26 +00:00
* fix(ds): resolve remaining DS Drift findings from #1951 Migrate admin users family rows to DS::Disclosure and invitation delete to DS::Button. Drop redundant profile group i18n default: fallbacks. Closes #1951 Co-authored-by: Cursor <cursoragent@cursor.com> * fix(a11y): keep DS::Disclosure focus-ring on admin family rows summary_class overrides the :bare default, so include focus-ring explicitly to preserve keyboard focus styling per DS Rule 4. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
271aa756b8
commit
85cddbbd0b
@@ -51,10 +51,16 @@
|
||||
<div class="space-y-4">
|
||||
<% @families_with_users.each do |family, users| %>
|
||||
<% pending_invitations = @invitations_by_family[family.id] || [] %>
|
||||
<details class="bg-container-inset rounded-lg overflow-hidden group"
|
||||
data-controller="admin-invitation-delete"
|
||||
data-admin-invitation-delete-delete-all-label-value="<%= t(".invitations.delete_all") %>">
|
||||
<summary class="flex items-center justify-between gap-4 px-4 py-3 cursor-pointer select-none hover:bg-surface-hover">
|
||||
<%= render DS::Disclosure.new(
|
||||
variant: :bare,
|
||||
summary_class: "list-none focus-ring flex items-center justify-between gap-4 px-4 py-3 cursor-pointer select-none hover:bg-surface-hover",
|
||||
class: "bg-container-inset rounded-lg overflow-hidden",
|
||||
data: {
|
||||
controller: "admin-invitation-delete",
|
||||
admin_invitation_delete_delete_all_label_value: t(".invitations.delete_all")
|
||||
}
|
||||
) do |disclosure| %>
|
||||
<% disclosure.with_summary_content do %>
|
||||
<div class="flex items-center gap-3">
|
||||
<%= icon "users", class: "w-5 h-5 text-secondary shrink-0" %>
|
||||
<div>
|
||||
@@ -80,7 +86,7 @@
|
||||
<% end %>
|
||||
<%= icon "chevron-down", class: "w-4 h-4 text-secondary transition-transform group-open:rotate-180" %>
|
||||
</div>
|
||||
</summary>
|
||||
<% end %>
|
||||
|
||||
<div class="border-t border-primary">
|
||||
<table class="w-full">
|
||||
@@ -154,12 +160,16 @@
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<%= form_with url: admin_invitation_path(invitation), method: :delete, class: "inline" do |f| %>
|
||||
<button type="submit"
|
||||
data-admin-invitation-delete-target="button"
|
||||
data-action="click->admin-invitation-delete#handleClick"
|
||||
class="text-sm text-destructive border border-destructive rounded-lg px-2 py-1 hover:bg-destructive/10 transition-colors">
|
||||
<%= t(".invitations.delete") %>
|
||||
</button>
|
||||
<%= render DS::Button.new(
|
||||
text: t(".invitations.delete"),
|
||||
type: "submit",
|
||||
variant: :outline_destructive,
|
||||
size: :sm,
|
||||
data: {
|
||||
admin_invitation_delete_target: "button",
|
||||
action: "click->admin-invitation-delete#handleClick"
|
||||
}
|
||||
) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -174,7 +184,7 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</details>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
<% end %>
|
||||
|
||||
<% unless Current.user.ui_layout_intro? %>
|
||||
<%= settings_section title: Current.family&.moniker == "Group" ? t(".group_title", default: "Group") : t(".household_title"), subtitle: t(".household_subtitle", moniker_plural: family_moniker_plural_downcase, moniker: family_moniker_downcase) do %>
|
||||
<%= settings_section title: Current.family&.moniker == "Group" ? t(".group_title") : t(".household_title"), subtitle: t(".household_subtitle", moniker_plural: family_moniker_plural_downcase, moniker: family_moniker_downcase) do %>
|
||||
<div class="space-y-4">
|
||||
<%= styled_form_with model: Current.user, class: "space-y-4", data: { controller: "auto-submit-form" } do |form| %>
|
||||
<%= form.fields_for :family do |family_fields| %>
|
||||
<% name_label = Current.family&.moniker == "Group" ? t(".group_form_label", default: "Group name") : t(".household_form_label") %>
|
||||
<% name_placeholder = Current.family&.moniker == "Group" ? t(".group_form_input_placeholder", default: "Enter group name") : t(".household_form_input_placeholder") %>
|
||||
<% name_label = Current.family&.moniker == "Group" ? t(".group_form_label") : t(".household_form_label") %>
|
||||
<% name_placeholder = Current.family&.moniker == "Group" ? t(".group_form_input_placeholder") : t(".household_form_input_placeholder") %>
|
||||
<%= family_fields.text_field :name,
|
||||
placeholder: name_placeholder,
|
||||
label: name_label,
|
||||
|
||||
Reference in New Issue
Block a user