From 6237062617dc623f91fdc9853f8fa9780e7c9136 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Tue, 23 Sep 2025 22:13:20 +0200 Subject: [PATCH 01/11] dplDetectorId -> detectorId --- .../models/typedefs/SequelizeGaqDetector.js | 2 +- .../models/typedefs/SequelizeQcFlag.js | 2 +- lib/domain/entities/DataPassQcFlag.js | 2 +- lib/domain/entities/QcFlag.js | 2 +- lib/domain/entities/SimulationPassQcFlag.js | 2 +- lib/domain/entities/dpl/DplDetector.js | 2 +- .../qcFlags/qcFlagOverviewPanelLink.js | 6 +- .../ActiveColumns/gaqFlagsActiveColumns.js | 4 +- .../QcFlagsForDataPassOverviewModel.js | 2 +- .../QcFlagsForDataPassOverviewPage.js | 8 +-- .../QcFlagsForSimulationPassOverviewModel.js | 2 +- .../QcFlagsForSimulationPassOverviewPage.js | 8 +-- .../QcFlags/GaqFlags/GaqFlagsOverviewModel.js | 2 +- .../QcFlags/Overview/QcFlagsOverviewModel.js | 14 ++-- lib/public/views/QcFlags/QcFlagsModel.js | 30 ++++---- .../SynchronousQcFlagsOverviewModel.js | 2 +- .../QcFlags/details/QcFlagDetailsModel.js | 6 +- .../runDetectorsAsyncQcActiveColumns.js | 28 ++++---- .../runDetectorsSyncQcActiveColumns.js | 2 +- .../controllers/gaqDetectors.controller.js | 6 +- lib/server/controllers/qcFlag.controller.js | 24 +++---- .../qualityControlFlag/QcFlagService.js | 6 +- .../QcFlagSummaryService.js | 8 +-- lib/usecases/run/GetAllRunsUseCase.js | 12 ++-- test/api/gaqDetectors.test.js | 4 +- test/api/qcFlags.test.js | 70 +++++++++---------- .../qualityControlFlag/QcFlagService.test.js | 18 ++--- .../public/qcFlags/detailsForDataPass.test.js | 8 +-- .../qcFlags/detailsForSimulationPass.test.js | 16 ++--- .../qcFlags/forDataPassOverview.test.js | 10 +-- .../qcFlags/forSimulationPassOverview.test.js | 12 ++-- .../qcFlags/synchronousOverview.test.js | 2 +- .../runs/runsPerDataPass.overview.test.js | 6 +- .../runsPerSimulationPass.overview.test.js | 2 +- 34 files changed, 165 insertions(+), 165 deletions(-) diff --git a/lib/database/models/typedefs/SequelizeGaqDetector.js b/lib/database/models/typedefs/SequelizeGaqDetector.js index d32c0f43bc..42752cac7d 100644 --- a/lib/database/models/typedefs/SequelizeGaqDetector.js +++ b/lib/database/models/typedefs/SequelizeGaqDetector.js @@ -16,7 +16,7 @@ * * @property {number} dataPassId * @property {number} runNumber - * @property {number} dplDetectorId + * @property {number} detectorId * @property {Date} createdAt * @property {Date} updatedAt */ diff --git a/lib/database/models/typedefs/SequelizeQcFlag.js b/lib/database/models/typedefs/SequelizeQcFlag.js index 0361b19c53..537850170b 100644 --- a/lib/database/models/typedefs/SequelizeQcFlag.js +++ b/lib/database/models/typedefs/SequelizeQcFlag.js @@ -23,7 +23,7 @@ * @property {number} createdById * @property {number} flagTypeId * @property {number} runNumber - * @property {number} dplDetectorId + * @property {number} detectorId * @property {number} createdAt * @property {number} updatedAt * @property {SequelizeQcFlagType|null} flagType diff --git a/lib/domain/entities/DataPassQcFlag.js b/lib/domain/entities/DataPassQcFlag.js index 4f25e910ce..b36838f031 100644 --- a/lib/domain/entities/DataPassQcFlag.js +++ b/lib/domain/entities/DataPassQcFlag.js @@ -22,7 +22,7 @@ * @property {number} createdById * @property {number} flagTypeId * @property {number} runNumber - * @property {number} dplDetectorId + * @property {number} detectorId * @property {number} createdAt * @property {number} updatedAt * @property {DataPass|null} dataPass diff --git a/lib/domain/entities/QcFlag.js b/lib/domain/entities/QcFlag.js index 24ece7ef61..7590c3afcb 100644 --- a/lib/domain/entities/QcFlag.js +++ b/lib/domain/entities/QcFlag.js @@ -24,7 +24,7 @@ * @property {number} flagTypeId * @property {number} runNumber * @property {number} dataPassId - * @property {number} dplDetectorId + * @property {number} detectorId * @property {number} createdAt * @property {number} updatedAt * @property {User|null} createdBy diff --git a/lib/domain/entities/SimulationPassQcFlag.js b/lib/domain/entities/SimulationPassQcFlag.js index 64b2e04423..985743add7 100644 --- a/lib/domain/entities/SimulationPassQcFlag.js +++ b/lib/domain/entities/SimulationPassQcFlag.js @@ -22,7 +22,7 @@ * @property {number} createdById * @property {number} flagTypeId * @property {number} runNumber - * @property {number} dplDetectorId + * @property {number} detectorId * @property {number} createdAt * @property {number} updatedAt * @property {SimulationPass|null} simulationPass diff --git a/lib/domain/entities/dpl/DplDetector.js b/lib/domain/entities/dpl/DplDetector.js index dbf5a6ee39..c65b8e26ed 100644 --- a/lib/domain/entities/dpl/DplDetector.js +++ b/lib/domain/entities/dpl/DplDetector.js @@ -22,6 +22,6 @@ /** * @typedef DplDetectorIdentifier object to uniquely identify a DPL detector - * @property {number} [dplDetectorId] the id of the DPL detector + * @property {number} [detectorId] the id of the DPL detector * @property {string} [dplDetectorName] the name of the DPL detector */ diff --git a/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js b/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js index af0af67c32..b39a715e92 100644 --- a/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js +++ b/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js @@ -21,11 +21,11 @@ import { frontLink } from '../common/navigation/frontLink.js'; * @param {number} [scope.dataPassId] data pass id - exclusive with simulationPassId parameter * @param {number} [scope.simulationPassId] simulation pass id - exclusive with dataPassId parameter * @param {number} scope.runNumber run number - * @param {number} scope.dplDetectorId DPL detector id + * @param {number} scope.detectorId DPL detector id * @param {object} [attributes] attributes @see frontLink attributes parameter * @return {Component} link */ -export const qcFlagOverviewPanelLink = (content, { dataPassId, simulationPassId, runNumber, dplDetectorId }, attributes = {}) => { +export const qcFlagOverviewPanelLink = (content, { dataPassId, simulationPassId, runNumber, detectorId }, attributes = {}) => { let options = {}; let pageName = ''; if (dataPassId) { @@ -41,7 +41,7 @@ export const qcFlagOverviewPanelLink = (content, { dataPassId, simulationPassId, return frontLink( content, pageName, - { runNumber, dplDetectorId, ...options }, + { runNumber, detectorId, ...options }, { title: 'QC flags overview', ...attributes }, ); }; diff --git a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js index 09d5fa3a40..cebcb2f91e 100644 --- a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js +++ b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js @@ -64,7 +64,7 @@ const formatGeneralQuality = (contributingFlags, gaqDetectors) => { * @return {Component} display of QC flag */ const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, detectorId }) => { - const flag = contributingFlags.find(({ dplDetectorId }) => dplDetectorId === detectorId); + const flag = contributingFlags.find(({ detectorId }) => detectorId === detectorId); if (!flag) { return h('.gray-darker.m2.badge', tooltip(iconBan(), 'No flag is assigned')); } @@ -86,7 +86,7 @@ const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, de id: flag.id, dataPassId, runNumber, - dplDetectorId: detectorId, + detectorId: detectorId, }, ); }; diff --git a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js index 20a919657f..5b9953af36 100644 --- a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js +++ b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js @@ -39,7 +39,7 @@ export class QcFlagsForDataPassOverviewModel extends QcFlagsOverviewModel { return buildUrl('/api/qcFlags/perDataPass', { dataPassId: this._dataPassId, runNumber: this._runNumber, - dplDetectorId: this._dplDetectorId, + detectorId: this._detectorId, filter: this.dplDetector.match({ Success: ({ type }) => [DetectorType.AOT_GLO, DetectorType.AOT_EVENT, DetectorType.MUON_GLO].includes(type) ? { createdBy: { names: 'Anonymous', operator: 'none' } } diff --git a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js index 3a16b2cb41..f98aa380ab 100644 --- a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js @@ -41,7 +41,7 @@ export const QcFlagsForDataPassOverviewPage = ({ const { dataPass: remoteDataPass, run: remoteRun, - dplDetectorId, + detectorId, dplDetector: remoteDplDetector, items: remoteQcFlags, sortModel, @@ -56,11 +56,11 @@ export const QcFlagsForDataPassOverviewPage = ({ qcFlagId: { name: 'Id', visible: true, - format: (qcFlagId, { dataPassId, dplDetectorId, runNumber }) => + format: (qcFlagId, { dataPassId, detectorId, runNumber }) => frontLink( h('.btn.btn-primary.white', qcFlagId), 'qc-flag-details-for-data-pass', - { id: qcFlagId, dataPassId, runNumber, dplDetectorId }, + { id: qcFlagId, dataPassId, runNumber, detectorId }, ), classes: 'w-5', }, @@ -74,7 +74,7 @@ export const QcFlagsForDataPassOverviewPage = ({ remoteDataPass, remoteRun, remoteDplDetector, - remoteDplDetectorUserHasAccessTo(dplDetectorId, remoteDplDetectorsUserHasAccessTo), + remoteDplDetectorUserHasAccessTo(detectorId, remoteDplDetectorsUserHasAccessTo), remoteQcFlags, ]).match({ NotAsked: () => null, diff --git a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewModel.js b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewModel.js index f0d20714fe..4ab653b206 100644 --- a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewModel.js +++ b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewModel.js @@ -38,7 +38,7 @@ export class QcFlagsForSimulationPassOverviewModel extends QcFlagsOverviewModel return buildUrl('/api/qcFlags/perSimulationPass', { simulationPassId: this._simulationPassId, runNumber: this._runNumber, - dplDetectorId: this._dplDetectorId, + detectorId: this._detectorId, }); } diff --git a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js index fb11ae1876..486889f86f 100644 --- a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js @@ -41,7 +41,7 @@ export const QcFlagsForSimulationPassOverviewPage = ({ const { simulationPass: remoteSimulationPass, run: remoteRun, - dplDetectorId, + detectorId, dplDetector: remoteDplDetector, items: remoteQcFlags, sortModel, @@ -57,11 +57,11 @@ export const QcFlagsForSimulationPassOverviewPage = ({ qcFlagId: { name: 'Id', visible: true, - format: (qcFlagId, { simulationPassId, dplDetectorId, runNumber }) => + format: (qcFlagId, { simulationPassId, detectorId, runNumber }) => frontLink( h('.btn.btn-primary.white', qcFlagId), 'qc-flag-details-for-simulation-pass', - { id: qcFlagId, simulationPassId, runNumber, dplDetectorId }, + { id: qcFlagId, simulationPassId, runNumber, detectorId }, ), classes: 'w-5', }, @@ -75,7 +75,7 @@ export const QcFlagsForSimulationPassOverviewPage = ({ remoteSimulationPass, remoteRun, remoteDplDetector, - remoteDplDetectorUserHasAccessTo(dplDetectorId, remoteDplDetectorsUserHasAccessTo), + remoteDplDetectorUserHasAccessTo(detectorId, remoteDplDetectorsUserHasAccessTo), ]) .match({ NotAsked: () => null, diff --git a/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js b/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js index bf38d822b0..cb87fe6f17 100644 --- a/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js @@ -140,7 +140,7 @@ export class GaqFlagsOverviewModel extends OverviewPageModel { await jsonPost('/api/gaqDetectors', { dataPassId: this._dataPassId, runNumbers: [this._runNumber], - dplDetectorIds: this._gaqDetectorPickerModel.selected, + detectorIds: this._gaqDetectorPickerModel.selected, }); this._setGaqDetectorsRequestResult.setCurrent(RemoteData.success(null)); diff --git a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js index 0758d5fa9c..70f32e31e7 100644 --- a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js @@ -60,10 +60,10 @@ export class QcFlagsOverviewModel extends OverviewPageModel { _getDetector() { this._dplDetector$.setCurrent(detectorsProvider.qc$.getCurrent().match({ Success: (dplDetectors) => { - const dplDetector = dplDetectors.find(({ id }) => id === this._dplDetectorId); + const dplDetector = dplDetectors.find(({ id }) => id === this._detectorId); return dplDetector ? RemoteData.success(dplDetector) - : RemoteData.failure({ errors: [{ detail: `There is no dplDetector with given id (${this._dplDetectorId})` }] }); + : RemoteData.failure({ errors: [{ detail: `There is no dplDetector with given id (${this._detectorId})` }] }); }, Failure: (payload) => RemoteData.failure(payload), Loading: () => RemoteData.loading(), @@ -122,15 +122,15 @@ export class QcFlagsOverviewModel extends OverviewPageModel { * DplDetector id getter * @return {number} current dpl detector id */ - get dplDetectorId() { - return this._dplDetectorId; + get detectorId() { + return this._detectorId; } /** * Set id of DPL detector which for QC flags should be fetched - * @param {number} dplDetectorId detector id + * @param {number} detectorId detector id */ - set dplDetectorId(dplDetectorId) { - this._dplDetectorId = dplDetectorId; + set detectorId(detectorId) { + this._detectorId = detectorId; } } diff --git a/lib/public/views/QcFlags/QcFlagsModel.js b/lib/public/views/QcFlags/QcFlagsModel.js index 9cb026aa8a..83f369c32b 100644 --- a/lib/public/views/QcFlags/QcFlagsModel.js +++ b/lib/public/views/QcFlags/QcFlagsModel.js @@ -51,13 +51,13 @@ export class QcFlagsModel extends Observable { * @param {object} parameters parameters for the model * @param {number} parameters.runNumber run number * @param {number} parameters.dataPassId data pass id - * @param {number} parameters.dplDetectorId dpl detector id + * @param {number} parameters.detectorId dpl detector id * @returns {void} */ - loadForDataPassOverview({ dataPassId, runNumber, dplDetectorId }) { + loadForDataPassOverview({ dataPassId, runNumber, detectorId }) { this._forDataPassOverviewModel.runNumber = parseInt(runNumber, 10); this._forDataPassOverviewModel.dataPassId = parseInt(dataPassId, 10); - this._forDataPassOverviewModel.dplDetectorId = parseInt(dplDetectorId, 10); + this._forDataPassOverviewModel.detectorId = parseInt(detectorId, 10); this._forDataPassOverviewModel.load(); } @@ -131,10 +131,10 @@ export class QcFlagsModel extends Observable { * @param {number} parameters.id run number * @param {number} parameters.dataPassId data pass id * @param {number} parameters.runNumber dpl detector id - * @param {number} parameters.dplDetectorId dpl detector id + * @param {number} parameters.detectorId dpl detector id * @returns {void} */ - loadDetailsForDataPass({ id, dataPassId, runNumber, dplDetectorId }) { + loadDetailsForDataPass({ id, dataPassId, runNumber, detectorId }) { this._detailsForDataPassModel = new QcFlagDetailsForDataPassModel( { id: parseInt(id, 10), dataPassId: parseInt(dataPassId, 10) }, () => this.model.router.go( @@ -144,7 +144,7 @@ export class QcFlagsModel extends Observable { page: 'qc-flags-for-data-pass', runNumber, dataPassId, - dplDetectorId, + detectorId, }, ), true, @@ -167,13 +167,13 @@ export class QcFlagsModel extends Observable { * @param {object} parameters parameters for the model * @param {number} parameters.simulationPassId simulation pass id * @param {number} parameters.runNumber run number - * @param {number} parameters.dplDetectorId dpl detector id + * @param {number} parameters.detectorId dpl detector id * @returns {void} */ - loadForSimulationPassOverview({ simulationPassId, runNumber, dplDetectorId }) { + loadForSimulationPassOverview({ simulationPassId, runNumber, detectorId }) { this._forSimulationPassOverviewModel.runNumber = parseInt(runNumber, 10); this._forSimulationPassOverviewModel.simulationPassId = parseInt(simulationPassId, 10); - this._forSimulationPassOverviewModel.dplDetectorId = parseInt(dplDetectorId, 10); + this._forSimulationPassOverviewModel.detectorId = parseInt(detectorId, 10); this._forSimulationPassOverviewModel.load(); } @@ -225,10 +225,10 @@ export class QcFlagsModel extends Observable { * @param {number} parameters.id id * @param {number} parameters.simulationPassId simulation pass id * @param {number} parameters.runNumber run number - * @param {number} parameters.dplDetectorId dpl detector id + * @param {number} parameters.detectorId dpl detector id * @returns {void} */ - loadDetailsForSimulationPass({ id, simulationPassId, runNumber, dplDetectorId }) { + loadDetailsForSimulationPass({ id, simulationPassId, runNumber, detectorId }) { this._detailsForSimulationPassModel = new QcFlagDetailsForSimulationPassModel( { id: parseInt(id, 10), simulationPassId: parseInt(simulationPassId, 10) }, () => this.model.router.go(buildUrl( @@ -237,7 +237,7 @@ export class QcFlagsModel extends Observable { page: 'qc-flags-for-simulation-pass', runNumber, simulationPassId, - dplDetectorId, + detectorId, }, ), true), ); @@ -257,12 +257,12 @@ export class QcFlagsModel extends Observable { * Load the overview page model * @param {object} parameters parameters for the model * @param {number} parameters.runNumber run number - * @param {number} parameters.dplDetectorId dpl detector id + * @param {number} parameters.detectorId dpl detector id * @returns {void} */ - loadSynchronousOverview({ runNumber, dplDetectorId }) { + loadSynchronousOverview({ runNumber, detectorId }) { this._synchronousOverviewModel.runNumber = parseInt(runNumber, 10); - this._synchronousOverviewModel.dplDetectorId = parseInt(dplDetectorId, 10); + this._synchronousOverviewModel.detectorId = parseInt(detectorId, 10); this._synchronousOverviewModel.load(); } diff --git a/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewModel.js b/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewModel.js index 0428a4020d..8021fbf6f2 100644 --- a/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewModel.js @@ -31,6 +31,6 @@ export class SynchronousQcFlagsOverviewModel extends QcFlagsOverviewModel { * @inheritdoc */ getRootEndpoint() { - return buildUrl('/api/qcFlags/synchronous', { detectorId: this._dplDetectorId, runNumber: this._runNumber }); + return buildUrl('/api/qcFlags/synchronous', { detectorId: this._detectorId, runNumber: this._runNumber }); } } diff --git a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js index ebe457d0ed..f940155bbb 100644 --- a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js +++ b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js @@ -70,7 +70,7 @@ export class QcFlagDetailsModel extends Observable { await this._fetchQcFlag(); this._qcFlag$.getCurrent().match({ Success: (qcFlag) => { - this._dplDetectorId = qcFlag.dplDetectorId; + this._detectorId = qcFlag.detectorId; this._getDetector(); }, Other: () => null, @@ -100,10 +100,10 @@ export class QcFlagDetailsModel extends Observable { _getDetector() { this._dplDetector$.setCurrent(detectorsProvider.qc$.getCurrent().match({ Success: (dplDetectors) => { - const dplDetector = dplDetectors.find(({ id }) => id === this._dplDetectorId); + const dplDetector = dplDetectors.find(({ id }) => id === this._detectorId); return dplDetector ? RemoteData.success(dplDetector) - : RemoteData.failure({ errors: [{ detail: `There is no dplDetector with given id (${this._dplDetectorId})` }] }); + : RemoteData.failure({ errors: [{ detail: `There is no dplDetector with given id (${this._detectorId})` }] }); }, Failure: (payload) => RemoteData.failure(payload), Loading: () => RemoteData.loading(), diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js index a8b9da8f2a..8982d5ee5b 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js @@ -31,14 +31,14 @@ import { DetectorType } from '../../../domain/enums/DetectorTypes.js'; * @param {number} [monalisaProduction.dataPassId] data pass id -- exclusive with `simulationPassId` * @param {number} [monalisaProduction.simulationPassId] simulation pass id -- exclusive with `dataPassId` * @param {Run} run a run - * @param {number} dplDetectorId id of the detector + * @param {number} detectorId id of the detector * @param {QcSummary} qcSummary QC summary * @return {Component} component */ -const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, dplDetectorId, qcSummary) => { +const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, detectorId, qcSummary) => { const { runNumber } = run; - let qcSummaryDisplay = getQcSummaryDisplay(qcSummary[runNumber][dplDetectorId]); + let qcSummaryDisplay = getQcSummaryDisplay(qcSummary[runNumber][detectorId]); qcSummaryDisplay = isRunNotSubjectToQc(run) ? tooltip(qcSummaryDisplay, getRunQcExclusionReason(run)) @@ -46,7 +46,7 @@ const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, d return qcFlagOverviewPanelLink( qcSummaryDisplay, - { dataPassId, simulationPassId, runNumber, dplDetectorId }, + { dataPassId, simulationPassId, runNumber, detectorId }, ); }; @@ -78,12 +78,12 @@ export const createRunDetectorsAsyncQcActiveColumns = ( throw new Error('`dataPass` and `simulationPass` are exclusive options'); } - let activeColumnEntries = dplDetectors?.map(({ name: detectorName, id: dplDetectorId, type: dplDetectorType }) => [ + let activeColumnEntries = dplDetectors?.map(({ name: detectorName, id: detectorId, type: dplDetectorType }) => [ detectorName, { name: detectorName.toUpperCase(), visible: true, - format: (_, run) => remoteDplDetectorUserHasAccessTo(dplDetectorId, remoteDplDetectorsUserHasAccessTo).match({ + format: (_, run) => remoteDplDetectorUserHasAccessTo(detectorId, remoteDplDetectorsUserHasAccessTo).match({ NotAsked: () => null, Failure: (errors) => errorAlert(errors), Success: (detectorUserHasAccessTo) => { @@ -100,14 +100,14 @@ export const createRunDetectorsAsyncQcActiveColumns = ( 'input.select-multi-flag', { type: 'checkbox', - checked: runDetectorsSelectionModel.isRunDetectorSelected(run.runNumber, dplDetectorId), + checked: runDetectorsSelectionModel.isRunDetectorSelected(run.runNumber, detectorId), onchange: (e) => e.target.checked - ? runDetectorsSelectionModel.selectRunDetector(run.runNumber, dplDetectorId) - : runDetectorsSelectionModel.unselectRunDetector(run.runNumber, dplDetectorId), + ? runDetectorsSelectionModel.selectRunDetector(run.runNumber, detectorId) + : runDetectorsSelectionModel.unselectRunDetector(run.runNumber, detectorId), }, ); - if (!qcSummary?.[runNumber]?.[dplDetectorId]) { // If there is no QC flag assigned + if (!qcSummary?.[runNumber]?.[detectorId]) { // If there is no QC flag assigned return runExcludedFromQc ? h('.text-center', tooltip(iconX(), getRunQcExclusionReason(run))) : h('.flex-row.items-center.gc1', [ @@ -132,7 +132,7 @@ export const createRunDetectorsAsyncQcActiveColumns = ( runDetectorAsyncQualityDisplay( { dataPassId: dataPass?.id, simulationPassId: simulationPass?.id }, run, - dplDetectorId, + detectorId, qcSummary, ), ]); @@ -143,16 +143,16 @@ export const createRunDetectorsAsyncQcActiveColumns = ( }, ]) ?? []; - const filtersEntries = dplDetectors?.map(({ name: detectorName, id: dplDetectorId }) => [ + const filtersEntries = dplDetectors?.map(({ name: detectorName, id: detectorId }) => [ detectorName, { name: detectorName.toUpperCase(), visible: false, profiles: profile, filter: (filteringModel) => { - const filterModel = filteringModel.get(`detectorsQc[_${dplDetectorId}][notBadFraction]`); + const filterModel = filteringModel.get(`detectorsQc[_${detectorId}][notBadFraction]`); return filterModel - ? numericalComparisonFilter(filterModel, { step: 0.1, selectorPrefix: `detectorsQc-for-${dplDetectorId}-notBadFraction` }) + ? numericalComparisonFilter(filterModel, { step: 0.1, selectorPrefix: `detectorsQc-for-${detectorId}-notBadFraction` }) : null; }, }, diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js index 41cf85c7e9..b438daae7f 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js @@ -41,7 +41,7 @@ export const runDetectorsSyncQcActiveColumns = ( return runDetectorSummary ? qcFlagOverviewPanelLink( getQcSummaryDisplay({ ...runDetectorSummary, missingVerificationsCount: 0 }), // Ignore verifications - { runNumber, dplDetectorId: detectorId }, + { runNumber, detectorId: detectorId }, ) : h('m2.badge.gray', iconBan()); }, diff --git a/lib/server/controllers/gaqDetectors.controller.js b/lib/server/controllers/gaqDetectors.controller.js index 98ce7b6101..04056f3b2b 100644 --- a/lib/server/controllers/gaqDetectors.controller.js +++ b/lib/server/controllers/gaqDetectors.controller.js @@ -28,7 +28,7 @@ const setGaqDetectorsHandler = async (req, res) => { DtoFactory.bodyOnly(Joi.object({ dataPassId: Joi.number(), runNumbers: Joi.array().items(Joi.number()).unique(), - dplDetectorIds: Joi.array().items(Joi.number()).unique(), + detectorIds: Joi.array().items(Joi.number()).unique(), })), req, res, @@ -38,13 +38,13 @@ const setGaqDetectorsHandler = async (req, res) => { const { dataPassId, runNumbers, - dplDetectorIds, + detectorIds, } = validatedDTO.body; const data = await gaqDetectorService.setGaqDetectors( dataPassId, runNumbers, - dplDetectorIds, + detectorIds, ); res.status(201).json({ data }); diff --git a/lib/server/controllers/qcFlag.controller.js b/lib/server/controllers/qcFlag.controller.js index bc7c818b88..a66df73a1b 100644 --- a/lib/server/controllers/qcFlag.controller.js +++ b/lib/server/controllers/qcFlag.controller.js @@ -58,7 +58,7 @@ const listQcFlagsPerDataPassHandler = async (req, res) => { DtoFactory.queryOnly({ dataPassId: Joi.number(), runNumber: Joi.number(), - dplDetectorId: Joi.number(), + detectorId: Joi.number(), page: PaginationDto, filter: qcFlagFilterDTO, }), @@ -70,13 +70,13 @@ const listQcFlagsPerDataPassHandler = async (req, res) => { const { dataPassId, runNumber, - dplDetectorId, + detectorId, page: { limit = ApiConfig.pagination.limit, offset } = {}, filter, } = validatedDTO.query; const { count, rows: items } = await qcFlagService.getAllPerDataPassAndRunAndDetector( - { dataPassId, runNumber, detectorId: dplDetectorId }, + { dataPassId, runNumber, detectorId: detectorId }, { limit, offset }, filter, ); @@ -95,7 +95,7 @@ const listQcFlagsPerSimulationPassHandler = async (req, res) => { DtoFactory.queryOnly({ simulationPassId: Joi.number(), runNumber: Joi.number(), - dplDetectorId: Joi.number(), + detectorId: Joi.number(), page: PaginationDto, filter: qcFlagFilterDTO, }), @@ -107,13 +107,13 @@ const listQcFlagsPerSimulationPassHandler = async (req, res) => { const { simulationPassId, runNumber, - dplDetectorId, + detectorId, page: { limit = ApiConfig.pagination.limit, offset } = {}, filter, } = validatedDTO.query; const { count, rows: items } = await qcFlagService.getAllPerSimulationPassAndRunAndDetector( - { simulationPassId, runNumber, detectorId: dplDetectorId }, + { simulationPassId, runNumber, detectorId: detectorId }, { limit, offset }, filter, ); @@ -176,10 +176,10 @@ const createQcFlagsHandler = async (req, res) => { }), otherwise: Joi.required(), }), - dplDetectorId: Joi.number().when('runDetectors', { + detectorId: Joi.number().when('runDetectors', { is: Joi.exist(), then: Joi.forbidden().messages({ - 'any.unknown': 'dplDetectorId is not allowed when runDetectors is provided.', + 'any.unknown': 'detectorId is not allowed when runDetectors is provided.', }), otherwise: Joi.required(), }), @@ -202,10 +202,10 @@ const createQcFlagsHandler = async (req, res) => { // Transform runDetectors into individual flag objects const flags = runDetectors ? runDetectors.flatMap(({ runNumber, detectorIds }) => - detectorIds.map((dplDetectorId) => ({ + detectorIds.map((detectorId) => ({ ...flagData, runNumber, - dplDetectorId, + detectorId, }))) : [flagData]; @@ -221,7 +221,7 @@ const createQcFlagsHandler = async (req, res) => { for (const flag of flags) { const scope = { runNumber: flag.runNumber, - detectorIdentifier: { detectorId: flag.dplDetectorId }, + detectorIdentifier: { detectorId: flag.detectorId }, dataPassIdentifier: flag.dataPassId ? { id: flag.dataPassId } : null, simulationPassIdentifier: flag.simulationPassId ? { id: flag.simulationPassId } : null, }; @@ -340,7 +340,7 @@ const getQcFlagsSummaryHandler = async (req, res) => { } = validatedDTO.query; const data = await qcFlagSummaryService.getSummary( - { dataPassId, simulationPassId, lhcPeriodId, dplDetectorIds: detectorIds }, + { dataPassId, simulationPassId, lhcPeriodId, detectorIds: detectorIds }, { mcReproducibleAsNotBad }, filter, ); diff --git a/lib/server/services/qualityControlFlag/QcFlagService.js b/lib/server/services/qualityControlFlag/QcFlagService.js index 3ea8743f89..9e4cdc47d8 100644 --- a/lib/server/services/qualityControlFlag/QcFlagService.js +++ b/lib/server/services/qualityControlFlag/QcFlagService.js @@ -276,7 +276,7 @@ class QcFlagService { } { - const { id, from, to, origin, createdById, runNumber, dplDetectorId, flagTypeId, createdAt } = qcFlag; + const { id, from, to, origin, createdById, runNumber, detectorId, flagTypeId, createdAt } = qcFlag; const qcFlagPropertiesToLog = { id, from, @@ -284,7 +284,7 @@ class QcFlagService { origin, createdById, runNumber, - dplDetectorId, + detectorId, flagTypeId, dataPassId, simulationPassId, @@ -371,7 +371,7 @@ class QcFlagService { const { user: { userId, externalUserId, roles: userRoles = [] } } = relations; const user = await getUserOrFail({ userId, externalUserId }); - const detector = await getQcDetectorOrFail({ detectorId: qcFlag.dplDetectorId }); + const detector = await getQcDetectorOrFail({ detectorId: qcFlag.detectorId }); validateUserDetectorAccess(userRoles, detector.name); await QcFlagVerificationRepository.insert({ diff --git a/lib/server/services/qualityControlFlag/QcFlagSummaryService.js b/lib/server/services/qualityControlFlag/QcFlagSummaryService.js index 27fa09858b..e411eab88f 100644 --- a/lib/server/services/qualityControlFlag/QcFlagSummaryService.js +++ b/lib/server/services/qualityControlFlag/QcFlagSummaryService.js @@ -79,14 +79,14 @@ class QcFlagSummaryService { * @param {number} [scope.dataPassId] data pass id - exclusive with other options * @param {number} [scope.simulationPassId] simulation pass id - exclusive with other options * @param {number} [scope.lhcPeriodId] id of LHC Period - exclusive with other options - * @param {number[]} [scope.dplDetectorIds] ids of dpl detectors + * @param {number[]} [scope.detectorIds] ids of dpl detectors * @param {object} [options] additional options * @param {boolean} [options.mcReproducibleAsNotBad = false] if set to true, `Limited Acceptance MC Reproducible` flag type is treated as * good one * @param {QcFlagFilter} [filter] filter * @return {Promise} summary */ - async getSummary({ dataPassId, simulationPassId, lhcPeriodId, dplDetectorIds }, { mcReproducibleAsNotBad = false } = {}, filter = {}) { + async getSummary({ dataPassId, simulationPassId, lhcPeriodId, detectorIds }, { mcReproducibleAsNotBad = false } = {}, filter = {}) { if (Boolean(dataPassId) + Boolean(simulationPassId) + Boolean(lhcPeriodId) !== 1) { throw new BadParameterError('One and exactly one of `dataPassId`, `simulationPassId` and `lhcPeriodId` is required'); } @@ -110,8 +110,8 @@ class QcFlagSummaryService { .include({ association: 'run', attributes: [], where: { lhcPeriodId } }); } - if (dplDetectorIds) { - queryBuilder.where('detectorId').oneOf(...dplDetectorIds); + if (detectorIds) { + queryBuilder.where('detectorId').oneOf(...detectorIds); } queryBuilder.include({ diff --git a/lib/usecases/run/GetAllRunsUseCase.js b/lib/usecases/run/GetAllRunsUseCase.js index 1af0e385f2..218805ad8c 100644 --- a/lib/usecases/run/GetAllRunsUseCase.js +++ b/lib/usecases/run/GetAllRunsUseCase.js @@ -410,14 +410,14 @@ class GetAllRunsUseCase { const { mcReproducibleAsNotBad } = detectorsQc; delete detectorsQc.mcReproducibleAsNotBad; - const dplDetectorIds = Object.keys(detectorsQc).map((id) => parseInt(id.slice(1), 10)); - if (dplDetectorIds.length > 0) { + const detectorIds = Object.keys(detectorsQc).map((id) => parseInt(id.slice(1), 10)); + if (detectorIds.length > 0) { const qcSummary = await qcFlagSummaryService.getSummary( { dataPassId, simulationPassId, lhcPeriodId, - dplDetectorIds, + detectorIds, }, { mcReproducibleAsNotBad }, ); @@ -425,11 +425,11 @@ class GetAllRunsUseCase { const runNumbers = Object.entries(qcSummary) .filter(([_, runSummary]) => { const mask = Object.entries(detectorsQc).map(([prefixedDetectorId, { notBadFraction: { operator, limit } }]) => { - const dplDetectorId = parseInt(prefixedDetectorId.slice(1), 10); - if (!(dplDetectorId in runSummary)) { + const detectorId = parseInt(prefixedDetectorId.slice(1), 10); + if (!(detectorId in runSummary)) { return false; } - return badEffectiveRunCoverageComparison(runSummary[dplDetectorId].badEffectiveRunCoverage, operator, limit); + return badEffectiveRunCoverageComparison(runSummary[detectorId].badEffectiveRunCoverage, operator, limit); }); return mask.every((valid) => valid); diff --git a/test/api/gaqDetectors.test.js b/test/api/gaqDetectors.test.js index 3afa9ef020..f6ef1b2cb2 100644 --- a/test/api/gaqDetectors.test.js +++ b/test/api/gaqDetectors.test.js @@ -29,7 +29,7 @@ module.exports = () => { const response = await request(server).post(`/api/gaqDetectors?token=${BkpRoles.GAQ}`).send({ dataPassId, runNumbers, - dplDetectorIds: detectorIds, + detectorIds: detectorIds, }); expect(response.status).to.be.equal(201); expect(response.body.data).to.have.all.deep.members(runNumbers @@ -43,7 +43,7 @@ module.exports = () => { const response = await request(server).post(`/api/gaqDetectors?token=${BkpRoles.GUEST}`).send({ dataPassId, runNumbers, - dplDetectorIds: detectorIds, + detectorIds: detectorIds, }); expect(response.status).to.be.equal(403); diff --git a/test/api/qcFlags.test.js b/test/api/qcFlags.test.js index ea4496eb6e..865e68184a 100644 --- a/test/api/qcFlags.test.js +++ b/test/api/qcFlags.test.js @@ -36,7 +36,7 @@ module.exports = () => { createdAt: new Date('2024-02-13 11:57:19').getTime(), updatedAt: new Date('2024-02-13 11:57:19').getTime(), runNumber: 1, - dplDetectorId: 1, + detectorId: 1, createdById: 2, verifications: [ { @@ -315,7 +315,7 @@ module.exports = () => { describe('GET /api/qcFlags/perDataPass and /api/qcFlags/perSimulationPass', () => { it('should successfully fetch QC flags for data pass', async () => { const response = await request(server) - .get('/api/qcFlags/perDataPass?dataPassId=1&runNumber=106&dplDetectorId=1'); + .get('/api/qcFlags/perDataPass?dataPassId=1&runNumber=106&detectorId=1'); expect(response.status).to.be.equal(200); const { data, meta } = response.body; expect(meta).to.be.eql({ page: { totalCount: 3, pageCount: 1 } }); @@ -326,7 +326,7 @@ module.exports = () => { it('should successfully fetch QC flags for simulation pass', async () => { const response = await request(server) - .get('/api/qcFlags/perSimulationPass?simulationPassId=1&runNumber=106&dplDetectorId=1'); + .get('/api/qcFlags/perSimulationPass?simulationPassId=1&runNumber=106&detectorId=1'); expect(response.status).to.be.equal(200); const { data, meta } = response.body; expect(meta).to.be.eql({ page: { totalCount: 2, pageCount: 1 } }); @@ -337,7 +337,7 @@ module.exports = () => { it('should support pagination', async () => { const response = await request(server) - .get('/api/qcFlags/perDataPass?dataPassId=1&runNumber=106&dplDetectorId=1&page[offset]=1&page[limit]=2'); + .get('/api/qcFlags/perDataPass?dataPassId=1&runNumber=106&detectorId=1&page[offset]=1&page[limit]=2'); expect(response.status).to.be.equal(200); const { data: qcFlags } = response.body; expect(qcFlags).to.be.an('array'); @@ -362,7 +362,7 @@ module.exports = () => { it('should return 400 if the limit is below 1', async () => { { const response = await request(server) - .get('/api/qcFlags/perDataPass?dataPassId=1&runNumber=106&dplDetectorId=1&page[offset]=1&page[limit]=0'); + .get('/api/qcFlags/perDataPass?dataPassId=1&runNumber=106&detectorId=1&page[offset]=1&page[limit]=0'); expect(response.status).to.be.equal(400); const { errors } = response.body; const titleError = errors.find((err) => err.source.pointer === '/data/attributes/query/page/limit'); @@ -377,13 +377,13 @@ module.exports = () => { const detectorId = 1; { const response = await request(server) - .get(`/api/qcFlags/perDataPass?dataPassId=${dataPassId}&runNumber=${runNumber}&dplDetectorId=${detectorId}&filter[createdBy][names]=John%20Doe&filter[createdBy][operator]=or`); + .get(`/api/qcFlags/perDataPass?dataPassId=${dataPassId}&runNumber=${runNumber}&detectorId=${detectorId}&filter[createdBy][names]=John%20Doe&filter[createdBy][operator]=or`); expect(response.body.data).to.be.lengthOf(2); } { const response = await request(server) - .get(`/api/qcFlags/perDataPass?dataPassId=${dataPassId}&runNumber=${runNumber}&dplDetectorId=${detectorId}&filter[createdBy][names]=John%20Doe&filter[createdBy][operator]=none`); + .get(`/api/qcFlags/perDataPass?dataPassId=${dataPassId}&runNumber=${runNumber}&detectorId=${detectorId}&filter[createdBy][names]=John%20Doe&filter[createdBy][operator]=none`); expect(response.body.data).to.be.lengthOf(0); } }); @@ -394,7 +394,7 @@ module.exports = () => { const detectorId = 1; { const response = await request(server) - .get(`/api/qcFlags/perDataPass?dataPassId=${dataPassId}&runNumber=${runNumber}&dplDetectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=SOME_OPERATOR`); + .get(`/api/qcFlags/perDataPass?dataPassId=${dataPassId}&runNumber=${runNumber}&detectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=SOME_OPERATOR`); expect(response.body.errors[0].detail).eql('\"query.filter.createdBy.operator\" must be one of [or, none]'); } }); @@ -405,13 +405,13 @@ module.exports = () => { const detectorId = 1; { const response = await request(server) - .get(`/api/qcFlags/perSimulationPass?simulationPassId=${simulationPassId}&runNumber=${runNumber}&dplDetectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=or`); + .get(`/api/qcFlags/perSimulationPass?simulationPassId=${simulationPassId}&runNumber=${runNumber}&detectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=or`); expect(response.body.data).to.be.lengthOf(2); } { const response = await request(server) - .get(`/api/qcFlags/perSimulationPass?simulationPassId=${simulationPassId}&runNumber=${runNumber}&dplDetectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=none`); + .get(`/api/qcFlags/perSimulationPass?simulationPassId=${simulationPassId}&runNumber=${runNumber}&detectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=none`); expect(response.body.data).to.be.lengthOf(0); } }); @@ -422,7 +422,7 @@ module.exports = () => { const detectorId = 1; { const response = await request(server) - .get(`/api/qcFlags/perSimulationPass?simulationPassId=${simulationPassId}&runNumber=${runNumber}&dplDetectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=SOME_OPERATOR`); + .get(`/api/qcFlags/perSimulationPass?simulationPassId=${simulationPassId}&runNumber=${runNumber}&detectorId=${detectorId}&filter[createdBy][names]=Jan%20Jansen&filter[createdBy][operator]=SOME_OPERATOR`); expect(response.body.errors[0].detail).eql('\"query.filter.createdBy.operator\" must be one of [or, none]'); } }); @@ -483,7 +483,7 @@ module.exports = () => { flagTypeId: 2, runNumber: 106, dataPassId: 1, - dplDetectorId: 1, + detectorId: 1, }; const response = await request(server).post('/api/qcFlags?token=admin').send(qcFlagCreationParameters); @@ -492,17 +492,17 @@ module.exports = () => { const { dataPassId, ...expectedProperties } = qcFlagCreationParameters; { - const { from, to, comment, flagTypeId, runNumber, dplDetectorId } = createdQcFlag; - expect({ from, to, comment, flagTypeId, runNumber, dplDetectorId }).to.be.eql(expectedProperties); + const { from, to, comment, flagTypeId, runNumber, detectorId } = createdQcFlag; + expect({ from, to, comment, flagTypeId, runNumber, detectorId }).to.be.eql(expectedProperties); } { - const { from, to, comment, flagTypeId, runNumber, detectorId: dplDetectorId, dataPasses } = await QcFlagRepository.findOne({ + const { from, to, comment, flagTypeId, runNumber, detectorId: detectorId, dataPasses } = await QcFlagRepository.findOne({ include: [{ association: 'dataPasses' }], where: { id: createdQcFlag.id, }, }); - expect({ from: from.getTime(), to: to.getTime(), comment, flagTypeId, runNumber, dplDetectorId }).to + expect({ from: from.getTime(), to: to.getTime(), comment, flagTypeId, runNumber, detectorId }).to .be.eql(expectedProperties); expect(dataPasses.map(({ id }) => id)).to.have.all.members([dataPassId]); } @@ -516,7 +516,7 @@ module.exports = () => { flagTypeId: 2, runNumber: 106, dataPassId: 1, - dplDetectorId: 21, + detectorId: 21, }; const response = await request(server).post('/api/qcFlags?token=det-glo').send(qcFlagCreationParameters); @@ -524,12 +524,12 @@ module.exports = () => { const [createdQcFlag] = response.body.data; const { dataPassId } = qcFlagCreationParameters; { - const { comment, flagTypeId, runNumber, dplDetectorId } = createdQcFlag; - expect({ comment, flagTypeId, runNumber, dplDetectorId }).to.be.eql({ + const { comment, flagTypeId, runNumber, detectorId } = createdQcFlag; + expect({ comment, flagTypeId, runNumber, detectorId }).to.be.eql({ comment: qcFlagCreationParameters.comment, flagTypeId: qcFlagCreationParameters.flagTypeId, runNumber: qcFlagCreationParameters.runNumber, - dplDetectorId: qcFlagCreationParameters.dplDetectorId, + detectorId: qcFlagCreationParameters.detectorId, }); } { @@ -543,7 +543,7 @@ module.exports = () => { comment: qcFlagCreationParameters.comment, flagTypeId: qcFlagCreationParameters.flagTypeId, runNumber: qcFlagCreationParameters.runNumber, - detectorId: qcFlagCreationParameters.dplDetectorId, + detectorId: qcFlagCreationParameters.detectorId, }); expect(dataPasses.map(({ id }) => id)).to.have.all.members([dataPassId]); } @@ -557,7 +557,7 @@ module.exports = () => { flagTypeId: 2, runNumber: 106, simulationPassId: 1, - dplDetectorId: 1, + detectorId: 1, }; const response = await request(server).post('/api/qcFlags?token=det-cpv').send(qcFlagCreationParameters); @@ -565,18 +565,18 @@ module.exports = () => { const [createdQcFlag] = response.body.data; const { simulationPassId, ...expectedProperties } = qcFlagCreationParameters; { - const { from, to, comment, flagTypeId, runNumber, dplDetectorId } = createdQcFlag; - expect({ from, to, comment, flagTypeId, runNumber, dplDetectorId }).to.be.eql(expectedProperties); + const { from, to, comment, flagTypeId, runNumber, detectorId } = createdQcFlag; + expect({ from, to, comment, flagTypeId, runNumber, detectorId }).to.be.eql(expectedProperties); } { - const { from, to, comment, flagTypeId, runNumber, detectorId: dplDetectorId, simulationPasses } + const { from, to, comment, flagTypeId, runNumber, detectorId: detectorId, simulationPasses } = await QcFlagRepository.findOne({ include: [{ association: 'simulationPasses' }], where: { id: createdQcFlag.id, }, }); - expect({ from: from.getTime(), to: to.getTime(), comment, flagTypeId, runNumber, dplDetectorId }).to + expect({ from: from.getTime(), to: to.getTime(), comment, flagTypeId, runNumber, detectorId }).to .be.eql(expectedProperties); expect(simulationPasses.map(({ id }) => id)).to.have.all.members([simulationPassId]); } @@ -604,12 +604,12 @@ module.exports = () => { })); expect(createdQcFlags.filter(({ runNumber }) => runNumber === 56).length).to.be.equal(1); expect(createdQcFlags.filter(({ runNumber }) => runNumber === 49).length).to.be.equal(2); - expect(createdQcFlags.find(({ runNumber, dplDetectorId }) => runNumber === 49 && dplDetectorId === 4)).to.exist; - expect(createdQcFlags.find(({ runNumber, dplDetectorId }) => runNumber === 49 && dplDetectorId === 7)).to.exist; - expect(createdQcFlags.find(({ runNumber, dplDetectorId }) => runNumber === 56 && dplDetectorId === 4)).to.exist; + expect(createdQcFlags.find(({ runNumber, detectorId }) => runNumber === 49 && detectorId === 4)).to.exist; + expect(createdQcFlags.find(({ runNumber, detectorId }) => runNumber === 49 && detectorId === 7)).to.exist; + expect(createdQcFlags.find(({ runNumber, detectorId }) => runNumber === 56 && detectorId === 4)).to.exist; }); - it('should fail to create QC flag instance when runDetectors and runNumber or dplDetectorId are specified', async () => { + it('should fail to create QC flag instance when runDetectors and runNumber or detectorId are specified', async () => { const qcFlagCreationParameters = { from: new Date('2019-08-09 01:29:50').getTime(), to: new Date('2019-08-09 05:40:00').getTime(), @@ -617,7 +617,7 @@ module.exports = () => { flagTypeId: 2, runNumber: 106, dataPassId: 1, - dplDetectorId: 1, + detectorId: 1, runDetectors: [ { runNumber: 106, @@ -640,10 +640,10 @@ module.exports = () => { { status: '422', source: { - pointer: '/data/attributes/body/dplDetectorId', + pointer: '/data/attributes/body/detectorId', }, title: 'Invalid Attribute', - detail: 'dplDetectorId is not allowed when runDetectors is provided.', + detail: 'detectorId is not allowed when runDetectors is provided.', }, ]); }); @@ -657,7 +657,7 @@ module.exports = () => { runNumber: 106, simulationPassId: 1, dataPassId: 1, - dplDetectorId: 1, + detectorId: 1, }; const response = await request(server).post('/api/qcFlags?token=admin').send(qcFlagCreationParameters); @@ -683,7 +683,7 @@ module.exports = () => { flagTypeId: 2, runNumber: 106, dataPassId: 1, - dplDetectorId: 1, + detectorId: 1, }; await dataPassService.setFrozenState({ id: 1 }, true); diff --git a/test/lib/server/services/qualityControlFlag/QcFlagService.test.js b/test/lib/server/services/qualityControlFlag/QcFlagService.test.js index 1bea8078f5..d51c19d08c 100644 --- a/test/lib/server/services/qualityControlFlag/QcFlagService.test.js +++ b/test/lib/server/services/qualityControlFlag/QcFlagService.test.js @@ -58,7 +58,7 @@ const qcFlagWithId1 = { createdById: 1, flagTypeId: 5, // LimitedAcceptance MC Reproducible runNumber: 106, - dplDetectorId: 1, // CPV + detectorId: 1, // CPV createdAt: new Date('2024-02-13 11:57:16').getTime(), updatedAt: new Date('2024-02-13 11:57:16').getTime(), @@ -339,7 +339,7 @@ module.exports = () => { it('should successfully get non-empty QC flags summary for a data pass when filtering by CreatedBy and detectors', async () => { { - const data = await qcFlagSummaryService.getSummary({ dataPassId: 1, dplDetectorIds: [22, 1] }) + const data = await qcFlagSummaryService.getSummary({ dataPassId: 1, detectorIds: [22, 1] }) expect(data).to.be.eql({ 106: { 22: { @@ -368,7 +368,7 @@ module.exports = () => { { const data = await qcFlagSummaryService.getSummary( - { dataPassId: 1, dplDetectorIds: [22, 1] }, + { dataPassId: 1, detectorIds: [22, 1] }, {}, { createdBy: { names: ['Anonymous'], operator: 'none' }} ) @@ -578,7 +578,7 @@ module.exports = () => { comment, flagTypeId, runNumber, - dplDetectorId: detectorId, + detectorId: detectorId, createdBy: { externalId: externalUserId }, } = createdQcFlags[qcFlagIndex]; const qcFlag = qcFlags[qcFlagIndex]; @@ -686,7 +686,7 @@ module.exports = () => { const relations = { user: { roles: ['admin'], externalUserId: 456 } }; - const [{ id, runNumber, dplDetectorId: detectorId }] = await qcFlagService.create([qcFlag], scope, relations); + const [{ id, runNumber, detectorId: detectorId }] = await qcFlagService.create([qcFlag], scope, relations); const olderFlags = (await QcFlagRepository.findAll({ where: { @@ -764,7 +764,7 @@ module.exports = () => { const [ { id, from, to, comment, flagTypeId, runNumber, - dplDetectorId: detectorId, createdBy: { externalId: externalUserId }, createdAt, + detectorId: detectorId, createdBy: { externalId: externalUserId }, createdAt, }, ] = await qcFlagService.create([qcFlag], scope, relations); @@ -1155,7 +1155,7 @@ module.exports = () => { }; const relations = { user: { roles: ['det-cpv'], externalUserId: 456 } }; - const [{ id, from, to, comment, flagTypeId, runNumber, dplDetectorId: detectorId, createdBy: { externalId: externalUserId } }] = + const [{ id, from, to, comment, flagTypeId, runNumber, detectorId: detectorId, createdBy: { externalId: externalUserId } }] = await qcFlagService.create([qcFlag], scope, relations); expect({ @@ -1238,7 +1238,7 @@ module.exports = () => { const relations = { user: { roles: ['admin'], externalUserId: 456 } }; - const [{ id, from, to, comment, flagTypeId, runNumber, dplDetectorId: detectorId, createdBy: { externalId: externalUserId } }] = + const [{ id, from, to, comment, flagTypeId, runNumber, detectorId: detectorId, createdBy: { externalId: externalUserId } }] = await qcFlagService.create([qcFlagCreationParameters], scope, relations); expect({ from, to, comment, flagTypeId, runNumber, detectorId, externalUserId }).to.be.eql({ @@ -1299,7 +1299,7 @@ module.exports = () => { }; const relations = { user: { roles: ['det-cpv'], externalUserId: 456 } }; - const [{ id, from, to, flagTypeId, runNumber, dplDetectorId: detectorId, createdBy: { externalId: externalUserId } }] = + const [{ id, from, to, flagTypeId, runNumber, detectorId: detectorId, createdBy: { externalId: externalUserId } }] = await qcFlagService.create([qcFlag], scope, relations); expect({ diff --git a/test/public/qcFlags/detailsForDataPass.test.js b/test/public/qcFlags/detailsForDataPass.test.js index f62bfe2834..0167c7b60b 100644 --- a/test/public/qcFlags/detailsForDataPass.test.js +++ b/test/public/qcFlags/detailsForDataPass.test.js @@ -54,7 +54,7 @@ module.exports = () => { id: 1, dataPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); expect(response.status()).to.equal(200); @@ -98,7 +98,7 @@ module.exports = () => { await waitForNavigation(page, () => pressElement(page, '#qc-flag-details-dataPass a', true)); await waitForNavigation(page, () => pressElement(page, '#row106-CPV a', true)); - expectUrlParams(page, { page: 'qc-flags-for-data-pass', dataPassId: '1', runNumber: 106, dplDetectorId: 1 }); + expectUrlParams(page, { page: 'qc-flags-for-data-pass', dataPassId: '1', runNumber: 106, detectorId: 1 }); await waitForTableLength(page, 3); await waitForNavigation(page, () => pressElement(page, '#row1-qcFlagId a', true)); }); @@ -113,7 +113,7 @@ module.exports = () => { id: '1', dataPassId: '1', runNumber: '106', - dplDetectorId: '1', + detectorId: '1', }); await page.waitForSelector('button#delete'); @@ -124,7 +124,7 @@ module.exports = () => { page: 'qc-flags-for-data-pass', dataPassId: '1', runNumber: '106', - dplDetectorId: '1', + detectorId: '1', }); unsetConfirmationDialogActions(page); diff --git a/test/public/qcFlags/detailsForSimulationPass.test.js b/test/public/qcFlags/detailsForSimulationPass.test.js index e02d902345..70e0f25d5e 100644 --- a/test/public/qcFlags/detailsForSimulationPass.test.js +++ b/test/public/qcFlags/detailsForSimulationPass.test.js @@ -52,7 +52,7 @@ module.exports = () => { id: 5, simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); expect(response.status()).to.equal(200); @@ -67,7 +67,7 @@ module.exports = () => { id: 5, simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await waitForNavigation(page, () => pressElement(page, '#qc-flag-details-simulationPass a')); expectUrlParams(page, { page: 'runs-per-simulation-pass', simulationPassId: '1' }); @@ -78,7 +78,7 @@ module.exports = () => { id: 5, simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await waitForNavigation(page, () => pressElement(page, '#qc-flag-details-runNumber a')); expectUrlParams(page, { page: 'run-detail', runNumber: '106' }); @@ -89,7 +89,7 @@ module.exports = () => { id: 5, simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await expectInnerText(page, '#qc-flag-details-id', 'Id:\n5'); @@ -111,7 +111,7 @@ module.exports = () => { id: 5, simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await page.waitForSelector('button#delete'); @@ -123,7 +123,7 @@ module.exports = () => { id: '5', simulationPassId: '1', runNumber: '106', - dplDetectorId: '1', + detectorId: '1', }); // Delete @@ -133,7 +133,7 @@ module.exports = () => { page: 'qc-flags-for-simulation-pass', simulationPassId: '1', runNumber: '106', - dplDetectorId: '1', + detectorId: '1', }); unsetConfirmationDialogActions(page); }); @@ -143,7 +143,7 @@ module.exports = () => { id: 6, simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await page.waitForSelector('#delete:not([disabled])'); diff --git a/test/public/qcFlags/forDataPassOverview.test.js b/test/public/qcFlags/forDataPassOverview.test.js index e3aba3e886..97c153472d 100644 --- a/test/public/qcFlags/forDataPassOverview.test.js +++ b/test/public/qcFlags/forDataPassOverview.test.js @@ -49,7 +49,7 @@ module.exports = () => { const response = await goToPage(page, 'qc-flags-for-data-pass', { queryParameters: { dataPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); // We expect the page to return the correct status code, making sure the server is running properly @@ -69,7 +69,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-data-pass', { queryParameters: { dataPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await waitForNavigation(page, () => pressElement(page, '#breadcrumb-data-pass-name')); @@ -80,7 +80,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-data-pass', { queryParameters: { dataPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number')); @@ -91,7 +91,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-data-pass', { queryParameters: { dataPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); // eslint-disable-next-line jsdoc/require-param @@ -115,7 +115,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-data-pass', { queryParameters: { dataPassId: 2, runNumber: 2, - dplDetectorId: 1, + detectorId: 1, } }); await page.waitForSelector('#breadcrumb-run-number.danger a'); diff --git a/test/public/qcFlags/forSimulationPassOverview.test.js b/test/public/qcFlags/forSimulationPassOverview.test.js index f6143949f5..a004b5f48b 100644 --- a/test/public/qcFlags/forSimulationPassOverview.test.js +++ b/test/public/qcFlags/forSimulationPassOverview.test.js @@ -50,7 +50,7 @@ module.exports = () => { const response = await goToPage(page, 'qc-flags-for-simulation-pass', { queryParameters: { simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); // We expect the page to return the correct status code, making sure the server is running properly @@ -70,7 +70,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-simulation-pass', { queryParameters: { simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await waitForNavigation(page, () => pressElement(page, '#breadcrumb-simulation-pass-name')); @@ -81,7 +81,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-simulation-pass', { queryParameters: { simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number')); @@ -92,7 +92,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-simulation-pass', { queryParameters: { simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); // eslint-disable-next-line jsdoc/require-param @@ -113,7 +113,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-simulation-pass', { queryParameters: { simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); await expectInnerText(page, '#firstRowIndex', '1'); @@ -125,7 +125,7 @@ module.exports = () => { await goToPage(page, 'qc-flags-for-simulation-pass', { queryParameters: { simulationPassId: 1, runNumber: 106, - dplDetectorId: 1, + detectorId: 1, } }); const amountSelectorId = '#amountSelector'; diff --git a/test/public/qcFlags/synchronousOverview.test.js b/test/public/qcFlags/synchronousOverview.test.js index e72c4eca91..7a5adbd948 100644 --- a/test/public/qcFlags/synchronousOverview.test.js +++ b/test/public/qcFlags/synchronousOverview.test.js @@ -47,7 +47,7 @@ module.exports = () => { }); it('loads the page successfully', async () => { - const response = await goToPage(page, 'synchronous-qc-flags', { queryParameters: { runNumber: 56, dplDetectorId: 7 } }); + const response = await goToPage(page, 'synchronous-qc-flags', { queryParameters: { runNumber: 56, detectorId: 7 } }); expect(response.status()).to.equal(200); expect(await page.title()).to.equal('AliceO2 Bookkeeping'); diff --git a/test/public/runs/runsPerDataPass.overview.test.js b/test/public/runs/runsPerDataPass.overview.test.js index 358f36474e..6fcce4ff79 100644 --- a/test/public/runs/runsPerDataPass.overview.test.js +++ b/test/public/runs/runsPerDataPass.overview.test.js @@ -139,7 +139,7 @@ module.exports = () => { }); await expectLink(page, 'tr#row106 .column-CPV a', { - href: 'http://localhost:4000/?page=qc-flags-for-data-pass&runNumber=106&dplDetectorId=1&dataPassId=1', + href: 'http://localhost:4000/?page=qc-flags-for-data-pass&runNumber=106&detectorId=1&dataPassId=1', innerText: '67MC.R', }); await page.waitForSelector('tr#row106 .column-CPV a .icon'); @@ -167,14 +167,14 @@ module.exports = () => { await waitForTableLength(page, 3); await expectInnerText(page, 'tr#row106 .column-CPV a', '89'); await expectLink(page, 'tr#row106 .column-CPV a', { - href: 'http://localhost:4000/?page=qc-flags-for-data-pass&runNumber=106&dplDetectorId=1&dataPassId=1', + href: 'http://localhost:4000/?page=qc-flags-for-data-pass&runNumber=106&detectorId=1&dataPassId=1', innerText: '89', }); await pressElement(page, '#mcReproducibleAsNotBadToggle input', true); await waitForTableLength(page, 3); await expectInnerText(page, 'tr#row106 .column-CPV a', '67MC.R'); await expectLink(page, 'tr#row106 .column-CPV a', { - href: 'http://localhost:4000/?page=qc-flags-for-data-pass&runNumber=106&dplDetectorId=1&dataPassId=1', + href: 'http://localhost:4000/?page=qc-flags-for-data-pass&runNumber=106&detectorId=1&dataPassId=1', innerText: '67MC.R', }); }); diff --git a/test/public/runs/runsPerSimulationPass.overview.test.js b/test/public/runs/runsPerSimulationPass.overview.test.js index f7489050ff..daa1cc8d0c 100644 --- a/test/public/runs/runsPerSimulationPass.overview.test.js +++ b/test/public/runs/runsPerSimulationPass.overview.test.js @@ -128,7 +128,7 @@ module.exports = () => { await reloadPage(page); await expectLink(page, 'tr#row56 .column-ITS a', { - href: 'http://localhost:4000/?page=qc-flags-for-simulation-pass&runNumber=56&dplDetectorId=4&simulationPassId=2', + href: 'http://localhost:4000/?page=qc-flags-for-simulation-pass&runNumber=56&detectorId=4&simulationPassId=2', innerText: '0', }); From 5b8544517c023c6ebbd4cffe6a35e4ccbbcba8f2 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Tue, 23 Sep 2025 22:29:40 +0200 Subject: [PATCH 02/11] dplDetector -> detector in public --- lib/database/adapters/QcFlagAdapter.js | 2 +- lib/public/Model.js | 2 +- .../QcFlagsForDataPassOverviewModel.js | 2 +- .../QcFlagsForDataPassOverviewPage.js | 4 ++-- .../QcFlagsForSimulationPassOverviewPage.js | 4 ++-- .../QcFlags/Overview/QcFlagsOverviewModel.js | 20 +++++++++---------- .../SynchronousQcFlagsOverviewPage.js | 2 +- .../QcFlags/details/QcFlagDetailsModel.js | 20 +++++++++---------- .../QcFlags/details/qcFlagDetailsComponent.js | 6 +++--- .../runDetectorsAsyncQcActiveColumns.js | 10 +++++----- .../views/Runs/Details/runDetailsComponent.js | 14 ++++++------- .../RunsPerDataPassOverviewPage.js | 2 +- .../RunsPerSimulationPassOverviewPage.js | 2 +- .../public/qcFlags/detailsForDataPass.test.js | 2 +- .../qcFlags/detailsForSimulationPass.test.js | 2 +- 15 files changed, 47 insertions(+), 47 deletions(-) diff --git a/lib/database/adapters/QcFlagAdapter.js b/lib/database/adapters/QcFlagAdapter.js index 58c27a5de0..894eb7d4d0 100644 --- a/lib/database/adapters/QcFlagAdapter.js +++ b/lib/database/adapters/QcFlagAdapter.js @@ -61,7 +61,7 @@ class QcFlagAdapter { comment: comment ?? null, origin, runNumber, - dplDetectorId: detectorId, + detectorId, flagTypeId, flagType: flagType ? this.qcFlagTypeAdapter.toMinifiedEntity(flagType) : null, createdById, diff --git a/lib/public/Model.js b/lib/public/Model.js index 6818118c81..99062ce756 100644 --- a/lib/public/Model.js +++ b/lib/public/Model.js @@ -406,7 +406,7 @@ export default class Model extends Observable { * * @return {RemoteData} dpl detectors remote data */ - get dplDetectorsUserHasAccessTo() { + get detectorsUserHasAccessTo() { return this._qcDetectorsUserHasAccessTo.getCurrent(); } diff --git a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js index 5b9953af36..de9022cd94 100644 --- a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js +++ b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js @@ -40,7 +40,7 @@ export class QcFlagsForDataPassOverviewModel extends QcFlagsOverviewModel { dataPassId: this._dataPassId, runNumber: this._runNumber, detectorId: this._detectorId, - filter: this.dplDetector.match({ + filter: this.detector.match({ Success: ({ type }) => [DetectorType.AOT_GLO, DetectorType.AOT_EVENT, DetectorType.MUON_GLO].includes(type) ? { createdBy: { names: 'Anonymous', operator: 'none' } } : {}, diff --git a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js index f98aa380ab..84c9c40420 100644 --- a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js @@ -36,13 +36,13 @@ const PAGE_USED_HEIGHT = 215; */ export const QcFlagsForDataPassOverviewPage = ({ qcFlags: { forDataPassOverviewModel: qcFlagsForDataPassOverviewModel }, - dplDetectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, }) => { const { dataPass: remoteDataPass, run: remoteRun, detectorId, - dplDetector: remoteDplDetector, + detector: remoteDplDetector, items: remoteQcFlags, sortModel, } = qcFlagsForDataPassOverviewModel; diff --git a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js index 486889f86f..0f2681a71d 100644 --- a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js @@ -36,13 +36,13 @@ const PAGE_USED_HEIGHT = 215; */ export const QcFlagsForSimulationPassOverviewPage = ({ qcFlags: { forSimulationPassOverviewModel: qcFlagsForSimulationPassOverviewModel }, - dplDetectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, }) => { const { simulationPass: remoteSimulationPass, run: remoteRun, detectorId, - dplDetector: remoteDplDetector, + detector: remoteDplDetector, items: remoteQcFlags, sortModel, pagination: paginationModel, diff --git a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js index 70f32e31e7..80b94025b9 100644 --- a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js @@ -30,8 +30,8 @@ export class QcFlagsOverviewModel extends OverviewPageModel { constructor() { super(); detectorsProvider.qc$.observe(() => this._getDetector()); - this._dplDetector$ = new ObservableData(RemoteData.notAsked()); - this._dplDetector$.bubbleTo(this); + this._detector$ = new ObservableData(RemoteData.notAsked()); + this._detector$.bubbleTo(this); this._run$ = new ObservableData(RemoteData.notAsked()); this._run$.bubbleTo(this); @@ -58,12 +58,12 @@ export class QcFlagsOverviewModel extends OverviewPageModel { * @return {void} */ _getDetector() { - this._dplDetector$.setCurrent(detectorsProvider.qc$.getCurrent().match({ - Success: (dplDetectors) => { - const dplDetector = dplDetectors.find(({ id }) => id === this._detectorId); - return dplDetector - ? RemoteData.success(dplDetector) - : RemoteData.failure({ errors: [{ detail: `There is no dplDetector with given id (${this._detectorId})` }] }); + this._detector$.setCurrent(detectorsProvider.qc$.getCurrent().match({ + Success: (detectors) => { + const detector = detectors.find(({ id }) => id === this._detectorId); + return detector + ? RemoteData.success(detector) + : RemoteData.failure({ errors: [{ detail: `There is no detector with given id (${this._detectorId})` }] }); }, Failure: (payload) => RemoteData.failure(payload), Loading: () => RemoteData.loading(), @@ -106,8 +106,8 @@ export class QcFlagsOverviewModel extends OverviewPageModel { * Detector getter * @return {RemoteData} current detector */ - get dplDetector() { - return this._dplDetector$.getCurrent(); + get detector() { + return this._detector$.getCurrent(); } /** diff --git a/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js b/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js index b8937c51ba..308a0fe5f2 100644 --- a/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js +++ b/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js @@ -37,7 +37,7 @@ export const SynchronousQcFlagsOverviewPage = ({ qcFlags: { synchronousOverviewM items: qcFlags, sortModel, pagination: paginationModel, - dplDetector: remoteDplDetector, + detector: remoteDplDetector, run: remoteRun, } = synchronousOverviewModel; diff --git a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js index f940155bbb..7e49e2d626 100644 --- a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js +++ b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js @@ -45,8 +45,8 @@ export class QcFlagDetailsModel extends Observable { this._deleteResult$.bubbleTo(this); detectorsProvider.qc$.observe(() => this._getDetector()); - this._dplDetector$ = new ObservableData(RemoteData.notAsked()); - this._dplDetector$.bubbleTo(this); + this._detector$ = new ObservableData(RemoteData.notAsked()); + this._detector$.bubbleTo(this); this._verificationEnabled = false; this._verificationCreationModel = new QcFlagVerificationCreationModel( @@ -98,12 +98,12 @@ export class QcFlagDetailsModel extends Observable { * @return {void} */ _getDetector() { - this._dplDetector$.setCurrent(detectorsProvider.qc$.getCurrent().match({ - Success: (dplDetectors) => { - const dplDetector = dplDetectors.find(({ id }) => id === this._detectorId); - return dplDetector - ? RemoteData.success(dplDetector) - : RemoteData.failure({ errors: [{ detail: `There is no dplDetector with given id (${this._detectorId})` }] }); + this._detector$.setCurrent(detectorsProvider.qc$.getCurrent().match({ + Success: (detectors) => { + const detector = detectors.find(({ id }) => id === this._detectorId); + return detector + ? RemoteData.success(detector) + : RemoteData.failure({ errors: [{ detail: `There is no detector with given id (${this._detectorId})` }] }); }, Failure: (payload) => RemoteData.failure(payload), Loading: () => RemoteData.loading(), @@ -182,8 +182,8 @@ export class QcFlagDetailsModel extends Observable { * * @return {RemoteData} current detector */ - get dplDetector() { - return this._dplDetector$.getCurrent(); + get detector() { + return this._detector$.getCurrent(); } } diff --git a/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js b/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js index a542f76822..a230dcee9e 100644 --- a/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js +++ b/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js @@ -66,7 +66,7 @@ const verifyButton = (verificationEnabled, onClick) => h( export const qcFlagDetailsComponent = (qcFlagDetailsModel, additionalDetailsConfiguration = {}) => { const { qcFlag: remoteQcFlag, - dplDetector: remoteDplDetector, + detector: remoteDplDetector, deleteResult, verificationEnabled, verificationCreationModel, @@ -144,11 +144,11 @@ A different person to verify the flag is encouraged. Do you want to continue?'; { id: qcFlagDetailsConfiguration.id, ...additionalDetailsConfiguration, - dplDetector: { + detector: { name: 'Detector', visible: true, format: () => remoteDplDetector.match({ - Success: (dplDetector) => dplDetector.name, + Success: (detector) => detector.name, Loading: () => spinner({ size: 3, absolute: false }), NotAsked: () => tooltip(h('.f3', iconWarning()), 'No dpl detector data was asked for'), Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load dpl detector info'), diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js index 8982d5ee5b..5c44f7af82 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js @@ -54,7 +54,7 @@ const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, d * Factory for detectors related active columns configuration * * @param {RunDetectorsSelectionModel} runDetectorsSelectionModel the run/detectors selection model - * @param {DplDetector[]} dplDetectors detectors list + * @param {DplDetector[]} detectors detectors list * @param {RemoteData} remoteDplDetectorsUserHasAccessTo dpl detectors list remote data * @param {object} monalisaProduction id of the production -- data pass or simulation pass * @param {DataPass} [monalisaProduction.dataPass] data pass containing the run -- exclusive with `simulationPass` @@ -66,7 +66,7 @@ const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, d */ export const createRunDetectorsAsyncQcActiveColumns = ( runDetectorsSelectionModel, - dplDetectors, + detectors, remoteDplDetectorsUserHasAccessTo, { dataPass, simulationPass }, { profile, qcSummary } = {}, @@ -78,7 +78,7 @@ export const createRunDetectorsAsyncQcActiveColumns = ( throw new Error('`dataPass` and `simulationPass` are exclusive options'); } - let activeColumnEntries = dplDetectors?.map(({ name: detectorName, id: detectorId, type: dplDetectorType }) => [ + let activeColumnEntries = detectors?.map(({ name: detectorName, id: detectorId, type: detectorType }) => [ detectorName, { name: detectorName.toUpperCase(), @@ -88,7 +88,7 @@ export const createRunDetectorsAsyncQcActiveColumns = ( Failure: (errors) => errorAlert(errors), Success: (detectorUserHasAccessTo) => { const detectorWasActiveDuringRun = Boolean(run.detectorsQualities.find(({ name }) => name === detectorName)); - if (dplDetectorType === DetectorType.PHYSICAL && !detectorWasActiveDuringRun) { + if (detectorType === DetectorType.PHYSICAL && !detectorWasActiveDuringRun) { return null; } @@ -143,7 +143,7 @@ export const createRunDetectorsAsyncQcActiveColumns = ( }, ]) ?? []; - const filtersEntries = dplDetectors?.map(({ name: detectorName, id: detectorId }) => [ + const filtersEntries = detectors?.map(({ name: detectorName, id: detectorId }) => [ detectorName, { name: detectorName.toUpperCase(), diff --git a/lib/public/views/Runs/Details/runDetailsComponent.js b/lib/public/views/Runs/Details/runDetailsComponent.js index a8f8b1c0c5..38580b67ce 100644 --- a/lib/public/views/Runs/Details/runDetailsComponent.js +++ b/lib/public/views/Runs/Details/runDetailsComponent.js @@ -548,23 +548,23 @@ export const runDetailsComponent = (runDetailsModel, router) => runDetailsModel. onclick: () => router.go(`?page=flp-detail&id=${entry.id}`), }), }), - [RUN_DETAILS_PANELS_KEYS.DPL_PROCESSES]: (dplDetectorsRemoteData) => dplDetectorsRemoteData.match({ + [RUN_DETAILS_PANELS_KEYS.DPL_PROCESSES]: (detectorsRemoteData) => detectorsRemoteData.match({ NotAsked: () => null, Loading: () => spinner({ size: 5, absolute: false }), /** * Display a dpl detector table * - * @param {DplDetectorTreeNodeModel[]} dplDetectorNodes the detectors nodes to display + * @param {DplDetectorTreeNodeModel[]} detectorNodes the detectors nodes to display * @return {vnode} the table */ - Success: (dplDetectorNodes) => { - if (dplDetectorNodes.length === 0) { + Success: (detectorNodes) => { + if (detectorNodes.length === 0) { return h('p', 'NO DETECTOR'); } - return h('.flex-column.g3', dplDetectorNodes.map((dplDetectorNode) => collapsibleTreeNode( - dplDetectorNode, - (dplDetector) => dplDetector.name, + return h('.flex-column.g3', detectorNodes.map((detectorNode) => collapsibleTreeNode( + detectorNode, + (detector) => detector.name, (dplProcessNode) => collapsibleTreeNode( dplProcessNode, (dplProcess) => diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js index 02c6a08070..78ed0e7097 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js @@ -90,7 +90,7 @@ const skimmableControl = (dataPass, onclick, requestResult) => { */ export const RunsPerDataPassOverviewPage = ({ runs: { perDataPassOverviewModel }, - dplDetectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, modalModel, }) => { perDataPassOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount( diff --git a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js index 630874cf54..ef61cdb1d2 100644 --- a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js +++ b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js @@ -49,7 +49,7 @@ const getRowClasses = (run) => isRunNotSubjectToQc(run) ? '.danger' : null; */ export const RunsPerSimulationPassOverviewPage = ({ runs: { perSimulationPassOverviewModel }, - dplDetectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, modalModel, }) => { perSimulationPassOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount( diff --git a/test/public/qcFlags/detailsForDataPass.test.js b/test/public/qcFlags/detailsForDataPass.test.js index 0167c7b60b..a32078725d 100644 --- a/test/public/qcFlags/detailsForDataPass.test.js +++ b/test/public/qcFlags/detailsForDataPass.test.js @@ -80,7 +80,7 @@ module.exports = () => { await expectInnerText(page, '#qc-flag-details-id', 'Id:\n1'); await expectInnerText(page, '#qc-flag-details-dataPass', 'Data pass:\nLHC22b_apass1'); await expectInnerText(page, '#qc-flag-details-runNumber', 'Run:\n106'); - await expectInnerText(page, '#qc-flag-details-dplDetector', 'Detector:\nCPV'); + await expectInnerText(page, '#qc-flag-details-detector', 'Detector:\nCPV'); await expectInnerText(page, '#qc-flag-details-flagType', 'Type:\nLimited Acceptance MC Reproducible'); await expectInnerText(page, '#qc-flag-details-from', 'From:\n08/08/2019, 22:43:20'); await expectInnerText(page, '#qc-flag-details-to', 'To:\n09/08/2019, 04:16:40'); diff --git a/test/public/qcFlags/detailsForSimulationPass.test.js b/test/public/qcFlags/detailsForSimulationPass.test.js index 70e0f25d5e..c673401f25 100644 --- a/test/public/qcFlags/detailsForSimulationPass.test.js +++ b/test/public/qcFlags/detailsForSimulationPass.test.js @@ -95,7 +95,7 @@ module.exports = () => { await expectInnerText(page, '#qc-flag-details-id', 'Id:\n5'); await expectInnerText(page, '#qc-flag-details-simulationPass', 'Simulation pass:\nLHC23k6c'); await expectInnerText(page, '#qc-flag-details-runNumber', 'Run:\n106'); - await expectInnerText(page, '#qc-flag-details-dplDetector', 'Detector:\nCPV'); + await expectInnerText(page, '#qc-flag-details-detector', 'Detector:\nCPV'); await expectInnerText(page, '#qc-flag-details-flagType', 'Type:\nBad'); await expectInnerText(page, '#qc-flag-details-from', 'From:\n08/08/2019, 13:46:40'); await expectInnerText(page, '#qc-flag-details-to', 'To:\n09/08/2019, 07:50:00'); From 85c20bb7093ae0cecb0b9bd5d306cbfbf8127a98 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Tue, 23 Sep 2025 22:31:43 +0200 Subject: [PATCH 03/11] DplDetector -> Detector in Qc* --- .../QcFlags/ActiveColumns/gaqFlagsActiveColumns.js | 2 +- .../ForDataPass/QcFlagsForDataPassOverviewPage.js | 10 +++++----- .../QcFlagsForSimulationPassOverviewPage.js | 10 +++++----- .../views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js | 2 +- .../views/QcFlags/Overview/QcFlagsOverviewModel.js | 4 ++-- .../Synchronous/SynchronousQcFlagsOverviewPage.js | 4 ++-- lib/public/views/QcFlags/details/QcFlagDetailsModel.js | 2 +- .../views/QcFlags/details/qcFlagDetailsComponent.js | 4 ++-- .../services/qualityControlFlag/QcFlagService.js | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js index cebcb2f91e..a477980c12 100644 --- a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js +++ b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js @@ -94,7 +94,7 @@ const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, de /** * Factory for GAQ detectors related active columns configuration * - * @param {Detector[]|DplDetector[]} gaqDetectors detectors list + * @param {Detector[]|Detector[]} gaqDetectors detectors list * @param {object} scope scope of GAQ flags * @param {number} scope.dataPassId id of data pass for which a QC flag is assigned * @param {number} scope.runNumber run number for which a QC flag is assigned diff --git a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js index 84c9c40420..17bb071d2e 100644 --- a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js @@ -23,7 +23,7 @@ import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js'; import { qcFlagsBreadcrumbs } from '../../../components/qcFlags/qcFlagsBreadcrumbs.js'; import errorAlert from '../../../components/common/errorAlert.js'; import spinner from '../../../components/common/spinner.js'; -import { remoteDplDetectorUserHasAccessTo } from '../../../services/detectors/remoteDplDetectorUserHasAccessTo.js'; +import { remoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; const TABLEROW_HEIGHT = 35; // Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes; @@ -36,13 +36,13 @@ const PAGE_USED_HEIGHT = 215; */ export const QcFlagsForDataPassOverviewPage = ({ qcFlags: { forDataPassOverviewModel: qcFlagsForDataPassOverviewModel }, - detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDetectorsUserHasAccessTo, }) => { const { dataPass: remoteDataPass, run: remoteRun, detectorId, - detector: remoteDplDetector, + detector: remoteDetector, items: remoteQcFlags, sortModel, } = qcFlagsForDataPassOverviewModel; @@ -73,8 +73,8 @@ export const QcFlagsForDataPassOverviewPage = ({ mergeRemoteData([ remoteDataPass, remoteRun, - remoteDplDetector, - remoteDplDetectorUserHasAccessTo(detectorId, remoteDplDetectorsUserHasAccessTo), + remoteDetector, + remoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo), remoteQcFlags, ]).match({ NotAsked: () => null, diff --git a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js index 0f2681a71d..12177b0d29 100644 --- a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js @@ -20,7 +20,7 @@ import { table } from '../../../components/common/table/table.js'; import { paginationComponent } from '../../../components/Pagination/paginationComponent.js'; import { qcFlagCreationPanelLink } from '../../../components/qcFlags/qcFlagCreationPanelLink.js'; import { qcFlagsBreadcrumbs } from '../../../components/qcFlags/qcFlagsBreadcrumbs.js'; -import { remoteDplDetectorUserHasAccessTo } from '../../../services/detectors/remoteDplDetectorUserHasAccessTo.js'; +import { remoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js'; import errorAlert from '../../../components/common/errorAlert.js'; import spinner from '../../../components/common/spinner.js'; @@ -36,13 +36,13 @@ const PAGE_USED_HEIGHT = 215; */ export const QcFlagsForSimulationPassOverviewPage = ({ qcFlags: { forSimulationPassOverviewModel: qcFlagsForSimulationPassOverviewModel }, - detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDetectorsUserHasAccessTo, }) => { const { simulationPass: remoteSimulationPass, run: remoteRun, detectorId, - detector: remoteDplDetector, + detector: remoteDetector, items: remoteQcFlags, sortModel, pagination: paginationModel, @@ -74,8 +74,8 @@ export const QcFlagsForSimulationPassOverviewPage = ({ mergeRemoteData([ remoteSimulationPass, remoteRun, - remoteDplDetector, - remoteDplDetectorUserHasAccessTo(detectorId, remoteDplDetectorsUserHasAccessTo), + remoteDetector, + remoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo), ]) .match({ NotAsked: () => null, diff --git a/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js b/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js index cb87fe6f17..dc449472f8 100644 --- a/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js @@ -192,7 +192,7 @@ export class GaqFlagsOverviewModel extends OverviewPageModel { /** * Get list of DPL detectors which flags contributes to GAQ - * @return {RemoteData} dpl detectors remote data + * @return {RemoteData} dpl detectors remote data */ get gaqDetectors() { return this._gaqDetectors$.getCurrent(); diff --git a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js index 80b94025b9..f4068b5035 100644 --- a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js @@ -104,7 +104,7 @@ export class QcFlagsOverviewModel extends OverviewPageModel { /** * Detector getter - * @return {RemoteData} current detector + * @return {RemoteData} current detector */ get detector() { return this._detector$.getCurrent(); @@ -119,7 +119,7 @@ export class QcFlagsOverviewModel extends OverviewPageModel { } /** - * DplDetector id getter + * Detector id getter * @return {number} current dpl detector id */ get detectorId() { diff --git a/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js b/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js index 308a0fe5f2..d6d32fc473 100644 --- a/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js +++ b/lib/public/views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js @@ -37,7 +37,7 @@ export const SynchronousQcFlagsOverviewPage = ({ qcFlags: { synchronousOverviewM items: qcFlags, sortModel, pagination: paginationModel, - detector: remoteDplDetector, + detector: remoteDetector, run: remoteRun, } = synchronousOverviewModel; @@ -59,7 +59,7 @@ export const SynchronousQcFlagsOverviewPage = ({ qcFlags: { synchronousOverviewM return h( '', { onremove: () => synchronousOverviewModel.reset() }, - mergeRemoteData([remoteRun, remoteDplDetector]).match({ + mergeRemoteData([remoteRun, remoteDetector]).match({ NotAsked: () => null, Failure: (errors) => errorAlert(errors), Success: ([run, detector]) => [ diff --git a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js index 7e49e2d626..cacbc0c46b 100644 --- a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js +++ b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js @@ -180,7 +180,7 @@ export class QcFlagDetailsModel extends Observable { /** * Dpl Detector getter * - * @return {RemoteData} current detector + * @return {RemoteData} current detector */ get detector() { return this._detector$.getCurrent(); diff --git a/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js b/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js index a230dcee9e..7d3d32aa0c 100644 --- a/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js +++ b/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js @@ -66,7 +66,7 @@ const verifyButton = (verificationEnabled, onClick) => h( export const qcFlagDetailsComponent = (qcFlagDetailsModel, additionalDetailsConfiguration = {}) => { const { qcFlag: remoteQcFlag, - detector: remoteDplDetector, + detector: remoteDetector, deleteResult, verificationEnabled, verificationCreationModel, @@ -147,7 +147,7 @@ A different person to verify the flag is encouraged. Do you want to continue?'; detector: { name: 'Detector', visible: true, - format: () => remoteDplDetector.match({ + format: () => remoteDetector.match({ Success: (detector) => detector.name, Loading: () => spinner({ size: 3, absolute: false }), NotAsked: () => tooltip(h('.f3', iconWarning()), 'No dpl detector data was asked for'), diff --git a/lib/server/services/qualityControlFlag/QcFlagService.js b/lib/server/services/qualityControlFlag/QcFlagService.js index 9e4cdc47d8..718ec79506 100644 --- a/lib/server/services/qualityControlFlag/QcFlagService.js +++ b/lib/server/services/qualityControlFlag/QcFlagService.js @@ -114,7 +114,7 @@ class QcFlagService { * @param {Partial[]} qcFlags flags to create * @param {object} scope scope of the QC flags to create * @param {number} scope.runNumber associated run's number - * @param {DplDetectorIdentifier} scope.detectorIdentifier associated dplDetector's identifier + * @param {DetectorIdentifier} scope.detectorIdentifier associated dplDetector's identifier * @param {DataPassIdentifier} [scope.dataPassIdentifier] associated data pass id * @param {SimulationPassIdentifier} [scope.simulationPassIdentifier] associated simulation pass id * @param {object} relations relations of the QC flag From 02e6f4e4b80cf74e97140d85fff634f96de6e4d5 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Tue, 23 Sep 2025 22:32:32 +0200 Subject: [PATCH 04/11] dplDetector -> detector in Qc* --- lib/server/services/qualityControlFlag/QcFlagService.js | 2 +- lib/server/services/qualityControlFlag/QcFlagSummaryService.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/server/services/qualityControlFlag/QcFlagService.js b/lib/server/services/qualityControlFlag/QcFlagService.js index 718ec79506..8416bbc36d 100644 --- a/lib/server/services/qualityControlFlag/QcFlagService.js +++ b/lib/server/services/qualityControlFlag/QcFlagService.js @@ -114,7 +114,7 @@ class QcFlagService { * @param {Partial[]} qcFlags flags to create * @param {object} scope scope of the QC flags to create * @param {number} scope.runNumber associated run's number - * @param {DetectorIdentifier} scope.detectorIdentifier associated dplDetector's identifier + * @param {DetectorIdentifier} scope.detectorIdentifier associated detector's identifier * @param {DataPassIdentifier} [scope.dataPassIdentifier] associated data pass id * @param {SimulationPassIdentifier} [scope.simulationPassIdentifier] associated simulation pass id * @param {object} relations relations of the QC flag diff --git a/lib/server/services/qualityControlFlag/QcFlagSummaryService.js b/lib/server/services/qualityControlFlag/QcFlagSummaryService.js index e411eab88f..8b28d1aeda 100644 --- a/lib/server/services/qualityControlFlag/QcFlagSummaryService.js +++ b/lib/server/services/qualityControlFlag/QcFlagSummaryService.js @@ -13,7 +13,7 @@ /** * @typedef RunQcSummary - * @type {Object} dplDetectorID to RunDetectorQcSummary mappings + * @type {Object} detectorID to RunDetectorQcSummary mappings */ /** From c34e125d65f38db607934ef1071629bd2d359b3c Mon Sep 17 00:00:00 2001 From: xsalonx Date: Tue, 23 Sep 2025 22:45:34 +0200 Subject: [PATCH 05/11] rm --- lib/public/Model.js | 2 +- ...HasAccessTo.js => remoteDetectorUserHasAccessTo.js} | 4 ++-- .../ForDataPass/QcFlagsForDataPassOverviewPage.js | 4 ++-- .../QcFlagsForSimulationPassOverviewPage.js | 4 ++-- .../ActiveColumns/runDetectorsAsyncQcActiveColumns.js | 10 +++++----- .../runDetectorsQualitiesActiveColumns.js | 2 +- .../RunPerDataPass/RunsPerDataPassOverviewModel.js | 2 +- .../Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js | 4 ++-- .../RunsPerSimulationPassOverviewModel.js | 2 +- .../RunsPerSimulationPassOverviewPage.js | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) rename lib/public/services/detectors/{remoteDplDetectorUserHasAccessTo.js => remoteDetectorUserHasAccessTo.js} (80%) diff --git a/lib/public/Model.js b/lib/public/Model.js index 99062ce756..6deeb9bcad 100644 --- a/lib/public/Model.js +++ b/lib/public/Model.js @@ -404,7 +404,7 @@ export default class Model extends Observable { /** * Get dpl detector which user can manage QC flags for * - * @return {RemoteData} dpl detectors remote data + * @return {RemoteData} dpl detectors remote data */ get detectorsUserHasAccessTo() { return this._qcDetectorsUserHasAccessTo.getCurrent(); diff --git a/lib/public/services/detectors/remoteDplDetectorUserHasAccessTo.js b/lib/public/services/detectors/remoteDetectorUserHasAccessTo.js similarity index 80% rename from lib/public/services/detectors/remoteDplDetectorUserHasAccessTo.js rename to lib/public/services/detectors/remoteDetectorUserHasAccessTo.js index ddb842c601..05edc1541a 100644 --- a/lib/public/services/detectors/remoteDplDetectorUserHasAccessTo.js +++ b/lib/public/services/detectors/remoteDetectorUserHasAccessTo.js @@ -17,10 +17,10 @@ * If the user do not have access to the given detector, remote data will be success with null payload * * @param {number} detectorId id of the detector that should be returned - * @param {RemoteData} remoteDplDetectorsUserHasAccessTo dpl detectors list remote data + * @param {RemoteData} remoteDetectorsUserHasAccessTo dpl detectors list remote data * @return {RemoteData} remote data of the detector */ -export const remoteDplDetectorUserHasAccessTo = (detectorId, remoteDplDetectorsUserHasAccessTo) => remoteDplDetectorsUserHasAccessTo.apply({ +export const getRemoteDetectorUserHasAccessTo = (detectorId, remoteDetectorsUserHasAccessTo) => remoteDetectorsUserHasAccessTo.apply({ Success: (detectors) => detectors.find(({ id }) => id === detectorId) ?? null, Failure: () => `An error has occurred, unable to check if the user has access to the detector ${detectorId}`, }); diff --git a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js index 17bb071d2e..6bb31172c7 100644 --- a/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js @@ -23,7 +23,7 @@ import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js'; import { qcFlagsBreadcrumbs } from '../../../components/qcFlags/qcFlagsBreadcrumbs.js'; import errorAlert from '../../../components/common/errorAlert.js'; import spinner from '../../../components/common/spinner.js'; -import { remoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; +import { getRemoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; const TABLEROW_HEIGHT = 35; // Estimate of the navbar and pagination elements height total; Needs to be updated in case of changes; @@ -74,7 +74,7 @@ export const QcFlagsForDataPassOverviewPage = ({ remoteDataPass, remoteRun, remoteDetector, - remoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo), + getRemoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo), remoteQcFlags, ]).match({ NotAsked: () => null, diff --git a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js index 12177b0d29..c2152602db 100644 --- a/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js +++ b/lib/public/views/QcFlags/ForSimulationPass/QcFlagsForSimulationPassOverviewPage.js @@ -20,7 +20,7 @@ import { table } from '../../../components/common/table/table.js'; import { paginationComponent } from '../../../components/Pagination/paginationComponent.js'; import { qcFlagCreationPanelLink } from '../../../components/qcFlags/qcFlagCreationPanelLink.js'; import { qcFlagsBreadcrumbs } from '../../../components/qcFlags/qcFlagsBreadcrumbs.js'; -import { remoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; +import { getRemoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; import { mergeRemoteData } from '../../../utilities/mergeRemoteData.js'; import errorAlert from '../../../components/common/errorAlert.js'; import spinner from '../../../components/common/spinner.js'; @@ -75,7 +75,7 @@ export const QcFlagsForSimulationPassOverviewPage = ({ remoteSimulationPass, remoteRun, remoteDetector, - remoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo), + getRemoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo), ]) .match({ NotAsked: () => null, diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js index 5c44f7af82..a23c3c9d1c 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js @@ -17,7 +17,7 @@ import { isRunNotSubjectToQc } from '../../../components/qcFlags/isRunNotSubject import { getQcSummaryDisplay } from './getQcSummaryDisplay.js'; import { getRunQcExclusionReason } from '../../../components/qcFlags/getRunQcExclusionReason.js'; import { qcFlagOverviewPanelLink } from '../../../components/qcFlags/qcFlagOverviewPanelLink.js'; -import { remoteDplDetectorUserHasAccessTo } from '../../../services/detectors/remoteDplDetectorUserHasAccessTo.js'; +import { getRemoteDetectorUserHasAccessTo } from '../../../services/detectors/remoteDetectorUserHasAccessTo.js'; import errorAlert from '../../../components/common/errorAlert.js'; import spinner from '../../../components/common/spinner.js'; import { numericalComparisonFilter } from '../../../components/Filters/common/filters/numericalComparisonFilter.js'; @@ -54,8 +54,8 @@ const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, d * Factory for detectors related active columns configuration * * @param {RunDetectorsSelectionModel} runDetectorsSelectionModel the run/detectors selection model - * @param {DplDetector[]} detectors detectors list - * @param {RemoteData} remoteDplDetectorsUserHasAccessTo dpl detectors list remote data + * @param {Detector[]} detectors detectors list + * @param {RemoteData} remoteDetectorsUserHasAccessTo dpl detectors list remote data * @param {object} monalisaProduction id of the production -- data pass or simulation pass * @param {DataPass} [monalisaProduction.dataPass] data pass containing the run -- exclusive with `simulationPass` * @param {SimulationPass} [monalisaProduction.simulationPass] simulation pass containing the run -- exclusive with `dataPass` @@ -67,7 +67,7 @@ const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, d export const createRunDetectorsAsyncQcActiveColumns = ( runDetectorsSelectionModel, detectors, - remoteDplDetectorsUserHasAccessTo, + remoteDetectorsUserHasAccessTo, { dataPass, simulationPass }, { profile, qcSummary } = {}, ) => { @@ -83,7 +83,7 @@ export const createRunDetectorsAsyncQcActiveColumns = ( { name: detectorName.toUpperCase(), visible: true, - format: (_, run) => remoteDplDetectorUserHasAccessTo(detectorId, remoteDplDetectorsUserHasAccessTo).match({ + format: (_, run) => getRemoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo).match({ NotAsked: () => null, Failure: (errors) => errorAlert(errors), Success: (detectorUserHasAccessTo) => { diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsQualitiesActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsQualitiesActiveColumns.js index 32c777b15d..d3bc2e7492 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsQualitiesActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsQualitiesActiveColumns.js @@ -15,7 +15,7 @@ import { formatDetectorQuality } from '../format/formatDetectorQuality.js'; /** * Factory for detectors' qualities related active columns configuration * - * @param {Detector[]|DplDetector[]} detectors detectors list + * @param {Detector[]} detectors detectors list * @param {object} [options] additional options * @param {object|string|string[]} [options.profiles] profiles to which the column is restricted to * @return {object} active columns configuration diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js index 304051713a..f30e10a6b7 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewModel.js @@ -285,7 +285,7 @@ export class RunsPerDataPassOverviewModel extends FixedPdpBeamTypeRunsOverviewMo /** * Get all detectors - * @return {RemoteData} detectors + * @return {RemoteData} detectors */ get detectors() { return this._detectors$.getCurrent(); diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js index 78ed0e7097..33c65a9b5a 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js @@ -90,7 +90,7 @@ const skimmableControl = (dataPass, onclick, requestResult) => { */ export const RunsPerDataPassOverviewPage = ({ runs: { perDataPassOverviewModel }, - detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDetectorsUserHasAccessTo, modalModel, }) => { perDataPassOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount( @@ -181,7 +181,7 @@ export const RunsPerDataPassOverviewPage = ({ ...createRunDetectorsAsyncQcActiveColumns( perDataPassOverviewModel.runDetectorsSelectionModel, detectors, - remoteDplDetectorsUserHasAccessTo, + remoteDetectorsUserHasAccessTo, { dataPass }, { profile: 'runsPerDataPass', diff --git a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js index d0af918e87..48f0a92269 100644 --- a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js +++ b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewModel.js @@ -108,7 +108,7 @@ export class RunsPerSimulationPassOverviewModel extends FixedPdpBeamTypeRunsOver /** * Get all detectors - * @return {RemoteData} detectors + * @return {RemoteData} detectors */ get detectors() { return this._detectors$.getCurrent(); diff --git a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js index ef61cdb1d2..73844cbb89 100644 --- a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js +++ b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js @@ -49,7 +49,7 @@ const getRowClasses = (run) => isRunNotSubjectToQc(run) ? '.danger' : null; */ export const RunsPerSimulationPassOverviewPage = ({ runs: { perSimulationPassOverviewModel }, - detectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo, + detectorsUserHasAccessTo: remoteDetectorsUserHasAccessTo, modalModel, }) => { perSimulationPassOverviewModel.pagination.provideDefaultItemsPerPage(estimateDisplayableRowsCount( @@ -84,7 +84,7 @@ export const RunsPerSimulationPassOverviewPage = ({ ...createRunDetectorsAsyncQcActiveColumns( perSimulationPassOverviewModel.runDetectorsSelectionModel, detectors, - remoteDplDetectorsUserHasAccessTo, + remoteDetectorsUserHasAccessTo, { simulationPass }, { profile: 'runsPerSimulationPass', From d1e52a8e8b2bb8b5fb4d3df01f31e6ba47d56f43 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Tue, 23 Sep 2025 22:49:16 +0200 Subject: [PATCH 06/11] DPL detecotr -> detector --- .../QcFlagEffectivePeriodRepository.js | 2 +- lib/public/Model.js | 4 ++-- .../qcFlags/qcFlagCreationPanelLink.js | 2 +- .../qcFlags/qcFlagOverviewPanelLink.js | 2 +- .../components/qcFlags/qcFlagsBreadcrumbs.js | 2 +- lib/public/models/UserRoleSelectionModel.js | 2 +- .../detectors/remoteDetectorUserHasAccessTo.js | 2 +- .../QcFlags/GaqFlags/GaqFlagsOverviewModel.js | 4 ++-- .../QcFlags/Overview/QcFlagsOverviewModel.js | 6 +++--- lib/public/views/QcFlags/QcFlagsModel.js | 12 ++++++------ .../views/QcFlags/details/QcFlagDetailsModel.js | 4 ++-- .../QcFlags/details/qcFlagDetailsComponent.js | 4 ++-- .../runDetectorsAsyncQcActiveColumns.js | 2 +- .../views/Runs/Details/runDetailsComponent.js | 2 +- .../services/detector/getQcDetectorOrFail.js | 2 +- lib/server/services/gaq/GaqDetectorsService.js | 16 ++++++++-------- .../services/qualityControlFlag/QcFlagService.js | 8 ++++---- .../qualityControlFlag/QcFlagSummaryService.js | 2 +- .../qualityControlFlag/QcFlagService.test.js | 4 ++-- 19 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/database/repositories/QcFlagEffectivePeriodRepository.js b/lib/database/repositories/QcFlagEffectivePeriodRepository.js index b4a5ef8899..37125f6fad 100644 --- a/lib/database/repositories/QcFlagEffectivePeriodRepository.js +++ b/lib/database/repositories/QcFlagEffectivePeriodRepository.js @@ -36,7 +36,7 @@ class QcFlagEffectivePeriodRepository extends Repository { * @param {number} [monalisaProduction.dataPassId] id of data pass, which the QC flag belongs to * @param {number} [monalisaProduction.simulationPassId] id of simulation pass, which the QC flags belongs to * @param {number} monalisaProduction.runNumber runNumber of run, which the QC flags belongs to - * @param {number} monalisaProduction.detectorId id of DPL detector, which the QC flags belongs to + * @param {number} monalisaProduction.detectorId id of detector, which the QC flags belongs to * @return {Promise} effective periods promise */ async findOverlappingPeriodsCreatedBeforeLimit(period, createdAtUpperLimit, { dataPassId, simulationPassId, runNumber, detectorId }) { diff --git a/lib/public/Model.js b/lib/public/Model.js index 6deeb9bcad..8ec85e13e5 100644 --- a/lib/public/Model.js +++ b/lib/public/Model.js @@ -402,9 +402,9 @@ export default class Model extends Observable { } /** - * Get dpl detector which user can manage QC flags for + * Get detector which user can manage QC flags for * - * @return {RemoteData} dpl detectors remote data + * @return {RemoteData} detectors remote data */ get detectorsUserHasAccessTo() { return this._qcDetectorsUserHasAccessTo.getCurrent(); diff --git a/lib/public/components/qcFlags/qcFlagCreationPanelLink.js b/lib/public/components/qcFlags/qcFlagCreationPanelLink.js index b596bab89c..f7bdca7778 100644 --- a/lib/public/components/qcFlags/qcFlagCreationPanelLink.js +++ b/lib/public/components/qcFlags/qcFlagCreationPanelLink.js @@ -22,7 +22,7 @@ import { getRunQcExclusionReason } from './getRunQcExclusionReason.js'; * @param {DataPass} [production.dataPass] data pass - exclusive with simulationPassId parameter * @param {SimulationPass} [production.simulationPass] simulation pass - exclusive with dataPassId parameter * @param {Run} run run - * @param {Detector|null} detector DPL detector if user has access to it, null if not + * @param {Detector|null} detector detector if user has access to it, null if not * @param {object} [options] display options * @param {Component} [options.noPermissionContent] a display in case user has no permission to manage QC flags for given detector * @param {string[]} [options.linkClasses] css classes to apply to the link (in addition to the default ones) diff --git a/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js b/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js index b39a715e92..6b9f838d01 100644 --- a/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js +++ b/lib/public/components/qcFlags/qcFlagOverviewPanelLink.js @@ -21,7 +21,7 @@ import { frontLink } from '../common/navigation/frontLink.js'; * @param {number} [scope.dataPassId] data pass id - exclusive with simulationPassId parameter * @param {number} [scope.simulationPassId] simulation pass id - exclusive with dataPassId parameter * @param {number} scope.runNumber run number - * @param {number} scope.detectorId DPL detector id + * @param {number} scope.detectorId detector id * @param {object} [attributes] attributes @see frontLink attributes parameter * @return {Component} link */ diff --git a/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js b/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js index 20c969c25e..6f62a98b18 100644 --- a/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js +++ b/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js @@ -10,7 +10,7 @@ import { RunQualities } from '../../domain/enums/RunQualities.js'; * @param {DataPass} [qcBreadcrumbsElements.dataPass] data pass -- exclusive with `remoteSimulationPass` * @param {SimulationPass} [qcBreadcrumbsElements.simulationPass] simulation pass -- exclusive with `remoteDataPass` * @param {Run} qcBreadcrumbsElements.run run - * @param {Detector} [qcBreadcrumbsElements.detector] dpl detector + * @param {Detector} [qcBreadcrumbsElements.detector] detector * @param {string} [header = 'QC'] header text * @return {Component} breadcrumbs */ diff --git a/lib/public/models/UserRoleSelectionModel.js b/lib/public/models/UserRoleSelectionModel.js index 7129fce089..9d5ffa3ef4 100644 --- a/lib/public/models/UserRoleSelectionModel.js +++ b/lib/public/models/UserRoleSelectionModel.js @@ -35,7 +35,7 @@ export class UserRoleSelectionModel extends SelectionDropdownModel { */ _initialize() { /** - * Update dropdown model options with DPL detector provider remote data + * Update dropdown model options with detector provider remote data * @return {void} */ const update = () => this.setAvailableOptions(detectorsProvider.qc$.getCurrent().match({ diff --git a/lib/public/services/detectors/remoteDetectorUserHasAccessTo.js b/lib/public/services/detectors/remoteDetectorUserHasAccessTo.js index 05edc1541a..748533e231 100644 --- a/lib/public/services/detectors/remoteDetectorUserHasAccessTo.js +++ b/lib/public/services/detectors/remoteDetectorUserHasAccessTo.js @@ -17,7 +17,7 @@ * If the user do not have access to the given detector, remote data will be success with null payload * * @param {number} detectorId id of the detector that should be returned - * @param {RemoteData} remoteDetectorsUserHasAccessTo dpl detectors list remote data + * @param {RemoteData} remoteDetectorsUserHasAccessTo detectors list remote data * @return {RemoteData} remote data of the detector */ export const getRemoteDetectorUserHasAccessTo = (detectorId, remoteDetectorsUserHasAccessTo) => remoteDetectorsUserHasAccessTo.apply({ diff --git a/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js b/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js index dc449472f8..03186c6609 100644 --- a/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js @@ -191,8 +191,8 @@ export class GaqFlagsOverviewModel extends OverviewPageModel { } /** - * Get list of DPL detectors which flags contributes to GAQ - * @return {RemoteData} dpl detectors remote data + * Get list of detectors which flags contributes to GAQ + * @return {RemoteData} detectors remote data */ get gaqDetectors() { return this._gaqDetectors$.getCurrent(); diff --git a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js index f4068b5035..f7c2158928 100644 --- a/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js +++ b/lib/public/views/QcFlags/Overview/QcFlagsOverviewModel.js @@ -54,7 +54,7 @@ export class QcFlagsOverviewModel extends OverviewPageModel { } /** - * Fetch DPL detector which QC flags should be fetched + * Fetch detector which QC flags should be fetched * @return {void} */ _getDetector() { @@ -120,14 +120,14 @@ export class QcFlagsOverviewModel extends OverviewPageModel { /** * Detector id getter - * @return {number} current dpl detector id + * @return {number} current detector id */ get detectorId() { return this._detectorId; } /** - * Set id of DPL detector which for QC flags should be fetched + * Set id of detector which for QC flags should be fetched * @param {number} detectorId detector id */ set detectorId(detectorId) { diff --git a/lib/public/views/QcFlags/QcFlagsModel.js b/lib/public/views/QcFlags/QcFlagsModel.js index 83f369c32b..028707556c 100644 --- a/lib/public/views/QcFlags/QcFlagsModel.js +++ b/lib/public/views/QcFlags/QcFlagsModel.js @@ -51,7 +51,7 @@ export class QcFlagsModel extends Observable { * @param {object} parameters parameters for the model * @param {number} parameters.runNumber run number * @param {number} parameters.dataPassId data pass id - * @param {number} parameters.detectorId dpl detector id + * @param {number} parameters.detectorId detector id * @returns {void} */ loadForDataPassOverview({ dataPassId, runNumber, detectorId }) { @@ -130,8 +130,8 @@ export class QcFlagsModel extends Observable { * @param {object} parameters parameters for the model * @param {number} parameters.id run number * @param {number} parameters.dataPassId data pass id - * @param {number} parameters.runNumber dpl detector id - * @param {number} parameters.detectorId dpl detector id + * @param {number} parameters.runNumber detector id + * @param {number} parameters.detectorId detector id * @returns {void} */ loadDetailsForDataPass({ id, dataPassId, runNumber, detectorId }) { @@ -167,7 +167,7 @@ export class QcFlagsModel extends Observable { * @param {object} parameters parameters for the model * @param {number} parameters.simulationPassId simulation pass id * @param {number} parameters.runNumber run number - * @param {number} parameters.detectorId dpl detector id + * @param {number} parameters.detectorId detector id * @returns {void} */ loadForSimulationPassOverview({ simulationPassId, runNumber, detectorId }) { @@ -225,7 +225,7 @@ export class QcFlagsModel extends Observable { * @param {number} parameters.id id * @param {number} parameters.simulationPassId simulation pass id * @param {number} parameters.runNumber run number - * @param {number} parameters.detectorId dpl detector id + * @param {number} parameters.detectorId detector id * @returns {void} */ loadDetailsForSimulationPass({ id, simulationPassId, runNumber, detectorId }) { @@ -257,7 +257,7 @@ export class QcFlagsModel extends Observable { * Load the overview page model * @param {object} parameters parameters for the model * @param {number} parameters.runNumber run number - * @param {number} parameters.detectorId dpl detector id + * @param {number} parameters.detectorId detector id * @returns {void} */ loadSynchronousOverview({ runNumber, detectorId }) { diff --git a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js index cacbc0c46b..332f6ab74e 100644 --- a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js +++ b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js @@ -93,7 +93,7 @@ export class QcFlagDetailsModel extends Observable { } /** - * Fetch DPL detector which for QC flag is to be created + * Fetch detector which for QC flag is to be created * * @return {void} */ @@ -178,7 +178,7 @@ export class QcFlagDetailsModel extends Observable { } /** - * Dpl Detector getter + * detector getter * * @return {RemoteData} current detector */ diff --git a/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js b/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js index 7d3d32aa0c..68549e786b 100644 --- a/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js +++ b/lib/public/views/QcFlags/details/qcFlagDetailsComponent.js @@ -150,8 +150,8 @@ A different person to verify the flag is encouraged. Do you want to continue?'; format: () => remoteDetector.match({ Success: (detector) => detector.name, Loading: () => spinner({ size: 3, absolute: false }), - NotAsked: () => tooltip(h('.f3', iconWarning()), 'No dpl detector data was asked for'), - Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load dpl detector info'), + NotAsked: () => tooltip(h('.f3', iconWarning()), 'No detector data was asked for'), + Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load detector info'), }), }, ...qcFlagDetailsConfiguration, diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js index a23c3c9d1c..204969c2c2 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsAsyncQcActiveColumns.js @@ -55,7 +55,7 @@ const runDetectorAsyncQualityDisplay = ({ dataPassId, simulationPassId }, run, d * * @param {RunDetectorsSelectionModel} runDetectorsSelectionModel the run/detectors selection model * @param {Detector[]} detectors detectors list - * @param {RemoteData} remoteDetectorsUserHasAccessTo dpl detectors list remote data + * @param {RemoteData} remoteDetectorsUserHasAccessTo detectors list remote data * @param {object} monalisaProduction id of the production -- data pass or simulation pass * @param {DataPass} [monalisaProduction.dataPass] data pass containing the run -- exclusive with `simulationPass` * @param {SimulationPass} [monalisaProduction.simulationPass] simulation pass containing the run -- exclusive with `dataPass` diff --git a/lib/public/views/Runs/Details/runDetailsComponent.js b/lib/public/views/Runs/Details/runDetailsComponent.js index 38580b67ce..f094e06f15 100644 --- a/lib/public/views/Runs/Details/runDetailsComponent.js +++ b/lib/public/views/Runs/Details/runDetailsComponent.js @@ -553,7 +553,7 @@ export const runDetailsComponent = (runDetailsModel, router) => runDetailsModel. Loading: () => spinner({ size: 5, absolute: false }), /** - * Display a dpl detector table + * Display a detector table * * @param {DplDetectorTreeNodeModel[]} detectorNodes the detectors nodes to display * @return {vnode} the table diff --git a/lib/server/services/detector/getQcDetectorOrFail.js b/lib/server/services/detector/getQcDetectorOrFail.js index 21c1b25264..d5255a5ab2 100644 --- a/lib/server/services/detector/getQcDetectorOrFail.js +++ b/lib/server/services/detector/getQcDetectorOrFail.js @@ -20,7 +20,7 @@ const { QC_DETECTOR_TYPES } = require('../../../domain/enums/DetectorTypes.js'); /** * Find and return a QC (PHYSICAL or QC_ONLY) detector identified by its name or id and throw if it does not exists * - * @param {DetectorIdentifier} identifier the identifier of the DPL detector to fetch + * @param {DetectorIdentifier} identifier the identifier of the detector to fetch * @return {Promise} the found detector */ exports.getQcDetectorOrFail = async ({ detectorId, detectorName }) => { diff --git a/lib/server/services/gaq/GaqDetectorsService.js b/lib/server/services/gaq/GaqDetectorsService.js index 1ac2a0dc7e..fa83223293 100644 --- a/lib/server/services/gaq/GaqDetectorsService.js +++ b/lib/server/services/gaq/GaqDetectorsService.js @@ -33,12 +33,12 @@ const DEFAULT_GAQ_DETECTORS_FOR_LEAD_LEAD_RUNS = ['TPC', 'ITS', 'FT0', 'ZDC']; */ class GaqDetectorService { /** - * Set list of DPL detectors which flags contribute to GAQ (global aggregated quality) + * Set list of detectors which flags contribute to GAQ (global aggregated quality) * for given runs and data pass * * @param {number} dataPassId data pass id * @param {number[]} runNumbers list of run numbers - * @param {number[]} detectorIds list of ids of DPL detectors included in GAQ computation for the given runs and data pass + * @param {number[]} detectorIds list of ids of detectors included in GAQ computation for the given runs and data pass * @return {Promise} promise resolved once association between data pass, runs and detectors was set */ setGaqDetectors(dataPassId, runNumbers, detectorIds) { @@ -62,7 +62,7 @@ class GaqDetectorService { } /** - * Set default list of DPL detectors which flags contribute to GAQ (global aggregated quality) for given runs and data pass + * Set default list of detectors which flags contribute to GAQ (global aggregated quality) for given runs and data pass * Where, for given run, default list of GAQ detectors is intersection of detectors linked to it with list of detectors * from @see DEFAULT_GAQ_DETECTORS_FOR_PDP_BEAM_TYPE, which depends on beam type of the run * @@ -106,11 +106,11 @@ class GaqDetectorService { } /** - * Find DPL detectors which flags contribute to GAQ for given run and data pass + * Find detectors which flags contribute to GAQ for given run and data pass * * @param {number} dataPassId id of data pass * @param {number} runNumber run number - * @return {Promise[]>} promise of DPL detectors + * @return {Promise[]>} promise of detectors */ async getGaqDetectors(dataPassId, runNumber) { const queryBuilder = dataSource.createQueryBuilder() @@ -147,11 +147,11 @@ class GaqDetectorService { /** * Verify that all the given runs includes each of the given detectors - * As there is no direct link between runs and DPL detectors, - * association between run and corresponding Detector (with same name as DPL Detector) is checked + * As there is no direct link between runs and detectors, + * association between run and corresponding Detector (with same name as detector) is checked * * @param {number[]} runNumbers list of run numbers - * @param {number[]} detectorIds list of IDs of DPL detectors + * @param {number[]} detectorIds list of IDs of detectors * @return {Promise} promise resolved once associations are validated * @throws {BadParameterError} if some association does not exist */ diff --git a/lib/server/services/qualityControlFlag/QcFlagService.js b/lib/server/services/qualityControlFlag/QcFlagService.js index 8416bbc36d..7f41026ce7 100644 --- a/lib/server/services/qualityControlFlag/QcFlagService.js +++ b/lib/server/services/qualityControlFlag/QcFlagService.js @@ -385,12 +385,12 @@ class QcFlagService { } /** - * Return a paginated list of QC flags related to a given data pass, run and dpl detector + * Return a paginated list of QC flags related to a given data pass, run and detector * * @param {object} criteria the QC flag criteria * @param {number} criteria.dataPassId the id of the data pass to which QC flag should relate * @param {number} criteria.runNumber the run number of the run to which QC flag should relate - * @param {number} criteria.detectorId the id of the DPL detector to which QC flag should release + * @param {number} criteria.detectorId the id of the detector to which QC flag should release * @param {object} [pagination] the pagination to apply * @param {number} [pagination.offset] amount of items to skip * @param {number} [pagination.limit] amount of items to fetch @@ -442,12 +442,12 @@ class QcFlagService { } /** - * Return a paginated list of QC flags related to a given simulation pass, run and dpl detector + * Return a paginated list of QC flags related to a given simulation pass, run and detector * * @param {object} criteria the QC flag criteria * @param {number} criteria.simulationPassId the id of the simulation pass to which QC flag should relate * @param {number} criteria.runNumber the run number of the run to which QC flag should relate - * @param {number} criteria.detectorId the id of the DPL detector to which QC flag should release + * @param {number} criteria.detectorId the id of the detector to which QC flag should release * @param {object} [pagination] the pagination to apply * @param {number} [pagination.offset] amount of items to skip * @param {number} [pagination.limit] amount of items to fetch diff --git a/lib/server/services/qualityControlFlag/QcFlagSummaryService.js b/lib/server/services/qualityControlFlag/QcFlagSummaryService.js index 8b28d1aeda..4bc77dc0ce 100644 --- a/lib/server/services/qualityControlFlag/QcFlagSummaryService.js +++ b/lib/server/services/qualityControlFlag/QcFlagSummaryService.js @@ -79,7 +79,7 @@ class QcFlagSummaryService { * @param {number} [scope.dataPassId] data pass id - exclusive with other options * @param {number} [scope.simulationPassId] simulation pass id - exclusive with other options * @param {number} [scope.lhcPeriodId] id of LHC Period - exclusive with other options - * @param {number[]} [scope.detectorIds] ids of dpl detectors + * @param {number[]} [scope.detectorIds] ids of detectors * @param {object} [options] additional options * @param {boolean} [options.mcReproducibleAsNotBad = false] if set to true, `Limited Acceptance MC Reproducible` flag type is treated as * good one diff --git a/test/lib/server/services/qualityControlFlag/QcFlagService.test.js b/test/lib/server/services/qualityControlFlag/QcFlagService.test.js index d51c19d08c..4c3145897d 100644 --- a/test/lib/server/services/qualityControlFlag/QcFlagService.test.js +++ b/test/lib/server/services/qualityControlFlag/QcFlagService.test.js @@ -490,7 +490,7 @@ module.exports = () => { assert.strictEqual(response.length, 0, 'Response should be empty array'); }); - it('should fail to create QC flag because there is no association between data pass, run and dpl detector', async () => { + it('should fail to create QC flag because there is no association between data pass, run and detector', async () => { const qcFlag = { from: new Date('2019-08-09 01:29:50').getTime(), to: new Date('2019-08-09 05:40:00').getTime(), @@ -1117,7 +1117,7 @@ module.exports = () => { assert.strictEqual(response.length, 0, 'Response should be empty array'); }); - it('should fail to create QC flag because there is no association between simulation pass, run and dpl detector', async () => { + it('should fail to create QC flag because there is no association between simulation pass, run and detector', async () => { const qcFlag = { from: new Date('2019-08-09 01:29:50').getTime(), to: new Date('2019-08-09 05:40:00').getTime(), From 52d64edf6de5fd72926150c0fc0b46e0faef9481 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Wed, 24 Sep 2025 01:51:44 +0200 Subject: [PATCH 07/11] fix --- .../views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js | 6 +++--- lib/public/views/QcFlags/details/QcFlagDetailsModel.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js index a477980c12..94ef57ded0 100644 --- a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js +++ b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js @@ -63,8 +63,8 @@ const formatGeneralQuality = (contributingFlags, gaqDetectors) => { * @param {number} scope.detectorId id of detector for which a QC flag is assigned * @return {Component} display of QC flag */ -const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, detectorId }) => { - const flag = contributingFlags.find(({ detectorId }) => detectorId === detectorId); +const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, detectorId: targetDetectorId }) => { + const flag = contributingFlags.find(({ detectorId }) => detectorId === targetDetectorId); if (!flag) { return h('.gray-darker.m2.badge', tooltip(iconBan(), 'No flag is assigned')); } @@ -86,7 +86,7 @@ const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, de id: flag.id, dataPassId, runNumber, - detectorId: detectorId, + detectorId: targetDetectorId, }, ); }; diff --git a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js index 332f6ab74e..c1abc0a515 100644 --- a/lib/public/views/QcFlags/details/QcFlagDetailsModel.js +++ b/lib/public/views/QcFlags/details/QcFlagDetailsModel.js @@ -178,7 +178,7 @@ export class QcFlagDetailsModel extends Observable { } /** - * detector getter + * Detector getter * * @return {RemoteData} current detector */ From 9fb6eb5e6d12e98c72df10b8a0eb58f4f424dad7 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Wed, 24 Sep 2025 01:56:17 +0200 Subject: [PATCH 08/11] cleanup --- .../QcFlags/ActiveColumns/gaqFlagsActiveColumns.js | 2 +- .../ActiveColumns/runDetectorsSyncQcActiveColumns.js | 2 +- lib/server/controllers/qcFlag.controller.js | 4 ++-- test/api/qcFlags.test.js | 4 ++-- .../qualityControlFlag/QcFlagService.test.js | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js index 94ef57ded0..80e9247edf 100644 --- a/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js +++ b/lib/public/views/QcFlags/ActiveColumns/gaqFlagsActiveColumns.js @@ -94,7 +94,7 @@ const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, de /** * Factory for GAQ detectors related active columns configuration * - * @param {Detector[]|Detector[]} gaqDetectors detectors list + * @param {Detector[]} gaqDetectors detectors list * @param {object} scope scope of GAQ flags * @param {number} scope.dataPassId id of data pass for which a QC flag is assigned * @param {number} scope.runNumber run number for which a QC flag is assigned diff --git a/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js b/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js index b438daae7f..4f57a3770a 100644 --- a/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js +++ b/lib/public/views/Runs/ActiveColumns/runDetectorsSyncQcActiveColumns.js @@ -41,7 +41,7 @@ export const runDetectorsSyncQcActiveColumns = ( return runDetectorSummary ? qcFlagOverviewPanelLink( getQcSummaryDisplay({ ...runDetectorSummary, missingVerificationsCount: 0 }), // Ignore verifications - { runNumber, detectorId: detectorId }, + { runNumber, detectorId }, ) : h('m2.badge.gray', iconBan()); }, diff --git a/lib/server/controllers/qcFlag.controller.js b/lib/server/controllers/qcFlag.controller.js index a66df73a1b..f5bf389491 100644 --- a/lib/server/controllers/qcFlag.controller.js +++ b/lib/server/controllers/qcFlag.controller.js @@ -76,7 +76,7 @@ const listQcFlagsPerDataPassHandler = async (req, res) => { } = validatedDTO.query; const { count, rows: items } = await qcFlagService.getAllPerDataPassAndRunAndDetector( - { dataPassId, runNumber, detectorId: detectorId }, + { dataPassId, runNumber, detectorId }, { limit, offset }, filter, ); @@ -113,7 +113,7 @@ const listQcFlagsPerSimulationPassHandler = async (req, res) => { } = validatedDTO.query; const { count, rows: items } = await qcFlagService.getAllPerSimulationPassAndRunAndDetector( - { simulationPassId, runNumber, detectorId: detectorId }, + { simulationPassId, runNumber, detectorId }, { limit, offset }, filter, ); diff --git a/test/api/qcFlags.test.js b/test/api/qcFlags.test.js index 865e68184a..c9ac221095 100644 --- a/test/api/qcFlags.test.js +++ b/test/api/qcFlags.test.js @@ -496,7 +496,7 @@ module.exports = () => { expect({ from, to, comment, flagTypeId, runNumber, detectorId }).to.be.eql(expectedProperties); } { - const { from, to, comment, flagTypeId, runNumber, detectorId: detectorId, dataPasses } = await QcFlagRepository.findOne({ + const { from, to, comment, flagTypeId, runNumber, detectorId, dataPasses } = await QcFlagRepository.findOne({ include: [{ association: 'dataPasses' }], where: { id: createdQcFlag.id, @@ -569,7 +569,7 @@ module.exports = () => { expect({ from, to, comment, flagTypeId, runNumber, detectorId }).to.be.eql(expectedProperties); } { - const { from, to, comment, flagTypeId, runNumber, detectorId: detectorId, simulationPasses } + const { from, to, comment, flagTypeId, runNumber, detectorId, simulationPasses } = await QcFlagRepository.findOne({ include: [{ association: 'simulationPasses' }], where: { diff --git a/test/lib/server/services/qualityControlFlag/QcFlagService.test.js b/test/lib/server/services/qualityControlFlag/QcFlagService.test.js index 4c3145897d..a6f367619e 100644 --- a/test/lib/server/services/qualityControlFlag/QcFlagService.test.js +++ b/test/lib/server/services/qualityControlFlag/QcFlagService.test.js @@ -578,7 +578,7 @@ module.exports = () => { comment, flagTypeId, runNumber, - detectorId: detectorId, + detectorId, createdBy: { externalId: externalUserId }, } = createdQcFlags[qcFlagIndex]; const qcFlag = qcFlags[qcFlagIndex]; @@ -686,7 +686,7 @@ module.exports = () => { const relations = { user: { roles: ['admin'], externalUserId: 456 } }; - const [{ id, runNumber, detectorId: detectorId }] = await qcFlagService.create([qcFlag], scope, relations); + const [{ id, runNumber, detectorId }] = await qcFlagService.create([qcFlag], scope, relations); const olderFlags = (await QcFlagRepository.findAll({ where: { @@ -764,7 +764,7 @@ module.exports = () => { const [ { id, from, to, comment, flagTypeId, runNumber, - detectorId: detectorId, createdBy: { externalId: externalUserId }, createdAt, + detectorId, createdBy: { externalId: externalUserId }, createdAt, }, ] = await qcFlagService.create([qcFlag], scope, relations); @@ -1155,7 +1155,7 @@ module.exports = () => { }; const relations = { user: { roles: ['det-cpv'], externalUserId: 456 } }; - const [{ id, from, to, comment, flagTypeId, runNumber, detectorId: detectorId, createdBy: { externalId: externalUserId } }] = + const [{ id, from, to, comment, flagTypeId, runNumber, detectorId, createdBy: { externalId: externalUserId } }] = await qcFlagService.create([qcFlag], scope, relations); expect({ @@ -1238,7 +1238,7 @@ module.exports = () => { const relations = { user: { roles: ['admin'], externalUserId: 456 } }; - const [{ id, from, to, comment, flagTypeId, runNumber, detectorId: detectorId, createdBy: { externalId: externalUserId } }] = + const [{ id, from, to, comment, flagTypeId, runNumber, detectorId, createdBy: { externalId: externalUserId } }] = await qcFlagService.create([qcFlagCreationParameters], scope, relations); expect({ from, to, comment, flagTypeId, runNumber, detectorId, externalUserId }).to.be.eql({ @@ -1299,7 +1299,7 @@ module.exports = () => { }; const relations = { user: { roles: ['det-cpv'], externalUserId: 456 } }; - const [{ id, from, to, flagTypeId, runNumber, detectorId: detectorId, createdBy: { externalId: externalUserId } }] = + const [{ id, from, to, flagTypeId, runNumber, detectorId, createdBy: { externalId: externalUserId } }] = await qcFlagService.create([qcFlag], scope, relations); expect({ From da57e3a30818a1fb7a75d8d6a0737c2dea25594f Mon Sep 17 00:00:00 2001 From: xsalonx Date: Wed, 24 Sep 2025 01:59:48 +0200 Subject: [PATCH 09/11] cleanup --- lib/server/controllers/qcFlag.controller.js | 2 +- lib/server/services/gaq/GaqDetectorsService.js | 2 +- test/api/gaqDetectors.test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/server/controllers/qcFlag.controller.js b/lib/server/controllers/qcFlag.controller.js index f5bf389491..72378b5d90 100644 --- a/lib/server/controllers/qcFlag.controller.js +++ b/lib/server/controllers/qcFlag.controller.js @@ -340,7 +340,7 @@ const getQcFlagsSummaryHandler = async (req, res) => { } = validatedDTO.query; const data = await qcFlagSummaryService.getSummary( - { dataPassId, simulationPassId, lhcPeriodId, detectorIds: detectorIds }, + { dataPassId, simulationPassId, lhcPeriodId, detectorIds }, { mcReproducibleAsNotBad }, filter, ); diff --git a/lib/server/services/gaq/GaqDetectorsService.js b/lib/server/services/gaq/GaqDetectorsService.js index fa83223293..d442d41e94 100644 --- a/lib/server/services/gaq/GaqDetectorsService.js +++ b/lib/server/services/gaq/GaqDetectorsService.js @@ -110,7 +110,7 @@ class GaqDetectorService { * * @param {number} dataPassId id of data pass * @param {number} runNumber run number - * @return {Promise[]>} promise of detectors + * @return {Promise[]>} promise of detectors */ async getGaqDetectors(dataPassId, runNumber) { const queryBuilder = dataSource.createQueryBuilder() diff --git a/test/api/gaqDetectors.test.js b/test/api/gaqDetectors.test.js index f6ef1b2cb2..b146c07343 100644 --- a/test/api/gaqDetectors.test.js +++ b/test/api/gaqDetectors.test.js @@ -29,7 +29,7 @@ module.exports = () => { const response = await request(server).post(`/api/gaqDetectors?token=${BkpRoles.GAQ}`).send({ dataPassId, runNumbers, - detectorIds: detectorIds, + detectorIds, }); expect(response.status).to.be.equal(201); expect(response.body.data).to.have.all.deep.members(runNumbers @@ -43,7 +43,7 @@ module.exports = () => { const response = await request(server).post(`/api/gaqDetectors?token=${BkpRoles.GUEST}`).send({ dataPassId, runNumbers, - detectorIds: detectorIds, + detectorIds, }); expect(response.status).to.be.equal(403); From ab1daffbb9abfe8b3cb7b72bb221cbfe2ab2aad7 Mon Sep 17 00:00:00 2001 From: xsalonx Date: Wed, 24 Sep 2025 02:10:15 +0200 Subject: [PATCH 10/11] fix --- lib/database/adapters/RunAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/database/adapters/RunAdapter.js b/lib/database/adapters/RunAdapter.js index 0211f7bbef..38cd867c0b 100644 --- a/lib/database/adapters/RunAdapter.js +++ b/lib/database/adapters/RunAdapter.js @@ -293,8 +293,8 @@ class RunAdapter { const adaptedQcFlags = qcFlags ? qcFlags.map(this.qcFlagAdapter.toEntity) : []; entityObject.qcFlags = adaptedQcFlags.reduce((acc, qcFlag) => { - acc[qcFlag.dplDetectorId] = acc[qcFlag.dplDetectorId] ?? []; - acc[qcFlag.dplDetectorId].push(qcFlag); + acc[qcFlag.detectorId] = acc[qcFlag.detectorId] ?? []; + acc[qcFlag.detectorId].push(qcFlag); return acc; }, {}); From 743c73e3247f9825f3d251615035e94bbf30d66b Mon Sep 17 00:00:00 2001 From: xsalonx Date: Wed, 24 Sep 2025 02:14:12 +0200 Subject: [PATCH 11/11] bring back dpl to run details --- .../views/Runs/Details/runDetailsComponent.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/public/views/Runs/Details/runDetailsComponent.js b/lib/public/views/Runs/Details/runDetailsComponent.js index f094e06f15..a8f8b1c0c5 100644 --- a/lib/public/views/Runs/Details/runDetailsComponent.js +++ b/lib/public/views/Runs/Details/runDetailsComponent.js @@ -548,23 +548,23 @@ export const runDetailsComponent = (runDetailsModel, router) => runDetailsModel. onclick: () => router.go(`?page=flp-detail&id=${entry.id}`), }), }), - [RUN_DETAILS_PANELS_KEYS.DPL_PROCESSES]: (detectorsRemoteData) => detectorsRemoteData.match({ + [RUN_DETAILS_PANELS_KEYS.DPL_PROCESSES]: (dplDetectorsRemoteData) => dplDetectorsRemoteData.match({ NotAsked: () => null, Loading: () => spinner({ size: 5, absolute: false }), /** - * Display a detector table + * Display a dpl detector table * - * @param {DplDetectorTreeNodeModel[]} detectorNodes the detectors nodes to display + * @param {DplDetectorTreeNodeModel[]} dplDetectorNodes the detectors nodes to display * @return {vnode} the table */ - Success: (detectorNodes) => { - if (detectorNodes.length === 0) { + Success: (dplDetectorNodes) => { + if (dplDetectorNodes.length === 0) { return h('p', 'NO DETECTOR'); } - return h('.flex-column.g3', detectorNodes.map((detectorNode) => collapsibleTreeNode( - detectorNode, - (detector) => detector.name, + return h('.flex-column.g3', dplDetectorNodes.map((dplDetectorNode) => collapsibleTreeNode( + dplDetectorNode, + (dplDetector) => dplDetector.name, (dplProcessNode) => collapsibleTreeNode( dplProcessNode, (dplProcess) =>