Skip to content

Commit

Permalink
HPCC-31629 Bump WsWorkunits to latest version
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Apr 18, 2024
1 parent eb039c7 commit a0d57f7
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 202 deletions.
254 changes: 127 additions & 127 deletions esp/src/package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions esp/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
"@fluentui/react-hooks": "8.7.0",
"@fluentui/react-icons-mdl2": "1.3.59",
"@fluentui/react-migration-v8-v9": "9.6.3",
"@hpcc-js/chart": "2.83.1",
"@hpcc-js/codemirror": "2.61.2",
"@hpcc-js/common": "2.71.15",
"@hpcc-js/comms": "2.91.3",
"@hpcc-js/chart": "2.83.2",
"@hpcc-js/codemirror": "2.61.3",
"@hpcc-js/common": "2.71.16",
"@hpcc-js/comms": "2.92.0",
"@hpcc-js/dataflow": "8.1.6",
"@hpcc-js/eclwatch": "2.73.44",
"@hpcc-js/graph": "2.85.13",
"@hpcc-js/html": "2.42.18",
"@hpcc-js/layout": "2.49.20",
"@hpcc-js/map": "2.77.19",
"@hpcc-js/other": "2.15.20",
"@hpcc-js/phosphor": "2.18.6",
"@hpcc-js/react": "2.53.14",
"@hpcc-js/tree": "2.40.15",
"@hpcc-js/util": "2.50.6",
"@hpcc-js/eclwatch": "2.74.0",
"@hpcc-js/graph": "2.85.14",
"@hpcc-js/html": "2.42.19",
"@hpcc-js/layout": "2.49.21",
"@hpcc-js/map": "2.77.20",
"@hpcc-js/other": "2.15.21",
"@hpcc-js/phosphor": "2.18.7",
"@hpcc-js/react": "2.53.15",
"@hpcc-js/tree": "2.40.16",
"@hpcc-js/util": "2.51.0",
"@kubernetes/client-node": "0.20.0",
"clipboard": "2.0.11",
"d3-dsv": "3.0.1",
Expand Down
10 changes: 5 additions & 5 deletions esp/src/src-react/components/ECLArchive.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { CommandBar, ContextualMenuItemType, ICommandBarItemProps } from "@fluentui/react";
import { Workunit, WUDetails, IScope } from "@hpcc-js/comms";
import { Workunit, WsWorkunits, IScope } from "@hpcc-js/comms";
import { scopedLogger } from "@hpcc-js/util";
import nlsHPCC from "src/nlsHPCC";
import { useWorkunitArchive } from "../hooks/workunit";
Expand All @@ -15,14 +15,14 @@ import { MetricsPropertiesTables } from "./MetricsPropertiesTables";

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

const scopeFilterDefault: WUDetails.RequestNS.ScopeFilter = {
const scopeFilterDefault: Partial<WsWorkunits.ScopeFilter> = {
MaxDepth: 999999,
ScopeTypes: ["graph"]
ScopeTypes: { ScopeType: ["graph"] }
};

const nestedFilterDefault: WUDetails.RequestNS.NestedFilter = {
const nestedFilterDefault: WsWorkunits.NestedFilter = {
Depth: 999999,
ScopeTypes: ["activity"]
ScopeTypes: { ScopeType: ["activity"] }
};

interface ECLArchiveProps {
Expand Down
6 changes: 3 additions & 3 deletions esp/src/src-react/components/Metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,17 +198,17 @@ export const Metrics: React.FunctionComponent<MetricsProps> = ({
.request({
ScopeFilter: {
MaxDepth: 3,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
},
NestedFilter: {
Depth: 0,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
},
PropertiesToReturn: {
AllProperties: false,
AllStatistics: true,
AllHints: false,
Properties: ["WhenStarted", "TimeElapsed", "TimeLocalExecute"]
Properties: { Property: ["WhenStarted", "TimeElapsed", "TimeLocalExecute"] }
},
ScopeOptions: {
IncludeId: true,
Expand Down
6 changes: 3 additions & 3 deletions esp/src/src-react/components/WorkunitsDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";
import { Dropdown, IStackItemStyles, IStackStyles, IStackTokens, Overlay, Spinner, SpinnerSize, Stack, Text } from "@fluentui/react";
import { useConst } from "@fluentui/react-hooks";
import { Card, CardHeader, CardPreview } from "@fluentui/react-components";
import { WorkunitsService, WUQuery } from "@hpcc-js/comms";
import { WorkunitsService, WsWorkunits } from "@hpcc-js/comms";
import { Area, Column, Pie, Bar } from "@hpcc-js/chart";
import { chain, filter, group, map, sort } from "@hpcc-js/dataflow";
import * as Observable from "dojo/store/Observable";
Expand Down Expand Up @@ -33,7 +33,7 @@ const innerStackTokens: IStackTokens = {

const service = new WorkunitsService({ baseUrl: "" });

interface WorkunitEx extends WUQuery.ECLWorkunit {
interface WorkunitEx extends WsWorkunits.ECLWorkunit {
Day: string;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ export const WorkunitsDashboard: React.FunctionComponent<WorkunitsDashboardProps
EndDate: end.toISOString(),
PageSize: 999999
}).then(response => {
setWorkunits([...map(response.Workunits.ECLWorkunit, (row: WUQuery.ECLWorkunit) => ({ ...row, Day: wuidToDate(row.Wuid) }))]);
setWorkunits([...map(response.Workunits.ECLWorkunit, (row: WsWorkunits.ECLWorkunit) => ({ ...row, Day: wuidToDate(row.Wuid) }))]);
setLoading(false);
});
}, [filterProps.lastNDays]);
Expand Down
36 changes: 18 additions & 18 deletions esp/src/src-react/hooks/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { useConst, useForceUpdate } from "@fluentui/react-hooks";
import { WUDetails, WUDetailsMeta, WorkunitsService, IScope } from "@hpcc-js/comms";
import { WsWorkunits, WorkunitsService, IScope } from "@hpcc-js/comms";
import { scopedLogger } from "@hpcc-js/util";
import { userKeyValStore } from "src/KeyValStore";
import { useWorkunit } from "./workunit";
Expand Down Expand Up @@ -102,27 +102,27 @@ export enum FetchStatus {
COMPLETE
}

const scopeFilterDefault: WUDetails.RequestNS.ScopeFilter = {
const scopeFilterDefault: Partial<WsWorkunits.ScopeFilter> = {
MaxDepth: 999999,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
};

const nestedFilterDefault: WUDetails.RequestNS.NestedFilter = {
const nestedFilterDefault: WsWorkunits.NestedFilter = {
Depth: 0,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
};

export function useWorkunitMetrics(
wuid: string,
scopeFilter: WUDetails.RequestNS.ScopeFilter = scopeFilterDefault,
nestedFilter: WUDetails.RequestNS.NestedFilter = nestedFilterDefault
): [IScope[], { [id: string]: any }, WUDetailsMeta.Activity[], WUDetailsMeta.Property[], string[], string[], FetchStatus, () => void] {
scopeFilter: Partial<WsWorkunits.ScopeFilter> = scopeFilterDefault,
nestedFilter: WsWorkunits.NestedFilter = nestedFilterDefault
): [IScope[], { [id: string]: any }, WsWorkunits.Activity2[], WsWorkunits.Property2[], string[], string[], FetchStatus, () => void] {

const [workunit, state] = useWorkunit(wuid);
const [data, setData] = React.useState<IScope[]>([]);
const [columns, setColumns] = React.useState<{ [id: string]: any }>([]);
const [activities, setActivities] = React.useState<WUDetailsMeta.Activity[]>([]);
const [properties, setProperties] = React.useState<WUDetailsMeta.Property[]>([]);
const [activities, setActivities] = React.useState<WsWorkunits.Activity2[]>([]);
const [properties, setProperties] = React.useState<WsWorkunits.Property2[]>([]);
const [measures, setMeasures] = React.useState<string[]>([]);
const [scopeTypes, setScopeTypes] = React.useState<string[]>([]);
const [status, setStatus] = React.useState<FetchStatus>(FetchStatus.COMPLETE);
Expand Down Expand Up @@ -175,15 +175,15 @@ export function useWorkunitMetrics(
export function useQueryMetrics(
querySet: string,
queryId: string,
scopeFilter: WUDetails.RequestNS.ScopeFilter = scopeFilterDefault,
nestedFilter: WUDetails.RequestNS.NestedFilter = nestedFilterDefault
): [IScope[], { [id: string]: any }, WUDetailsMeta.Activity[], WUDetailsMeta.Property[], string[], string[], FetchStatus, () => void] {
scopeFilter: Partial<WsWorkunits.ScopeFilter> = scopeFilterDefault,
nestedFilter: WsWorkunits.NestedFilter = nestedFilterDefault
): [IScope[], { [id: string]: any }, WsWorkunits.Activity2[], WsWorkunits.Property2[], string[], string[], FetchStatus, () => void] {

const [query, state, _refresh] = useQuery(querySet, queryId);
const [data, setData] = React.useState<IScope[]>([]);
const [columns, setColumns] = React.useState<{ [id: string]: any }>([]);
const [activities, setActivities] = React.useState<WUDetailsMeta.Activity[]>([]);
const [properties, setProperties] = React.useState<WUDetailsMeta.Property[]>([]);
const [activities, setActivities] = React.useState<WsWorkunits.Activity2[]>([]);
const [properties, setProperties] = React.useState<WsWorkunits.Property2[]>([]);
const [measures, setMeasures] = React.useState<string[]>([]);
const [scopeTypes, setScopeTypes] = React.useState<string[]>([]);
const [status, setStatus] = React.useState<FetchStatus>(FetchStatus.COMPLETE);
Expand Down Expand Up @@ -237,9 +237,9 @@ export function useWUQueryMetrics(
wuid: string,
querySet: string,
queryId: string,
scopeFilter: WUDetails.RequestNS.ScopeFilter = scopeFilterDefault,
nestedFilter: WUDetails.RequestNS.NestedFilter = nestedFilterDefault
): [IScope[], { [id: string]: any }, WUDetailsMeta.Activity[], WUDetailsMeta.Property[], string[], string[], FetchStatus, () => void] {
scopeFilter: Partial<WsWorkunits.ScopeFilter> = scopeFilterDefault,
nestedFilter: WsWorkunits.NestedFilter = nestedFilterDefault
): [IScope[], { [id: string]: any }, WsWorkunits.Activity2[], WsWorkunits.Property2[], string[], string[], FetchStatus, () => void] {
const wuMetrics = useWorkunitMetrics(wuid, scopeFilter, nestedFilter);
const queryMetrics = useQueryMetrics(querySet, queryId, scopeFilter, nestedFilter);
return querySet && queryId ? [...queryMetrics] : [...wuMetrics];
Expand Down
22 changes: 11 additions & 11 deletions esp/src/src-react/hooks/workunit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import { useConst } from "@fluentui/react-hooks";
import { Workunit, DFUWorkunit, Result, WUDetails, WUStateID, WUInfo, WorkunitsService } from "@hpcc-js/comms";
import { Workunit, DFUWorkunit, Result, WsWorkunits, WUStateID, WorkunitsService } from "@hpcc-js/comms";
import { scopedLogger } from "@hpcc-js/util";
import nlsHPCC from "src/nlsHPCC";
import * as Utility from "src/Utility";
Expand Down Expand Up @@ -122,7 +122,7 @@ export function useWorkunitVariables(wuid: string): [Variable[], Workunit, WUSta
return [variables, workunit, state, inc];
}

export interface SourceFile extends WUInfo.ECLSourceFile {
export interface SourceFile extends WsWorkunits.ECLSourceFile {
__hpcc_parentName: string;
}

Expand Down Expand Up @@ -159,10 +159,10 @@ export function useWorkunitSourceFiles(wuid: string): [SourceFile[], Workunit, W
return [sourceFiles, workunit, state, inc];
}

export function useWorkunitWorkflows(wuid: string): [WUInfo.ECLWorkflow[], Workunit, () => void] {
export function useWorkunitWorkflows(wuid: string): [WsWorkunits.ECLWorkflow[], Workunit, () => void] {

const [workunit, state] = useWorkunit(wuid);
const [workflows, setWorkflows] = React.useState<WUInfo.ECLWorkflow[]>([]);
const [workflows, setWorkflows] = React.useState<WsWorkunits.ECLWorkflow[]>([]);
const [count, increment] = useCounter();

React.useEffect(() => {
Expand All @@ -186,7 +186,7 @@ export function useWorkunitXML(wuid: string): [string] {
const [xml, setXML] = React.useState("");

React.useEffect(() => {
service.WUFile({
service.WUFileEx({
Wuid: wuid,
Type: "XML"
}).then(response => {
Expand All @@ -197,10 +197,10 @@ export function useWorkunitXML(wuid: string): [string] {
return [xml];
}

export function useWorkunitExceptions(wuid: string): [WUInfo.ECLException[], Workunit, () => void] {
export function useWorkunitExceptions(wuid: string): [WsWorkunits.ECLException[], Workunit, () => void] {

const [workunit, state] = useWorkunit(wuid);
const [exceptions, setExceptions] = React.useState<WUInfo.ECLException[]>([]);
const [exceptions, setExceptions] = React.useState<WsWorkunits.ECLException[]>([]);
const [count, increment] = useCounter();

React.useEffect(() => {
Expand Down Expand Up @@ -285,7 +285,7 @@ export interface HelperRow {
workunit: Workunit;
}

function mapHelpers(workunit: Workunit, helpers: WUInfo.ECLHelpFile[] = []): HelperRow[] {
function mapHelpers(workunit: Workunit, helpers: WsWorkunits.ECLHelpFile[] = []): HelperRow[] {
return helpers.map((helper, i): HelperRow => {
return {
id: "H:" + i,
Expand All @@ -298,7 +298,7 @@ function mapHelpers(workunit: Workunit, helpers: WUInfo.ECLHelpFile[] = []): Hel
});
}

function mapThorLogInfo(workunit: Workunit, thorLogInfo: WUInfo.ThorLogInfo[] = []): HelperRow[] {
function mapThorLogInfo(workunit: Workunit, thorLogInfo: WsWorkunits.ThorLogInfo[] = []): HelperRow[] {
const retVal: HelperRow[] = [];
for (let i = 0; i < thorLogInfo.length; ++i) {
for (let j = 0; j < thorLogInfo[i].NumberSlaves; ++j) {
Expand Down Expand Up @@ -352,9 +352,9 @@ export function useWorkunitHelpers(wuid: string): [HelperRow[], () => void] {
return [helpers, incCounter];
}

export function useGlobalWorkunitNotes(): [WUDetails.Note[]] {
export function useGlobalWorkunitNotes(): [WsWorkunits.Note[]] {

const [notes, setNotes] = React.useState<WUDetails.Note[]>([]);
const [notes, setNotes] = React.useState<WsWorkunits.Note[]>([]);

React.useEffect(() => {
const workunit = Workunit.attach({ baseUrl: "" }, "");
Expand Down
10 changes: 5 additions & 5 deletions esp/src/src/ECLArchiveWidget.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
import { ECLEditor } from "@hpcc-js/codemirror";
import { extent, Palette } from "@hpcc-js/common";
import { Workunit } from "@hpcc-js/comms";
import { Workunit, WsWorkunits } from "@hpcc-js/comms";
import { Table } from "@hpcc-js/dgrid";
import { SplitPanel } from "@hpcc-js/phosphor";
import { DirectoryTree } from "@hpcc-js/tree";
import { xml2json } from "@hpcc-js/util";
import { RecursivePartial, xml2json } from "@hpcc-js/util";
import "dijit/form/Button";
import "dijit/layout/BorderContainer";
import "dijit/layout/ContentPane";
Expand Down Expand Up @@ -168,10 +168,10 @@ export class ECLArchiveWidget {
.relativeSizes([0.2, 0.8])
.lazyRender()
;
const scopesOptions = {
const scopesOptions: RecursivePartial<WsWorkunits.WUDetails> = {
ScopeFilter: {
MaxDepth: 999999,
ScopeTypes: ["graph"]
ScopeTypes: { ScopeType: ["graph"] }
},
ScopeOptions: {
IncludeMatchedScopesInResults: true,
Expand All @@ -189,7 +189,7 @@ export class ECLArchiveWidget {
},
NestedFilter: {
Depth: 999999,
ScopeTypes: ["activity"]
ScopeTypes: { ScopeType: ["activity"] }
},
PropertiesToReturn: {
AllStatistics: true,
Expand Down
12 changes: 6 additions & 6 deletions esp/src/src/ESPWorkunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as all from "dojo/promise/all";
import * as Observable from "dojo/store/Observable";
import * as topic from "dojo/topic";

import { Workunit as HPCCWorkunit, WorkunitsService, WUQuery, WUUpdate } from "@hpcc-js/comms";
import { Workunit as HPCCWorkunit, WorkunitsService, WsWorkunits as WsWorkunitsNS, WUUpdate } from "@hpcc-js/comms";
import { IEvent } from "@hpcc-js/util";

import * as ESPRequest from "./ESPRequest";
Expand Down Expand Up @@ -888,7 +888,7 @@ const Workunit = declare([ESPUtil.Singleton], { // jshint ignore:line
return (this._hpccWU as HPCCWorkunit).fetchDetails({
ScopeFilter: {
MaxDepth: 999999,
ScopeTypes: ["graph"]
ScopeTypes: { ScopeType: ["graph"] }
},
ScopeOptions: {
IncludeMatchedScopesInResults: true,
Expand All @@ -906,7 +906,7 @@ const Workunit = declare([ESPUtil.Singleton], { // jshint ignore:line
},
NestedFilter: {
Depth: 999999,
ScopeTypes: ["activity"]
ScopeTypes: { ScopeType: ["activity"] }
},
PropertiesToReturn: {
AllStatistics: false,
Expand Down Expand Up @@ -1043,10 +1043,10 @@ export function CreateWUQueryStoreLegacy(options) {

const service = new WorkunitsService({ baseUrl: "" });

export type WUQueryStore = BaseStore<WUQuery.Request, typeof Workunit>;
export type WUQueryStore = BaseStore<WsWorkunitsNS.WUQuery, typeof Workunit>;

export function CreateWUQueryStore(): BaseStore<WUQuery.Request, typeof Workunit> {
const store = new Paged<WUQuery.Request, typeof Workunit>({
export function CreateWUQueryStore(): BaseStore<WsWorkunitsNS.WUQuery, typeof Workunit> {
const store = new Paged<WsWorkunitsNS.WUQuery, typeof Workunit>({
start: "PageStartFrom",
count: "PageSize",
sortBy: "Sortby",
Expand Down
12 changes: 6 additions & 6 deletions esp/src/src/Timings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ export class Timings {
.request({
ScopeFilter: {
MaxDepth: 3,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
},
NestedFilter: {
Depth: 0,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
},
PropertiesToReturn: {
AllProperties: false,
AllStatistics: true,
AllHints: false,
Properties: ["WhenStarted", "TimeElapsed"]
Properties: { Property: ["WhenStarted", "TimeElapsed"] }
},
ScopeOptions: {
IncludeId: true,
Expand Down Expand Up @@ -212,17 +212,17 @@ export class Timings {
this.fetchDetailsNormalizedPromise = Promise.all([this.wu.fetchDetailsMeta(), this.wu.fetchDetailsRaw({
ScopeFilter: {
MaxDepth: 999999,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
},
NestedFilter: {
Depth: 0,
ScopeTypes: []
ScopeTypes: { ScopeType: [] }
},
PropertiesToReturn: {
AllProperties: false,
AllStatistics: true,
AllHints: false,
Properties: []
Properties: { Property: [] }
},
ScopeOptions: {
IncludeId: true,
Expand Down
Loading

0 comments on commit a0d57f7

Please sign in to comment.