From 5fc6d25a6920ae815eca013190606dce2b2c9bca Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 17 Feb 2026 13:40:19 +1100 Subject: [PATCH] Display presence of variant link in UI It's quite ugly. But we will be iterating on this later. --- app/views/admin/products_v3/_variant_row.html.haml | 2 ++ config/locales/en.yml | 2 ++ spec/system/admin/products_v3/actions_spec.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/views/admin/products_v3/_variant_row.html.haml b/app/views/admin/products_v3/_variant_row.html.haml index d8edcaecd6..359b2afbe4 100644 --- a/app/views/admin/products_v3/_variant_row.html.haml +++ b/app/views/admin/products_v3/_variant_row.html.haml @@ -2,6 +2,8 @@ - method_on_demand, method_on_hand = variant.new_record? ? [:on_demand_desired, :on_hand_desired ]: [:on_demand, :on_hand] %td.col-image -# empty + - variant.source_variants.each do |source_variant| + = content_tag(:span, "🔗", title: t('admin.products_page.variant_row.sourced_from', source_name: source_variant.name, source_id: source_variant.id)) %td.col-name.field.naked_inputs = f.hidden_field :id = f.text_field :display_name, 'aria-label': t('admin.products_page.columns.name'), placeholder: variant.product.name diff --git a/config/locales/en.yml b/config/locales/en.yml index e38653bf95..37be1f0f74 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -720,6 +720,8 @@ en: create_sourced_variant: Create sourced variant image: edit: Edit + variant_row: + sourced_from: "Sourced from: %{source_name} (%{source_id})" product_preview: product_preview: Product preview shop_tab: Shop diff --git a/spec/system/admin/products_v3/actions_spec.rb b/spec/system/admin/products_v3/actions_spec.rb index 07eff652e1..5170418283 100644 --- a/spec/system/admin/products_v3/actions_spec.rb +++ b/spec/system/admin/products_v3/actions_spec.rb @@ -315,6 +315,8 @@ RSpec.describe 'As an enterprise user, I can perform actions on the products scr within "table.products" do # There are now two copies expect(all_input_values).to match /My friends box.*My friends box/ + # One of them is designated as a source variant + expect(page).to have_content "🔗" end end end