Fixes #3668 - The defined ignored attributes in the popover context are not working.
This commit is contained in:
parent
4ab01e3638
commit
ea30bf80bf
3 changed files with 23 additions and 1 deletions
|
@ -25,6 +25,7 @@ class App.SingleObjectPopoverProvider extends App.PopoverProvider
|
||||||
buildContentFor: (elem) ->
|
buildContentFor: (elem) ->
|
||||||
id = @objectIdFor(elem)
|
id = @objectIdFor(elem)
|
||||||
object = @constructor.klass.fullLocal(id)
|
object = @constructor.klass.fullLocal(id)
|
||||||
|
ignoredAttributes = @constructor.ignoredAttributes
|
||||||
|
|
||||||
# get display data
|
# get display data
|
||||||
data = _.values(@constructor.klass.attributesGet('view'))
|
data = _.values(@constructor.klass.attributesGet('view'))
|
||||||
|
@ -37,7 +38,7 @@ class App.SingleObjectPopoverProvider extends App.PopoverProvider
|
||||||
|
|
||||||
# add to show if value exists
|
# add to show if value exists
|
||||||
# do not show ignroed attributes
|
# do not show ignroed attributes
|
||||||
object[name] && attr.shown && !_.include(@constructor.ignoredAttributes, name)
|
object[name] && attr.shown && !_.include(ignoredAttributes, name)
|
||||||
|
|
||||||
@buildHtmlContent(
|
@buildHtmlContent(
|
||||||
object: object
|
object: object
|
||||||
|
|
|
@ -270,6 +270,19 @@ module CommonActions
|
||||||
|
|
||||||
modal_disappear(timeout: timeout) if disappears
|
modal_disappear(timeout: timeout) if disappears
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Show the popover on hover
|
||||||
|
#
|
||||||
|
# @example
|
||||||
|
# popover_on_hover(page.find('button.hover_me'))
|
||||||
|
#
|
||||||
|
def popover_on_hover(element, wait_for_popover_killer: true)
|
||||||
|
# wait for popover killer to pass
|
||||||
|
sleep 3 if wait_for_popover_killer
|
||||||
|
|
||||||
|
move_mouse_to(element)
|
||||||
|
move_mouse_by(5, 5)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
|
@ -33,4 +33,12 @@ RSpec.describe 'User Profile', type: :system do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'check that ignored attributes for user popover are not visible' do
|
||||||
|
fill_in id: 'global-search', with: customer.firstname
|
||||||
|
|
||||||
|
popover_on_hover(find('.nav-tab--search.user'))
|
||||||
|
|
||||||
|
expect(page).to have_css('.popover label', count: 1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue