From c28a903e8aab1e1a8e3b11d8b08d22b55d2b1328 Mon Sep 17 00:00:00 2001 From: Jaap Rood Date: Wed, 3 Jun 2020 12:28:30 +0200 Subject: [PATCH 1/2] Disable EndpointDetails route through new feature flag --- workspaces/ui/.env | 3 ++- workspaces/ui/.env.development | 3 ++- .../src/components/dashboards/TestingDashboard.js | 13 ++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/workspaces/ui/.env b/workspaces/ui/.env index 400f50e392..6a76f8dc78 100644 --- a/workspaces/ui/.env +++ b/workspaces/ui/.env @@ -1,2 +1,3 @@ REACT_APP_TESTING_DASHBOARD=false -REACT_APP_TESTING_DASHBOARD_TEASER=false \ No newline at end of file +REACT_APP_TESTING_DASHBOARD_TEASER=false +REACT_APP_TESTING_DASHBOARD_ENDPOINT_DETAILS=false \ No newline at end of file diff --git a/workspaces/ui/.env.development b/workspaces/ui/.env.development index 92247e9df8..df72e65434 100644 --- a/workspaces/ui/.env.development +++ b/workspaces/ui/.env.development @@ -1,2 +1,3 @@ REACT_APP_TESTING_DASHBOARD=true -REACT_APP_TESTING_DASHBOARD_TEASER=false \ No newline at end of file +REACT_APP_TESTING_DASHBOARD_TEASER=false +REACT_APP_TESTING_DASHBOARD_ENDPOINT_DETAILS=true \ No newline at end of file diff --git a/workspaces/ui/src/components/dashboards/TestingDashboard.js b/workspaces/ui/src/components/dashboards/TestingDashboard.js index cbb6df029d..62911fa477 100644 --- a/workspaces/ui/src/components/dashboards/TestingDashboard.js +++ b/workspaces/ui/src/components/dashboards/TestingDashboard.js @@ -80,11 +80,14 @@ export default function TestingDashboardPage(props) { {hasCaptures ? (
- + {process.env.REACT_APP_TESTING_DASHBOARD_ENDPOINT_DETAILS === + 'true' && ( + + )} Date: Wed, 3 Jun 2020 12:38:18 +0200 Subject: [PATCH 2/2] Only render links to endpoint details route when feature flag for it is enabled --- .../src/components/testing/ReportSummary.js | 147 ++++++++++-------- 1 file changed, 78 insertions(+), 69 deletions(-) diff --git a/workspaces/ui/src/components/testing/ReportSummary.js b/workspaces/ui/src/components/testing/ReportSummary.js index 4917c658b5..e9da9bdd50 100644 --- a/workspaces/ui/src/components/testing/ReportSummary.js +++ b/workspaces/ui/src/components/testing/ReportSummary.js @@ -115,83 +115,92 @@ export default function ReportSummary(props) { {endpoints.length > 0 ? (
    - {endpoints.map((endpoint) => ( -
  • - - { + const endpointHeader = ( +
    + -
    + {endpoint.descriptor.httpMethod} + + + {endpoint.descriptor.fullPath} + + +
    + {endpoint.counts.diffs > 0 && ( - {endpoint.descriptor.httpMethod} + {endpoint.counts.diffs} + {endpoint.counts.diffs > 1 ? ' diffs' : ' diff'} - - {endpoint.descriptor.fullPath} - - -
    - {endpoint.counts.diffs > 0 && ( - - {endpoint.counts.diffs} - {endpoint.counts.diffs > 1 ? ' diffs' : ' diff'} - + )} + {endpoint.counts.incompliant > 0 ? ( + 0 ? ( - - - {endpoint.counts.incompliant}/ - {endpoint.counts.interactions} - - {' incompliant'} - - ) : ( - - - {endpoint.counts.compliant}/ - {endpoint.counts.interactions} - - {' compliant'} - + > + + {endpoint.counts.incompliant}/ + {endpoint.counts.interactions} + + {' incompliant'} + + ) : ( + -
    - - - {currentEndpointId && endpoint.id === currentEndpointId && ( - - )} - -
  • - ))} + > + + {endpoint.counts.compliant}/ + {endpoint.counts.interactions} + + {' compliant'} + + )} +
+ + ); + return ( +
  • + + {process.env.REACT_APP_TESTING_DASHBOARD_ENDPOINT_DETAILS === + 'true' ? ( + + {endpointHeader} + + ) : ( +
    {endpointHeader}
    + )} + {currentEndpointId && endpoint.id === currentEndpointId && ( + + )} +
    +
  • + ); + })} ) : ( // @TODO: revisit this empty state