Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/database/adapters/QcFlagAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class QcFlagAdapter {
comment: comment ?? null,
origin,
runNumber,
dplDetectorId: detectorId,
detectorId,
flagTypeId,
flagType: flagType ? this.qcFlagTypeAdapter.toMinifiedEntity(flagType) : null,
createdById,
Expand Down
4 changes: 2 additions & 2 deletions lib/database/adapters/RunAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}, {});

Expand Down
2 changes: 1 addition & 1 deletion lib/database/models/typedefs/SequelizeGaqDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @property {number} dataPassId
* @property {number} runNumber
* @property {number} dplDetectorId
* @property {number} detectorId
* @property {Date} createdAt
* @property {Date} updatedAt
*/
2 changes: 1 addition & 1 deletion lib/database/models/typedefs/SequelizeQcFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SequelizeQcFlagEffectivePeriod[]>} effective periods promise
*/
async findOverlappingPeriodsCreatedBeforeLimit(period, createdAtUpperLimit, { dataPassId, simulationPassId, runNumber, detectorId }) {
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/entities/DataPassQcFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/entities/QcFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/entities/SimulationPassQcFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/domain/entities/dpl/DplDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
6 changes: 3 additions & 3 deletions lib/public/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ 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<DplDetector[]>} dpl detectors remote data
* @return {RemoteData<Detector[]>} detectors remote data
*/
get dplDetectorsUserHasAccessTo() {
get detectorsUserHasAccessTo() {
return this._qcDetectorsUserHasAccessTo.getCurrent();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/public/components/qcFlags/qcFlagCreationPanelLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lib/public/components/qcFlags/qcFlagOverviewPanelLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 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) {
Expand All @@ -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 },
);
};
2 changes: 1 addition & 1 deletion lib/public/components/qcFlags/qcFlagsBreadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/public/models/UserRoleSelectionModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DplDetector[]>} remoteDplDetectorsUserHasAccessTo dpl detectors list remote data
* @param {RemoteData<Detector[]>} remoteDetectorsUserHasAccessTo 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}`,
});
Original file line number Diff line number Diff line change
Expand Up @@ -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(({ dplDetectorId }) => dplDetectorId === 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'));
}
Expand All @@ -86,15 +86,15 @@ const formatGaqDetectorQuality = (contributingFlags, { dataPassId, runNumber, de
id: flag.id,
dataPassId,
runNumber,
dplDetectorId: detectorId,
detectorId: targetDetectorId,
},
);
};

/**
* Factory for GAQ detectors related active columns configuration
*
* @param {Detector[]|DplDetector[]} 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export class QcFlagsForDataPassOverviewModel extends QcFlagsOverviewModel {
return buildUrl('/api/qcFlags/perDataPass', {
dataPassId: this._dataPassId,
runNumber: this._runNumber,
dplDetectorId: this._dplDetectorId,
filter: this.dplDetector.match({
detectorId: this._detectorId,
filter: this.detector.match({
Success: ({ type }) => [DetectorType.AOT_GLO, DetectorType.AOT_EVENT, DetectorType.MUON_GLO].includes(type)
? { createdBy: { names: 'Anonymous', operator: 'none' } }
: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { 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;
Expand All @@ -36,13 +36,13 @@ const PAGE_USED_HEIGHT = 215;
*/
export const QcFlagsForDataPassOverviewPage = ({
qcFlags: { forDataPassOverviewModel: qcFlagsForDataPassOverviewModel },
dplDetectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo,
detectorsUserHasAccessTo: remoteDetectorsUserHasAccessTo,
}) => {
const {
dataPass: remoteDataPass,
run: remoteRun,
dplDetectorId,
dplDetector: remoteDplDetector,
detectorId,
detector: remoteDetector,
items: remoteQcFlags,
sortModel,
} = qcFlagsForDataPassOverviewModel;
Expand All @@ -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',
},
Expand All @@ -73,8 +73,8 @@ export const QcFlagsForDataPassOverviewPage = ({
mergeRemoteData([
remoteDataPass,
remoteRun,
remoteDplDetector,
remoteDplDetectorUserHasAccessTo(dplDetectorId, remoteDplDetectorsUserHasAccessTo),
remoteDetector,
getRemoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo),
remoteQcFlags,
]).match({
NotAsked: () => null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { 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';
Expand All @@ -36,13 +36,13 @@ const PAGE_USED_HEIGHT = 215;
*/
export const QcFlagsForSimulationPassOverviewPage = ({
qcFlags: { forSimulationPassOverviewModel: qcFlagsForSimulationPassOverviewModel },
dplDetectorsUserHasAccessTo: remoteDplDetectorsUserHasAccessTo,
detectorsUserHasAccessTo: remoteDetectorsUserHasAccessTo,
}) => {
const {
simulationPass: remoteSimulationPass,
run: remoteRun,
dplDetectorId,
dplDetector: remoteDplDetector,
detectorId,
detector: remoteDetector,
items: remoteQcFlags,
sortModel,
pagination: paginationModel,
Expand All @@ -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',
},
Expand All @@ -74,8 +74,8 @@ export const QcFlagsForSimulationPassOverviewPage = ({
mergeRemoteData([
remoteSimulationPass,
remoteRun,
remoteDplDetector,
remoteDplDetectorUserHasAccessTo(dplDetectorId, remoteDplDetectorsUserHasAccessTo),
remoteDetector,
getRemoteDetectorUserHasAccessTo(detectorId, remoteDetectorsUserHasAccessTo),
])
.match({
NotAsked: () => null,
Expand Down
6 changes: 3 additions & 3 deletions lib/public/views/QcFlags/GaqFlags/GaqFlagsOverviewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -191,8 +191,8 @@ export class GaqFlagsOverviewModel extends OverviewPageModel {
}

/**
* Get list of DPL detectors which flags contributes to GAQ
* @return {RemoteData<DplDetector[]>} dpl detectors remote data
* Get list of detectors which flags contributes to GAQ
* @return {RemoteData<Detector[]>} detectors remote data
*/
get gaqDetectors() {
return this._gaqDetectors$.getCurrent();
Expand Down
Loading