fix: remove condition from annotations and children
This commit is contained in:
parent
6f7fb9841c
commit
53fe3c3dd8
3 changed files with 3 additions and 12 deletions
|
@ -77,4 +77,5 @@
|
||||||
= render TypesDeChampEditor::BlockComponent.new(block: coordinate, coordinates: coordinate.revision_types_de_champ)
|
= render TypesDeChampEditor::BlockComponent.new(block: coordinate, coordinates: coordinate.revision_types_de_champ)
|
||||||
= render TypesDeChampEditor::AddChampButtonComponent.new(revision: coordinate.revision, parent: coordinate, is_annotation: coordinate.private?)
|
= render TypesDeChampEditor::AddChampButtonComponent.new(revision: coordinate.revision, parent: coordinate, is_annotation: coordinate.private?)
|
||||||
|
|
||||||
= render(TypesDeChampEditor::ConditionsComponent.new(tdc: type_de_champ, upper_tdcs: @upper_coordinates.map(&:type_de_champ), procedure_id: procedure.id))
|
- if Flipper.enabled?(:conditional, controller.current_user) && !type_de_champ.private? && !coordinate.child?
|
||||||
|
= render(TypesDeChampEditor::ConditionsComponent.new(tdc: type_de_champ, upper_tdcs: @upper_coordinates.map(&:type_de_champ), procedure_id: procedure.id))
|
||||||
|
|
|
@ -201,11 +201,7 @@ class TypesDeChampEditor::ConditionsComponent < ApplicationComponent
|
||||||
end
|
end
|
||||||
|
|
||||||
def render?
|
def render?
|
||||||
if Flipper.enabled?(:conditional, controller.current_user)
|
@condition.present? || available_targets_for_select.any?
|
||||||
@condition.present? || available_targets_for_select.any?
|
|
||||||
else
|
|
||||||
false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def input_name_for(name)
|
def input_name_for(name)
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
describe TypesDeChampEditor::ConditionsComponent, type: :component do
|
describe TypesDeChampEditor::ConditionsComponent, type: :component do
|
||||||
include Logic
|
include Logic
|
||||||
|
|
||||||
# TODO: remove along with feature flipping
|
|
||||||
before do
|
|
||||||
allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(nil)
|
|
||||||
allow(Flipper).to receive(:enabled?).with(:conditional, anything).and_return(true)
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'render' do
|
describe 'render' do
|
||||||
let(:tdc) { create(:type_de_champ, condition: condition) }
|
let(:tdc) { create(:type_de_champ, condition: condition) }
|
||||||
let(:condition) { nil }
|
let(:condition) { nil }
|
||||||
|
|
Loading…
Add table
Reference in a new issue