From 88807c7839c2bc31d1edcf49099b5e62331bccaa Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:18:38 -0400 Subject: [PATCH 1/3] HPCC-30351 ECL Watch v9 fix WU results buttons Open (Legacy) button didn't work and Visualize button was missing Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/eclwatch/VizWidget.js | 2 +- esp/src/src-react/components/Results.tsx | 16 ++++++++++++++-- .../src-react/components/WorkunitDetails.tsx | 17 ++++++++++------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/esp/src/eclwatch/VizWidget.js b/esp/src/eclwatch/VizWidget.js index 4708c10b94c..6ff09e500b7 100644 --- a/esp/src/eclwatch/VizWidget.js +++ b/esp/src/eclwatch/VizWidget.js @@ -391,7 +391,7 @@ define([ refreshData: function () { if (this.limit.get("value") > this.rows.length) { - var result = this.wu.results[this.params.Sequence]; + var result = this.wu.results.filter(r => r.Sequence == this.params.Sequence)[0]; var context = this; result.fetchNRows(this.rows.length, this.limit.get("value")).then(function (response) { context.rows = context.rows.concat(response); diff --git a/esp/src/src-react/components/Results.tsx b/esp/src/src-react/components/Results.tsx index f867da58f61..58d6ac9f890 100644 --- a/esp/src/src-react/components/Results.tsx +++ b/esp/src/src-react/components/Results.tsx @@ -91,10 +91,22 @@ export const Results: React.FunctionComponent = ({ key: "open legacy", text: nlsHPCC.OpenLegacyMode, disabled: !uiState.hasSelection, iconProps: { iconName: "WindowEdit" }, onClick: () => { if (selection.length === 1) { - window.location.href = `#/workunits/${wuid}/outputs/${selection[0].Name}/legacy`; + window.location.href = `#/workunits/${wuid}/outputs/${selection[0].Name}?__legacy`; } else { for (let i = selection.length - 1; i >= 0; --i) { - window.open(`#/workunits/${wuid}/outputs/${selection[i].Name}/legacy`, "_blank"); + window.open(`#/workunits/${wuid}/outputs/${selection[i].Name}?__legacy`, "_blank"); + } + } + } + }, + { + key: "visualize", text: nlsHPCC.Visualize, disabled: !uiState.hasSelection, iconProps: { iconName: "BarChartVertical" }, + onClick: () => { + if (selection.length === 1) { + window.location.href = `#/workunits/${wuid}/outputs/${selection[0].Sequence}?__visualize`; + } else { + for (let i = selection.length - 1; i >= 0; --i) { + window.open(`#/workunits/${wuid}/outputs/${selection[i].Sequence}?__visualize`, "_blank"); } } } diff --git a/esp/src/src-react/components/WorkunitDetails.tsx b/esp/src/src-react/components/WorkunitDetails.tsx index c09f3ef5806..8b17f47aa53 100644 --- a/esp/src/src-react/components/WorkunitDetails.tsx +++ b/esp/src/src-react/components/WorkunitDetails.tsx @@ -11,18 +11,19 @@ import { DojoAdapter } from "../layouts/DojoAdapter"; import { pivotItemStyle } from "../layouts/pivot"; import { pushUrl } from "../util/history"; import { WorkunitPersona } from "./controls/StateIcon"; -import { Results } from "./Results"; -import { Variables } from "./Variables"; -import { SourceFiles } from "./SourceFiles"; import { Helpers } from "./Helpers"; +import { IFrame } from "./IFrame"; +import { Logs } from "./Logs"; +import { Metrics } from "./Metrics"; import { Queries } from "./Queries"; import { Resources } from "./Resources"; +import { Result } from "./Result"; +import { Results } from "./Results"; import { FetchEditor, WUXMLSourceEditor } from "./SourceEditor"; +import { SourceFiles } from "./SourceFiles"; +import { Variables } from "./Variables"; import { Workflows } from "./Workflows"; -import { Metrics } from "./Metrics"; import { WorkunitSummary } from "./WorkunitSummary"; -import { Result } from "./Result"; -import { Logs } from "./Logs"; const logger = scopedLogger("src-react/components/WorkunitDetails.tsx"); @@ -84,7 +85,9 @@ export const WorkunitDetails: React.FunctionComponent = ({ {state ? - : + queryParams.hasOwnProperty("__legacy") ?