Hi,
this patch re-eanbles selecting collections (all packages from collection are added). I
think it's better to keep this hack in model because users could be confused, though
we should rework sw selection views soon (I hope).
Show replies by date
From: Jan Provaznik <jprovazn(a)redhat.com>
When user selects collection, all packages from collection are added to template instead
of adding group name. As we don't have new SW selection design yet, I think it's
better to keep this hack.
---
src/app/util/image_descriptor_xml.rb | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/app/util/image_descriptor_xml.rb b/src/app/util/image_descriptor_xml.rb
index e9f71d9..70f2e34 100644
--- a/src/app/util/image_descriptor_xml.rb
+++ b/src/app/util/image_descriptor_xml.rb
@@ -126,11 +126,15 @@ class ImageDescriptorXML
end
def add_group(gname)
- #unless group = repository_manager.groups.find(gname)
- # raise "group #{gname} not found in repositories"
- #end
- node = get_or_create_node('groups')
- add_group_node(node, gname) unless groups.include?(gname)
+ # FIXME: this is temporary hack until we have new design:
+ # when adding group, we add particular group packages
+ # instead of whole group
+ unless group = repository_manager.groups.find {|g| g[:id] == gname}
+ raise "group #{gname} not found in repositories"
+ end
+ group[:packages].keys.each {|p| add_package(p)}
+ #node = get_or_create_node('groups')
+ #add_group_node(node, gname) unless groups.include?(gname)
end
def remove_package(package)
--
1.7.2.3
From: Jan Provaznik <jprovazn(a)redhat.com>
Uncommented test fo sw selection because I re-enabled collection selection.
---
src/features/template.feature | 42 ++++++++++++++++++++--------------------
1 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/src/features/template.feature b/src/features/template.feature
index e4cf867..e36ee72 100644
--- a/src/features/template.feature
+++ b/src/features/template.feature
@@ -32,27 +32,27 @@ Feature: Manage Templates
Then I should see "New Template"
And I should see "libdeltacloud"
- #Scenario: Add group and remove package to/from the template
- # Given I am on the templates page
- # When I press "Template"
- # Then I should be on the new template page
- # When I fill in the following:
- # | tpl_name | mocktemplate |
- # And I press "Add Software"
- # Then I should see "Managed Content Selection"
- # When I press "Collections"
- # And I check "group_deltacloud"
- # And I press "Add Selected"
- # Then I should see "Managed Content to Bundle"
- # And the "tpl[name]" field by name should contain "mocktemplate"
- # And the page should contain "#package_libdeltacloud" selector
- # When I press "remove_package_libdeltacloud"
- # Then I should see "Managed Content to Bundle"
- # And the page should not contain "#package_libdeltacloud" selector
- # When I press "Save"
- # Then I should be on the templates page
- # And I should see "Template saved"
- # And I should see "mocktemplate"
+ Scenario: Add group and remove package to/from the template
+ Given I am on the templates page
+ When I press "Template"
+ Then I should be on the new template page
+ When I fill in the following:
+ | tpl_name | mocktemplate |
+ And I press "Add Software"
+ Then I should see "Managed Content Selection"
+ When I press "Collections"
+ And I check "group_deltacloud"
+ And I press "Add Selected"
+ Then I should see "Managed Content to Bundle"
+ And the "tpl[name]" field by name should contain "mocktemplate"
+ And the page should contain "#package_libdeltacloud" selector
+ When I press "remove_package_libdeltacloud"
+ Then I should see "Managed Content to Bundle"
+ And the page should not contain "#package_libdeltacloud" selector
+ When I press "Save"
+ Then I should be on the templates page
+ And I should see "Template saved"
+ And I should see "mocktemplate"
Scenario: Sorting templates
Given there is a "mock1" template
--
1.7.2.3