mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Simplify column toggling in report spec
* This partly reverts 3a957fb988.
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MultipleCheckedSelectComponent < ViewComponent::Base
|
||||
# @param id [String]
|
||||
# Uniquely identifies the MultipleCheckedSelect (mcs) field.
|
||||
# '_mcs_field' will be appended to the given ID to form the complete ID.
|
||||
def initialize(id:, name:, options:, selected:)
|
||||
@id = "#{id}_mcs_field"
|
||||
def initialize(name:, options:, selected:)
|
||||
@name = name
|
||||
@options = options.map { |option| [option[0], option[1].to_sym] }
|
||||
@selected = selected.nil? ? [] : selected.map(&:to_sym)
|
||||
|
||||
Reference in New Issue
Block a user