From 31e66a8321dcdc07e9c099952881c92423f18001 Mon Sep 17 00:00:00 2001 From: Martin Boulais <31805063+martinboulais@users.noreply.github.com> Date: Thu, 11 Apr 2024 08:03:48 +0200 Subject: [PATCH] [O2B-1204] Several improvements of the on-call template (#1481) * [O2B-1204] Several improvements of the on-call template * Fix test * Fix test --- .../Create/templates/OnCallLogTemplate.js | 3 ++- .../onCallLogCreationConfiguration.js | 26 +++++++++++++++---- test/public/logs/create.test.js | 4 +-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/lib/public/views/Logs/Create/templates/OnCallLogTemplate.js b/lib/public/views/Logs/Create/templates/OnCallLogTemplate.js index d1a4abe64b..11741d732c 100644 --- a/lib/public/views/Logs/Create/templates/OnCallLogTemplate.js +++ b/lib/public/views/Logs/Create/templates/OnCallLogTemplate.js @@ -20,7 +20,7 @@ import { detectorsProvider } from '../../../../services/detectors/detectorsProvi * * @type {string[]} */ -const ALICE_SYSTEMS = ['FLP', 'ECS', 'EPN', 'DCS', 'OTHER']; +const ALICE_SYSTEMS = ['FLP', 'EPN', 'DCS', 'OTHER', 'CTP', 'PDP', 'QC', 'LHCIF', 'TPC HV', 'RP']; const SHIFTER_TAGS = { DCS: 'DCS Shifter', @@ -106,6 +106,7 @@ export class OnCallLogTemplate extends Observable { get detectorsAndSystems() { return this._detectors$.getCurrent().apply({ Success: (detectors) => [ + 'ALL', ...detectors.map(({ name }) => name), ...ALICE_SYSTEMS, ], diff --git a/lib/public/views/Logs/Create/templates/onCallLogCreationConfiguration.js b/lib/public/views/Logs/Create/templates/onCallLogCreationConfiguration.js index e91b225408..f4415575b4 100644 --- a/lib/public/views/Logs/Create/templates/onCallLogCreationConfiguration.js +++ b/lib/public/views/Logs/Create/templates/onCallLogCreationConfiguration.js @@ -119,11 +119,27 @@ export const onCallLogCreationConfiguration = (creationModel, template) => { h(PanelComponent, [ h(LabelPanelHeaderComponent, { required: true, for: 'lhcBeamMode' }, 'LHC Beam mode'), h( - 'input#lhcBeamMode.form-control', - { - value: template.formData.lhcBeamMode, - oninput: (e) => template.patchFormData({ lhcBeamMode: e.target.value }), - }, + 'select#lhcBeamMode.form-control', + { onchange: (e) => template.patchFormData({ lhcBeamMode: e.target.value }) }, + [ + h('option', { disabled: true, selected: true }, '- None -'), + [ + 'NO BEAM', + 'INJECTION PROBE BEAM', + 'INJECTION PHYSICS BEAM', + 'PREPARE RAMP', + 'RAMP', + 'FLAT TOP', + 'SQUEEZE', + 'STABLE BEAMS', + 'DUMP', + 'RAMP DOWN', + ].map((lhcBeamMode) => h( + 'option', + { value: lhcBeamMode }, + lhcBeamMode, + )), + ], ), ]), h(PanelComponent, { class: 'flex-column flex-grow' }, [ diff --git a/test/public/logs/create.test.js b/test/public/logs/create.test.js index b910bc5412..7f0654d6d0 100644 --- a/test/public/logs/create.test.js +++ b/test/public/logs/create.test.js @@ -496,8 +496,8 @@ module.exports = () => { const shifterPosition = 'ECS'; await page.select('#shifterPosition', shifterPosition); - const beamMode = 'Beam mode'; - await fillInput(page, '#lhcBeamMode', beamMode); + const beamMode = 'INJECTION PHYSICS BEAM'; + await page.select('#lhcBeamMode', beamMode); const description = 'Description\nof the issue'; await pressElement(page, '#issue-description ~ .CodeMirror');