Skip to content

Commit 0f8eed4

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/eslint-plugin-jsdoc-54.1.0
2 parents 3c1e415 + 0ce697b commit 0f8eed4

48 files changed

Lines changed: 871 additions & 425 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
'use strict';
15+
16+
const { Sequelize } = require('sequelize');
17+
const { DETECTOR_TYPES, DetectorType } = require('../../../domain/enums/DetectorTypes.js');
18+
19+
/** @type {import('sequelize-cli').Migration} */
20+
module.exports = {
21+
up: async (queryInterface) => queryInterface.sequelize.transaction(async () => {
22+
await queryInterface.changeColumn(
23+
'detectors',
24+
'type',
25+
{ type: Sequelize.ENUM(...DETECTOR_TYPES), allowNull: false },
26+
);
27+
}),
28+
29+
down: async (queryInterface) => queryInterface.sequelize.transaction(async () => {
30+
await queryInterface.changeColumn(
31+
'detectors',
32+
'type',
33+
{
34+
type: Sequelize.ENUM([
35+
DetectorType.PHYSICAL,
36+
DetectorType.QC_ONLY,
37+
DetectorType.VIRTUAL,
38+
DetectorType.OTHER,
39+
]),
40+
allowNull: false,
41+
},
42+
);
43+
}),
44+
};

lib/database/seeders/20200713103855-runs.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,50 @@ module.exports = {
27772777
updated_at: '2019-08-09 14:00:00',
27782778
created_at: '2019-08-09 14:00:00',
27792779
},
2780+
2781+
{
2782+
id: 109,
2783+
run_number: 109,
2784+
time_o2_start: '2020-08-08 13:00:00',
2785+
first_tf_timestamp: '2020-08-08 13:00:00',
2786+
time_trg_start: '2020-08-08 13:00:00',
2787+
time_trg_end: '2020-08-09 14:00:00',
2788+
time_o2_end: '2020-08-09 14:00:00',
2789+
run_type_id: 12,
2790+
run_quality: 'good',
2791+
n_detectors: 15,
2792+
n_flps: 12,
2793+
n_epns: 12,
2794+
n_subtimeframes: 12,
2795+
bytes_read_out: 64,
2796+
dd_flp: true,
2797+
dcs: false,
2798+
epn: true,
2799+
fill_number: null,
2800+
epn_topology: 'quite a long topology, which will for sure require a balloon to be displayed properly',
2801+
concatenated_detectors: 'CPV',
2802+
lhc_period_id: 3,
2803+
lhc_beam_mode: 'STABLE BEAMS',
2804+
odc_topology_full_name: 'hash',
2805+
pdp_workflow_parameters: 'QC,GPU,CTF,EVENT_DISPLAY',
2806+
pdp_beam_type: 'OO',
2807+
readout_cfg_uri: 'Repository hash',
2808+
start_of_data_transfer: '2022-03-21 13:00:00',
2809+
end_of_data_transfer: '2022-03-21 13:30:00',
2810+
ctf_file_count: 500,
2811+
ctf_file_size: '214920239535280',
2812+
tf_file_count: 30,
2813+
tf_file_size: '214920239535280',
2814+
other_file_count: 50,
2815+
other_file_size: '214920239535280',
2816+
definition: RunDefinition.PHYSICS,
2817+
trigger_efficiency: 1,
2818+
trigger_acceptance: 0.7569974555,
2819+
cross_section: 78600,
2820+
2821+
updated_at: '2020-08-09 14:00:00',
2822+
created_at: '2020-08-09 14:00:00',
2823+
},
27802824
], { transaction }),
27812825
])),
27822826

lib/database/seeders/20221005120315-detector.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,23 @@ module.exports = {
123123
name: 'GLO',
124124
type: DetectorType.QC_ONLY,
125125
},
126+
127+
{
128+
id: 22,
129+
name: 'VTX',
130+
type: DetectorType.AOT_GLO,
131+
},
132+
{
133+
id: 23,
134+
name: 'EVS',
135+
type: DetectorType.AOT_EVENT,
136+
},
137+
{
138+
id: 24,
139+
name: 'MUD',
140+
type: DetectorType.MUON_GLO,
141+
},
142+
126143
], { transaction });
127144
}),
128145
down: async (queryInterface) =>

lib/database/seeders/20221006084006-run-detectors.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,12 @@ module.exports = {
699699
detector_id: 16,
700700
quality: 'good',
701701
},
702+
703+
{
704+
run_number: 109,
705+
detector_id: 1,
706+
quality: 'good',
707+
},
702708
],
703709
{ transaction },
704710
),

lib/database/seeders/20240112102011-data-passes.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ module.exports = {
7777
created_at: '2024-02-11 10:00:00',
7878
updated_at: '2024-02-11 10:00:00',
7979
},
80+
81+
/** LHC23f */
82+
{
83+
id: 9,
84+
name: 'LHC23f_cpass0',
85+
lhc_period_id: 3,
86+
created_at: '2024-02-11 10:00:00',
87+
updated_at: '2024-02-11 10:00:00',
88+
},
8089
], { transaction });
8190

8291
await queryInterface.bulkInsert('data_pass_versions', [
@@ -144,7 +153,15 @@ module.exports = {
144153
updated_at: '2024-02-15 12:00:00',
145154
},
146155

147-
], { transaction }),
156+
{
157+
id: 9,
158+
description: 'cpass0',
159+
data_pass_id: 9,
160+
created_at: '2024-02-15 12:00:00',
161+
updated_at: '2024-02-15 12:00:00',
162+
},
163+
164+
], { transaction });
148165

149166
await queryInterface.bulkInsert('data_pass_version_status_history', [
150167

@@ -248,7 +265,15 @@ module.exports = {
248265
created_at: '2024-02-15 12:30:00',
249266
updated_at: '2024-02-15 12:30:00',
250267
},
251-
], { transaction }),
268+
269+
{
270+
id: 14,
271+
data_pass_version_id: 9,
272+
status: DataPassVersionStatus.RUNNING,
273+
created_at: '2024-02-15 12:00:00',
274+
updated_at: '2024-02-15 12:00:00',
275+
},
276+
], { transaction });
252277

253278
await queryInterface.bulkInsert('data_passes_runs', [
254279
{ data_pass_id: 1, run_number: 106, ready_for_skimming: true },
@@ -274,6 +299,9 @@ module.exports = {
274299
{ data_pass_id: 5, run_number: 54 },
275300
{ data_pass_id: 5, run_number: 56 },
276301
{ data_pass_id: 5, run_number: 105 },
302+
303+
{ data_pass_id: 9, run_number: 109 },
304+
277305
], { transaction });
278306
}),
279307

lib/domain/enums/DetectorTypes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
const DetectorType = Object.freeze({
1515
PHYSICAL: 'PHYSICAL',
1616
QC_ONLY: 'QC',
17+
AOT_GLO: 'AOT-GLO',
18+
AOT_EVENT: 'AOT-EVENT',
19+
MUON_GLO: 'MUON-GLO',
1720
VIRTUAL: 'VIRTUAL',
1821
OTHER: 'OTHER',
1922
});
@@ -25,8 +28,11 @@ const DETECTOR_TYPES = Object.values(DetectorType);
2528
*/
2629
const DATA_TAKING_DETECTOR_TYPES = [DetectorType.PHYSICAL, DetectorType.VIRTUAL];
2730

31+
const QC_DETECTOR_TYPES = [DetectorType.PHYSICAL, DetectorType.QC_ONLY, DetectorType.AOT_EVENT, DetectorType.AOT_GLO, DetectorType.MUON_GLO];
32+
2833
module.exports = {
2934
DetectorType,
3035
DETECTOR_TYPES,
3136
DATA_TAKING_DETECTOR_TYPES,
37+
QC_DETECTOR_TYPES,
3238
};

lib/public/components/Filters/common/FilteringModel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ export class FilteringModel extends Observable {
108108
/**
109109
* Add new filter
110110
*
111+
* NOTE that the method has no effect if called more than once for the same key
112+
*
111113
* @param {string} key key of a new filter
112114
* @param {FilterModel} filter the new filter
113115
*/
114116
put(key, filter) {
115117
if (key in this._filters) {
116-
throw new Error(`Filter under key ${key} already exists`);
118+
return;
117119
}
118120

119121
this._filters[key] = filter;
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/**
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
import { DATA_EXPORT_TYPES } from '../../../domain/enums/DataExportTypes.js';
15+
import errorAlert from '../errorAlert.js';
16+
import spinner from '../spinner.js';
17+
import { h } from '/js/src/index.js';
18+
19+
/**
20+
* Export form component, containing the fields to export, the export type and the export button
21+
*
22+
* @param {DataExportModel} exportModel export model
23+
* @param {ModalHandler} modalHandler The modal handler, used to dismiss modal after export
24+
*
25+
* @return {Component} the form component
26+
*/
27+
const exportForm = (exportModel, modalHandler) => {
28+
const { selectedFields, selectedExportType, dataExportConfiguration } = exportModel;
29+
const fields = Object.keys(dataExportConfiguration);
30+
31+
const fieldsSelected = selectedFields.length > 0;
32+
33+
const fieldsSelectionLabels = [
34+
h('label.form-check-label.f4.mt1', { for: 'fields' }, 'Fields'),
35+
h(
36+
'label.form-check-label.f6',
37+
{ for: 'fields' },
38+
'Select which fields to be exported. (CTRL + click for multiple selection)',
39+
),
40+
];
41+
42+
const fieldsSelection = h('select#fields.form-control', {
43+
style: 'min-height: 20rem;',
44+
multiple: true,
45+
onchange: ({ target }) => exportModel.setSelectedFields(target.selectedOptions),
46+
}, [
47+
...fields
48+
.filter((name) => !['id', 'actions'].includes(name))
49+
.map((name) => h('option', {
50+
value: name,
51+
selected: selectedFields.length ? selectedFields.includes(name) : false,
52+
}, name)),
53+
]);
54+
55+
const exportTypeSelectionLabels = [
56+
h('label.form-check-label.f4.mt1', 'Export type'),
57+
h('label.form-check-label.f6', 'Select output format'),
58+
];
59+
60+
const exportTypeSelect = h('.flex-row.g3', DATA_EXPORT_TYPES.map((exportType) => {
61+
const id = `data-export-type-${exportType}`;
62+
return h('.form-check', [
63+
h('input.form-check-input', {
64+
id,
65+
type: 'radio',
66+
value: exportType,
67+
checked: selectedExportType.length ? selectedExportType.includes(exportType) : false,
68+
name: 'export-type',
69+
onclick: () => exportModel.setSelectedExportType(exportType),
70+
}),
71+
h('label.form-check-label', {
72+
for: id,
73+
}, exportType),
74+
]);
75+
}));
76+
77+
const exportBtn = h('button.shadow-level1.btn.btn-success.mt2#send', {
78+
disabled: !fieldsSelected,
79+
onclick: async () => {
80+
await exportModel.createExport();
81+
modalHandler.dismiss();
82+
},
83+
}, 'Export');
84+
85+
const dataLength = exportModel.items.match({ Success: ({ length } = {}) => length, Other: () => null });
86+
const { totalExistingItemsCount } = exportModel;
87+
88+
const truncatedDataInfo = dataLength && dataLength < totalExistingItemsCount
89+
? h(
90+
'#truncated-export-warning.warning',
91+
`The data export is limited to ${dataLength} entries, only the most recent data will be exported`,
92+
)
93+
: null;
94+
95+
return [
96+
truncatedDataInfo,
97+
fieldsSelectionLabels,
98+
fieldsSelection,
99+
exportTypeSelectionLabels,
100+
exportTypeSelect,
101+
exportBtn,
102+
];
103+
};
104+
105+
/**
106+
* A function to construct the exports data screen
107+
*
108+
* @param {DataExportModel} exportModel export model
109+
* @param {ModalHandler} modalHandler The modal handler, used to dismiss modal after export
110+
* @return {Component} Return the view of the inputs
111+
*/
112+
const exportModal = (exportModel, modalHandler) => {
113+
exportModel.callForData();
114+
115+
return h('div#export-data-modal', [
116+
h('h2.w-50', 'Export data'),
117+
exportModel.items.match({
118+
NotAsked: () => errorAlert(),
119+
Failure: (errors) => errorAlert(errors),
120+
Loading: () => spinner({ size: 2, absolute: false }),
121+
Other: () => exportForm(exportModel, modalHandler),
122+
}),
123+
]);
124+
};
125+
126+
/**
127+
* Builds a button which will open popover for data export
128+
*
129+
* @param {DataExportModel} exportModel export model
130+
* @param {ModalModel} modalModel modal model
131+
* @param {object} [displayConfiguration] additional display options
132+
* @param {boolean} [displayConfiguration.autoMarginLeft = true] if true margin left is set to auto, otherwise not
133+
* @returns {Component} button
134+
*/
135+
export const exportTriggerAndModal = (exportModel, modalModel, { autoMarginLeft = true } = {}) =>
136+
h(`button.btn.btn-primary${autoMarginLeft ? '.mlauto' : ''}#export-data-trigger`, {
137+
disabled: exportModel.disabled,
138+
onclick: () => modalModel.display({ content: (modalModel) => exportModal(exportModel, modalModel), size: 'medium' }),
139+
}, 'Export data');
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2019-2020 CERN and copyright holders of ALICE O2.
4+
* See http://alice-o2.web.cern.ch/copyright for details of the copyright holders.
5+
* All rights not expressly granted are reserved.
6+
*
7+
* This software is distributed under the terms of the GNU General Public
8+
* License v3 (GPL Version 3), copied verbatim in the file "COPYING".
9+
*
10+
* In applying this license CERN does not waive the privileges and immunities
11+
* granted to it by virtue of its status as an Intergovernmental Organization
12+
* or submit itself to any jurisdiction.
13+
*/
14+
15+
export const DataExportTypes = Object.freeze({
16+
JSON: 'JSON',
17+
CSV: 'CSV',
18+
});
19+
20+
export const DATA_EXPORT_TYPES = Object.values(DataExportTypes);

0 commit comments

Comments
 (0)