-
Notifications
You must be signed in to change notification settings - Fork 90
nics: Improve the dialog experience with new framework components #2435
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
base: main
Are you sure you want to change the base?
Conversation
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
26c86f5 to
5168d18
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
5168d18 to
dc7d51d
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
dc7d51d to
ea2d88b
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
03b053c to
9e650a2
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
9e650a2 to
e22b04b
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
e22b04b to
ec962d2
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
ec962d2 to
dfd70a6
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
dfd70a6 to
4e63f3e
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
520176e to
dd682c7
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
dd682c7 to
474d21e
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
474d21e to
336a232
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
336a232 to
1d0f9e3
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
1d0f9e3 to
3b71159
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
3b71159 to
6408b0c
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
6408b0c to
4e45c3b
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
4e45c3b to
0ef9729
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
0ef9729 to
d596cf6
Compare
cockpituous
left a comment
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.
There are more than 10 code coverage comments, see the full report here.
| name="mac-setting" | ||
| isChecked={!v_set.get()} | ||
| label={_("Generate automatically")} | ||
| onChange={() => v_set.set(false)} |
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 added line is not executed by any test. Details
| function validate_NetworkMacRow(value: DialogValue<NetworkMacValue>) { | ||
| value.validate(v => { | ||
| if (v.set && v.val === "") | ||
| return _("Network MAC can not be 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.
This added line is not executed by any test. Details
| mac: ( | ||
| values.mac.set | ||
| ? values.mac.val | ||
| : getRandomMac(await appState.getVms()) |
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 added line is not executed by any test. Details
|
|
||
| const defaultBody = ( | ||
| <> | ||
| <Form onSubmit={e => e.preventDefault()} isHorizontal> |
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 added line is not executed by any test. Details
|
|
||
| if (osTypeArch == 'ppc64' && osTypeMachine == 'pseries') | ||
| availableModelTypes.push({ name: 'spapr-vlan' }); | ||
| availableModelTypes.push({ value: 'spapr-vlan', label: 'spapr-vlan' }); |
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 added line is not executed by any test. Details
| } else { | ||
| // User session | ||
| if (dialogValues.availableSources.network.length > 0) { | ||
| if (availableSources.network && availableSources.network.length > 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.
This added line is not executed by any test. Details
| detailHeadline: _("Provides a virtual LAN with NAT to the outside world."), | ||
| disabled: false, |
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.
These 2 added lines are not executed by any test. Details
| // matter what. | ||
| if (network.type in _availableSourcesForType) { | ||
| const avail = _availableSourcesForType[network.type]; | ||
| const src = getNetworkSource(network) || ""; |
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 added line is not executed by any test. Details
| if (!avail.includes(src)) | ||
| avail.push(src); | ||
| } | ||
| } else if (vm.connectionName == "system" && _availableSourcesForType.network.length == 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.
This added line is not executed by any test. Details
| if (network) { | ||
| type = network.type; | ||
| source = getNetworkSource(network) || ""; | ||
| mode = (type == "direct" ? (network.source.mode || "") : "bridge"); |
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 added line is not executed by any test. Details
- Use DialogRadioSelect etc as appropriate. - Change TypeAndSource to disable types without sources instead of disabling the sources selector. - When editing a interface, always include the current source in the choices, even if it doesn't actually exist. - When adding, re-create "default" network when none other exists to always have a path through the dialog.
d596cf6 to
000eda6
Compare
update_funcwhen creating value handles.This adds the obvious porcelain components for checkboxes, dropdown selects and radio buttons and uses them in the "nics" dialogs. At the same time, the dialog experience is improved in a number of ways:
Instead of being read-only with a tooltip, the mac field is now disabled with a helper text. The readonly state is rare and communicates less well than the disabled state. Tooltips (that open on hover) are not mobile friendly and generally awkward. There is enough space in the dialog for a inline explanation.
The "interface type" is selected with radio buttons instead of a dropdown. There are only three types and there is enough space to show them all. Instead of a info popover with questionably typography and content, the choices now have brief helper text to explain their purpose.
When a interface type has no sources, the type is disabled, instead of keeping it enabled and showing an empty list of sources, which would be a dead-end.
When editing a interface, the current source is always in the "Source" dropdown, even if it doesn't currently exist. Consequently, the current type is always enabled.
When adding a interface and there are no virtual networks, the "Source" dropdown offers to to create the "default" network (which really should always exist anyway). This means that the "network" type is always enabled.