Skip to content

Commit

Permalink
Merge pull request #221 from yast/order_fix
Browse files Browse the repository at this point in the history
SP1: Addon selection dialog - sort the addons by label (bsc#949424)
  • Loading branch information
lslezak committed Oct 9, 2015
2 parents 7eb553f + 9a20244 commit 87e9aae
Show file tree
Hide file tree
Showing 7 changed files with 650 additions and 193 deletions.
7 changes: 7 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Oct 8 15:51:19 UTC 2015 - lslezak@suse.cz

- Addon selection dialog - sort the addons by the displayed label,
not by the internal name (which might not be unique) (bsc#949424)
- 3.1.158

-------------------------------------------------------------------
Fri Oct 2 10:26:44 UTC 2015 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-registration.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 3.1.157
Version: 3.1.158
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
4 changes: 2 additions & 2 deletions src/lib/registration/addon_sorter.rb
Expand Up @@ -23,8 +23,8 @@ module Registration
# paid (non-free) first
x.free ? 1 : -1
else
# sort the groups by name
x.name <=> y.name
# sort the groups by label ("friendly_name" or "name" attribute)
x.label <=> y.label
end
end
end
19 changes: 15 additions & 4 deletions test/addon_sorter_spec.rb
Expand Up @@ -9,12 +9,23 @@

it "sorts the addons in display order" do
expected = [
"sle-ha", "sle-ha-geo", "sle-sdk", "sle-we",
"sle-module-adv-systems-management", "sle-module-legacy",
"sle-module-public-cloud", "sle-module-web-scripting"
"SUSE Cloud for SLE 12 Compute Nodes 5 x86_64",
"SUSE Enterprise Storage 1 x86_64",
"SUSE Enterprise Storage 2 x86_64",
"SUSE Linux Enterprise High Availability Extension 12 x86_64",
"SUSE Linux Enterprise High Availability GEO Extension 12 x86_64",
"SUSE Linux Enterprise Live Patching 12 x86_64",
"SUSE Linux Enterprise Workstation Extension 12 x86_64",
"SUSE Linux Enterprise Software Development Kit 12 x86_64",
"Advanced Systems Management Module 12 x86_64",
"Containers Module 12 x86_64",
"Legacy Module 12 x86_64",
"Public Cloud Module 12 x86_64",
"Toolchain Module 12 x86_64",
"Web and Scripting Module 12 x86_64"
]

expect(available_addons.sort(&Registration::ADDON_SORTER).map(&:identifier)).to eql(expected)
expect(available_addons.sort(&Registration::ADDON_SORTER).map(&:label)).to eql(expected)
end

it "moves the unknown product types at the end" do
Expand Down

0 comments on commit 87e9aae

Please sign in to comment.