diff --git a/QualityControl/lib/dtos/ObjectGetDto.js b/QualityControl/lib/dtos/ObjectGetDto.js index 1aee13e5f..43c93b88f 100644 --- a/QualityControl/lib/dtos/ObjectGetDto.js +++ b/QualityControl/lib/dtos/ObjectGetDto.js @@ -14,6 +14,7 @@ import Joi from 'joi'; import { RunNumberDto } from './filters/RunNumberDto.js'; +import { QcDetectorNameDto } from './filters/QcDetectorNameDto.js'; const periodNamePattern = /^LHC\d{1,2}[a-z0-9]+$/i; @@ -25,6 +26,7 @@ const periodNamePattern = /^LHC\d{1,2}[a-z0-9]+$/i; function createFiltersSchema(runTypes) { return Joi.object({ RunNumber: RunNumberDto.optional(), + QcDetectorName: QcDetectorNameDto.optional(), RunType: runTypes.length > 0 ? Joi.string().valid(...runTypes).optional() : Joi.string().optional(), diff --git a/QualityControl/lib/dtos/filters/QcDetectorNameDto.js b/QualityControl/lib/dtos/filters/QcDetectorNameDto.js new file mode 100644 index 000000000..a067d8e54 --- /dev/null +++ b/QualityControl/lib/dtos/filters/QcDetectorNameDto.js @@ -0,0 +1,22 @@ +/** + * @license + * Copyright 2019-2020 CERN and copyright holders of ALICE O2. + * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. + * All rights not expressly granted are reserved. + * + * This software is distributed under the terms of the GNU General Public + * License v3 (GPL Version 3), copied verbatim in the file "COPYING". + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + +import Joi from 'joi'; + +export const QcDetectorNameDto = Joi.string() + .min(1) + .messages({ + 'number.base': 'Detector name must be a string', + 'number.min': 'Detector name must not be an empty string', + }); diff --git a/QualityControl/public/common/filters/filter.js b/QualityControl/public/common/filters/filter.js index 6d658d9e2..4fec31dfa 100644 --- a/QualityControl/public/common/filters/filter.js +++ b/QualityControl/public/common/filters/filter.js @@ -61,6 +61,81 @@ export const dynamicSelector = (config) => { }); }; +/** + * Represents options grouped for HTML . + * Keys are group labels (for the label), + * values are arrays of option values (for