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

VirtualMachine details: add Disks tab #1731

Merged

Conversation

atiratree
Copy link
Member

@atiratree atiratree commented Jun 17, 2019

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 17, 2019
@openshift-ci-robot
Copy link
Contributor

Hi @suomiy. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

frontend/package.json Outdated Show resolved Hide resolved
frontend/packages/console-shared/src/selectors/index.ts Outdated Show resolved Hide resolved
"kubevirt-web-ui-components": "^0.1.34-4"
"kubevirt-web-ui-components": "^0.1.34-4",
"kubevirt-typescript-api": "^0.18.1-rc",
"openshift-typescript-api": "^4.1.0-rc1"
Copy link
Member Author

Choose a reason for hiding this comment

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

added all TS definitions of openshift/kubevirt objects. These are generated from openapi specifications with few manual changes and released as kubevirt-typescript-api and openshift-typescript-api packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe it would make sense to move this into main package.json and use all the types across the whole project

Copy link
Member Author

Choose a reason for hiding this comment

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

thoughts?

import { Firehose, LoadingInline } from '@console/internal/components/utils';
import { HelpBlock, FormGroup } from 'patternfly-react';
import { StorageClassModel } from '@console/internal/models';
import { V1StorageClass } from 'openshift-typescript-api/esm';
Copy link
Member Author

Choose a reason for hiding this comment

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

eg: usage of the fully typed V1StorageClass

@atiratree
Copy link
Member Author

atiratree commented Jun 17, 2019

Similar approach will be used for NICs in the followup

@spadgett spadgett added this to the v4.2 milestone Jun 17, 2019
@atiratree atiratree force-pushed the kubevirt.disksPage branch 2 times, most recently from 37dd455 to 6bf96df Compare June 17, 2019 18:16
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 17, 2019
@atiratree
Copy link
Member Author

atiratree commented Jun 17, 2019

I decoupled this PR from #1682. There is just a thin commit which adds YAML editor (b5fec02).

Please let me know if I should make a separate PR for just a YAML editor so that Marek and I can develop in parallel more easily.

@mareklibra

@spadgett
Copy link
Member

This is not an editor pattern we've used elsewhere in console. Have we considered just showing a dialog? That would be more inline with the existing experience.

@atiratree
Copy link
Member Author

atiratree commented Jun 18, 2019

created a Base PR for YAML editor and Events: #1739

@matthewcarleton
Copy link
Contributor

This is not an editor pattern we've used elsewhere in console. Have we considered just showing a dialog? That would be more inline with the existing experience.

hey @spadgett this design aligns with Patternfly so I believe it's the right way to do it. Does it make sense to have a follow up discussion to determine how to deal with inline editing in OpenShift in general? That might be out of scope for this PR.
https://www.patternfly.org/pattern-library/forms-and-controls/inline-edit/#inline-edit-in-a-table-view

@lizsurette @beanh66 WDYT?

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 18, 2019
@lizsurette
Copy link

hey @spadgett this design aligns with Patternfly so I believe it's the right way to do it. Does it make sense to have a follow up discussion to determine how to deal with inline editing in OpenShift in general? That might be out of scope for this PR.
https://www.patternfly.org/pattern-library/forms-and-controls/inline-edit/#inline-edit-in-a-table-view

Agreed that we should probably discuss this as a follow-up. The history here is that within the Create VM flow (which is in a modal wizard) we really couldn't open a modal to edit these items on top of a modal, so went with the inline edit table pattern.

@atiratree atiratree force-pushed the kubevirt.disksPage branch from 6bf96df to 9ef9efc Compare June 18, 2019 16:01
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 18, 2019
@beanh66
Copy link

beanh66 commented Jun 18, 2019

I agree with @spadgett, we should consider using the kebab menu and popping a modal to make these edits similar to editing labels or annotations today.

@lizsurette
Copy link

I agree with @spadgett, we should consider using the kebab menu and popping a modal to make these edits similar to editing labels or annotations today.

Are you guys okay with this being inconsistent with the wizard flow of adding/editing Disks and Networks where we will need to use inline tables rather than pop a modal on a modal?

FYI @jelkosz since this would be a new implementation for editing Disks and Networks in VM Details.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 18, 2019
@jelkosz
Copy link

jelkosz commented Jun 19, 2019

I agree with @spadgett, we should consider using the kebab menu and popping a modal to make these edits similar to editing labels or annotations today.

The annotations editor does not have a specific tab, since there is only an "X annotations" label in the details screen and a pencil next to it. If I click the pencil, a popup shows up which is using the same pattern inside as we have here (e.g. a table where you can edit the fields inline).

I don't think we can have disks and nics to be hidden behind a small "5 disks" label and than having a table in the kebab - configuring virtual machine disks and nics is way too involved operation for that, far from being a list of key-value pairs. Even today, but will grow bigger probably. Also, the disks and nics are the most important HW configurations of the VM...

Anyway, this seems to be a topic where all options have strong pros and cons and we could argue about them for a long time. But the main question for me is, do we want to argue about it now and block this PR? Or can we just proceed with this PR and take the discussion offline to a followup? If the design is at least acceptable, I would really vote against re-writing it now if we want to stood any chance of moving the content of the fork here on time.

@atiratree atiratree force-pushed the kubevirt.disksPage branch from 9ef9efc to 5b86217 Compare June 19, 2019 09:49
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 19, 2019
@atiratree atiratree force-pushed the kubevirt.disksPage branch from 5b86217 to b10d641 Compare June 19, 2019 10:03
@atiratree atiratree force-pushed the kubevirt.disksPage branch from b10d641 to e41c2b3 Compare June 19, 2019 10:51
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 19, 2019
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 20, 2019
@atiratree
Copy link
Member Author

removed dependency on the types (#1773)

Can we continue with this PR as is and resolve the ongoing discussion in the followup if the design changes?

@matthewcarleton
Copy link
Contributor

matthewcarleton commented Jun 24, 2019

I agree with @jelkosz
It would be an odd interaction to have a list of disks that you edit individually in a pop up considering how extensive that edit can possibly be.
We could show this in a modal but it wouldn't be as simple as key value so it's seems like we are forcing a strange experience on the user just to stay in line with other simpler patterns.
This is going to be the same issue for editing NICs so I agree with the general thought here that we should not block this PR but revisit after it is merged to ensure alignment that works across all these scenarios.

@atiratree atiratree force-pushed the kubevirt.disksPage branch from e425813 to 412e53f Compare June 25, 2019 16:46
@jelkosz
Copy link

jelkosz commented Jun 26, 2019

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 26, 2019
@atiratree atiratree force-pushed the kubevirt.disksPage branch 4 times, most recently from 68695af to b101a86 Compare June 26, 2019 09:55

export type DeleteDeviceModalProps = {
deviceType: DeviceType;
device: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add better type ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The types will be added after #1813 is merged


import { getStorageSize } from '../selectors';

export const getDataVolumeResources = (dataVolume) => _.get(dataVolume, 'spec.pvc.resources');
Copy link
Contributor

Choose a reason for hiding this comment

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

types ?

Copy link
Member Author

Choose a reason for hiding this comment

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

will be added after #1813

frontend/packages/kubevirt-plugin/src/selectors/vm/disk.ts Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2019
@atiratree atiratree force-pushed the kubevirt.disksPage branch 2 times, most recently from a1274b5 to 861aac9 Compare June 26, 2019 11:51
@atiratree
Copy link
Member Author

fixed

- actions: create & remove VM disks
@atiratree atiratree force-pushed the kubevirt.disksPage branch from 861aac9 to 8594b52 Compare June 26, 2019 13:58
@rawagner
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rawagner, suomiy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@atiratree
Copy link
Member Author

/test backend

@atiratree
Copy link
Member Author

/test frontend

@atiratree
Copy link
Member Author

/retest

1 similar comment
@atiratree
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit b9bd6db into openshift:master Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.