Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate visibility expressions for CustomButtons #15725

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Aug 3, 2017

method CustomButtonSet#filter_with_visibility_expression is called when custom buttons are going to display - the method is doing filtering:

how filter_with_visibility_expression works

(from 36bff47)

  # Params:
  #   custom_button_sets: <Array>CustomButtonSet
  #   object: for this object are evaluated visibility_expression of CustomButtons
  #           one CustomButtonSet contains any CustomButtons,
  #           CustomButtonSet has stored this ids of CustomButtons in array CustomButton#set_data[:button_order]
  # Returns:
  #   <Array>CustomButtonSet
  #
  # example:
  # let's have:
  # custom_buttons_set =
  #   <Array> [<CustomButtonSet> id: 10000000000075,
  #     set_data:
  #       {:button_order=> [1, 2]}, list ids of custom buttons in custom button set (group of buttons in UI)
  # ... ]
  # object = Vm.first
  #
  # then CustomButtonSet.filter_with_visibility_expression(custom_button_sets, object) returns:
  #  - same custom_button_sets array when all visibility expressions are not populated(CustomButton#visibility_expression = nil)
  #  - same custom_button_sets array but with filtered list custom buttons ids in each custom button set from
  #    custom_button_sets when any visibility expression is evaluated to true
  #    - ids of custom buttons with visibility expression which are evaluated to false are removed from CustomButtonSet#set_data[:button_order]
  #  - filtered custom_button_sets array when all visibilty expression custom buttons have been evaluated to false

Links

UI PR: ManageIQ/manageiq-ui-classic#1824
first part of https://www.pivotaltracker.com/story/show/147780767 - visibility of custom buttons

@miq-bot miq-bot added the wip label Aug 3, 2017
@lpichler lpichler force-pushed the evaluate_visibility_expressions_for_buttons branch 2 times, most recently from 47148e3 to 9aa2dd6 Compare August 3, 2017 19:16
@lpichler lpichler changed the title [WIP] Evaluate visibility expressions for CustomButtons Evaluate visibility expressions for CustomButtons Aug 3, 2017
@lpichler
Copy link
Contributor Author

lpichler commented Aug 3, 2017

@miq-bot assign @gtanzillo
cc @martinpovolny
@miq-bot add_label enhancement

@miq-bot miq-bot removed the wip label Aug 3, 2017
@lpichler lpichler force-pushed the evaluate_visibility_expressions_for_buttons branch 2 times, most recently from 958e7ca to 386c685 Compare August 4, 2017 08:19
@miq-bot
Copy link
Member

miq-bot commented Aug 8, 2017

This pull request is not mergeable. Please rebase and repush.

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@gtanzillo gtanzillo added this to the Sprint 66 Ending Aug 7, 2017 milestone Aug 8, 2017
@gtanzillo
Copy link
Member

@lpichler Please resolve conflict and I'll merge.

@lpichler lpichler force-pushed the evaluate_visibility_expressions_for_buttons branch from 386c685 to 20e02dc Compare August 8, 2017 07:38
@lpichler lpichler force-pushed the evaluate_visibility_expressions_for_buttons branch from 20e02dc to e2e352a Compare August 8, 2017 07:41
@lpichler lpichler force-pushed the evaluate_visibility_expressions_for_buttons branch from e2e352a to 20c194d Compare August 8, 2017 07:44
@miq-bot
Copy link
Member

miq-bot commented Aug 8, 2017

Checked commits lpichler/manageiq@f1f0be7~...20c194d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks fine. 👍

@lpichler lpichler closed this Aug 8, 2017
@lpichler lpichler reopened this Aug 8, 2017
@gtanzillo gtanzillo merged commit 3b3f43f into ManageIQ:master Aug 8, 2017
@lpichler lpichler deleted the evaluate_visibility_expressions_for_buttons branch August 8, 2017 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants