-
Notifications
You must be signed in to change notification settings - Fork 30
Details, Inventory card and Health card for Storage Dashboard #311
Conversation
Pull Request Test Coverage Report for Build 1271
💛 - Coveralls |
Sorry for the XXL PR, Once this is merged will make sure all that for each component we send it separately. |
b8f25e5
to
a4082b5
Compare
@mareklibra @rawagner please review. |
a4082b5
to
d700c65
Compare
</DashboardCard> | ||
); | ||
|
||
const getClusterName = cephCluster => { |
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.
no need to have this as separate function - you can directly use getName(cephCluster) and the result will be the same
}, | ||
{ | ||
component: StorageDetails, | ||
name: 'Loading cluster details', |
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 Loading storage details
|
||
const InventoryBody = ({ nodes, pods, vms, vmis, pvs, pvcs, migrations }) => ( | ||
<React.Fragment> | ||
<InventoryRow title="Nodes" {...mapNodesToProps(nodes)} /> |
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.
Looking at the design - you want Nodes
, Disks
, Pods
, PVs
and PVCs
. You are missing Disks
but I guess you will add them later, however VMs
here are not needed so you can get rid of vm
, vmi
and migrations
@@ -0,0 +1,74 @@ | |||
import { getVmStatus, VM_STATUS_ALL_ERROR, VM_STATUS_ALL_PROGRESS } from '../../../utils/status/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.
this file is the same as ClusterOverview/Inventory/utils
so you could move it to Dashboard/Inventory/utils
and reuse it in ClusterOverview/Inventory
and StorageOverview/Inventory
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.
maybe mapStatuses
and resolveStatusResult
could be moved. But I am not sure about the other mapXToProps. Shouldn't these be different for each dashboard?
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.
as written in #311 (comment) I think that its fine to have overlapping information so IMHO it makes sense to move these utils as other dashboards will use it.
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 that is the case then sure, it makes sense to move them
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.
metadata: { | ||
// should be the same namespaces as the vm | ||
name: 'disk-one_pv', | ||
namespace: 'default', |
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.
PVs are not namespaced (applies for all other occurrences)
import { NOT_HANDLED } from '../common'; | ||
|
||
const statusMapper = { | ||
Available: PV_STATUS_AVAILABLE, |
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.
you could convert all values to form such as Available: { status: PV_STATUS_AVAILABLE }
and then in getPvStatus
you could just do pv => statusMapper[getStatusPhase(pv)] || {status: PV_STATUS_DEFAULT};
. getMappedStatus
could be deleted then
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.
the statusMapper is only meant to be the mapping of constant -> constant, getMappedStatus can include other functionality in the future.
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.
@suomiy ok, i think there is not action needed @cloudbehl :)
@@ -0,0 +1,49 @@ | |||
import React from 'react'; |
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 extract some parts of Health to Dashboard
but I think this is fine for now, we can do it as a follow up
export const PV_STATUS_DEFAULT = 'PV_STATUS_DEFAULT'; | ||
|
||
export const PV_STATUS_ALL_ERROR = [PV_STATUS_FAILED]; | ||
export const PV_STATUS_ALL_PROGRESS = [PV_STATUS_AVAILABLE]; |
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.
does it make sense to have Available PV shown as inProgress?
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.
@suomiy The PV that are not bound and are available to be claimed I put them under this category. I was also bit confused about it, if you can provide some feedback on what should be shown in this category.
@@ -0,0 +1,74 @@ | |||
import { getVmStatus, VM_STATUS_ALL_ERROR, VM_STATUS_ALL_PROGRESS } from '../../../utils/status/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.
maybe mapStatuses
and resolveStatusResult
could be moved. But I am not sure about the other mapXToProps. Shouldn't these be different for each dashboard?
<InventoryRow title="Nodes" {...mapNodesToProps(nodes)} /> | ||
<InventoryRow title="Pods" {...mapPodsToProps(pods)} /> | ||
<InventoryRow title="PVs" {...mapPvsToProps(pvs)} /> | ||
<InventoryRow title="PVCs" {...mapPvcsToProps(pvcs)} /> |
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.
what is the point of showing the same information in both dashboards?
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 guess there will be overlapping information since Cluster Overview is very general and other dashboards will want to focus more on some specifics but still show important parts like PVs and PVCs in case of Storage.
</div> | ||
); | ||
|
||
const OCSHealthMap = { |
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.
maybe it would make sense to make a status component out of this
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.
+1 lets do this when we refactor Health Card
ad167e3
to
0c35f96
Compare
- Moved Inventory utils to common place
0c35f96
to
d9ad2ee
Compare
ref: kubevirt/web-ui#260