Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32030 ECL Watch v9 fix multi ESP calls on Query details #18747

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions esp/src/src-react/components/QueryDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,23 @@ export const QueryDetails: React.FunctionComponent<QueryDetailsProps> = ({
const [logicalFileCount, setLogicalFileCount] = React.useState<number>(0);
const [superFileCount, setSuperFileCount] = React.useState<number>(0);
const [libsUsedCount, setLibsUsedCount] = React.useState<number>(0);
const [suspended, setSuspended] = React.useState(false);
const [activated, setActivated] = React.useState(false);

React.useEffect(() => {
setQuery(ESPQuery.Get(querySet, queryId));
}, [setQuery, queryId, querySet]);

React.useEffect(() => {
query?.getDetails().then(({ WUQueryDetailsResponse }) => {
query?.getDetails().then(() => {
setWuid(query.Wuid);
setLogicalFileCount(query.LogicalFiles?.Item?.length);
setSuperFileCount(query.SuperFiles?.SuperFile?.length);
setLibsUsedCount(query.LibrariesUsed?.Item?.length);
setActivated(query.Activated);
setSuspended(query.Suspended);
});
}, [query, setLogicalFileCount, setSuperFileCount, setLibsUsedCount]);
}, [query]);

const onTabSelect = React.useCallback((tab: TabInfo) => {
switch (tab.id) {
Expand Down Expand Up @@ -100,7 +104,7 @@ export const QueryDetails: React.FunctionComponent<QueryDetailsProps> = ({
<div style={{ height: "100%" }}>
<OverflowTabList tabs={tabs} selected={tab} onTabSelect={onTabSelect} size="medium" />
<DelayLoadedPanel visible={tab === "summary"} size={size}>
<QuerySummary queryId={queryId} querySet={querySet} />
<QuerySummary queryId={queryId} querySet={querySet} isSuspended={suspended} isActivated={activated} />
</DelayLoadedPanel>
<DelayLoadedPanel visible={tab === "errors"} size={size}>
<QueryErrors queryId={queryId} querySet={querySet} />
Expand Down
24 changes: 12 additions & 12 deletions esp/src/src-react/components/QuerySummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ const logger = scopedLogger("../components/QuerySummary.tsx");
interface QuerySummaryProps {
querySet: string;
queryId: string;
isSuspended?: boolean;
isActivated?: boolean;
}

export const QuerySummary: React.FunctionComponent<QuerySummaryProps> = ({
querySet,
queryId
queryId,
isSuspended = false,
isActivated = false
}) => {

const [query, setQuery] = React.useState<any>();
const [wuid, setWuid] = React.useState<string>("");
const [suspended, setSuspended] = React.useState(false);
const [activated, setActivated] = React.useState(false);
const [suspended, setSuspended] = React.useState(isSuspended);
const [activated, setActivated] = React.useState(isActivated);

const [DeleteConfirm, setShowDeleteConfirm] = useConfirm({
title: nlsHPCC.Delete,
Expand Down Expand Up @@ -57,12 +60,9 @@ export const QuerySummary: React.FunctionComponent<QuerySummaryProps> = ({
}, [queryId, querySet]);

React.useEffect(() => {
query?.getDetails().then(({ WUQueryDetailsResponse }) => {
setWuid(query?.Wuid);
setSuspended(query.Suspended);
setActivated(query.Activated);
});
}, [query]);
setActivated(isActivated);
setSuspended(isSuspended);
}, [isActivated, isSuspended]);

const buttons = React.useMemo((): ICommandBarItemProps[] => [
{
Expand All @@ -73,7 +73,7 @@ export const QuerySummary: React.FunctionComponent<QuerySummaryProps> = ({
{
key: "save", text: nlsHPCC.Save, iconProps: { iconName: "Save" }, disabled: !canSave,
onClick: () => {
const selection = [{ QuerySetId: querySet, Id: queryId }];
const selection = [{ QuerySetId: querySet, Id: queryId, Name: query?.QueryName }];
const actions = [];
if (suspended !== query?.Suspended) {
actions.push(WsWorkunits.WUQuerysetQueryAction(selection, suspended ? "Suspend" : "Unsuspend"));
Expand Down Expand Up @@ -125,7 +125,7 @@ export const QuerySummary: React.FunctionComponent<QuerySummaryProps> = ({
}} />
<Divider>{nlsHPCC.Workunit}</Divider>
<TableGroup fields={{
"wuid": { label: nlsHPCC.WUID, type: "link", value: wuid, href: `#/workunits/${wuid}`, readonly: true },
"wuid": { label: nlsHPCC.WUID, type: "link", value: query?.Wuid, href: `#/workunits/${query?.Wuid}`, readonly: true },
"dll": { label: nlsHPCC.Dll, type: "string", value: query?.Dll, readonly: true },
}} />
<Divider>{nlsHPCC.Other}</Divider>
Expand Down
Loading