From e862b9d29d65ba9981beb7173306cf174afdf8d1 Mon Sep 17 00:00:00 2001 From: Jorge Padilla Date: Wed, 7 Jun 2023 23:54:24 +0900 Subject: [PATCH] fix(frontend): fix analyzer results in trace DAG (#2674) --- web/cypress/e2e/TestRunDetail/Outputs.spec.ts | 3 + .../e2e/TestRunDetail/TestRunDetail.spec.ts | 2 + web/src/components/Drawer/Drawer.tsx | 1 + .../RunDetailTrace/RunDetailTrace.styled.ts | 2 + .../RunDetailTrace/Visualization.tsx | 8 +-- .../components/DAG/AnalyzerResults.styled.ts | 62 +++++++++++++++++++ .../components/DAG/AnalyzerResults.tsx | 44 +++++++++++++ .../components/DAG/SpanNode.styled.ts | 49 --------------- .../Visualization/components/DAG/SpanNode.tsx | 55 +++++++--------- .../hooks/__tests__/useElementSize.test.tsx | 8 --- web/src/hooks/useElementSize.tsx | 38 ------------ web/src/hooks/useOnClickOutside.tsx | 24 +++++++ web/src/redux/slices/Trace.slice.ts | 8 ++- web/src/selectors/Trace.selectors.ts | 4 ++ web/src/services/Span.service.ts | 21 +++---- 15 files changed, 183 insertions(+), 146 deletions(-) create mode 100644 web/src/components/Visualization/components/DAG/AnalyzerResults.styled.ts create mode 100644 web/src/components/Visualization/components/DAG/AnalyzerResults.tsx delete mode 100644 web/src/hooks/__tests__/useElementSize.test.tsx delete mode 100644 web/src/hooks/useElementSize.tsx create mode 100644 web/src/hooks/useOnClickOutside.tsx diff --git a/web/cypress/e2e/TestRunDetail/Outputs.spec.ts b/web/cypress/e2e/TestRunDetail/Outputs.spec.ts index 76e57d2ff0..4bb363ae6b 100644 --- a/web/cypress/e2e/TestRunDetail/Outputs.spec.ts +++ b/web/cypress/e2e/TestRunDetail/Outputs.spec.ts @@ -7,6 +7,7 @@ describe('Outputs', () => { // Open output flow from the Trace view (attributes) cy.selectRunDetailMode(2); cy.get('[data-cy=trace-node-database]', {timeout: 25000}).first().click({force: true}); + cy.get('[data-cy=toggle-drawer]', {timeout: 25000}).click({force: true}); cy.get('[data-cy=attributes-search-container] input').type('db.name'); cy.get('[data-cy=attribute-row-db-name] .ant-dropdown-trigger').click(); cy.contains('Create output').click(); @@ -45,6 +46,7 @@ describe('Outputs', () => { // Open output flow from the Trace view (attributes) cy.selectRunDetailMode(2); cy.get('[data-cy=trace-node-database]', {timeout: 25000}).first().click({force: true}); + cy.get('[data-cy=toggle-drawer]', {timeout: 25000}).click({force: true}); cy.get('[data-cy=attributes-search-container] input').type('db.name'); cy.get('[data-cy=attribute-row-db-name] .ant-dropdown-trigger').click(); cy.contains('Create output').click(); @@ -87,6 +89,7 @@ describe('Outputs', () => { // Open output flow from the Trace view (attributes) cy.selectRunDetailMode(2); cy.get('[data-cy=trace-node-database]', {timeout: 25000}).first().click({force: true}); + cy.get('[data-cy=toggle-drawer]', {timeout: 25000}).click({force: true}); cy.get('[data-cy=attributes-search-container] input').type('db.name'); cy.get('[data-cy=attribute-row-db-name] .ant-dropdown-trigger').click(); cy.contains('Create output').click(); diff --git a/web/cypress/e2e/TestRunDetail/TestRunDetail.spec.ts b/web/cypress/e2e/TestRunDetail/TestRunDetail.spec.ts index e67c5c4e7c..1c4b298a61 100644 --- a/web/cypress/e2e/TestRunDetail/TestRunDetail.spec.ts +++ b/web/cypress/e2e/TestRunDetail/TestRunDetail.spec.ts @@ -7,6 +7,7 @@ describe('Test Run Detail Views', () => { it('Trace view -> show the attribute list for a specific span', () => { cy.selectRunDetailMode(2); cy.get('[data-cy=trace-node-http]').click(); + cy.get('[data-cy=toggle-drawer]').click(); cy.get('[data-cy=attribute-list]').should('be.visible'); cy.get('[data-cy=attribute-row-http-method]').should('be.visible'); @@ -15,6 +16,7 @@ describe('Test Run Detail Views', () => { it('Trace view -> attribute list', () => { cy.selectRunDetailMode(2); cy.get('[data-cy=trace-node-http]').click(); + cy.get('[data-cy=toggle-drawer]').click(); cy.get('[data-cy=attribute-list]').should('be.visible'); }); diff --git a/web/src/components/Drawer/Drawer.tsx b/web/src/components/Drawer/Drawer.tsx index f6d006f752..a87be3cbb7 100644 --- a/web/src/components/Drawer/Drawer.tsx +++ b/web/src/components/Drawer/Drawer.tsx @@ -66,6 +66,7 @@ const Drawer = ({leftPanel, rightPanel}: IProps) => {