mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-06 07:29:16 +00:00
Small improvment
- add value for preferred customer tags - allow passing html options to preferred customer tags hidden field
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TagRuleFormComponent < ViewComponent::Base
|
||||
def initialize(rule:, rule_data:, index:)
|
||||
def initialize(rule:, rule_data:, index:, customer_tags: "",
|
||||
hidden_field_customer_tag_options: {})
|
||||
@rule = rule
|
||||
@rule_data = rule_data
|
||||
@index = index
|
||||
@customer_tags = customer_tags
|
||||
@hidden_field_customer_tag_options = hidden_field_customer_tag_options
|
||||
end
|
||||
|
||||
attr_reader :rule, :index, :rule_data
|
||||
attr_reader :rule, :index, :rule_data, :customer_tags, :hidden_field_customer_tag_options
|
||||
|
||||
private
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
= hidden_field_tag element_name("type"), rule.type
|
||||
= hidden_field_tag element_name("priority"), index
|
||||
= hidden_field_tag element_name("is_default"), rule.is_default
|
||||
= hidden_field_tag element_name("preferred_customer_tags")
|
||||
= hidden_field_tag element_name("preferred_customer_tags"), customer_tags, hidden_field_customer_tag_options
|
||||
%span.text-normal
|
||||
= rule_data[:text_top]
|
||||
%td
|
||||
|
||||
Reference in New Issue
Block a user