Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Partitioner UI based on dynamic menu-buttons #752

Merged
merged 24 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8f28560
The Edit button always edits
ancorgs Sep 27, 2018
930c7c4
Allow to select the next tab by its label
ancorgs Sep 27, 2018
3d245ca
Remove :short option from PartitionAddButton
ancorgs Sep 27, 2018
9effec6
Actions executed from the table select the proper row at the end
ancorgs Sep 27, 2018
c661458
Do not open disks in the Partitions tab by default
ancorgs Sep 27, 2018
950c892
Use DeviceButtonsSet in all tables except system
ancorgs Sep 28, 2018
ec5bf85
Use DeviceResizeButton only for resizing, not to change PVs
ancorgs Sep 28, 2018
f1094b8
Fix wrong memoization
ancorgs Sep 28, 2018
e318e56
Redefine buttons in the different pages
ancorgs Sep 28, 2018
bc25efc
Remove not longer used buttons
ancorgs Sep 28, 2018
60aa9a4
Simplify DeviceButton, searching in table is not used
ancorgs Sep 28, 2018
5ae257b
Handle StrayBlkDevice in the Hard Disks table
ancorgs Sep 28, 2018
efe7f98
Adapt Partitioner unit tests to the new UI
ancorgs Sep 28, 2018
ebe0b34
Some code improvements
ancorgs Oct 1, 2018
1949922
Add some missing unit test
ancorgs Oct 1, 2018
7e8e997
Do not re-document what is documented in base classes
ancorgs Oct 1, 2018
47674c8
Adapt bcache table to the new UI
ancorgs Oct 1, 2018
a4ba9e6
Pages::DevicesTable as base class for 4 pages
ancorgs Oct 2, 2018
b107fc5
Avoid cyclic dependency of UIState and Pages
ancorgs Oct 2, 2018
e01da15
Code improvements
ancorgs Oct 2, 2018
90fa0b9
Delete All button in LVs list (consistent with partitions list)
ancorgs Oct 2, 2018
59a7b2c
More robust and tested DeviceMenuButton
ancorgs Oct 2, 2018
af5f9c1
Version and changelog
ancorgs Oct 2, 2018
9c39c04
Improve method documentation
ancorgs Oct 2, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/y2partitioner/widgets/device_menu_button.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def widget_id_for_action(action)
# @param id [Symbol, String]
# @return [Hash]
def action_for_widget_id(id)
return nil if id.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be nil or exception? if so, then please document it that it can also return nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I would never expect #handle to be called with no arguments (or with a nil argument) since handle_all_events is used.

Unfortunately, supporting that case is needed in order to be able to use include_examples "CWM::AbstractWidget" which always calls #handle with no arguments, so I have to adapt the class to ignore such wrong calls.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yeah. That is problematic, because for calls it uses arity and rspec mock basically mocks call with *args, so -1 arity and it breaks this test. Please add comment for it, as it is quite tricky.

actions.find { |action| widget_id_for_action(action) == id.to_sym }
end

Expand Down
2 changes: 2 additions & 0 deletions test/y2partitioner/widgets/disk_modify_button_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

subject(:button) { described_class.new(device) }

include_examples "CWM::AbstractWidget"

describe "#items" do
it "returns a list" do
expect(button.items).to be_a(Array)
Expand Down