Skip to content

Commit

Permalink
Merge pull request #18421 from jeclrsg/hpcc-31354-wu-details-ecl-tab-…
Browse files Browse the repository at this point in the history
…on-failed

HPCC-31354 ECL Watch v9 display ECL for failed WUs
  • Loading branch information
GordonSmith authored Mar 15, 2024
2 parents 86f38de + ad83e18 commit 1af3fa6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions esp/src/src-react/components/ECLArchive.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from "react";
import { CommandBar, ContextualMenuItemType, ICommandBarItemProps } from "@fluentui/react";
import { WUDetails, IScope } from "@hpcc-js/comms";
import { Workunit, WUDetails, IScope } from "@hpcc-js/comms";
import { scopedLogger } from "@hpcc-js/util";
import nlsHPCC from "src/nlsHPCC";
import { useWorkunitArchive } from "../hooks/workunit";
import { useWorkunitMetrics } from "../hooks/metrics";
Expand All @@ -12,6 +13,8 @@ import { ECLArchiveTree } from "./ECLArchiveTree";
import { ECLArchiveEditor } from "./ECLArchiveEditor";
import { MetricsPropertiesTables } from "./MetricsPropertiesTables";

const logger = scopedLogger("src-react/components/ECLArchive.tsx");

const scopeFilterDefault: WUDetails.RequestNS.ScopeFilter = {
MaxDepth: 999999,
ScopeTypes: ["graph"]
Expand Down Expand Up @@ -54,8 +57,15 @@ export const ECLArchive: React.FunctionComponent<ECLArchiveProps> = ({
setSelectionText(archive?.content(selection) ?? "");
setMarkers(archive?.markers(selection) ?? []);
setSelectedMetrics(archive?.metrics(selection) ?? []);
} else {
if (archive && !archive.build) {
const wu = Workunit.attach({ baseUrl: "" }, wuid);
wu.fetchQuery().then(function (query) {
setSelectionText(query?.Text ?? "");
}).catch(err => logger.error(err));
}
}
}, [archive, metrics.length, selection]);
}, [archive, metrics.length, selection, wuid]);

const setSelectedItem = React.useCallback((selId: string) => {
pushUrl(`${parentUrl}/${selId}`);
Expand Down

0 comments on commit 1af3fa6

Please sign in to comment.