lhcb-ntuple-wizard-test 2.0.6 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +2 -1
- package/dist/components/DecayCard.d.ts +1 -0
- package/dist/components/{DttNameInput.js → DecayCard.js} +9 -5
- package/dist/components/DecayLatex.js +1 -1
- package/dist/components/DecayTreeCard.js +7 -10
- package/dist/components/DecayTreeGraph.d.ts +1 -2
- package/dist/components/DecayTreeGraph.js +132 -46
- package/dist/components/DeleteButton.d.ts +2 -1
- package/dist/components/DeleteButton.js +2 -2
- package/dist/components/NtupleWizard.d.ts +2 -1
- package/dist/components/NtupleWizard.js +8 -2
- package/dist/components/RequestButtonGroup.d.ts +1 -7
- package/dist/components/RequestButtonGroup.js +5 -3
- package/dist/components/RequestRow.d.ts +1 -7
- package/dist/components/RequestRow.js +6 -5
- package/dist/components/StrippingLineBadge.js +1 -1
- package/dist/components/{TupleToolDropdown.d.ts → TupleToolClassDropdown.d.ts} +2 -5
- package/dist/components/{TupleToolDropdown.js → TupleToolClassDropdown.js} +10 -4
- package/dist/components/TupleToolGroup.d.ts +1 -2
- package/dist/components/TupleToolGroup.js +5 -5
- package/dist/components/TupleToolList.d.ts +1 -2
- package/dist/components/TupleToolList.js +11 -7
- package/dist/components/VerticalLine.d.ts +7 -0
- package/dist/components/VerticalLine.js +4 -0
- package/dist/components/modals/AddTupleToolModal.d.ts +3 -4
- package/dist/components/modals/AddTupleToolModal.js +12 -12
- package/dist/components/modals/ConfigureTupleToolModal.d.ts +2 -2
- package/dist/components/modals/ConfigureTupleToolModal.js +28 -11
- package/dist/components/modals/ReasonForRequestModal.d.ts +1 -3
- package/dist/components/modals/ReasonForRequestModal.js +6 -4
- package/dist/config.d.ts +18 -47
- package/dist/config.js +26 -39
- package/dist/pages/DecaySearchPage.d.ts +1 -5
- package/dist/pages/DecaySearchPage.js +3 -1
- package/dist/pages/DecayTreeConfigPage.d.ts +1 -5
- package/dist/pages/DecayTreeConfigPage.js +16 -14
- package/dist/pages/RequestPage.d.ts +1 -20
- package/dist/pages/RequestPage.js +15 -16
- package/dist/providers/DttProvider.d.ts +2 -0
- package/dist/providers/DttProvider.js +4 -1
- package/dist/providers/WizardConfigProvider.d.ts +21 -0
- package/dist/providers/WizardConfigProvider.js +21 -0
- package/dist/utils/utils.js +36 -3
- package/package.json +10 -5
- package/dist/components/DttNameInput.d.ts +0 -9
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const WizardConfigContext = createContext(null);
|
|
4
|
+
export const WizardConfigProvider = ({ basePath, submitLocation, requestReasonMessage, requestSubmittedMessage, onRequestSubmitted, children, }) => {
|
|
5
|
+
const variant = submitLocation ? "embedded" : "standalone";
|
|
6
|
+
return (_jsx(WizardConfigContext.Provider, { value: {
|
|
7
|
+
variant,
|
|
8
|
+
basePath,
|
|
9
|
+
submitLocation,
|
|
10
|
+
requestReasonMessage,
|
|
11
|
+
requestSubmittedMessage,
|
|
12
|
+
onRequestSubmitted,
|
|
13
|
+
}, children: children }));
|
|
14
|
+
};
|
|
15
|
+
export const useWizardConfig = () => {
|
|
16
|
+
const ctx = useContext(WizardConfigContext);
|
|
17
|
+
if (!ctx) {
|
|
18
|
+
throw new Error("useWizardConfig must be used within a WizardConfigProvider");
|
|
19
|
+
}
|
|
20
|
+
return ctx;
|
|
21
|
+
};
|
package/dist/utils/utils.js
CHANGED
|
@@ -23,18 +23,41 @@ const parseInput = (decay, input) => {
|
|
|
23
23
|
versions: decay.lines[`${stream}/${line}`],
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
+
const getDttName = (value) => {
|
|
27
|
+
const basename = value.split("/").pop() ?? value;
|
|
28
|
+
return basename.replace(/\.py$/i, "");
|
|
29
|
+
};
|
|
30
|
+
const getConfigOrderFromInfoYaml = (infoYaml) => {
|
|
31
|
+
const order = new Map();
|
|
32
|
+
if (!infoYaml) {
|
|
33
|
+
return order;
|
|
34
|
+
}
|
|
35
|
+
for (const [key, jobConfig] of Object.entries(infoYaml)) {
|
|
36
|
+
if (key === "defaults") {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const job = jobConfig;
|
|
40
|
+
for (const option of job.options) {
|
|
41
|
+
const dttName = getDttName(option);
|
|
42
|
+
if (!order.has(dttName)) {
|
|
43
|
+
order.set(dttName, order.size);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return order;
|
|
48
|
+
};
|
|
26
49
|
const addBkPathsToRows = (infoYaml, rows) => {
|
|
27
50
|
for (const row of rows) {
|
|
28
51
|
if (!row.dtt?.config.name) {
|
|
29
52
|
continue;
|
|
30
53
|
}
|
|
31
|
-
const dttName = row.dtt.config.name
|
|
54
|
+
const dttName = getDttName(row.dtt.config.name);
|
|
32
55
|
for (const [key, jobConfig] of Object.entries(infoYaml)) {
|
|
33
56
|
if (key === "defaults") {
|
|
34
57
|
continue;
|
|
35
58
|
}
|
|
36
59
|
const job = jobConfig;
|
|
37
|
-
if (job.options.some((option) => option
|
|
60
|
+
if (job.options.some((option) => getDttName(option) === dttName)) {
|
|
38
61
|
row.paths.push(job.input.bk_query);
|
|
39
62
|
}
|
|
40
63
|
}
|
|
@@ -516,7 +539,17 @@ export async function parseProductionFiles(files, metadata) {
|
|
|
516
539
|
export function processProductionFiles(metadata, configs, infoYaml) {
|
|
517
540
|
const rows = [];
|
|
518
541
|
const emailsToInform = [];
|
|
519
|
-
|
|
542
|
+
const configOrder = getConfigOrderFromInfoYaml(infoYaml);
|
|
543
|
+
const orderedConfigs = [...configs].sort((a, b) => {
|
|
544
|
+
const aName = getDttName(a.name ?? "");
|
|
545
|
+
const bName = getDttName(b.name ?? "");
|
|
546
|
+
const aOrder = configOrder.get(aName) ?? Number.MAX_SAFE_INTEGER;
|
|
547
|
+
const bOrder = configOrder.get(bName) ?? Number.MAX_SAFE_INTEGER;
|
|
548
|
+
if (aOrder !== bOrder)
|
|
549
|
+
return aOrder - bOrder;
|
|
550
|
+
return aName.localeCompare(bName);
|
|
551
|
+
});
|
|
552
|
+
for (const config of orderedConfigs) {
|
|
520
553
|
const decay = Object.values(metadata.decays).find((d) => d.descriptors.template === config.descriptorTemplate);
|
|
521
554
|
if (!decay) {
|
|
522
555
|
return `[${config.name}] Unknown decay '${config.descriptorTemplate}'`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lhcb-ntuple-wizard-test",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "An application to access large-scale open data from LHCb",
|
|
5
5
|
"url": "https://gitlab.cern.ch/lhcb-dpa/wp6-analysis-preservation-and-open-data/lhcb-ntuple-wizard-frontend/issues",
|
|
6
6
|
"private": false,
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"@mathjax/src": "4.1.0",
|
|
20
20
|
"better-react-mathjax": "2.3.0",
|
|
21
21
|
"bootstrap": "5.3.8",
|
|
22
|
+
"cytoscape": "3.33.1",
|
|
23
|
+
"cytoscape-dagre": "^2.5.0",
|
|
22
24
|
"dompurify": "^3.3.1",
|
|
23
25
|
"email-validator": "2.0.4",
|
|
24
26
|
"js-yaml": "4.1.1",
|
|
@@ -29,9 +31,10 @@
|
|
|
29
31
|
"pako": "2.1.0",
|
|
30
32
|
"react-bootstrap": "2.10.10",
|
|
31
33
|
"react-bootstrap-icons": "1.11.6",
|
|
32
|
-
"react-
|
|
34
|
+
"react-cytoscapejs": "^2.0.0",
|
|
33
35
|
"react-infinite-scroll-component": "^6.1.1",
|
|
34
36
|
"react-select": "5.10.2",
|
|
37
|
+
"react-toastify": "^11.0.5",
|
|
35
38
|
"typia": "^11.0.3"
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
@@ -69,19 +72,21 @@
|
|
|
69
72
|
"@babel/preset-react": "7.27.1",
|
|
70
73
|
"@eslint/js": "^9.17.0",
|
|
71
74
|
"@kennethwkz/unplugin-typia": "^2.6.7",
|
|
75
|
+
"@types/cytoscape-dagre": "^2.3.4",
|
|
72
76
|
"@types/jest": "^30.0.0",
|
|
73
77
|
"@types/js-yaml": "^4.0.9",
|
|
74
78
|
"@types/lodash": "^4.17.21",
|
|
75
79
|
"@types/lodash.memoize": "^4.1.9",
|
|
76
80
|
"@types/pako": "^2.0.4",
|
|
77
81
|
"@types/react": "^19.2.7",
|
|
82
|
+
"@types/react-cytoscapejs": "^1.2.6",
|
|
78
83
|
"@types/react-dom": "^19.2.3",
|
|
79
84
|
"@types/react-router-dom": "^5.3.3",
|
|
80
85
|
"@types/vis": "^4.21.27",
|
|
81
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
82
|
-
"@typescript-eslint/parser": "^8.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^8.56.0",
|
|
87
|
+
"@typescript-eslint/parser": "^8.56.0",
|
|
83
88
|
"@vitejs/plugin-react": "5.1.2",
|
|
84
|
-
"eslint": "^9.
|
|
89
|
+
"eslint": "^9.39.3",
|
|
85
90
|
"eslint-plugin-react": "^7.37.5",
|
|
86
91
|
"globals": "^16.0.0",
|
|
87
92
|
"react": "^19.2.3",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RowData } from "../models/rowData";
|
|
2
|
-
interface Props {
|
|
3
|
-
row: RowData;
|
|
4
|
-
hideDownloadButtons: boolean;
|
|
5
|
-
hideUploadButtons: boolean;
|
|
6
|
-
basePath: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function DttNameInput({ row, hideDownloadButtons, hideUploadButtons, basePath }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
-
export {};
|