Skip to content

Commit

Permalink
Fixes zammad#4414 - Ticket selector allows for duplicate attributes w…
Browse files Browse the repository at this point in the history
…ith expert mode switched off.
  • Loading branch information
dvuckovic authored and rolfschmidt committed Dec 5, 2022
1 parent 3685ff7 commit 3aedfb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -777,4 +777,4 @@ class App.UiElement.ticket_selector extends App.UiElement.ApplicationSelector
return App.Config.get('ticket_allow_expert_conditions')

@hasDuplicateSelector: ->
return @hasExpertConditions()
return @hasExpertConditions() && @isExpertMode
13 changes: 13 additions & 0 deletions spec/system/manage/overviews_expert_conditions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@
end
end
end

it 'does not allow duplicate attributes when the expert mode is switched off (#4414)' do
scroll_into_view('.ticket_selector')

within '.ticket_selector' do
check_expert_mode(false)

# Check if the State attribute is disabled in the new dropdown.
find('.js-filterElement:nth-child(1) .js-add').click
attribute_selector = find('.js-filterElement:nth-child(2) .js-attributeSelector select')
expect(attribute_selector.find('option', text: 'State').disabled?).to be(true)
end
end
end

context 'with existing objects' do
Expand Down

0 comments on commit 3aedfb1

Please sign in to comment.