From df59bb7dcf63205f32e61a54554ea077f4e2c86a Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 5 Aug 2022 14:34:39 -0400 Subject: [PATCH] lint and polish --- controller/overview.go | 1 - ui/src/Environments.js | 16 +++++++++++++--- ui/src/Services.js | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/controller/overview.go b/controller/overview.go index 1f26550d..dbf95a1d 100644 --- a/controller/overview.go +++ b/controller/overview.go @@ -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(), diff --git a/ui/src/Environments.js b/ui/src/Environments.js index d0b781a9..4eac32a5 100644 --- a/ui/src/Environments.js +++ b/ui/src/Environments.js @@ -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 }) => - 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 (
@@ -45,6 +54,7 @@ const Environments = (props) => { expandableRows expandableRowsComponent={servicesComponent} expandableRowExpanded={servicesExpanded} + conditionalRowStyles={conditionalRowStyles} />
)} diff --git a/ui/src/Services.js b/ui/src/Services.js index 31057f70..b7bc9b06 100644 --- a/ui/src/Services.js +++ b/ui/src/Services.js @@ -18,8 +18,8 @@ const Services = (props) => { sortable: true, }, { - name: 'Active', - selector: row => row.active, + name: 'Updated', + selector: row => row.updatedAt, sortable: true } ]