-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
partition_buttons | ||
else | ||
raid_buttons | ||
types = [:partition, :software_raid, :lvm_vg, :lvm_lv, :stray_blk_device] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like constant for list of supported device types?
working_graph.find_device(device_sid) | ||
end | ||
|
||
# @return [Array<[Symbol, String]>] list of menu options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, this comment is a bit imprecise. I prefer here simple see for CWM method which defines how it exactly have to look.
# | ||
# @return [Boolean] | ||
def validate_presence | ||
return true unless device.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: but me is more nature return true if device
@@ -34,7 +34,8 @@ class LvmDevicesTable < ConfigurableBlkDevicesTable | |||
# @param devices [Array<Y2Storage::Lvm_vg, Y2Storage::Lvm_lv>] devices to display | |||
# @param pager [CWM::Pager] table have feature, that double click change content of pager | |||
# if someone do not need this feature, make it only optional | |||
def initialize(devices, pager) | |||
# @param buttons_set [DeviceButtonsSet] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please document also why it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that whole documentation should not be there, in LvmDevicesTable
, which is not the base class. #devices
and #pager
are already (better) documented in the base class.
def initialize(pager: nil, table: nil, device: nil, short: false) | ||
super(pager: pager, table: table, device: device) | ||
@short_label = short | ||
# Constructor. See parent class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry this see won;t create automatic link in yardoc
src/lib/y2partitioner/dialogs/md.rb
Outdated
@@ -33,6 +33,8 @@ | |||
# @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FCustomWidget:${0} | |||
# @!macro [new] seeDialog | |||
# @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FDialog:${0} | |||
# @!macro [new] seeItemsSelection | |||
# @see http://www.rubydoc.info/github/yast/yast-yast2/CWM%2FItemsSelection:${0} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks familiar for me :) https://github.com/yast/yast-storage-ng/pull/746/files#diff-e9f6c27fd34d282cdefbf6f09306cccdR36
14e5416
to
2053c58
Compare
|
||
# @see DevicesTable | ||
def table_buttons | ||
Empty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, what about making this default behavior in base and redefine only when needed?
src/lib/y2partitioner/ui_state.rb
Outdated
# | ||
# @return [String] | ||
def self.md_raids_label | ||
N_("RAID") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it is not constant? We usually use N_ in constants. and _ in common methods. This usage of N_ and _ in caller looks strange for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just moved stuff from the previous place in a hurry (kind of). With UIState being a singleton class, it makes indeed no sense to keep the old N_
thingie.
# @macro seeAbstractWidget | ||
def label | ||
_(self.class.label) | ||
_(UIState.lvm_label) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if label already have _()
instead of N_ then we do not need to translate it again here.
@@ -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? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
package/yast2-storage-ng.spec
Outdated
@@ -16,7 +16,7 @@ | |||
# | |||
|
|||
Name: yast2-storage-ng | |||
Version: 4.1.20 | |||
Version: 4.1.21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should finally fix that indentation issue :)
✔️ Internal Jenkins job #46 successfully finished |
✔️ Public Jenkins job #42 successfully finished |
Sometime ago[1][2], the .label method from some pages was moved to the UIState in order to avoid a dependency cycles. However, it was a kind of temporary fix and it's time to really solve the problem. As first step, this commit "restore" the .label method for those pages. Subsequent commit(s) will avoid mentioned dependency. [1] #752 [2] b107fc5
Sometime ago[1][2], the .label method from some pages was moved to the UIState in order to avoid a dependency cycles. However, it was a kind of temporary fix and it's time to really solve the problem. As first step, this commit "restore" the .label method for those pages. Subsequent commit(s) will avoid mentioned dependency. [1] #752 [2] b107fc5
Sometime ago[1][2], the .label method from some pages was moved to the UIState in order to avoid a dependency cycles. However, it was a kind of temporary fix and it's time to really solve the problem. As first step, this commit "restore" the .label method for those pages. Subsequent commit(s) will avoid mentioned dependency. [1] #752 [2] b107fc5
Main PR for https://trello.com/c/5rrmzwKh/276-3-partitioner-unleash-the-beast
This implements the UI described in this gist, check that document for the rationale.
The new UI fits into an 80x24 text console and allows all kind of operations. For example, it's possible to start with three empty disks and end up creating this complex setup using only the Partitioner.
There you can see:
/dev/md0
is an MD RAID defined on top of two partitions and formatted as "/" (nothing really new here),/dev/md1
is an MD RAID defined on top of a combination of full disks (/dev/sdb
) and partitions (/dev/sda3
) and containing partitions like/dev/md1p1
and/dev/md1p2
itself (two things that were not possible in the old Partitioner),/dev/volgroup0
is an LVM VG based on one of those MD partitions,/dev/sdc
is a disk hosting directly a file-system with no partitions in between (also a new possibility).And this is how some parts of the process to create such setup look like in a text console.
Directly formatting a disk (no partitions):
Playing with partitions.
Creating an MD RAID on top of two full disks and then creating partitions within the RAID.
Last but not least, that's how those screens look in graphical mode (SLE-15-SP1 installation).