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 {
logrus.Infof("active = %t", svc.Active)
es.Services = append(es.Services, &rest_model_zrok.Service{
Active: svc.Active,
CreatedAt: svc.CreatedAt.String(),

View File

@ -24,14 +24,23 @@ const Environments = (props) => {
sortable: true,
},
{
name: 'Active',
selector: row => row.environment.active ? 'Active' : 'Inactive',
name: 'Updated',
selector: row => row.environment.updatedAt,
sortable: true,
},
]
const conditionalRowStyles = [
{
when: row => !row.environment.active,
style: {
display: 'none'
}
}
]
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 (
<div>
@ -45,6 +54,7 @@ const Environments = (props) => {
expandableRows
expandableRowsComponent={servicesComponent}
expandableRowExpanded={servicesExpanded}
conditionalRowStyles={conditionalRowStyles}
/>
</div>
)}

View File

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