lint and polish

This commit is contained in:
Michael Quigley 2022-08-05 14:34:39 -04:00
parent 17038dc4e7
commit df59bb7dcf
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
3 changed files with 15 additions and 6 deletions

View File

@ -38,7 +38,6 @@ func overviewHandler(_ metadata.OverviewParams, principal *rest_model_zrok.Princ
}, },
} }
for _, svc := range svcs { for _, svc := range svcs {
logrus.Infof("active = %t", svc.Active)
es.Services = append(es.Services, &rest_model_zrok.Service{ es.Services = append(es.Services, &rest_model_zrok.Service{
Active: svc.Active, Active: svc.Active,
CreatedAt: svc.CreatedAt.String(), CreatedAt: svc.CreatedAt.String(),

View File

@ -24,14 +24,23 @@ const Environments = (props) => {
sortable: true, sortable: true,
}, },
{ {
name: 'Active', name: 'Updated',
selector: row => row.environment.active ? 'Active' : 'Inactive', selector: row => row.environment.updatedAt,
sortable: true, sortable: true,
}, },
] ]
const conditionalRowStyles = [
{
when: row => !row.environment.active,
style: {
display: 'none'
}
}
]
const servicesComponent = ({ data }) => <Services services={data.services} /> const servicesComponent = ({ data }) => <Services services={data.services} />
const servicesExpanded = row => row.services != null && row.services.length > 0 const servicesExpanded = row => row.services != null && row.services.length > 0 && row.services.some((row) => row.active)
return ( return (
<div> <div>
@ -45,6 +54,7 @@ const Environments = (props) => {
expandableRows expandableRows
expandableRowsComponent={servicesComponent} expandableRowsComponent={servicesComponent}
expandableRowExpanded={servicesExpanded} expandableRowExpanded={servicesExpanded}
conditionalRowStyles={conditionalRowStyles}
/> />
</div> </div>
)} )}

View File

@ -18,8 +18,8 @@ const Services = (props) => {
sortable: true, sortable: true,
}, },
{ {
name: 'Active', name: 'Updated',
selector: row => row.active, selector: row => row.updatedAt,
sortable: true sortable: true
} }
] ]