From 854b936f0db8fa139f56ac4f6bd12a64a4d907bc Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Fri, 10 Sep 2021 10:16:30 +0100 Subject: [PATCH] Follow up c5659600f3d2fe3487540f0f0cd3992fd9c13ccc - Fixes #3726 - It should be possible to show attributes which are configured shown false. --- app/assets/javascripts/app/views/generic/attribute.jst.eco | 2 +- app/models/core_workflow/attributes.rb | 2 +- spec/system/ticket/create_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/views/generic/attribute.jst.eco b/app/assets/javascripts/app/views/generic/attribute.jst.eco index 90f051e2c..25c29218e 100644 --- a/app/assets/javascripts/app/views/generic/attribute.jst.eco +++ b/app/assets/javascripts/app/views/generic/attribute.jst.eco @@ -1,4 +1,4 @@ -
<%= " #{ @attribute.item_class }" if @attribute.item_class %><%= " is-required" if !@attribute.null %><%= " is-hidden is-removed hide" if @attribute.shown == false %>"<%= " data-width=#{ @attribute.grid_width }" if @attribute.grid_width %>> +
<%= " #{ @attribute.item_class }" if @attribute.item_class %><%= " is-required" if !@attribute.null %><%= " is-hidden hide" if @attribute.shown == false %>"<%= " data-width=#{ @attribute.grid_width }" if @attribute.grid_width %>> <% if @attribute.style == 'block': %>

<% end %> diff --git a/app/models/core_workflow/attributes.rb b/app/models/core_workflow/attributes.rb index 4d5f346d7..5f7f73457 100644 --- a/app/models/core_workflow/attributes.rb +++ b/app/models/core_workflow/attributes.rb @@ -77,7 +77,7 @@ class CoreWorkflow::Attributes result[ attribute[:name] ] = if @payload['request_id'] == 'ChecksCoreWorkflow.validate_workflows' 'show' else - screen_value(attribute, 'shown') == false ? 'remove' : 'show' + screen_value(attribute, 'shown') == false ? 'hide' : 'show' end end end diff --git a/spec/system/ticket/create_spec.rb b/spec/system/ticket/create_spec.rb index 7c44de025..6bf350adf 100644 --- a/spec/system/ticket/create_spec.rb +++ b/spec/system/ticket/create_spec.rb @@ -531,7 +531,7 @@ RSpec.describe 'Ticket Create', type: :system do end it 'does not show the field' do - expect(page).to have_css("div[data-attribute-name='#{field_name}'].is-hidden.is-removed", visible: :hidden) + expect(page).to have_css("div[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden) end end end