From 9586b86519ef293b2d55980f833dfa0bb76c7ac2 Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Wed, 26 Jun 2024 18:58:57 -0400 Subject: [PATCH 1/7] HPCC-32163 Zap LogFilter Absolute Time Range Fix - Fixes absolute time range param name - Fixes erroneous time range param test Signed-off-by: Rodrigo Pastrana --- esp/services/ws_workunits/ws_workunitsHelpers.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/esp/services/ws_workunits/ws_workunitsHelpers.hpp b/esp/services/ws_workunits/ws_workunitsHelpers.hpp index 5305b0dec1a..8ceafe5864d 100644 --- a/esp/services/ws_workunits/ws_workunitsHelpers.hpp +++ b/esp/services/ws_workunits/ws_workunitsHelpers.hpp @@ -186,13 +186,15 @@ struct WUComponentLogOptions } else if (!isEmptyString(end)) { - if (isEmptyString(end)) + if (isEmptyString(start)) throw makeStringException(ECLWATCH_INVALID_INPUT, "ZapLogFilter: Empty 'Absolute TimeRange Start' detected!"); } else { if (relativeTimeBufferSecs > 0 ) wuLogSearchTimeBuffSecs = relativeTimeBufferSecs; + else + throw makeStringException(ECLWATCH_INVALID_INPUT, "ZapLogFilter: Invalid 'TimeRange' detected!"); } } @@ -206,9 +208,9 @@ struct WUComponentLogOptions logDataFormat = logAccessFormatFromName(requestedLogDataFormat.str()); StringBuffer start; // Absolute query time range start in YYYY-DD-MMTHH:MM:SS - zapHttpRequest->getParameter("LogFilter_AbsoluteTimeRange_Start", start); + zapHttpRequest->getParameter("LogFilter_AbsoluteTimeRange_StartDate", start); StringBuffer end; // Absolute query time range end in YYYY-DD-MMTHH:MM:SS - zapHttpRequest->getParameter("LogFilter_AbsoluteTimeRange_End", end); + zapHttpRequest->getParameter("LogFilter_AbsoluteTimeRange_EndDate", end); // Query time range based on WU Time +- Buffer in seconds unsigned bufferSecs = (unsigned)zapHttpRequest->getParameterInt("LogFilter_RelativeTimeRangeBuffer", 0); From 2f7c051a7a4268a427eda3725d222918f4107650 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Fri, 24 May 2024 15:27:45 -0400 Subject: [PATCH 2/7] HPCC-31920 ECL Watch v9 fix error deleting last subfile Fixes an issue in ECL Watch v9 where attempting to delete the last subfile of a superfile would cause the subfile to not be properly removed and an exception to be logged. Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/src-react/components/FileDetails.tsx | 4 +-- .../components/LogicalFileSummary.tsx | 2 +- esp/src/src-react/components/SubFiles.tsx | 27 +++++++++++-------- esp/src/src-react/components/SuperFiles.tsx | 4 +-- esp/src/src-react/hooks/file.ts | 22 ++++++++++++++- 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/esp/src/src-react/components/FileDetails.tsx b/esp/src/src-react/components/FileDetails.tsx index 599339bc7da..c936e617142 100644 --- a/esp/src/src-react/components/FileDetails.tsx +++ b/esp/src/src-react/components/FileDetails.tsx @@ -41,10 +41,10 @@ export const FileDetails: React.FunctionComponent = ({ }) => { const [file] = useFile(cluster, logicalFile); React.useEffect(() => { - if (file?.NodeGroup && cluster === undefined) { + if (file?.NodeGroup && cluster === undefined && !file?.isSuperfile) { replaceUrl(`/files/${file.NodeGroup}/${logicalFile}`); } - }, [cluster, file?.NodeGroup, logicalFile]); + }, [cluster, file?.NodeGroup, file?.isSuperfile, logicalFile]); const [defFile] = useDefFile(cluster, logicalFile, WsDfu.DFUDefFileFormat.def); const [xmlFile] = useDefFile(cluster, logicalFile, WsDfu.DFUDefFileFormat.xml); diff --git a/esp/src/src-react/components/LogicalFileSummary.tsx b/esp/src/src-react/components/LogicalFileSummary.tsx index 469f2c57b83..a2551783357 100644 --- a/esp/src/src-react/components/LogicalFileSummary.tsx +++ b/esp/src/src-react/components/LogicalFileSummary.tsx @@ -181,7 +181,7 @@ export const LogicalFileSummary: React.FunctionComponent ({ label: "", type: "link", value: row.Name, href: `#/files/${row.Name}` })) }, + "SuperOwner": { label: nlsHPCC.SuperFile, type: "links", links: file?.Superfiles?.DFULogicalFile?.map(row => ({ label: "", type: "link", value: row.Name, href: `#/files/${row.NodeGroup !== null ? row.NodeGroup : undefined}/${row.Name}` })) }, "NodeGroup": { label: nlsHPCC.ClusterName, type: "string", value: file?.NodeGroup, readonly: true }, "Description": { label: nlsHPCC.Description, type: "string", value: description }, "JobName": { label: nlsHPCC.JobName, type: "string", value: file?.JobName, readonly: true }, diff --git a/esp/src/src-react/components/SubFiles.tsx b/esp/src/src-react/components/SubFiles.tsx index 7337454931f..e7088869472 100644 --- a/esp/src/src-react/components/SubFiles.tsx +++ b/esp/src/src-react/components/SubFiles.tsx @@ -5,7 +5,7 @@ import nlsHPCC from "src/nlsHPCC"; import { QuerySortItem } from "src/store/Store"; import * as WsDfu from "src/WsDfu"; import { useConfirm } from "../hooks/confirm"; -import { useFile } from "../hooks/file"; +import { useFile, useSubfiles } from "../hooks/file"; import { FluentGrid, useCopyButtons, useFluentStoreState, FluentColumns } from "./controls/Grid"; import { ShortVerticalDivider } from "./Common"; import { pushUrl } from "../util/history"; @@ -28,7 +28,8 @@ export const SubFiles: React.FunctionComponent = ({ sort = defaultSort }) => { - const [file, , , refresh] = useFile(cluster, logicalFile); + const [file] = useFile(cluster, logicalFile); + const [subfiles, refreshSubfiles] = useSubfiles(cluster, logicalFile); const [uiState, setUIState] = React.useState({ ...defaultUIState }); const [data, setData] = React.useState([]); const { @@ -101,26 +102,30 @@ export const SubFiles: React.FunctionComponent = ({ message: nlsHPCC.RemoveSubfiles2, items: selection.map(item => item.Name), onSubmit: React.useCallback(() => { - WsDfu.SuperfileAction("remove", file.Name, selection, false).then(() => refresh()); - }, [file, refresh, selection]) + WsDfu.SuperfileAction("remove", file.Name, selection, false).then(() => refreshSubfiles()); + }, [file, refreshSubfiles, selection]) }); React.useEffect(() => { - const subfiles = []; + const files = []; const promises = []; - file?.subfiles?.Item.forEach(item => { + subfiles?.Item.forEach(item => { const logicalFile = ESPLogicalFile.Get("", item); promises.push(logicalFile.getInfo2({ onAfterSend: function (response) { } })); - subfiles.push(logicalFile); + files.push(logicalFile); }); - Promise.all(promises).then(logicalFiles => { - setData(subfiles); - }); - }, [file?.subfiles]); + if (promises.length) { + Promise.all(promises).then(logicalFiles => { + setData(files); + }); + } else { + setData(files); + } + }, [file, subfiles]); const buttons = React.useMemo((): ICommandBarItemProps[] => [ { diff --git a/esp/src/src-react/components/SuperFiles.tsx b/esp/src/src-react/components/SuperFiles.tsx index b1cbe3bdd0b..b9cb69e99e4 100644 --- a/esp/src/src-react/components/SuperFiles.tsx +++ b/esp/src/src-react/components/SuperFiles.tsx @@ -43,11 +43,11 @@ export const SuperFiles: React.FunctionComponent = ({ label: nlsHPCC.Name, sortable: true, formatter: (name, row) => { - return {name}; + return {name}; } } }; - }, [cluster]); + }, []); // Command Bar --- const buttons = React.useMemo((): ICommandBarItemProps[] => [ diff --git a/esp/src/src-react/hooks/file.ts b/esp/src/src-react/hooks/file.ts index 7210998f5cf..7ea78a2cc70 100644 --- a/esp/src/src-react/hooks/file.ts +++ b/esp/src/src-react/hooks/file.ts @@ -14,7 +14,7 @@ export function useFile(cluster: string, name: string): [LogicalFile, boolean, n const [count, increment] = useCounter(); React.useEffect(() => { - const file = LogicalFile.attach({ baseUrl: "" }, cluster, name); + const file = LogicalFile.attach({ baseUrl: "" }, cluster === "undefined" ? undefined : cluster, name); let active = true; let handle; const fetchInfo = singletonDebounce(file, "fetchInfo"); @@ -87,3 +87,23 @@ export function useFileHistory(cluster: string, name: string): [WsDfu.Origin[], return [history, eraseHistory, increment]; } + +export function useSubfiles(cluster: string, name: string): [WsDfu.subfiles, () => void] { + + const [file] = useFile(cluster, name); + const [subfiles, setSubfiles] = React.useState({ Item: [] }); + const [count, increment] = useCounter(); + + React.useEffect(() => { + if (file) { + file.fetchInfo() + .then(response => { + setSubfiles(response.subfiles ?? { Item: [] }); + }) + .catch(err => logger.error(err)) + ; + } + }, [file, count]); + + return [subfiles, increment]; +} From f196e5553a0dde44117f817cf8f207b8f2579cc1 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Fri, 28 Jun 2024 12:37:40 +0100 Subject: [PATCH 3/7] Split off 9.4.74 Signed-off-by: Gordon Smith --- helm/hpcc/Chart.yaml | 4 ++-- helm/hpcc/templates/_helpers.tpl | 2 +- helm/hpcc/templates/dafilesrv.yaml | 2 +- helm/hpcc/templates/dali.yaml | 2 +- helm/hpcc/templates/dfuserver.yaml | 2 +- helm/hpcc/templates/eclagent.yaml | 4 ++-- helm/hpcc/templates/eclccserver.yaml | 4 ++-- helm/hpcc/templates/eclscheduler.yaml | 2 +- helm/hpcc/templates/esp.yaml | 2 +- helm/hpcc/templates/localroxie.yaml | 2 +- helm/hpcc/templates/roxie.yaml | 8 ++++---- helm/hpcc/templates/sasha.yaml | 2 +- helm/hpcc/templates/thor.yaml | 10 +++++----- version.cmake | 4 ++-- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/helm/hpcc/Chart.yaml b/helm/hpcc/Chart.yaml index c194d77e8d6..63368e54cce 100644 --- a/helm/hpcc/Chart.yaml +++ b/helm/hpcc/Chart.yaml @@ -6,9 +6,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 9.4.73-closedown0 +version: 9.4.75-closedown0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 9.4.73-closedown0 +appVersion: 9.4.75-closedown0 diff --git a/helm/hpcc/templates/_helpers.tpl b/helm/hpcc/templates/_helpers.tpl index ab3e33f4178..225a27e6a17 100644 --- a/helm/hpcc/templates/_helpers.tpl +++ b/helm/hpcc/templates/_helpers.tpl @@ -1519,7 +1519,7 @@ kind: Service metadata: name: {{ $lvars.serviceName | quote }} labels: - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $.root "instance" $lvars.serviceName ) | indent 4 }} {{- if $lvars.labels }} {{ toYaml $lvars.labels | indent 4 }} diff --git a/helm/hpcc/templates/dafilesrv.yaml b/helm/hpcc/templates/dafilesrv.yaml index a50440cf06b..71fbbe75ba9 100644 --- a/helm/hpcc/templates/dafilesrv.yaml +++ b/helm/hpcc/templates/dafilesrv.yaml @@ -51,7 +51,7 @@ spec: labels: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "dafilesrv" "name" "dafilesrv" "instance" .name) | indent 8 }} server: {{ .name | quote }} - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 annotations: checksum/config: {{ $configSHA }} {{- include "hpcc.generateAnnotations" $commonCtx | indent 8 }} diff --git a/helm/hpcc/templates/dali.yaml b/helm/hpcc/templates/dali.yaml index 21ade987987..2b61cc50e8f 100644 --- a/helm/hpcc/templates/dali.yaml +++ b/helm/hpcc/templates/dali.yaml @@ -88,7 +88,7 @@ spec: run: {{ $dali.name | quote }} server: {{ $dali.name | quote }} app: dali - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8 }} {{- end }} diff --git a/helm/hpcc/templates/dfuserver.yaml b/helm/hpcc/templates/dfuserver.yaml index 36fdadbb6cf..e6b3ca0c48f 100644 --- a/helm/hpcc/templates/dfuserver.yaml +++ b/helm/hpcc/templates/dfuserver.yaml @@ -57,7 +57,7 @@ spec: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "dfuserver" "name" "dfuserver" "instance" .name) | indent 8 }} run: {{ .name | quote }} accessDali: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/eclagent.yaml b/helm/hpcc/templates/eclagent.yaml index 7b86a7449d1..33e874fa680 100644 --- a/helm/hpcc/templates/eclagent.yaml +++ b/helm/hpcc/templates/eclagent.yaml @@ -60,7 +60,7 @@ data: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" $apptype "name" "eclagent" "instance" $appJobName "instanceOf" (printf "%s-job" .me.name)) | indent 12 }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey .me "labels" }} {{ toYaml .me.labels | indent 12 }} {{- end }} @@ -137,7 +137,7 @@ spec: run: {{ .name | quote }} accessDali: "yes" accessEsp: {{ .useChildProcesses | default false | ternary "yes" "no" | quote }} - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/eclccserver.yaml b/helm/hpcc/templates/eclccserver.yaml index 882b2b7f63c..952d68140c3 100644 --- a/helm/hpcc/templates/eclccserver.yaml +++ b/helm/hpcc/templates/eclccserver.yaml @@ -58,7 +58,7 @@ data: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclccserver" "name" "eclccserver" "instance" $compileJobName "instanceOf" (printf "%s-job" .me.name)) | indent 12 }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey .me "labels" }} {{ toYaml .me.labels | indent 12 }} {{- end }} @@ -143,7 +143,7 @@ spec: run: {{ .name | quote }} accessDali: "yes" accessEsp: {{ .useChildProcesses | default false | ternary "yes" "no" | quote }} - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/eclscheduler.yaml b/helm/hpcc/templates/eclscheduler.yaml index c69b739f350..12f07079b7d 100644 --- a/helm/hpcc/templates/eclscheduler.yaml +++ b/helm/hpcc/templates/eclscheduler.yaml @@ -65,7 +65,7 @@ spec: run: {{ .name | quote }} accessDali: "yes" accessEsp: "no" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/esp.yaml b/helm/hpcc/templates/esp.yaml index c28acbaaa8f..11064a7e82f 100644 --- a/helm/hpcc/templates/esp.yaml +++ b/helm/hpcc/templates/esp.yaml @@ -122,7 +122,7 @@ spec: accessSasha: "yes" {{- end }} app: {{ $application }} - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "name" $application "component" "esp" "instance" .name) | indent 8 }} {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8 }} diff --git a/helm/hpcc/templates/localroxie.yaml b/helm/hpcc/templates/localroxie.yaml index e5621197105..eccf6fb914c 100644 --- a/helm/hpcc/templates/localroxie.yaml +++ b/helm/hpcc/templates/localroxie.yaml @@ -73,7 +73,7 @@ spec: server: {{ $servername | quote }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "roxie-server" "name" "roxie" "instance" $roxie.name) | indent 8 }} {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} diff --git a/helm/hpcc/templates/roxie.yaml b/helm/hpcc/templates/roxie.yaml index 1c740401a65..02f2ef84769 100644 --- a/helm/hpcc/templates/roxie.yaml +++ b/helm/hpcc/templates/roxie.yaml @@ -125,7 +125,7 @@ spec: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "topology-server" "name" "roxie" "instance" $commonCtx.toponame) | indent 8 }} run: {{ $commonCtx.toponame | quote }} roxie-cluster: {{ $roxie.name | quote }} - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8}} {{- end }} @@ -182,7 +182,7 @@ kind: Service metadata: name: {{ $commonCtx.toponame | quote }} labels: - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "topology-server" "name" "roxie" "instance" $commonCtx.toponame) | indent 4 }} spec: ports: @@ -244,7 +244,7 @@ spec: roxie-cluster: {{ $roxie.name | quote }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "roxie-server" "name" "roxie" "instance" $servername) | indent 8 }} {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8}} @@ -352,7 +352,7 @@ spec: roxie-cluster: {{ $roxie.name | quote }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8}} {{- end }} diff --git a/helm/hpcc/templates/sasha.yaml b/helm/hpcc/templates/sasha.yaml index 01d5361a5b5..2eeccbb7348 100644 --- a/helm/hpcc/templates/sasha.yaml +++ b/helm/hpcc/templates/sasha.yaml @@ -53,7 +53,7 @@ spec: server: {{ $serviceName | quote }} app: sasha accessDali: {{ (has "dali" $sasha.access) | ternary "yes" "no" | quote }} - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- if hasKey $sasha "labels" }} {{ toYaml $sasha.labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/thor.yaml b/helm/hpcc/templates/thor.yaml index 8656e97f866..e8f015076d1 100644 --- a/helm/hpcc/templates/thor.yaml +++ b/helm/hpcc/templates/thor.yaml @@ -86,7 +86,7 @@ data: labels: accessDali: "yes" accessEsp: "yes" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclagent" "name" "thor" "instance" $eclAgentJobName "instanceOf" (printf "%s-job" .eclAgentName)) | indent 8 }} {{- if hasKey .me "labels" }} {{ toYaml .me.labels | indent 12 }} @@ -151,7 +151,7 @@ data: accessEsp: "yes" app: "thor" component: "thormanager" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 instance: "_HPCC_JOBNAME_" job: "_HPCC_JOBNAME_" {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "thormanager" "name" "thor" "instance" $thorManagerJobName "instanceOf" (printf "%s-thormanager-job" .me.name)) | indent 12 }} @@ -218,7 +218,7 @@ data: accessEsp: "yes" app: "thor" component: "thorworker" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 instance: "_HPCC_JOBNAME_" job: "_HPCC_JOBNAME_" {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "thorworker" "name" "thor" "instance" $thorWorkerJobName "instanceOf" (printf "%s-thorworker-job" .me.name)) | indent 12 }} @@ -351,7 +351,7 @@ spec: accessEsp: {{ $commonCtx.eclAgentUseChildProcesses | ternary "yes" "no" | quote }} app: "thor" component: "thor-eclagent" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 instance: {{ $commonCtx.eclAgentName | quote }} {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclagent" "name" "thor" "instance" $commonCtx.eclAgentName ) | indent 8 }} {{- if hasKey $commonCtx.me "labels" }} @@ -416,7 +416,7 @@ spec: accessEsp: "no" app: "thor" component: "thor-thoragent" - helmVersion: 9.4.73-closedown0 + helmVersion: 9.4.75-closedown0 instance: {{ $commonCtx.thorAgentName | quote }} {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclagent" "name" "thor" "instance" $commonCtx.thorAgentName ) | indent 8 }} {{- if hasKey $commonCtx.me "labels" }} diff --git a/version.cmake b/version.cmake index 22b14233235..39620d6c68a 100644 --- a/version.cmake +++ b/version.cmake @@ -5,8 +5,8 @@ set ( HPCC_NAME "Community Edition" ) set ( HPCC_PROJECT "community" ) set ( HPCC_MAJOR 9 ) set ( HPCC_MINOR 4 ) -set ( HPCC_POINT 73 ) +set ( HPCC_POINT 75 ) set ( HPCC_MATURITY "closedown" ) set ( HPCC_SEQUENCE 0 ) -set ( HPCC_TAG_TIMESTAMP "2024-06-20T15:59:29Z" ) +set ( HPCC_TAG_TIMESTAMP "2024-06-28T11:37:40Z" ) ### From ad19dc98582b730613b1922074ea44b7249c9d0b Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Fri, 28 Jun 2024 12:39:35 +0100 Subject: [PATCH 4/7] Split off 9.2.100 Signed-off-by: Gordon Smith --- helm/hpcc/Chart.yaml | 4 ++-- helm/hpcc/templates/_helpers.tpl | 2 +- helm/hpcc/templates/dafilesrv.yaml | 2 +- helm/hpcc/templates/dali.yaml | 2 +- helm/hpcc/templates/dfuserver.yaml | 2 +- helm/hpcc/templates/eclagent.yaml | 4 ++-- helm/hpcc/templates/eclccserver.yaml | 4 ++-- helm/hpcc/templates/eclscheduler.yaml | 2 +- helm/hpcc/templates/esp.yaml | 2 +- helm/hpcc/templates/localroxie.yaml | 2 +- helm/hpcc/templates/roxie.yaml | 8 ++++---- helm/hpcc/templates/sasha.yaml | 2 +- helm/hpcc/templates/thor.yaml | 10 +++++----- version.cmake | 4 ++-- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/helm/hpcc/Chart.yaml b/helm/hpcc/Chart.yaml index 6fb3b6188af..dc7185a7fec 100644 --- a/helm/hpcc/Chart.yaml +++ b/helm/hpcc/Chart.yaml @@ -6,9 +6,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 9.2.99-closedown0 +version: 9.2.101-closedown0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 9.2.99-closedown0 +appVersion: 9.2.101-closedown0 diff --git a/helm/hpcc/templates/_helpers.tpl b/helm/hpcc/templates/_helpers.tpl index 4658ca74316..ed555ffd9a7 100644 --- a/helm/hpcc/templates/_helpers.tpl +++ b/helm/hpcc/templates/_helpers.tpl @@ -1405,7 +1405,7 @@ kind: Service metadata: name: {{ $lvars.serviceName | quote }} labels: - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $.root "instance" $lvars.serviceName ) | indent 4 }} {{- if $lvars.labels }} {{ toYaml $lvars.labels | indent 4 }} diff --git a/helm/hpcc/templates/dafilesrv.yaml b/helm/hpcc/templates/dafilesrv.yaml index d9ab3304dae..95f4a3b6cd8 100644 --- a/helm/hpcc/templates/dafilesrv.yaml +++ b/helm/hpcc/templates/dafilesrv.yaml @@ -50,7 +50,7 @@ spec: labels: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "dafilesrv" "name" "dafilesrv" "instance" .name) | indent 8 }} server: {{ .name | quote }} - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 annotations: checksum/config: {{ $configSHA }} {{- include "hpcc.generateAnnotations" $commonCtx | indent 8 }} diff --git a/helm/hpcc/templates/dali.yaml b/helm/hpcc/templates/dali.yaml index 2c88ddbe102..6f60764deb1 100644 --- a/helm/hpcc/templates/dali.yaml +++ b/helm/hpcc/templates/dali.yaml @@ -82,7 +82,7 @@ spec: run: {{ $dali.name | quote }} server: {{ $dali.name | quote }} app: dali - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8 }} {{- end }} diff --git a/helm/hpcc/templates/dfuserver.yaml b/helm/hpcc/templates/dfuserver.yaml index faa5493a225..f2eaaa5c17d 100644 --- a/helm/hpcc/templates/dfuserver.yaml +++ b/helm/hpcc/templates/dfuserver.yaml @@ -56,7 +56,7 @@ spec: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "dfuserver" "name" "dfuserver" "instance" .name) | indent 8 }} run: {{ .name | quote }} accessDali: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/eclagent.yaml b/helm/hpcc/templates/eclagent.yaml index 1f5a8da4b07..5a398cf4cc8 100644 --- a/helm/hpcc/templates/eclagent.yaml +++ b/helm/hpcc/templates/eclagent.yaml @@ -58,7 +58,7 @@ data: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" $apptype "name" "eclagent" "instance" $appJobName "instanceOf" (printf "%s-job" .me.name)) | indent 12 }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey .me "labels" }} {{ toYaml .me.labels | indent 12 }} {{- end }} @@ -133,7 +133,7 @@ spec: run: {{ .name | quote }} accessDali: "yes" accessEsp: {{ .useChildProcesses | default false | ternary "yes" "no" | quote }} - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/eclccserver.yaml b/helm/hpcc/templates/eclccserver.yaml index 991b88ec767..7c19cc105fd 100644 --- a/helm/hpcc/templates/eclccserver.yaml +++ b/helm/hpcc/templates/eclccserver.yaml @@ -57,7 +57,7 @@ data: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclccserver" "name" "eclccserver" "instance" $compileJobName "instanceOf" (printf "%s-job" .me.name)) | indent 12 }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey .me "labels" }} {{ toYaml .me.labels | indent 12 }} {{- end }} @@ -140,7 +140,7 @@ spec: run: {{ .name | quote }} accessDali: "yes" accessEsp: {{ .useChildProcesses | default false | ternary "yes" "no" | quote }} - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/eclscheduler.yaml b/helm/hpcc/templates/eclscheduler.yaml index 713eec2275a..f5eb9ef1a03 100644 --- a/helm/hpcc/templates/eclscheduler.yaml +++ b/helm/hpcc/templates/eclscheduler.yaml @@ -64,7 +64,7 @@ spec: run: {{ .name | quote }} accessDali: "yes" accessEsp: "no" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/esp.yaml b/helm/hpcc/templates/esp.yaml index c11fc1ac990..7652a41ae91 100644 --- a/helm/hpcc/templates/esp.yaml +++ b/helm/hpcc/templates/esp.yaml @@ -120,7 +120,7 @@ spec: accessSasha: "yes" {{- end }} app: {{ $application }} - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "name" $application "component" "esp" "instance" .name) | indent 8 }} {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8 }} diff --git a/helm/hpcc/templates/localroxie.yaml b/helm/hpcc/templates/localroxie.yaml index 5d75783d0e0..e822313c7cb 100644 --- a/helm/hpcc/templates/localroxie.yaml +++ b/helm/hpcc/templates/localroxie.yaml @@ -70,7 +70,7 @@ spec: server: {{ $servername | quote }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "roxie-server" "name" "roxie" "instance" $roxie.name) | indent 8 }} {{- if hasKey . "labels" }} {{ toYaml .labels | indent 8 }} diff --git a/helm/hpcc/templates/roxie.yaml b/helm/hpcc/templates/roxie.yaml index 735c7d17117..f115994c70a 100644 --- a/helm/hpcc/templates/roxie.yaml +++ b/helm/hpcc/templates/roxie.yaml @@ -120,7 +120,7 @@ spec: {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "topology-server" "name" "roxie" "instance" $commonCtx.toponame) | indent 8 }} run: {{ $commonCtx.toponame | quote }} roxie-cluster: {{ $roxie.name | quote }} - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8}} {{- end }} @@ -178,7 +178,7 @@ kind: Service metadata: name: {{ $commonCtx.toponame | quote }} labels: - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "topology-server" "name" "roxie" "instance" $commonCtx.toponame) | indent 4 }} spec: ports: @@ -240,7 +240,7 @@ spec: roxie-cluster: {{ $roxie.name | quote }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "roxie-server" "name" "roxie" "instance" $servername) | indent 8 }} {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8}} @@ -346,7 +346,7 @@ spec: roxie-cluster: {{ $roxie.name | quote }} accessDali: "yes" accessEsp: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey $.Values.global "metrics" }} {{- include "hpcc.generateMetricsReporterLabel" $.Values.global.metrics | nindent 8}} {{- end }} diff --git a/helm/hpcc/templates/sasha.yaml b/helm/hpcc/templates/sasha.yaml index a660b392ae3..4bcbcc6b41b 100644 --- a/helm/hpcc/templates/sasha.yaml +++ b/helm/hpcc/templates/sasha.yaml @@ -53,7 +53,7 @@ spec: server: {{ $serviceName | quote }} app: sasha accessDali: {{ (has "dali" $sasha.access) | ternary "yes" "no" | quote }} - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- if hasKey $sasha "labels" }} {{ toYaml $sasha.labels | indent 8 }} {{- end }} diff --git a/helm/hpcc/templates/thor.yaml b/helm/hpcc/templates/thor.yaml index a99ee0d0356..e50507bff55 100644 --- a/helm/hpcc/templates/thor.yaml +++ b/helm/hpcc/templates/thor.yaml @@ -82,7 +82,7 @@ data: labels: accessDali: "yes" accessEsp: "yes" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclagent" "name" "thor" "instance" $eclAgentJobName "instanceOf" (printf "%s-job" .eclAgentName)) | indent 8 }} {{- if hasKey .me "labels" }} {{ toYaml .me.labels | indent 12 }} @@ -145,7 +145,7 @@ data: accessEsp: "yes" app: "thor" component: "thormanager" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 instance: "_HPCC_JOBNAME_" job: "_HPCC_JOBNAME_" {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "thormanager" "name" "thor" "instance" $thorManagerJobName "instanceOf" (printf "%s-thormanager-job" .me.name)) | indent 12 }} @@ -210,7 +210,7 @@ data: accessEsp: "yes" app: "thor" component: "thorworker" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 instance: "_HPCC_JOBNAME_" job: "_HPCC_JOBNAME_" {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "thorworker" "name" "thor" "instance" $thorWorkerJobName "instanceOf" (printf "%s-thorworker-job" .me.name)) | indent 12 }} @@ -341,7 +341,7 @@ spec: accessEsp: {{ $commonCtx.eclAgentUseChildProcesses | ternary "yes" "no" | quote }} app: "thor" component: "thor-eclagent" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 instance: {{ $commonCtx.eclAgentName | quote }} {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclagent" "name" "thor" "instance" $commonCtx.eclAgentName ) | indent 8 }} {{- if hasKey $commonCtx.me "labels" }} @@ -404,7 +404,7 @@ spec: accessEsp: "no" app: "thor" component: "thor-thoragent" - helmVersion: 9.2.99-closedown0 + helmVersion: 9.2.101-closedown0 instance: {{ $commonCtx.thorAgentName | quote }} {{- include "hpcc.addStandardLabels" (dict "root" $ "component" "eclagent" "name" "thor" "instance" $commonCtx.thorAgentName ) | indent 8 }} {{- if hasKey $commonCtx.me "labels" }} diff --git a/version.cmake b/version.cmake index 9f37c6d68fd..94b859bb5c4 100644 --- a/version.cmake +++ b/version.cmake @@ -5,8 +5,8 @@ set ( HPCC_NAME "Community Edition" ) set ( HPCC_PROJECT "community" ) set ( HPCC_MAJOR 9 ) set ( HPCC_MINOR 2 ) -set ( HPCC_POINT 99 ) +set ( HPCC_POINT 101 ) set ( HPCC_MATURITY "closedown" ) set ( HPCC_SEQUENCE 0 ) -set ( HPCC_TAG_TIMESTAMP "2024-06-20T16:00:57Z" ) +set ( HPCC_TAG_TIMESTAMP "2024-06-28T11:39:35Z" ) ### From 7cc3f958a1e1ff0c077bd823647c16c31310c3c8 Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Mon, 1 Jul 2024 08:10:43 +0100 Subject: [PATCH 5/7] HPCC-31408 Enable sorting for metric properties Signed-off-by: Gordon Smith --- esp/src/src-react/components/Metrics.tsx | 1 + esp/src/src-react/components/MetricsPropertiesTables.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/esp/src/src-react/components/Metrics.tsx b/esp/src/src-react/components/Metrics.tsx index ee05e3055e3..03f1e4d3a72 100644 --- a/esp/src/src-react/components/Metrics.tsx +++ b/esp/src/src-react/components/Metrics.tsx @@ -450,6 +450,7 @@ export const Metrics: React.FunctionComponent = ({ const propsTable2 = useConst(() => new Table() .columns([nlsHPCC.Property, nlsHPCC.Value]) .columnWidth("auto") + .sortable(true) ); const updatePropsTable2 = React.useCallback((selection: IScope[]) => { diff --git a/esp/src/src-react/components/MetricsPropertiesTables.tsx b/esp/src/src-react/components/MetricsPropertiesTables.tsx index 470516b55f7..83d8a894cff 100644 --- a/esp/src/src-react/components/MetricsPropertiesTables.tsx +++ b/esp/src/src-react/components/MetricsPropertiesTables.tsx @@ -23,6 +23,7 @@ export const MetricsPropertiesTables: React.FunctionComponent new Table() .columns([nlsHPCC.Property, nlsHPCC.Value, "Avg", "Min", "Max", "Delta", "StdDev", "SkewMin", "SkewMax", "NodeMin", "NodeMax"]) .columnWidth("auto") + .sortable(true) ); React.useEffect(() => { From adc18e098ec365acd09b89ca72125f2dde6ce535 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:56:47 -0400 Subject: [PATCH 6/7] HPCC-31952 ECL Watch v9 react component for permissions Created a react component for the dojo ShowIndividualPermissionsWidget. Also, as a workaround for the bug Jake reported in the dojo widget, added a grid refresh on a 100ms timeout after changing any permissions. Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- .../ShowIndividualPermissionsWidget.js | 1 + esp/src/package-lock.json | 31 ++- esp/src/package.json | 2 +- .../components/PermissionsEditor.tsx | 205 ++++++++++++++++++ esp/src/src-react/components/Security.tsx | 4 +- .../components/forms/AddGroupResource.tsx | 129 +++++++++++ .../components/forms/AddPermission.tsx | 2 +- esp/src/src/nls/hpcc.ts | 1 + 8 files changed, 362 insertions(+), 13 deletions(-) create mode 100644 esp/src/src-react/components/PermissionsEditor.tsx create mode 100644 esp/src/src-react/components/forms/AddGroupResource.tsx diff --git a/esp/src/eclwatch/ShowIndividualPermissionsWidget.js b/esp/src/eclwatch/ShowIndividualPermissionsWidget.js index fef10399d8b..ae3692d7ce6 100644 --- a/esp/src/eclwatch/ShowIndividualPermissionsWidget.js +++ b/esp/src/eclwatch/ShowIndividualPermissionsWidget.js @@ -181,6 +181,7 @@ define([ evt.preventDefault(); context.calcPermissionState(evt.cell.column.field, evt.value, evt.cell.row.data); evt.grid.store.put(evt.cell.row.data); + const t = window.setTimeout(() => { context.grid.refresh(); window.clearTimeout(t); }, 100); }); return retVal; }, diff --git a/esp/src/package-lock.json b/esp/src/package-lock.json index 06de90bbe29..363b1424c2d 100644 --- a/esp/src/package-lock.json +++ b/esp/src/package-lock.json @@ -18,7 +18,7 @@ "@hpcc-js/chart": "2.83.3", "@hpcc-js/codemirror": "2.62.0", "@hpcc-js/common": "2.71.17", - "@hpcc-js/comms": "2.92.2", + "@hpcc-js/comms": "2.92.3", "@hpcc-js/dataflow": "8.1.6", "@hpcc-js/eclwatch": "2.74.5", "@hpcc-js/graph": "2.85.15", @@ -1859,12 +1859,12 @@ } }, "node_modules/@hpcc-js/comms": { - "version": "2.92.2", - "resolved": "https://registry.npmjs.org/@hpcc-js/comms/-/comms-2.92.2.tgz", - "integrity": "sha512-9AbPnCYuTF6OhbSiG5QMDA2vuF457YL88h2ltuxPOjsOxp9Dp5VFlTkh88vW1W3Yph/+faGhiqUSvLMgFIwXEA==", + "version": "2.92.3", + "resolved": "https://registry.npmjs.org/@hpcc-js/comms/-/comms-2.92.3.tgz", + "integrity": "sha512-0mrIb4kXGTVnvHBpRZk+yas108sSXgIKq6HAGSv/ZJFCXEoKCynoaSH+DFaD9jcfZrVezn4fbjJtqYxXln86tA==", "dependencies": { - "@hpcc-js/ddl-shim": "^2.20.6", - "@hpcc-js/util": "^2.51.0", + "@hpcc-js/ddl-shim": "^2.20.7", + "@hpcc-js/util": "^2.51.1", "@xmldom/xmldom": "0.8.10", "abort-controller": "3.0.0", "node-fetch": "2.7.0", @@ -1873,6 +1873,14 @@ "undici": "5.28.4" } }, + "node_modules/@hpcc-js/comms/node_modules/@hpcc-js/util": { + "version": "2.51.1", + "resolved": "https://registry.npmjs.org/@hpcc-js/util/-/util-2.51.1.tgz", + "integrity": "sha512-BJuqg6FGqcV4RR8/BU5e7fASDtkl0Na7dWY+Th7r5ciWKI5AXsO0GtlgwDBt2uLUOlcGOMpYozmdbGSCoSHAvQ==", + "dependencies": { + "tslib": "2.6.3" + } + }, "node_modules/@hpcc-js/comms/node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1892,15 +1900,20 @@ } ] }, + "node_modules/@hpcc-js/comms/node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + }, "node_modules/@hpcc-js/dataflow": { "version": "8.1.6", "resolved": "https://registry.npmjs.org/@hpcc-js/dataflow/-/dataflow-8.1.6.tgz", "integrity": "sha512-BMmpA6CP00nRDdeq7MS/LRN+e08dyBnnLWEITK5zuEn8D9sFo4ZJlmrKNp+Lcox/m+CuNqWMTG9Z5c+hK2jUyw==" }, "node_modules/@hpcc-js/ddl-shim": { - "version": "2.20.6", - "resolved": "https://registry.npmjs.org/@hpcc-js/ddl-shim/-/ddl-shim-2.20.6.tgz", - "integrity": "sha512-0N9KwRr2rzSJEhfXjEDmT2IBf2Bm6QJ4ReOzhu1wTN3O3gKkUXxNxJMDePFyCNaeHaNWGEQOxewf1q9NtrSkbA==", + "version": "2.20.7", + "resolved": "https://registry.npmjs.org/@hpcc-js/ddl-shim/-/ddl-shim-2.20.7.tgz", + "integrity": "sha512-n+MQBW9zgfhN6zCTaZSiZfMAJfhR6bw4Fuo4fMhQdF2x17Yu/DbN8MReNvyq2OOBmxkwcp28/VxYnsJeppWMQw==", "hasInstallScript": true, "dependencies": { "ajv": "6.12.6" diff --git a/esp/src/package.json b/esp/src/package.json index 9f825f692bf..6030c085361 100644 --- a/esp/src/package.json +++ b/esp/src/package.json @@ -44,7 +44,7 @@ "@hpcc-js/chart": "2.83.3", "@hpcc-js/codemirror": "2.62.0", "@hpcc-js/common": "2.71.17", - "@hpcc-js/comms": "2.92.2", + "@hpcc-js/comms": "2.92.3", "@hpcc-js/dataflow": "8.1.6", "@hpcc-js/eclwatch": "2.74.5", "@hpcc-js/graph": "2.85.15", diff --git a/esp/src/src-react/components/PermissionsEditor.tsx b/esp/src/src-react/components/PermissionsEditor.tsx new file mode 100644 index 00000000000..b1d453f2354 --- /dev/null +++ b/esp/src/src-react/components/PermissionsEditor.tsx @@ -0,0 +1,205 @@ +import * as React from "react"; +import { Checkbox, CommandBar, ContextualMenuItemType, ICommandBarItemProps, Label, Stack } from "@fluentui/react"; +import { WsAccess, AccessService } from "@hpcc-js/comms"; +import { scopedLogger } from "@hpcc-js/util"; +import nlsHPCC from "src/nlsHPCC"; +import { useConfirm } from "../hooks/confirm"; +import { HolyGrail } from "../layouts/HolyGrail"; +import { ShortVerticalDivider } from "./Common"; +import { AddGroupResourceForm } from "./forms/AddGroupResource"; + +const logger = scopedLogger("src-react/components/PermissionsEditor.tsx"); + +const service = new AccessService({ baseUrl: "" }); + +// from ShowIndividualPermissionsWidget.js +const calcPermissionState = (field, value, row) => { + switch (field) { + case "allow_access": + row.allow_full = value && row.allow_read && row.allow_write; + if (value) + calcPermissionState("deny_access", false, row); + break; + case "allow_read": + row.allow_full = row.allow_access && value && row.allow_write; + if (value) + calcPermissionState("deny_read", false, row); + break; + case "allow_write": + row.allow_full = row.allow_access && row.allow_read && value; + if (value) + calcPermissionState("deny_write", false, row); + break; + case "allow_full": + row.allow_access = value; + row.allow_read = value; + row.allow_write = value; + if (value) + calcPermissionState("deny_full", false, row); + break; + case "deny_access": + row.deny_full = value && row.deny_read && row.deny_write; + if (value) + calcPermissionState("allow_access", false, row); + break; + case "deny_read": + row.deny_full = row.deny_access && value && row.deny_write; + if (value) + calcPermissionState("allow_read", false, row); + break; + case "deny_write": + row.deny_full = row.deny_access && row.deny_read && value; + if (value) + calcPermissionState("allow_write", false, row); + break; + case "deny_full": + row.deny_access = value; + row.deny_read = value; + row.deny_write = value; + if (value) + calcPermissionState("allow_full", false, row); + break; + } + row[field] = value; +}; + +interface PermissionsEditorProps { + BaseDn?: string; + Name?: string; +} + +export const PermissionsEditor: React.FunctionComponent = ({ + BaseDn, + Name +}) => { + + const [data, setData] = React.useState([]); + const [selectedIndex, setSelectedIndex] = React.useState(-1); + const [showAddGroup, setShowAddGroup] = React.useState(false); + + const refreshData = React.useCallback(() => { + service.ResourcePermissions({ BasednName: BaseDn, name: Name }) + .then(({ Permissions }: WsAccess.ResourcePermissionsResponse) => { + setData(Permissions?.Permission.map(Permission => { + return { + account_name: Permission.account_name, + allow_access: Permission.allow_access ?? false, + allow_read: Permission.allow_read ?? false, + allow_write: Permission.allow_write ?? false, + allow_full: Permission.allow_full ?? false, + deny_access: Permission.deny_access ?? false, + deny_read: Permission.deny_read ?? false, + deny_write: Permission.deny_write ?? false, + deny_full: Permission.deny_full ?? false, + }; + })); + setSelectedIndex(-1); + }) + .catch(err => logger.error(err)) + ; + }, [BaseDn, Name]); + + const [DeleteConfirm, setShowDeleteConfirm] = useConfirm({ + title: nlsHPCC.Delete, + message: nlsHPCC.DeleteSelectedGroups + "\n\n" + data[selectedIndex]?.account_name, + onSubmit: React.useCallback(() => { + service.PermissionAction({ + action: "delete", + BasednName: BaseDn, + rname: Name, + account_name: data[selectedIndex]?.account_name + }) + .then(() => refreshData()) + .catch(err => logger.error(err)) + ; + }, [BaseDn, data, Name, refreshData, selectedIndex]) + }); + + // Command Bar --- + const buttons = React.useMemo((): ICommandBarItemProps[] => [ + { + key: "refresh", text: nlsHPCC.Refresh, iconProps: { iconName: "Refresh" }, + onClick: () => refreshData() + }, + { key: "divider_1", itemType: ContextualMenuItemType.Divider, onRender: () => }, + { + key: "add", text: nlsHPCC.Add, + onClick: () => setShowAddGroup(true) + }, + { key: "divider_2", itemType: ContextualMenuItemType.Divider, onRender: () => }, + { + key: "delete", text: nlsHPCC.Delete, disabled: selectedIndex < 0, + onClick: () => setShowDeleteConfirm(true) + }, + ], [refreshData, selectedIndex, setShowDeleteConfirm]); + + React.useEffect(() => { + refreshData(); + }, [refreshData]); + + const onRowSelect = React.useCallback((evt, index) => { + if (evt.target.checked) { + setSelectedIndex(index); + } else { + setSelectedIndex(-1); + } + }, [setSelectedIndex]); + + const onPermissionCheckboxClick = React.useCallback((evt, permission, prop) => { + calcPermissionState(prop, evt.target.checked, permission); + service.PermissionAction({ + action: "update", + BasednName: BaseDn, + rname: Name, + account_type: 1, + ...permission + }).then(({ retcode, retmsg }) => { + if (retcode === 0) { + setData(prevState => { + const newState = Array.from(prevState); + return newState; + }); + } else if (retcode === -1) { + logger.error(retmsg); + refreshData(); + } + }).catch(err => logger.error(err)); + }, [BaseDn, Name, refreshData]); + + return <> + } + main={ +
+ + + + + + + + + + + + {data?.map((permission, index) => ( + + onRowSelect(ev, index)} /> + {permission.account_name} + onPermissionCheckboxClick(ev, permission, "allow_access")} /> + onPermissionCheckboxClick(ev, permission, "allow_read")} /> + onPermissionCheckboxClick(ev, permission, "allow_write")} /> + onPermissionCheckboxClick(ev, permission, "allow_full")} /> + onPermissionCheckboxClick(ev, permission, "deny_access")} /> + onPermissionCheckboxClick(ev, permission, "deny_read")} /> + onPermissionCheckboxClick(ev, permission, "deny_write")} /> + onPermissionCheckboxClick(ev, permission, "deny_full")} /> + + ))} +
+ } + /> + + + ; +}; \ No newline at end of file diff --git a/esp/src/src-react/components/Security.tsx b/esp/src/src-react/components/Security.tsx index fac4c8ed7a6..260f7b6239a 100644 --- a/esp/src/src-react/components/Security.tsx +++ b/esp/src/src-react/components/Security.tsx @@ -4,10 +4,10 @@ import { SizeMe } from "react-sizeme"; import { pushUrl } from "../util/history"; import { Groups } from "./Groups"; import { Permissions } from "./Permissions"; +import { PermissionsEditor } from "./PermissionsEditor"; import { Users } from "./Users"; import { useBuildInfo } from "../hooks/platform"; import { pivotItemStyle } from "../layouts/pivot"; -import { DojoAdapter } from "../layouts/DojoAdapter"; import nlsHPCC from "src/nlsHPCC"; interface SecurityProps { @@ -59,7 +59,7 @@ export const Security: React.FunctionComponent = ({ } {name && baseDn && - + } diff --git a/esp/src/src-react/components/forms/AddGroupResource.tsx b/esp/src/src-react/components/forms/AddGroupResource.tsx new file mode 100644 index 00000000000..0df103bf4a7 --- /dev/null +++ b/esp/src/src-react/components/forms/AddGroupResource.tsx @@ -0,0 +1,129 @@ +import * as React from "react"; +import { Checkbox, DefaultButton, PrimaryButton, TextField, } from "@fluentui/react"; +import { AccessService } from "@hpcc-js/comms"; +import { scopedLogger } from "@hpcc-js/util"; +import { useForm, Controller } from "react-hook-form"; +import nlsHPCC from "src/nlsHPCC"; +import { MessageBox } from "../../layouts/MessageBox"; + +const logger = scopedLogger("src-react/components/forms/AddGroupResource.tsx"); + +const service = new AccessService({ baseUrl: "" }); + +interface AddGroupResourceFormValues { + account_name: string; + allow_access: boolean; + allow_read: boolean; + allow_write: boolean; + allow_full: boolean; +} + +const defaultValues: AddGroupResourceFormValues = { + account_name: "", + allow_access: false, + allow_read: false, + allow_write: false, + allow_full: false +}; + +interface AddGroupResourceFormProps { + rname: string; + BasednName: string; + refreshGrid?: () => void; + showForm: boolean; + setShowForm: (_: boolean) => void; +} + +export const AddGroupResourceForm: React.FunctionComponent = ({ + rname, + BasednName, + refreshGrid, + showForm, + setShowForm +}) => { + + const { handleSubmit, control, reset } = useForm({ defaultValues }); + + const closeForm = React.useCallback(() => { + setShowForm(false); + }, [setShowForm]); + + const onSubmit = React.useCallback(() => { + handleSubmit( + (data, evt) => { + const request: any = data; + + request["action"] = "update"; + request["account_type"] = "1"; + request["rname"] = rname; + request["BasednName"] = BasednName; + + service.PermissionAction(request) + .then(() => { + closeForm(); + reset(defaultValues); + if (refreshGrid) refreshGrid(); + }) + .catch(err => logger.error(err)) + ; + }, + logger.info + )(); + }, [BasednName, closeForm, handleSubmit, refreshGrid, reset, rname]); + + return + + { reset(defaultValues); closeForm(); }} /> + }> + } + rules={{ + required: nlsHPCC.ValidationErrorRequired + }} + /> +
+ } + /> +
+
+ } + /> +
+
+ } + /> +
+
+ } + /> +
+
; +}; diff --git a/esp/src/src-react/components/forms/AddPermission.tsx b/esp/src/src-react/components/forms/AddPermission.tsx index 39f7df0f866..5b44b6eb7e2 100644 --- a/esp/src/src-react/components/forms/AddPermission.tsx +++ b/esp/src/src-react/components/forms/AddPermission.tsx @@ -67,7 +67,7 @@ export const AddPermissionForm: React.FunctionComponent )(); }, [closeForm, handleSubmit, refreshGrid, reset]); - return { reset(defaultValues); closeForm(); }} /> diff --git a/esp/src/src/nls/hpcc.ts b/esp/src/src/nls/hpcc.ts index 5b5cfb4d897..73435fe047d 100644 --- a/esp/src/src/nls/hpcc.ts +++ b/esp/src/src/nls/hpcc.ts @@ -31,6 +31,7 @@ export = { AddBinding: "Add Binding", AddFile: "Add File", AddGroup: "Add Group", + AddResource: "Add Resource", AddtionalProcessesToFilter: "Addtional Processes To Filter", AdditionalResources: "Additional Resources", AddPart: "Add Part", From 801f268fefba4dd3fcd4741466fc322928b5a676 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:36:03 -0400 Subject: [PATCH 7/7] HPCC-32128 ECL Watch v9 add ZAP creation indicator disables the Submit button and displaying a "Loading..." status on form submission Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- esp/src/src-react/components/forms/ZAPDialog.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/esp/src/src-react/components/forms/ZAPDialog.tsx b/esp/src/src-react/components/forms/ZAPDialog.tsx index d43147c8f3c..3d4e3e3c5c7 100644 --- a/esp/src/src-react/components/forms/ZAPDialog.tsx +++ b/esp/src/src-react/components/forms/ZAPDialog.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Checkbox, DefaultButton, Dropdown, Icon, IDropdownProps, IOnRenderComboBoxLabelProps, IStackTokens, ITextFieldProps, mergeStyleSets, PrimaryButton, Stack, TextField, TooltipHost } from "@fluentui/react"; +import { Checkbox, DefaultButton, Dropdown, Icon, IDropdownProps, IOnRenderComboBoxLabelProps, IStackTokens, ITextFieldProps, mergeStyleSets, PrimaryButton, Spinner, Stack, TextField, TooltipHost } from "@fluentui/react"; import { useForm, Controller } from "react-hook-form"; import { LogType } from "@hpcc-js/comms"; import { scopedLogger } from "@hpcc-js/util"; @@ -164,6 +164,8 @@ export const ZAPDialog: React.FunctionComponent = ({ }), [theme]); const [emailDisabled, setEmailDisabled] = React.useState(true); + const [submitDisabled, setSubmitDisabled] = React.useState(false); + const [spinnerHidden, setSpinnerHidden] = React.useState(true); const [columnMode, setColumnMode] = React.useState(ColumnMode.DEFAULT); const [logFormat, setLogFormat] = React.useState(LogFormat.CSV); const [showCustomColumns, setShowCustomColumns] = React.useState(false); @@ -184,6 +186,8 @@ export const ZAPDialog: React.FunctionComponent = ({ const logFilter = data.LogFilter; delete data.LogFilter; + setSubmitDisabled(true); + setSpinnerHidden(false); for (const key in data) { formData.append(key, data[key]); @@ -223,6 +227,8 @@ export const ZAPDialog: React.FunctionComponent = ({ link.click(); link.remove(); + setSubmitDisabled(false); + setSpinnerHidden(true); closeForm(); if (logAccessorMessage !== "") { @@ -253,7 +259,8 @@ export const ZAPDialog: React.FunctionComponent = ({ return - + + closeForm()} /> }>