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: ...@@ -37,7 +37,7 @@ build:
artifacts: artifacts:
when: always when: always
paths: paths:
- build/ - dist/
pages: pages:
stage: deploy stage: deploy
...@@ -45,7 +45,7 @@ pages: ...@@ -45,7 +45,7 @@ pages:
- build - build
script: script:
- rm -r public - rm -r public
- mv build public - mv dist public
artifacts: artifacts:
name: $CI_PIPELINE_ID name: $CI_PIPELINE_ID
paths: paths:
......
...@@ -10,22 +10,19 @@ ...@@ -10,22 +10,19 @@
or submit itself to any jurisdiction. or submit itself to any jurisdiction.
--> -->
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta name="description" content="Web site created using create-react-app" />
name="description" <link rel="apple-touch-icon" href="/logo192.png" />
content="Web site created using create-react-app" <!--
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a 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/ 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. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. 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. Only files inside the `public` folder can be referenced from the HTML.
...@@ -34,13 +31,13 @@ ...@@ -34,13 +31,13 @@
work correctly both with client-side routing and a non-root public URL. 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`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>LHCb NTuple Wizard</title> <title>LHCb NTuple Wizard</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div> <div id="root"></div>
<!-- <!--
This HTML file is a template. This HTML file is a template.
If you open it directly in the browser, you will see an empty page. If you open it directly in the browser, you will see an empty page.
...@@ -50,5 +47,11 @@ ...@@ -50,5 +47,11 @@
To begin the development, run `npm start` or `yarn start`. To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`. 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> </html>
This diff is collapsed.
{ {
"name": "lhcb-ntuple-wizard", "name": "lhcb-ntuple-wizard",
"version": "1.0.2", "version": "1.0.4",
"description": "An application to access large-scale open data from LHCb", "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", "url": "https://gitlab.cern.ch/lhcb-dpa/wp6-analysis-preservation-and-open-data/lhcb-ntuple-wizard-frontend/issues",
"private": false, "private": false,
...@@ -11,11 +11,13 @@ ...@@ -11,11 +11,13 @@
"README.md" "README.md"
], ],
"dependencies": { "dependencies": {
"@vitejs/plugin-react": "^4.2.1",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
"email-validator": "^2.0.4", "email-validator": "^2.0.4",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jszip": "^3.7.1", "jszip": "^3.7.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lodash.memoize": "^4.1.2",
"mathjax-react": "^2.0.1", "mathjax-react": "^2.0.1",
"pako": "^2.1.0", "pako": "^2.1.0",
"react": "^17.0.2", "react": "^17.0.2",
...@@ -25,17 +27,16 @@ ...@@ -25,17 +27,16 @@
"react-graph-vis": "^1.0.7", "react-graph-vis": "^1.0.7",
"react-infinite-scroll-component": "^6.1.0", "react-infinite-scroll-component": "^6.1.0",
"react-router-dom": "^5.2.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": { "overrides": {
"autoprefixer": "10.4.5" "autoprefixer": "10.4.5"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "vite --open",
"build": "react-scripts build", "build": "vite build",
"test": "react-scripts test", "preview": "vite preview",
"eject": "react-scripts eject",
"transpile": "babel src -d dist --copy-files", "transpile": "babel src -d dist --copy-files",
"prepublishOnly": "npm run transpile" "prepublishOnly": "npm run transpile"
}, },
......
...@@ -29,20 +29,10 @@ import { ...@@ -29,20 +29,10 @@ import {
Spinner, Spinner,
Tooltip, Tooltip,
} from "react-bootstrap"; } from "react-bootstrap";
import { import {Download, ExclamationCircle, PencilSquare, PlusLg, QuestionCircle, Send, Upload} from "react-bootstrap-icons";
Download,
ExclamationCircle,
FileEarmarkCode,
PencilSquare,
PlusLg,
QuestionCircle,
Send,
Upload,
} from "react-bootstrap-icons";
import {Route} from "react-router-dom"; import {Route} from "react-router-dom";
import Select from "react-select"; import Select from "react-select";
import Creatable from "react-select/creatable"; import Creatable from "react-select/creatable";
import config from "../config";
import MetadataContext from "../contexts/MetadataContext"; import MetadataContext from "../contexts/MetadataContext";
import BKPath from "../lib/BKPath"; import BKPath from "../lib/BKPath";
import DTTConfig from "../lib/DTTConfig"; import DTTConfig from "../lib/DTTConfig";
...@@ -541,15 +531,6 @@ class LinesTable extends React.Component { ...@@ -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 = () => { processSubmission = () => {
if (this.state.submitLocation) { if (this.state.submitLocation) {
this.setState({showReasonForRequestModal: true}); this.setState({showReasonForRequestModal: true});
...@@ -567,7 +548,6 @@ class LinesTable extends React.Component { ...@@ -567,7 +548,6 @@ class LinesTable extends React.Component {
generateAllFiles = () => { generateAllFiles = () => {
return [ return [
...this.state.rows.map((row) => [`${row.dtt.getSafeName()}.yaml`, yaml.dump(row.dtt.config)]), ...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())], ["info.yaml", yaml.dump(this.createInfoYaml())],
]; ];
}; };
...@@ -752,28 +732,6 @@ class LinesTable extends React.Component { ...@@ -752,28 +732,6 @@ class LinesTable extends React.Component {
<Download /> <Download />
</Button> </Button>
</OverlayTrigger> </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 { ...@@ -46,7 +46,7 @@ class SelectParticle extends React.Component {
<Select <Select
options={options} options={options}
isLoading={!loaded} isLoading={!loaded}
filterOption={(candidate, input) => candidate.value.startsWith(input)} filterOption={(candidate, input) => candidate.value.toLowerCase().startsWith(input.toLowerCase())}
{...remainingProps} {...remainingProps}
/> />
</div> </div>
......
...@@ -66,18 +66,5 @@ ...@@ -66,18 +66,5 @@
"height": "500px", "height": "500px",
"autoResize": true, "autoResize": true,
"width": "100%" "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()],
});
};