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

machines: Detach disk #9812

Merged
merged 2 commits into from
Sep 27, 2018
Merged

Conversation

KKoukiou
Copy link
Contributor

@KKoukiou KKoukiou commented Aug 8, 2018

Rebased on top of https://github.com//pull/9240, cannot be merged before it.
update: 9240 is already merged so this is ready for review.

@KKoukiou
Copy link
Contributor Author

KKoukiou commented Aug 8, 2018

@andreasn @garrett I am implementing a new feature in machines package. Specifically, in the Disks sub tab I am adding the [-] button to allow user to detach disks from VMs.
What do you think about the button choice? Is it a problem that the [Add Disk] button is different than the [-] button for removing disks?

diskdetach

@KKoukiou KKoukiou changed the title WIP: machines: Detach disk machines: Detach disk Sep 24, 2018
@KKoukiou KKoukiou requested a review from martinpitt September 24, 2018 10:27
@garrett
Copy link
Member

garrett commented Sep 25, 2018

I was looking for examples of this pattern in Cockpit, and found a bunch.

...but we're consistently inconsistent for both the add and remove buttons. I'm looking through PatternFly at the moment to see if there guidelines on what should be used (and so far, I haven't found anything).

I took a bunch of screenshots when looking around:

User account SSH keys

screenshot_2018-09-25 accounts - sunny

Applications

screenshot_2018-09-25 applications - sunny

Storage

screenshot_2018-09-25 storage - sunny

Firewall

screenshot_2018-09-25 sunny

@garrett
Copy link
Member

garrett commented Sep 25, 2018

I have scoured PatternFly.org and still haven't found anything relevant.

Here are interpreted rules from what we're doing on Cockpit:

  • A + button by itself is only used when in a grey header in a box.
  • A - button is used for removing something.
  • A trashcan is used instead when something is deleted, instead of just removed. (It's basically remove and delete.)
  • The Machines page uses a link for adding. (FWIW: I'm of the opinion that it should probably be a button, not a link.)

So, unless @andreasn has a difference of opinion, I think having an "Add" button spelled out and "-" buttons is probably correct.

We should probably test these patterns.


TL;DR: Yes, I think it's probably fine as-is.

@garrett
Copy link
Member

garrett commented Sep 25, 2018

Firstly: It's hard to see it without the HTML + CSS, and I can't really get this working on my machine to test it locally. 😞

So I'll elaborate what we talked about in IRC with a few other details worth mentioning:

  • Vertical alignment seems off for items in the table rows. It is probably due to additional padding for one (or more) of the elements inside the row. Otherwise, it could be vertical-align not being set to baseline.

  • The horizontal alignment could probably also be improved by left-aligning the text. If "File" is a label and could also be a "URI", then you could either put that in a <td> and use a colspan=2 on the corresponding "Source" <th> heading or add a min-width of 5em or so to the label. Both techniques should ensure the path (or URI? or anything else it could be?) are the same width. An advantage of the colspan technique is not requiring extra CSS and having the items line up perfectly without any assumptions.

  • I'd suggest removing the label or whatever element the "File" is enclosed within and using the th colspan to offset it from the path, with both the "File" and path in separate <td>s.

  • Also, the horizontal separator lines between the items seem a bit dark. 🤷‍♂️ (But perhaps I'm just being picky here?)

Here's a modified version of your screenshot that illustrates the above suggestions:

43837477-e8a70fcc-9b18-11e8-9b88-cb46417d736f-2


It would be nice if this could be fixed in this PR, but I'm happy to have this addressed in a second PR too if that makes things easier.

@KKoukiou
Copy link
Contributor Author

@garrett I think it's better to open separate issue for your comments above, because all are relevant to whole disks rows, however this PR is only adding the [-] button for each row.
So all 4 comments, are not relevant to this specific change. I 'll be glad to fix these in seperate PR.

pkg/machines/components/vmDisksTab.jsx Show resolved Hide resolved
pkg/machines/libvirt-common.es6 Show resolved Hide resolved
pkg/machines/libvirt-common.es6 Show resolved Hide resolved
pkg/machines/libvirt-dbus.es6 Outdated Show resolved Hide resolved
pkg/machines/libvirt-dbus.es6 Show resolved Hide resolved
test/verify/check-machines-dbus Show resolved Hide resolved
New feature is introduced only for LibvirtDBus provider
Detaching the disk is always done is permanent way and if the
domain is running the live state is affected as well.

Closes cockpit-project#9812
@KKoukiou
Copy link
Contributor Author

@martinpitt it's ready for review again!

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Looks great now, thanks!

@martinpitt martinpitt merged commit 442264d into cockpit-project:master Sep 27, 2018
garrett pushed a commit to garrett/cockpit that referenced this pull request Oct 17, 2018
New feature is introduced only for LibvirtDBus provider
Detaching the disk is always done is permanent way and if the
domain is running the live state is affected as well.

Closes cockpit-project#9812
@KKoukiou KKoukiou deleted the detach-disk branch November 29, 2018 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants