Display presence of variant link in UI

It's quite ugly. But we will be iterating on this later.
This commit is contained in:
David Cook
2026-02-17 13:40:19 +11:00
parent b877540f5f
commit 5fc6d25a69
3 changed files with 6 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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