From 9b3377a9b7c1067f1a5cc42d3df26e31a8a5fe49 Mon Sep 17 00:00:00 2001 From: Adrian Moennich Date: Wed, 8 May 2024 16:19:39 +0200 Subject: [PATCH] Update experiment picker --- labotel/indico_labotel/blueprint.py | 4 ++-- .../client/js/components/BootstrapOptions.jsx | 22 +++++++++---------- .../client/js/components/ExtraFilters.jsx | 6 ++--- .../client/js/components/LabotelLanding.jsx | 10 ++++----- .../client/js/components/Stats.jsx | 2 +- labotel/indico_labotel/controllers.py | 12 +++++----- labotel/indico_labotel/plugin.py | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/labotel/indico_labotel/blueprint.py b/labotel/indico_labotel/blueprint.py index bc5db0fc..029fb366 100644 --- a/labotel/indico_labotel/blueprint.py +++ b/labotel/indico_labotel/blueprint.py @@ -7,12 +7,12 @@ from indico.core.plugins import IndicoPluginBlueprint -from indico_labotel.controllers import RHLabotelStats, RHLabotelStatsCSV, RHUserExperiment +from indico_labotel.controllers import RHLabotelStats, RHLabotelStatsCSV, RHUserDivision blueprint = IndicoPluginBlueprint('labotel', __name__, url_prefix='/rooms') -blueprint.add_url_rule('/api/user/experiment', 'user_experiment', RHUserExperiment, methods=('GET', 'POST')) +blueprint.add_url_rule('/api/user/division', 'user_division', RHUserDivision, methods=('GET', 'POST')) blueprint.add_url_rule('/api/labotel-stats', 'stats', RHLabotelStats) blueprint.add_url_rule('/labotel-stats.csv', 'stats_csv', RHLabotelStatsCSV) diff --git a/labotel/indico_labotel/client/js/components/BootstrapOptions.jsx b/labotel/indico_labotel/client/js/components/BootstrapOptions.jsx index 9ad73684..f94ffd6b 100644 --- a/labotel/indico_labotel/client/js/components/BootstrapOptions.jsx +++ b/labotel/indico_labotel/client/js/components/BootstrapOptions.jsx @@ -5,7 +5,7 @@ // them and/or modify them under the terms of the MIT License; see // the LICENSE file for more details. -import defaultExperimentURL from 'indico-url:plugin_labotel.user_experiment'; +import defaultDivisionURL from 'indico-url:plugin_labotel.user_division'; import PropTypes from 'prop-types'; import React from 'react'; @@ -14,7 +14,7 @@ import {Button} from 'semantic-ui-react'; import {Translate} from 'indico/react/i18n'; import {indicoAxios, handleAxiosError} from 'indico/utils/axios'; -export const EXPERIMENTS = ['ATLAS', 'CMS', 'ALICE', 'LHCb', 'HSE']; +export const DIVISIONS = ['Laser', 'Clean Room', 'DSF/QART']; export default class BootstrapOptions extends React.Component { static propTypes = { @@ -22,11 +22,11 @@ export default class BootstrapOptions extends React.Component { options: PropTypes.object.isRequired, }; - handleExperimentClick = async experiment => { + handleDivisionClick = async division => { const {setOptions} = this.props; - setOptions({division: experiment}); + setOptions({division}); try { - await indicoAxios.post(defaultExperimentURL(), {value: experiment}); + await indicoAxios.post(defaultDivisionURL(), {value: division}); } catch (error) { handleAxiosError(error); } @@ -39,19 +39,19 @@ export default class BootstrapOptions extends React.Component { return ( - {EXPERIMENTS.map(experiment => ( + {DIVISIONS.map(div => ( ))}