Module: GitlabInternalEventsCli::Helpers::GroupOwnership
- Included in:
- GitlabInternalEventsCli::Helpers
- Defined in:
- lib/gitlab_internal_events_cli/helpers/group_ownership.rb
Instance Method Summary collapse
- #find_categories(group) ⇒ Object
- #find_section(group) ⇒ Object
- #find_stage(group) ⇒ Object
- #known_categories ⇒ Object
- #prompt_for_feature_categories(message, groups, default = nil) ⇒ Object
- #prompt_for_group_ownership(message, defaults = {}) ⇒ Object
Instance Method Details
#find_categories(group) ⇒ Object
44 45 46 |
# File 'lib/gitlab_internal_events_cli/helpers/group_ownership.rb', line 44 def find_categories(group) available_groups[group]&.fetch(:categories) end |
#find_section(group) ⇒ Object
40 41 42 |
# File 'lib/gitlab_internal_events_cli/helpers/group_ownership.rb', line 40 def find_section(group) available_groups[group]&.fetch(:section) end |
#find_stage(group) ⇒ Object
36 37 38 |
# File 'lib/gitlab_internal_events_cli/helpers/group_ownership.rb', line 36 def find_stage(group) available_groups[group]&.fetch(:stage) end |
#known_categories ⇒ Object
7 8 9 |
# File 'lib/gitlab_internal_events_cli/helpers/group_ownership.rb', line 7 def known_categories @known_categories ||= load_known_categories end |
#prompt_for_feature_categories(message, groups, default = nil) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/gitlab_internal_events_cli/helpers/group_ownership.rb', line 19 def prompt_for_feature_categories(, groups, default = nil) choices = category_choices(groups) valid_defaults = Array(default).compact & known_categories categories = cli.multi_select( , choices, **multiselect_opts, **filter_opts(header_size: 10) ) do || .default(*valid_defaults) if valid_defaults.any? () end categories.sort if categories.any? end |
#prompt_for_group_ownership(message, defaults = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/gitlab_internal_events_cli/helpers/group_ownership.rb', line 11 def prompt_for_group_ownership(, defaults = {}) if available_groups.any? prompt_for_ownership_from_ssot(, defaults) else prompt_for_ownership_manually(, defaults) end end |