Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • drosenda/lhcb-ntuple-wizard-frontend
  • lhcb-dpa/wp6-analysis-preservation-and-open-data/lhcb-ntuple-wizard-frontend
2 results
Show changes
Commits on Source (17)
......@@ -37,7 +37,7 @@ build:
artifacts:
when: always
paths:
- build/
- dist/
pages:
stage: deploy
......@@ -45,7 +45,7 @@ pages:
- build
script:
- rm -r public
- mv build public
- mv dist public
artifacts:
name: $CI_PIPELINE_ID
paths:
......
......@@ -10,22 +10,19 @@
or submit itself to any jurisdiction.
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
<link rel="manifest" href="/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
......@@ -34,13 +31,13 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>LHCb NTuple Wizard</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<title>LHCb NTuple Wizard</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
......@@ -50,5 +47,11 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<script type="module" src="/src/index.jsx"></script>
<script>
if (global === undefined) {
var global = window;
}
</script>
</body>
</html>
This diff is collapsed.
{
"name": "lhcb-ntuple-wizard",
"version": "1.0.2",
"version": "1.0.4",
"description": "An application to access large-scale open data from LHCb",
"url": "https://gitlab.cern.ch/lhcb-dpa/wp6-analysis-preservation-and-open-data/lhcb-ntuple-wizard-frontend/issues",
"private": false,
......@@ -11,11 +11,13 @@
"README.md"
],
"dependencies": {
"@vitejs/plugin-react": "^4.2.1",
"bootstrap": "^5.1.3",
"email-validator": "^2.0.4",
"js-yaml": "^4.1.0",
"jszip": "^3.7.1",
"lodash": "^4.17.21",
"lodash.memoize": "^4.1.2",
"mathjax-react": "^2.0.1",
"pako": "^2.1.0",
"react": "^17.0.2",
......@@ -25,17 +27,16 @@
"react-graph-vis": "^1.0.7",
"react-infinite-scroll-component": "^6.1.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-select": "^4.3.1"
"react-select": "^4.3.1",
"vite": "^5.1.1"
},
"overrides": {
"autoprefixer": "10.4.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"start": "vite --open",
"build": "vite build",
"preview": "vite preview",
"transpile": "babel src -d dist --copy-files",
"prepublishOnly": "npm run transpile"
},
......
......@@ -29,20 +29,10 @@ import {
Spinner,
Tooltip,
} from "react-bootstrap";
import {
Download,
ExclamationCircle,
FileEarmarkCode,
PencilSquare,
PlusLg,
QuestionCircle,
Send,
Upload,
} from "react-bootstrap-icons";
import {Download, ExclamationCircle, PencilSquare, PlusLg, QuestionCircle, Send, Upload} from "react-bootstrap-icons";
import {Route} from "react-router-dom";
import Select from "react-select";
import Creatable from "react-select/creatable";
import config from "../config";
import MetadataContext from "../contexts/MetadataContext";
import BKPath from "../lib/BKPath";
import DTTConfig from "../lib/DTTConfig";
......@@ -541,15 +531,6 @@ class LinesTable extends React.Component {
});
};
createPyOpts = (row) => {
const subdirectory = this.state.productionName;
const filename = row.dtt.getSafeName();
return Array(...config.pyOptsTemplate)
.join("\n")
.replace("{subdirectory}", subdirectory)
.replace("{filename}", filename);
};
processSubmission = () => {
if (this.state.submitLocation) {
this.setState({showReasonForRequestModal: true});
......@@ -567,7 +548,6 @@ class LinesTable extends React.Component {
generateAllFiles = () => {
return [
...this.state.rows.map((row) => [`${row.dtt.getSafeName()}.yaml`, yaml.dump(row.dtt.config)]),
...this.state.rows.map((row) => [`${row.dtt.getSafeName()}.py`, this.createPyOpts(row)]),
["info.yaml", yaml.dump(this.createInfoYaml())],
];
};
......@@ -752,28 +732,6 @@ class LinesTable extends React.Component {
<Download />
</Button>
</OverlayTrigger>
<OverlayTrigger
overlay={
<Tooltip>
Download python options file to load this DecayTreeTuple
from YAML
</Tooltip>
}
>
<Button
className="ms-auto"
type="button"
onClick={() =>
download(
this.createPyOpts(row),
`${row.dtt.getSafeName()}.py`
)
}
disabled={!this.state.productionName || !hasValidName}
>
<FileEarmarkCode />
</Button>
</OverlayTrigger>
</>
)}
......
......@@ -46,7 +46,7 @@ class SelectParticle extends React.Component {
<Select
options={options}
isLoading={!loaded}
filterOption={(candidate, input) => candidate.value.startsWith(input)}
filterOption={(candidate, input) => candidate.value.toLowerCase().startsWith(input.toLowerCase())}
{...remainingProps}
/>
</div>
......
......@@ -66,18 +66,5 @@
"height": "500px",
"autoResize": true,
"width": "100%"
},
"pyOptsTemplate": [
"# This file is generated by the NTuple Wizard <https://lbwizard.web.cern.ch>",
"",
"import os, yaml",
"from pathlib import Path",
"from Configurables import DaVinci",
"from AnalysisHelpers.decaytreetuple import configure_dtt",
"",
"config_file = Path(os.environ['ANALYSIS_PRODUCTIONS_BASE']) / '{subdirectory}' / '{filename}.yaml'",
"config = yaml.safe_load(open(config_file, 'rb'))",
"dtt = configure_dtt(config)",
"DaVinci().UserAlgorithms += [dtt]"
]
}
}
File moved
File moved
File moved
File moved
File moved
/*****************************************************************************\
* (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration *
* *
* This software is distributed under the terms of the GNU General Public *
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
* *
* In applying this licence, CERN does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
import {defineConfig} from "vite";
import react from "@vitejs/plugin-react";
export default () => {
return defineConfig({
plugins: [react()],
});
};