From f6cba707941fd2aaa63be5f263b3c381799a7538 Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Sat, 29 Jun 2024 11:40:54 +0530 Subject: [PATCH 01/21] moved three dots icon from component to html.erb Only one dropdown button were using three dots icons hence it is better to put it on block of component from html.erb. --- app/components/dropdown_menu_component.html.erb | 5 ----- app/views/casa_org/_contact_topics.html.erb | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/components/dropdown_menu_component.html.erb b/app/components/dropdown_menu_component.html.erb index d8d3f1a1c2..06873dbb94 100644 --- a/app/components/dropdown_menu_component.html.erb +++ b/app/components/dropdown_menu_component.html.erb @@ -2,11 +2,6 @@ diff --git a/app/views/casa_org/_contact_topics.html.erb b/app/views/casa_org/_contact_topics.html.erb index 747435379f..a25b86b2ea 100644 --- a/app/views/casa_org/_contact_topics.html.erb +++ b/app/views/casa_org/_contact_topics.html.erb @@ -37,7 +37,14 @@ <%= contact_topic.active ? "Yes" : "No" %> - <%= render(DropdownMenuComponent.new(menu_title: "Actions Menu", hide_label: true)) do %> + <%= render(DropdownMenuComponent.new(menu_title: "Actions Menu", hide_label: true)) do |component| %> + <% component.with_icon do %> + + <%= "Actions Menu" %> + + + <% end %> +
  • <%= link_to "Edit", edit_contact_topic_path(contact_topic), class: "dropdown-item" %>
  • <%= render(Modal::OpenLinkComponent.new(text: "Delete", target: id, klass: "dropdown-item")) %>
  • <% end %> From 5db3caf649de8bddf6c55fe11c1b98b6d49de597 Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Sat, 29 Jun 2024 11:50:14 +0530 Subject: [PATCH 02/21] updated: button css classes added to dropdown as variable display: flex and align-items: center added to style to align items of button horizontally. button_class variable added to dropdown component to dynamically change css properties of button like background color --- app/components/dropdown_menu_component.html.erb | 2 +- app/components/dropdown_menu_component.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/dropdown_menu_component.html.erb b/app/components/dropdown_menu_component.html.erb index 06873dbb94..bc6c00aa11 100644 --- a/app/components/dropdown_menu_component.html.erb +++ b/app/components/dropdown_menu_component.html.erb @@ -1,5 +1,5 @@ + <% end %> <% if policy(Supervisor).create? %> From 130bbc84ea05b9a307b6a1de4f05c9e8d509aba1 Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Sat, 29 Jun 2024 12:04:53 +0530 Subject: [PATCH 04/21] action menu dropdown button replaced with component --- app/views/volunteers/index.html.erb | 31 ++++++++++++----------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/app/views/volunteers/index.html.erb b/app/views/volunteers/index.html.erb index b90f53baa8..5af8ab140e 100644 --- a/app/views/volunteers/index.html.erb +++ b/app/views/volunteers/index.html.erb @@ -54,25 +54,20 @@ <% end %> - From 957dc23147c665e93972c549b60b2d445a7d104a Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Sun, 30 Jun 2024 01:44:08 +0530 Subject: [PATCH 09/21] minor fix --- app/views/volunteers/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/volunteers/index.html.erb b/app/views/volunteers/index.html.erb index d36ed9f48e..9f1b0d3574 100644 --- a/app/views/volunteers/index.html.erb +++ b/app/views/volunteers/index.html.erb @@ -49,7 +49,7 @@ <% end %> <% end %> - <%= render(DropdownMenuComponent.new(menu_title: "Actions Menu", klass: "pull-left mx-2 my-1 status-options")) do %> + <%= render(DropdownMenuComponent.new(menu_title: "Status", klass: "pull-left mx-2 my-1 status-options")) do %> From 951129208abffbd06885a69a7c551914b2eecf5f Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Fri, 5 Jul 2024 12:42:20 +0530 Subject: [PATCH 16/21] 'occurred at' dropdown button replaced with component --- app/views/reimbursements/index.html.erb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/reimbursements/index.html.erb b/app/views/reimbursements/index.html.erb index 0b584a4755..f4881b3eb0 100644 --- a/app/views/reimbursements/index.html.erb +++ b/app/views/reimbursements/index.html.erb @@ -36,9 +36,8 @@ - From 68aff5a2c689f78272d0129d0a996735e16b7ba2 Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Fri, 5 Jul 2024 12:42:33 +0530 Subject: [PATCH 17/21] margin right added to span --- app/components/dropdown_menu_component.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/dropdown_menu_component.rb b/app/components/dropdown_menu_component.rb index 54c6b7713d..095fda7583 100644 --- a/app/components/dropdown_menu_component.rb +++ b/app/components/dropdown_menu_component.rb @@ -27,6 +27,6 @@ def render? end def button_label - content_tag(:span, @menu_title, class: @hide_label ? "sr-only" : nil) + content_tag(:span, @menu_title, class: @hide_label ? "sr-only" : "mr-5") end end From 8fb7d625050ef3c14f14dbd66a5c5335d79d49a7 Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Fri, 12 Jul 2024 14:42:46 +0530 Subject: [PATCH 18/21] spec fixed for dropdown menu component --- spec/components/dropdown_menu_component_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/components/dropdown_menu_component_spec.rb b/spec/components/dropdown_menu_component_spec.rb index 64f6ad7636..6a55665c75 100644 --- a/spec/components/dropdown_menu_component_spec.rb +++ b/spec/components/dropdown_menu_component_spec.rb @@ -25,8 +25,7 @@ render_inline(DropdownMenuComponent.new(menu_title: "Example Title")) { "Example Item" } expect(page).to have_css("div.dropdown") - expect(page).to have_css("button.btn.btn-secondary.dropdown-toggle svg") - expect(page).to have_css("svg title", text: "Example Title") + expect(page).to have_css("button.btn.btn-secondary.dropdown-toggle") expect(page).to have_css(".dropdown-menu", text: "Example Item") end From c0045a881ebd52e1a623e71a47ab14fb23ac3b42 Mon Sep 17 00:00:00 2001 From: Ronak Gupta Date: Mon, 22 Jul 2024 19:00:25 +0530 Subject: [PATCH 19/21] bootsrap style added --- app/components/dropdown_menu_component.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/dropdown_menu_component.html.erb b/app/components/dropdown_menu_component.html.erb index bc6c00aa11..eb4a1ce8c4 100644 --- a/app/components/dropdown_menu_component.html.erb +++ b/app/components/dropdown_menu_component.html.erb @@ -1,5 +1,5 @@