Skip to content

Commit

Permalink
Merge pull request #526 from yast/master-bsc-1177504-2
Browse files Browse the repository at this point in the history
Updating warning popup if the user has skipped the registration. Adde…
  • Loading branch information
lslezak committed Dec 18, 2020
2 parents 832dc62 + 160082d commit a9056e7
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
7 changes: 7 additions & 0 deletions package/yast2-registration.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Dec 18 13:44:58 UTC 2020 - Stefan Schubert <schubi@suse.de>

- Updating warning popup if the user has skipped the registration.
Added media information while online installation (bsc#1177504).
- 4.3.17

-------------------------------------------------------------------
Tue Dec 8 09:16:16 UTC 2020 - schubi <schubi@intern>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-registration.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 4.3.16
Version: 4.3.17
Release: 0
Summary: YaST2 - Registration Module
License: GPL-2.0-only
Expand Down
23 changes: 19 additions & 4 deletions src/lib/registration/ui/base_system_registration_dialog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,25 @@ def default_skipping_text
# @return [String]
def online_skipping_text
# TRANSLATORS:
# Popup : Installation cannot be continued without registration.
_("<p>This installation is online only which requires registration for "\
"package repositories.\nFor installations without registration please "\
"install using full installation media.</p>")
# Popup (1/3) : Installation cannot be continued without registration.
warning = _("<p>This installation is online only which requires registration for "\
"package repositories.</p>")

# these cannot be nil
if !media_name.empty? && !download_url.empty?
# TRANSLATORS: a popup message (2/3) the user wants to skip the registration
# %{media_name} is the media name (e.g. SLE-15-SP2-Full),
# %{download_url} is an URL link (e.g. https://download.suse.com)
warning += _("<p>For installation without registering the system please "\
"install using the %{media_name} installation media from %{download_url}.</p>") %
{ media_name: media_name, download_url: download_url } # these cannot be nil

else
# TRANSLATORS: a popup message (3/3) the user wants to skip the registration
warning += _("<p>For installations without registration please "\
"install using full installation media.</p>")
end
warning
end

# UI term for the network configuration button (or empty if not needed)
Expand Down
38 changes: 38 additions & 0 deletions test/base_system_registration_dialog_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,44 @@
context "Online installation medium" do
let(:online?) { true }

context "when full_system_media_name and full_system_download_url" \
" is defined in control.xml" do
before do
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "full_system_media_name")
.and_return("SLE-$os_release_version-Full")
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "full_system_download_url").and_return("https://download.suse.com")
allow(Yast::OSRelease).to receive(:ReleaseVersionHumanReadable).and_return("15-SP2")
end

it "reports the media name and the download url to the user" do
expect(Yast2::Popup).to receive(:show).with(
/SLE-15-SP2-Full.*download.suse.com/m,
anything
).and_return(true)
expect(subject.run).to eq(:abort)
end
end

context "when full_system_media_name and full_system_download_url" \
" is NOT defined in control.xml" do
before do
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "full_system_media_name").and_return("")
allow(Yast::ProductFeatures).to receive(:GetStringFeature)
.with("globals", "full_system_download_url").and_return("")
end

it "does not mention any media information" do
expect(Yast2::Popup).to receive(:show).with(
/install using full installation media/, anything
)
.and_return(true)
expect(subject.run).to eq(:abort)
end
end

it "reports that this is an online media only" do
expect(Yast2::Popup).to receive(:show).with(
/This installation is online only/,
Expand Down

0 comments on commit a9056e7

Please sign in to comment.