From 91d24ba8ab5ddeda5f10b53d47ba231aec0585a1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 8 Jun 2023 14:20:09 +0200 Subject: [PATCH 1/2] Add `Edit` tooptip for action icon in orders table --- app/views/spree/admin/orders/_table_row.html.haml | 2 +- spec/system/admin/orders_spec.rb | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/spree/admin/orders/_table_row.html.haml b/app/views/spree/admin/orders/_table_row.html.haml index 42357d161e..b65e59a399 100644 --- a/app/views/spree/admin/orders/_table_row.html.haml +++ b/app/views/spree/admin/orders/_table_row.html.haml @@ -41,7 +41,7 @@ %div.row-loading-icons - if local_assigns[:success] %i.success.icon-ok-sign{"data-controller": "ephemeral"} - %a.icon_link.with-tip.icon-edit.no-text{href: edit_admin_order_path(order), 'ofn-with-tip' => t('spree.admin.orders.index.edit')} + %a.icon_link.with-tip.icon-edit.no-text{href: edit_admin_order_path(order), "data-controller": "tooltip", "data-tooltip-tip-value": t('spree.admin.orders.index.edit'), "data-tooltip-target": "element"} - if order.ready_to_ship? %div{ "data-controller": "tooltip", "data-tooltip-tip-value": t('spree.admin.orders.index.ship') } %button.icon-road.icon_link.with-tip.no-text{"data-reflex": "click->Admin::OrdersReflex#ship", "data-id": order.id.to_s, diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index d7d4131eb7..dc0bba4d67 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -697,8 +697,6 @@ distributors: [distributor4, distributor5]) } end it "displays Edit tooltip" do - pending("issue #10956") - within "tr#order_#{order.id}" do # checks shipment state expect(page).to have_content "PENDING" From 7ce3c3f447d87ddd193a555b1c072a4c388c8bc4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 8 Jun 2023 14:24:20 +0200 Subject: [PATCH 2/2] Overide a `text-transform: uppercase` to `capitalize` Inherit comes from `app/webpacker/css/admin/components/buttons.scss` --- app/webpacker/css/admin/components/tooltip.scss | 1 + spec/system/admin/orders_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/webpacker/css/admin/components/tooltip.scss b/app/webpacker/css/admin/components/tooltip.scss index 13205329f6..0776542354 100644 --- a/app/webpacker/css/admin/components/tooltip.scss +++ b/app/webpacker/css/admin/components/tooltip.scss @@ -16,6 +16,7 @@ color: #fff; max-width: 240px; white-space: normal; + text-transform: capitalize; } .arrow { diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index dc0bba4d67..0cab43a75b 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -683,7 +683,7 @@ distributors: [distributor4, distributor5]) } # mouse-hovers and finds tooltip find(".icon-road").hover - expect(page).to have_content "SHIP" + expect(page).to have_content "Ship" end within "tr#order_#{order.id}" do @@ -692,7 +692,7 @@ distributors: [distributor4, distributor5]) } # mouse-hovers and finds tooltip find(".icon-capture").hover - expect(page).to have_content "CAPTURE" + expect(page).to have_content "Capture" end end @@ -703,7 +703,7 @@ distributors: [distributor4, distributor5]) } # mouse-hovers and finds tooltip find(".icon-edit").hover - expect(page).to have_content "EDIT" + expect(page).to have_content "Edit" end end end