diff --git a/esp/src/eclwatch/LZBrowseWidget.js b/esp/src/eclwatch/LZBrowseWidget.js index 0fb0452bd16..1523c37fbf6 100644 --- a/esp/src/eclwatch/LZBrowseWidget.js +++ b/esp/src/eclwatch/LZBrowseWidget.js @@ -723,7 +723,7 @@ define([ label: this.i18n.Name, sortable: false, shouldExpand: function (row, level) { - if ((context.dzExpanded === "" || context.dzExpanded === row.data.DropZone.Name) && level <= 1) { + if ((context.dzExpanded === "" || context.dzExpanded === row.data.DropZone?.Name) && level <= 1) { context.dzExpanded = row.data.DropZone.Name; return true; } diff --git a/esp/src/src-react/components/ECLPlayground.tsx b/esp/src/src-react/components/ECLPlayground.tsx index 9baa721524a..7c3d436c02c 100644 --- a/esp/src/src-react/components/ECLPlayground.tsx +++ b/esp/src/src-react/components/ECLPlayground.tsx @@ -234,11 +234,11 @@ const ECLEditorToolbar: React.FunctionComponent = ({ const submitWU = React.useCallback(async () => { const wu = await Workunit.create({ baseUrl: "" }); - await wu.update({ QueryText: editor.ecl() }); + await wu.update({ Jobname: queryName, QueryText: editor.ecl() }); await wu.submit(cluster); wu.watchUntilComplete(changes => playgroundResults(wu)); - }, [cluster, editor, playgroundResults]); + }, [cluster, editor, playgroundResults, queryName]); const publishWU = React.useCallback(async () => { if (queryName === "") { @@ -249,7 +249,7 @@ const ECLEditorToolbar: React.FunctionComponent = ({ const wu = await Workunit.create({ baseUrl: "" }); - await wu.update({ QueryText: editor.ecl() }); + await wu.update({ Jobname: queryName, QueryText: editor.ecl() }); await wu.submit(cluster, WUUpdate.Action.Compile); wu.watchUntilComplete(changes => playgroundResults(wu, "publish")); diff --git a/esp/src/src-react/components/LandingZone.tsx b/esp/src/src-react/components/LandingZone.tsx index 391be3d9609..ea19f848aad 100644 --- a/esp/src/src-react/components/LandingZone.tsx +++ b/esp/src/src-react/components/LandingZone.tsx @@ -115,7 +115,7 @@ export const LandingZone: React.FunctionComponent = ({ filename: "landingZones", getSelected: function () { if (filter?.__dropZone) { - return this.inherited(arguments, [FileSpray.CreateLandingZonesFilterStore({})]); + return this.inherited(arguments, [FileSpray.CreateLandingZonesFilterStore({ dropZone: filter.__dropZone })]); } return this.inherited(arguments, [FileSpray.CreateFileListStore({})]); }, @@ -139,7 +139,7 @@ export const LandingZone: React.FunctionComponent = ({ label: nlsHPCC.Name, sortable: false, shouldExpand: function (row, level) { - if ((dzExpanded === "" || dzExpanded === row.data.DropZone.Name) && level <= 1) { + if ((dzExpanded === "" || dzExpanded === row.data.DropZone?.Name) && level <= 1) { dzExpanded = row.data.DropZone.Name; return true; } diff --git a/esp/src/src-react/components/WorkunitDetails.tsx b/esp/src/src-react/components/WorkunitDetails.tsx index bc05ace9119..c09f3ef5806 100644 --- a/esp/src/src-react/components/WorkunitDetails.tsx +++ b/esp/src/src-react/components/WorkunitDetails.tsx @@ -1,10 +1,12 @@ import * as React from "react"; import { IPivotItemProps, Pivot, PivotItem } from "@fluentui/react"; +import { scopedLogger } from "@hpcc-js/util"; import { SizeMe } from "react-sizeme"; import nlsHPCC from "src/nlsHPCC"; import { service, hasLogAccess } from "src/ESPLog"; import { useWorkunit } from "../hooks/workunit"; import { useUserTheme } from "../hooks/theme"; +import { useDeepEffect } from "../hooks/deepHooks"; import { DojoAdapter } from "../layouts/DojoAdapter"; import { pivotItemStyle } from "../layouts/pivot"; import { pushUrl } from "../util/history"; @@ -22,6 +24,8 @@ import { WorkunitSummary } from "./WorkunitSummary"; import { Result } from "./Result"; import { Logs } from "./Logs"; +const logger = scopedLogger("src-react/components/WorkunitDetails.tsx"); + interface WorkunitDetailsProps { wuid: string; tab?: string; @@ -54,7 +58,8 @@ export const WorkunitDetails: React.FunctionComponent = ({ const [logCount, setLogCount] = React.useState("*"); const [logsDisabled, setLogsDisabled] = React.useState(true); - React.useEffect(() => { + + useDeepEffect(() => { hasLogAccess().then(response => { setLogsDisabled(!response); return response; @@ -62,12 +67,12 @@ export const WorkunitDetails: React.FunctionComponent = ({ if (hasLogAccess) { service.GetLogsEx({ ...queryParams, jobId: wuid, LogLineStartFrom: 0, LogLineLimit: 10 }).then(response => { // HPCC-27711 - Requesting LogLineLimit=1 causes issues setLogCount(response.total); - }); + }).catch((err) => logger.error(err)); } }).catch(() => { setLogsDisabled(true); }); - }, [queryParams, wuid]); + }, [wuid], [queryParams]); return {({ size }) => pushUrl(`/workunits/${wuid}/${evt.props.itemKey}`)}>