From 85e98a04a5f8e2c1aa8ba1cac092432749e422c2 Mon Sep 17 00:00:00 2001 From: josemigallas Date: Tue, 15 Oct 2024 09:51:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=8B=20implements=20empty=20state=20in?= =?UTF-8?q?=20Invitations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/account/invitations/index.html.erb | 92 ++++++++++--------- config/locales/en.yml | 5 + 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/app/views/provider/admin/account/invitations/index.html.erb b/app/views/provider/admin/account/invitations/index.html.erb index dfd134bb2b..838f9dc004 100644 --- a/app/views/provider/admin/account/invitations/index.html.erb +++ b/app/views/provider/admin/account/invitations/index.html.erb @@ -6,49 +6,57 @@ <%= stylesheet_packs_chunks_tag 'table_toolbar' %> <% end %> - - - - - - - - - +<% if @invitations.total_entries.zero? %> + <%= render partial: 'shared/empty_state', locals: { icon: 'plus-circle', + title: t('.empty_state_title'), + body: t('.empty_state_body'), + primary: { title: t('.empty_state_primary_title'), + href: new_provider_admin_account_invitation_path } } %> +<% else %> +
RecipientSentAccepted? - <% if can?(:create, Invitation) and can?(:see, :multiple_users) %> - <%= link_to_unless_current 'Invite a New Team Member', new_provider_admin_account_invitation_path, :class => 'action add' %> - <% end %> -
+ + + + + + + + - - <% @invitations.each do |invitation| %> - - - - - + <% @invitations.each do |invitation| %> + + + + + - - <% end %> - -
RecipientSentAccepted? + <% if can?(:create, Invitation) and can?(:see, :multiple_users) %> + <%= link_to_unless_current 'Invite a New Team Member', new_provider_admin_account_invitation_path, :class => 'action add' %> + <% end %> +
<%= h invitation.email %><%= invitation_sent_date(invitation) %><%= invitation_status(invitation) %> -
-
-
- <% if can? :manage, invitation %> -
- <% unless invitation.accepted? -%> - <%= fancy_link_to("Resend", resend_provider_admin_account_invitation_path(invitation), {:method => :put, :class => 'refresh', "data-id" => invitation.id}) %> - <% end -%> -
- <% end -%> - <% if can? :manage, invitation %> -
- <%= delete_link_for provider_admin_account_invitation_path(invitation), data: { confirm: 'Are you sure you want to delete this invitation?' } %> -
- <% end %> +
<%= h invitation.email %><%= invitation_sent_date(invitation) %><%= invitation_status(invitation) %> +
+
+
+ <% if can? :manage, invitation %> +
+ <% unless invitation.accepted? -%> + <%= fancy_link_to("Resend", resend_provider_admin_account_invitation_path(invitation), {:method => :put, :class => 'refresh', "data-id" => invitation.id}) %> + <% end -%> +
+ <% end -%> + <% if can? :manage, invitation %> +
+ <%= delete_link_for provider_admin_account_invitation_path(invitation), data: { confirm: 'Are you sure you want to delete this invitation?' } %> +
+ <% end %> +
- -
+ + + <% end %> + + -<%= will_paginate @invitations %> + <%= will_paginate @invitations %> +<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ba2efa982a..bb0e102a8b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -403,6 +403,11 @@ en: admin: account: + invitations: + index: + empty_state_title: No invitations + empty_state_body: To add new members to your team, send them an invitation to join. + empty_state_primary_title: Invite a team member users: form: submit_button_label: 'Update User'