Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.0.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.2.x
  • Loading branch information
GordonSmith committed Sep 19, 2023
2 parents 6b4398a + 99c9cdf commit 2f7aa54
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion esp/src/eclwatch/LZBrowseWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions esp/src/src-react/components/ECLPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ const ECLEditorToolbar: React.FunctionComponent<ECLEditorToolbarProps> = ({
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 === "") {
Expand All @@ -249,7 +249,7 @@ const ECLEditorToolbar: React.FunctionComponent<ECLEditorToolbarProps> = ({

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"));
Expand Down
4 changes: 2 additions & 2 deletions esp/src/src-react/components/LandingZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const LandingZone: React.FunctionComponent<LandingZoneProps> = ({
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({})]);
},
Expand All @@ -139,7 +139,7 @@ export const LandingZone: React.FunctionComponent<LandingZoneProps> = ({
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;
}
Expand Down
11 changes: 8 additions & 3 deletions esp/src/src-react/components/WorkunitDetails.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -54,20 +58,21 @@ export const WorkunitDetails: React.FunctionComponent<WorkunitDetailsProps> = ({

const [logCount, setLogCount] = React.useState<number | string>("*");
const [logsDisabled, setLogsDisabled] = React.useState(true);
React.useEffect(() => {

useDeepEffect(() => {
hasLogAccess().then(response => {
setLogsDisabled(!response);
return response;
}).then(hasLogAccess => {
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 <SizeMe monitorHeight>{({ size }) =>
<Pivot overflowBehavior="menu" style={{ height: "100%" }} selectedKey={tab} onLinkClick={evt => pushUrl(`/workunits/${wuid}/${evt.props.itemKey}`)}>
Expand Down

0 comments on commit 2f7aa54

Please sign in to comment.