fix(dossier): should refresh dossier footer when removing options from multiselect
This commit is contained in:
parent
dd85a495e0
commit
3a54e44b57
8 changed files with 28 additions and 13 deletions
|
@ -62,8 +62,12 @@ class Champs::DropDownListChamp < Champ
|
|||
options.include?(value)
|
||||
end
|
||||
|
||||
def remove_option(options)
|
||||
update_column(:value, nil)
|
||||
def remove_option(options, touch = false)
|
||||
if touch
|
||||
update(value: nil)
|
||||
else
|
||||
update_column(:value, nil)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -70,8 +70,12 @@ class Champs::LinkedDropDownListChamp < Champ
|
|||
options.include?(primary_value) || options.include?(secondary_value)
|
||||
end
|
||||
|
||||
def remove_option(options)
|
||||
update_column(:value, nil)
|
||||
def remove_option(options, touch = false)
|
||||
if touch
|
||||
update(value: nil)
|
||||
else
|
||||
update_column(:value, nil)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -51,8 +51,13 @@ class Champs::MultipleDropDownListChamp < Champ
|
|||
(selected_options - options).size != selected_options.size
|
||||
end
|
||||
|
||||
def remove_option(options)
|
||||
update_column(:value, (selected_options - options).to_json)
|
||||
def remove_option(options, touch = false)
|
||||
value = (selected_options - options).to_json
|
||||
if touch
|
||||
update(value:)
|
||||
else
|
||||
update_columns(value:)
|
||||
end
|
||||
end
|
||||
|
||||
def focusable_input_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue