Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Merged
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
16 changes: 2 additions & 14 deletions app/config/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
* or submit itself to any jurisdiction.
*/

const { roles, flags: flagsTypes, detectors, pageNames, filterTypes, filterInputTypes, fieldNames } = require('./rct-data');
const { roles, detectors, pageNames, filterTypes, filterInputTypes, fieldNames, quality } = require('./rct-data');

module.exports = { // Properties that will be provided to frontend in the public folder
filterTypes: filterTypes,
filterInputTypes: filterInputTypes,

roles,
flagsTypes,
quality,
endpoints: {
login: '/login/',
logout: '/logout/',
Expand Down Expand Up @@ -58,21 +58,9 @@ module.exports = { // Properties that will be provided to frontend in the public
pageNames: pageNames,
fieldNames: fieldNames,

operationsNames: {
flag_insert: 'flags_insert',
flag_delete: 'flag_delete',
flag_update: 'flag_update',
verification_insert: 'verification_insert',
},

detectors: detectors,
themes: {
ehevi: 'ehevi',
webui: 'webui',
},
flagReasonColors: {
neutral: '277DA1',
bad: '922C40',
limitedAcceptance: 'DC9750',
},
};
2 changes: 1 addition & 1 deletion app/config/rct-data/healthcheckQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

const detectors = require('./detectors.js').sort();
const flags = require('./flags.json');
const flags = require('./quality/flags.json');
const physicalParticlesData = require('./physicalParticlesData.js');

const checkStaticData = {
Expand Down
4 changes: 2 additions & 2 deletions app/config/rct-data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const { viewTypes, pagesViewGroups } = require('./viewTypes.js');
const fieldNames = require('./fieldNames.js');
const { filterTypes, filterInputTypes } = require('./filterTypes.js');
const detectors = require('./detectors.js').sort();
const flags = require('./flags.json');
const roles = require('./roles.js');
const physicalParticlesData = require('./physicalParticlesData.js');
const beamTypesMappings = require('./beamTypesMappings.js');
const healthcheckQueries = require('./healthcheckQueries.js');
const quality = require('./quality');

module.exports = {
pageNames,
Expand All @@ -32,7 +32,7 @@ module.exports = {
filterInputTypes,
detectors,
roles,
flags,
quality,
physicalParticlesData,
beamTypesMappings,
...healthcheckQueries,
Expand Down
21 changes: 21 additions & 0 deletions app/config/rct-data/quality/flagReasonColors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @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.
*/

const flagReasonColors = {
neutral: '277DA1',
bad: '922C40',
limitedAcceptance: 'DC9750',
};

module.exports = flagReasonColors;
23 changes: 23 additions & 0 deletions app/config/rct-data/quality/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @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.
*/

const flags = require('./flags.json');
const runBasedQuality = require('./quality.js');
const flagReasonColors = require('./flagReasonColors.js');

module.exports = {
runBasedQuality: runBasedQuality,
flags: flags,
flagReasonColors: flagReasonColors,
};
20 changes: 20 additions & 0 deletions app/config/rct-data/quality/quality.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @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.
*/

const runBasedQuality = {
good: 'good',
bad: 'bad',
};

module.exports = runBasedQuality;
47 changes: 0 additions & 47 deletions app/public/components/chips/actionChip.js

This file was deleted.

22 changes: 22 additions & 0 deletions app/public/components/chips/linkChip.js
Original file line number Diff line number Diff line change
@@ -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 { h } from '/js/src/index.js';

export default function linkChip(navigation, label, href) {
return h('a.btn.chip.m1.no-text-decoration', {
onclick: (e) => navigation.handleLinkEvent(e),
href: href,
}, label);
}
50 changes: 29 additions & 21 deletions app/public/components/detectors/detectorIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,35 @@
* or submit itself to any jurisdiction.
*/

import qcTypeSelection from '../../views/runs/runsPerDataPass/overview/qcTypeSelection.js';
import { h } from '/js/src/index.js';
import { RCT } from '../../config.js';
const { runBasedQuality } = RCT.quality;

export default function detectorIcon(model, item, n, index, detectorName) {
const flagsUrl = `/?page=flags&data_pass_name=${index}&run_numbers=${item.run_number}&detector=${detectorName}&rows-on-site=50&site=1`;

return h('button.btn.transparent.tooltip.no-border-bottom.pointer', {
onclick: () => {
model.router.go(flagsUrl);
} },
h('svg', { width: '20px', height: '20px' },
h('circle',
{
cx: '50%',
cy: '50%',
r: '8px', //

/*
*Stroke: '#F7B538', strokes for the limited acceptance flags only
*'stroke-width': '3',
*/
fill: '#8CB369',
})),
h('span.detector-tooltip-field', `run_det_id: ${item[n]}`));
export default function detectorIcon(navigation, item, index, detectorName, timeBased = false) {
const runDetectorId = `${index}-${item.run_number}-${detectorName}`;
const runBasedQcModalId = `${runDetectorId}-qc-modal`;
return [
h('.modal', { id: runBasedQcModalId },
h('.modal-content.abs-center.p3', {
id: `${runBasedQcModalId}-content`,
}, qcTypeSelection(navigation, () => {
document.getElementById(runBasedQcModalId).style.display = 'none';
}, item, index, detectorName, runDetectorId, timeBased))),
h('button.btn.no-border-bottom.pointer.run-quality.good', {
id: runDetectorId,
onclick: () => {
document.getElementById(runBasedQcModalId).style.display = 'block';
document.addEventListener('click', (event) => {
const modalContent = document.getElementsByClassName('modal-content');
const modal = document.getElementsByClassName('modal');
if (Array.from(modalContent).find((e) => e != event.target)
&& Array.from(modal).find((e) => e == event.target)
&& document.getElementById(runBasedQcModalId)) {
document.getElementById(runBasedQcModalId).style.display = 'none';
}
});
} },
runBasedQuality.good),
];
}
2 changes: 1 addition & 1 deletion app/public/components/flags/flagsVisualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { h } from '/js/src/index.js';
import flagVisualization from './flagVisualization.js';
import { RCT } from '../../../../config.js';
const { flagReasonColors } = RCT;
const { flagReasonColors } = RCT.quality;

function filterDistinct(a) {
return a.filter((value, index, array) => array.indexOf(value) === index);
Expand Down
10 changes: 6 additions & 4 deletions app/public/components/sidebar/sidebarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@
*/

import { h } from '/js/src/index.js';
import subPagesCount from './subPagesCount.js';

export default function sidebarItem(model, pageName, label) {
const subPagesCount = model.getSubPagesCount(pageName);
const displayedSubPagesCount = subPagesCount > 0 ? ` (${subPagesCount})` : '';

return h('.flex-wrap', [
h('.page-title', {
class: model.router.params.page === pageName ? 'selected' : '',
onclick: () => model.goToDefaultPageUrl(pageName),
onclick: () => model.navigation.goToDefaultPageUrl(pageName),
},
model.router.params.page === pageName
? h('div',
h('.vertical-center',
h('.current-page',
h('.title-text-relative.hidden', label))),
h('.folder-20.vertical-center'),
h('.title-text.vertical-center', label, subPagesCount(model, pageName)))
h('.title-text.vertical-center', label, displayedSubPagesCount))
: h('div',
h('.folder-20.vertical-center'),
h('.title-text.vertical-center', label, subPagesCount(model, pageName)))),
h('.title-text.vertical-center', label, displayedSubPagesCount))),
]);
}
Loading