Skip to content

Commit

Permalink
Enable release notes in welcome screen if available
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Sep 1, 2017
1 parent dc2b25e commit be1617f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/installation/clients/inst_complex_welcome.rb
Expand Up @@ -28,6 +28,7 @@
Yast.import "Console"
Yast.import "FileUtils"
Yast.import "GetInstArgs"
Yast.import "InstData"
Yast.import "InstShowInfo"
Yast.import "Keyboard"
Yast.import "Language"
Expand Down Expand Up @@ -61,6 +62,7 @@ def main
textdomain "installation"

Yast::Wizard.EnableAbortButton
show_release_notes

loop do
dialog_result = ::Installation::Dialogs::ComplexWelcome.run(
Expand Down Expand Up @@ -174,6 +176,12 @@ def retranslate_yast
end
end

# Show release notes if they have been downloaded
def show_release_notes
return if InstData.release_notes.empty?
Wizard.ShowReleaseNotesButton(_("Re&lease Notes..."), "rel_notes")
end

# Return the list of base products
#
# @return [Array<Y2Packager::Product>] List of available base products
Expand Down
26 changes: 26 additions & 0 deletions test/inst_complex_welcome_test.rb
Expand Up @@ -97,9 +97,35 @@
end

it "runs the dialog" do
expect(Installation::Dialogs::ComplexWelcome).to receive(:run)
.and_return(:back)
subject.main
end

context "release notes" do
before do
allow(Yast::InstData).to receive(:release_notes).and_return(release_notes)
end

context "when release notes have been downloaded" do
let(:release_notes) { "release notes" }

it "show release notes" do
expect(Yast::Wizard).to receive(:ShowReleaseNotesButton)
subject.main
end
end

context "when release notes have not been downloaded" do
let(:release_notes) { "" }

it "does not download release notes again" do
expect(Yast::Wizard).to_not receive(:ShowReleaseNotesButton)
subject.main
end
end
end

context "when back is pressed" do
let(:dialog_results) { [:back] }

Expand Down

0 comments on commit be1617f

Please sign in to comment.