-
Notifications
You must be signed in to change notification settings - Fork 30
Render VmDetails with deleted template curreclty. #287
Render VmDetails with deleted template curreclty. #287
Conversation
1c0bf32
to
f243916
Compare
Pull Request Test Coverage Report for Build 1088
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1193
💛 - Coveralls |
wip until fixing coverage ... |
if (this.state.editing && !this.isVmOff(vm, launcherPod, importerPods, migration)) { | ||
this.setEditing(false); | ||
} | ||
|
||
// Check template, if template is missing, update view. | ||
if (getVmTemplate(vm) != null && this.state.templateError === PENDING_STR) { |
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 component will most likely be rerendered multiple times, but strictly speaking componentDidUpdate
will not be called for initial render.
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.
Thanks ! will fix that.
|
||
// Check template, if template is missing, update view. | ||
if (getVmTemplate(vm) != null && this.state.templateError === PENDING_STR) { | ||
retrieveVmTemplate(k8sGet, vm) |
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.
retrieveVmTemplate is already called for the flavor. Please call this method only once.
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.
👍
@@ -15,6 +15,8 @@ import { getId } from '../../../../selectors'; | |||
|
|||
const testVmDetails = (vm, otherProps) => <VmDetails {...VmDetailsFixture[0].props} vm={vm} {...otherProps} />; | |||
|
|||
const flushAllPromises = () => new Promise(resolve => setImmediate(resolve)); |
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 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.
Nice, thanks ❗ 👍
88af55e
to
a9e0a26
Compare
71bde61
to
3748b64
Compare
7de0d06
to
96e3563
Compare
b0942e7
to
93dd926
Compare
@yaacov I wonder if its okay to not show anything in UI if we cannot load the template ? We use the loaded template to get possible flavors when editing. Lets consider this flow:
@matthewcarleton WDYT ? |
@@ -145,7 +145,10 @@ export class VmTemplateDetails extends React.Component { | |||
const { vmTemplate, dataVolumes, NamespaceResourceLink, LoadingComponent } = this.props; | |||
const id = getId(vmTemplate); | |||
const vm = selectVm(vmTemplate.objects); | |||
const baseTemplateLabels = getVmTemplate(vmTemplate); | |||
const getTemplateDisplayName = () => { |
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 meant, can we replace the getVmTemplate method? So it can be also reused in vmDetails.
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 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 think it's ok now 💮
@suomiy WDYT ? |
@suomiy @matthewcarleton do we need some labels to the inputs in edit mode ? we curently have:
should it have labels in edit mode, e.g.
WDYT ? b - Does |
7c51b51
to
43c9da8
Compare
yup, I would make the margin similar to the dropdown
+1, that is a good remark. I guess it has to be some regression with InlineFormFactory, because It already has a title. Can you look at it? |
Sure 👍 |
const id = getId(vmTemplate); | ||
const vm = selectVm(vmTemplate.objects); | ||
const baseTemplate = getVmTemplate(vmTemplate); | ||
const baseTemplateLabels = getTemplateDisplayName(getVmTemplate(vmTemplate)); |
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.
nit: variable name
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.
sorry ... baseTemplateName
?
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, yup could be or baseTemplateDisplayName
@suomiy this is nearing the end 🎉 🎈 , should I squash, or leave separate commits for easier review ? |
@yaacov this looks great, thanks! One question, what happens when the available CPU/Memory is exceeded? |
TL;DR - I do not know. IFAIK we do not have the p.s. |
1dfe303
to
f252b77
Compare
…ng icon on template label instead. Ref: BZ1685393 1- Shaw warning triangle when template is missing. 2- Replace dropdown with div when only one option avaliable. 3- Add link to template resource. 4- Add deleted template test to vmTemplateDetails. 5- Show labels in the inline flavors edit form. 6- Add css to flavor label.
f252b77
to
5d3a01c
Compare
Currently, we do not have a way to know the quota AFAIK. The request will go ok, just the VM will fail with an error the next time you try to start it. |
don't worry about that. It will be squashed on merge |
is this present in this PR? |
Aaa... forgot to do |
@suomiy ah ok. Ya it would be a nicer experience for sure to know what the limit is at the time. Would it be possible to explore adding that feature (in another PR :) ) |
I think this should be explored on the backend. Doesn't seem like we can do much about it here in the UI. @jelkosz Do you have some additional information on this issue? |
looks good, merging |
Description
When we want to render VmDetails with missing VmTemplate we get a warning that we can not find the template. But It is OK to delete a template of an existing vm, the view should silently fall back to vm's current resources.
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1685393
Screenshots
When template is missing, show warning triangle instead of an error:
Replace drop-down with a label when only one flavor option is available:
Add an optional template resource link method to vmDetails:
Show labels for CPU and Memory in flavor form: