Skip to content

Commit

Permalink
Merge pull request #11589 from bzwei/heat_parameter_groups
Browse files Browse the repository at this point in the history
Handle the case that a parameter group does not have label
(cherry picked from commit 14f5a68)

https://bugzilla.redhat.com/show_bug.cgi?id=1382819
  • Loading branch information
gmcculloug authored and chessbyte committed Oct 7, 2016
1 parent 119c5b9 commit b4186e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/services/orchestration_template_dialog_service.rb
Expand Up @@ -46,7 +46,7 @@ def add_parameter_group(parameter_group, tab, position)

tab.dialog_groups.build(
:display => "edit",
:label => parameter_group.label,
:label => parameter_group.label || "Parameter Group#{position}",
:position => position
).tap do |dialog_group|
parameter_group.parameters.each_with_index { |param, index| add_parameter_field(param, dialog_group, index) }
Expand Down
4 changes: 1 addition & 3 deletions spec/fixtures/orchestration_templates/hot_parameters.yml
Expand Up @@ -9,9 +9,7 @@ parameter_groups:
- flavor
- image_id
- cartridges
- label: DB parameters
description: Database related parameters
parameters:
- parameters:
- admin_pass
- db_port
- metadata
Expand Down
4 changes: 2 additions & 2 deletions spec/models/orchestration_template_hot_spec.rb
Expand Up @@ -29,8 +29,8 @@ def assert_general_group(group)
end

def assert_db_group(group)
expect(group.label).to eq("DB parameters")
expect(group.description).to eq("Database related parameters")
expect(group.label).to be_nil
expect(group.description).to be_nil

assert_hidden_length_patterns(group.parameters[0])
assert_min_max_value(group.parameters[1])
Expand Down
Expand Up @@ -110,7 +110,7 @@ def assert_parameter_group1(group)

def assert_parameter_group2(group)
expect(group).to have_attributes(
:label => "DB parameters",
:label => "Parameter Group2",
:display => "edit",
)

Expand Down

0 comments on commit b4186e1

Please sign in to comment.