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 => ( ))}