Skip to content

Commit

Permalink
Main into this branch (contains subtask 2) (#1314)
Browse files Browse the repository at this point in the history
* Release 0.75.0 (#1305)

* [O2B-1092] add migration file (#1313)

* add migration file

* add model, fix outputsize type

* add typedef

* rename

* [O2B-883]: Add bold continuous/dashed line for detector quality in overview (#1293)

* Overview of runs now show quality by using a line under them in green(continous) /red(dotted)

* [O2B-1096] Fix run-overview to run-details navigation link (#1311)

* fix issue in which all run parameters were passed to the URL when navigating from run-overview to run-details

* [O2B-1097] Display environments IDs in white in envs-overview page (#1312)

* [O2B-1095] Fix log's attachment token passed parameter (#1306)

* Bump umzug from 3.4.0 to 3.5.0 (#1309)

Bumps [umzug](https://github.com/sequelize/umzug) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/sequelize/umzug/releases)
- [Changelog](https://github.com/sequelize/umzug/blob/main/CHANGELOG.md)
- [Commits](sequelize/umzug@v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: umzug
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump the dev-dependencies group with 2 updates (#1310)

Bumps the dev-dependencies group with 2 updates: [eslint](https://github.com/eslint/eslint) and [puppeteer](https://github.com/puppeteer/puppeteer).


Updates `eslint` from 8.55.0 to 8.56.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.55.0...v8.56.0)

Updates `puppeteer` from 21.5.2 to 21.6.1
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](puppeteer/puppeteer@puppeteer-v21.5.2...puppeteer-v21.6.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
- dependency-name: puppeteer
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: George Raduta <[email protected]>

* [O2B-926] Added switch button to overview for PHYSICS filter (#1303)

Co-authored-by: Menno Konijn <[email protected]>
Co-authored-by: George Raduta <[email protected]>

* [O2B-1085] update proto files and grpc run controller with new user struct (#1304)

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Martin Boulais <[email protected]>
Co-authored-by: xsalonx <[email protected]>
Co-authored-by: mennokonijn <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: George Raduta <[email protected]>
Co-authored-by: Menno Konijn <[email protected]>
  • Loading branch information
7 people authored Dec 22, 2023
1 parent c6efae4 commit b4a63a9
Show file tree
Hide file tree
Showing 21 changed files with 337 additions and 102 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.75.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%400.75.0)
* Notable changes for users:
* Added run per Period view
* The run number filter has been put back in place after being accidentally removed
* Fixed error displayed when deleting environment filter on logs overview
* A margin has been added between the popover and the screen edges
* Missing dates on the LHC overview pages are now shown to the user as '-' instead of 01/01/1970 01:00:00
* The LHC Periods page filter button is now styled in the same way as other pages
* Clicking in popover keep the scroll in place
* Notable change for developers:
* Refactored LogsModel, extracted overview to separate class
* Created separate model for Home page
* Reduce number of request of RunsOverviewModel
* Added getOrCreate function to UserService replacing the CreateOrUpdateUser use case and cleaned the user authentication code

## [0.74.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%400.74.0)

* Notable changes for users:
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Use the npm script (the `docker-compose` command must be available to npm)
npm run docker-run
```

You will then see in this tabs the server's log
You will then see in these tabs the server's log

### Run seeders

Expand Down
52 changes: 52 additions & 0 deletions lib/database/migrations/20231211080706-create-data-passes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
up: async (queryInterface, Sequelize) => queryInterface.sequelize.transaction(async (transaction) => {
await queryInterface.createTable('data_passes', {
id: {
type: Sequelize.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
description: {
type: Sequelize.TEXT,
},
output_size: {
type: Sequelize.BIGINT,
},
reconstructed_events_count: {
type: Sequelize.INTEGER,
},
last_run_number: {
type: Sequelize.INTEGER,
},
lhc_period_id: {
type: Sequelize.INTEGER,
references: {
model: 'lhc_periods',
key: 'id',
},
},
created_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
updated_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
},
}, { transaction });
}),

down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
await queryInterface.dropTable('data_passes', { transaction });
}),
};
51 changes: 51 additions & 0 deletions lib/database/models/dataPass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* 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 Sequelize = require('sequelize');

module.exports = (sequelize) => {
const DataPass = sequelize.define(
'DataPass',
{
id: {
type: Sequelize.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
name: {
type: Sequelize.STRING,
allowNull: false,
},
description: {
type: Sequelize.TEXT,
},
outputSize: {
type: Sequelize.BIGINT,
},
reconstructedEventsCount: {
type: Sequelize.INTEGER,
},
lastRunNumber: {
type: Sequelize.INTEGER,
},
},
{ tableName: 'data_passes' },
);

DataPass.associate = (models) => {
DataPass.belongsTo(models.LhcPeriod, { foreignKey: 'lhcPeriodId', as: 'lhcPeriod' });
};

return DataPass;
};
2 changes: 2 additions & 0 deletions lib/database/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const Tag = require('./tag');
const User = require('./user');
const LhcPeriod = require('./lhcPeriod');
const LhcPeriodStatistics = require('./lhcPeriodsStatistics');
const DataPass = require('./dataPass.js');

module.exports = (sequelize) => {
const models = {
Expand Down Expand Up @@ -64,6 +65,7 @@ module.exports = (sequelize) => {
User: User(sequelize),
LhcPeriod: LhcPeriod(sequelize),
LhcPeriodStatistics: LhcPeriodStatistics(sequelize),
DataPass: DataPass(sequelize),
};

Object.entries(models).forEach(([_key, model]) => {
Expand Down
1 change: 1 addition & 0 deletions lib/database/models/lhcPeriod.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = (sequelize) => {

LhcPeriod.associate = (models) => {
LhcPeriod.hasMany(models.Run, { foreignKey: 'lhcPeriodId', as: 'runs' });
LhcPeriod.hasOne(models.DataPass);
};

return LhcPeriod;
Expand Down
23 changes: 23 additions & 0 deletions lib/database/models/typedefs/SequelizeDataPass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* 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.
*/

/**
* @typedef SequelizeDataPass
*
* @property {number} id
* @property {string} name
* @property {string} description
* @property {number} outputSize
* @property {number} reconstructedEventsCount
* @property {number} lastRunNumber
*/
3 changes: 3 additions & 0 deletions lib/public/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ html, body {
.b-success { border-color: var(--color-success); }
.b-primary { border-color: var(--color-primary); }

.b-underline-good { border-bottom: 4px solid var(--color-success); }
.b-underline-bad { border-bottom: 4px dashed var(--color-danger); }

.overflow {
height: 1.5rem;
overflow: hidden;
Expand Down
3 changes: 1 addition & 2 deletions lib/public/components/Filters/RunsFilter/definitionFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
*/

import { checkboxFilter } from '../common/filters/checkboxFilter.js';

const RUN_DEFINITIONS = ['PHYSICS', 'COSMICS', 'TECHNICAL', 'SYNTHETIC', 'CALIBRATION', 'COMMISSIONING'];
import { RUN_DEFINITIONS } from '../../../domain/enums/RunDefinition.js';

/**
* Returns the definition filter component
Expand Down
2 changes: 1 addition & 1 deletion lib/public/components/Filters/RunsFilter/runNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { h } from '/js/src/index.js';
* @param {RunsOverviewModel} runsOverviewModel the runs overview model
* @return {vnode} A text box that lets the user look for logs with a specific author
*/
const runNumberFilter = (runsOverviewModel) => h('input.w-75', {
const runNumberFilter = (runsOverviewModel) => h('input', {
type: 'text',
id: 'runNumber',
value: runsOverviewModel.getRunNumberFilter(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const identifierColumnAndActionsDropdown = (page, linkContent, parameters
h(
'.flex-row.items-center.btn-group',
[
frontLink(linkContent, page, parameters, { class: 'btn btn-primary' }),
frontLink(linkContent, page, parameters, { class: 'btn btn-primary white' }),
dropdown(
h('.btn.btn-group-item.last-item', iconCaretBottom()),
h(
Expand Down
2 changes: 2 additions & 0 deletions lib/public/domain/enums/RunDefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ export const RunDefinition = {
Calibration: 'CALIBRATION',
Commissioning: 'COMMISSIONING',
};

export const RUN_DEFINITIONS = Object.values(RunDefinition);
2 changes: 1 addition & 1 deletion lib/public/views/Logs/Details/logTreeViewComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const logTreeViewComponent = (treeViewModel, authenticationToken) => {
isCollapsed,
() => treeViewModel.collapseLog(log.id),
() => treeViewModel.expandLog(log.id),
authenticationToken,
{ authenticationToken },
),
);

Expand Down
12 changes: 4 additions & 8 deletions lib/public/views/Runs/ActiveColumns/runsActiveColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { RunDefinition } from '../../../domain/enums/RunDefinition.js';
import { coloredCalibrationStatusComponent } from '../coloredCalibrationStatusComponent.js';
import { infoLoggerButtonGroup } from '../../../components/common/selection/infoLoggerButtonGroup/infoLoggerButtonGroup.js';
import { BeamModes } from '../../../domain/enums/BeamModes.js';
import { formatRunDetectorsInline } from '../format/formatRunDetectorsInline.js';
import { formatAliceCurrent } from '../format/formatAliceCurrent.js';

/**
Expand All @@ -63,7 +64,7 @@ export const runsActiveColumns = {
visible: true,
classes: 'w-10 f6 w-wrapped',
filter: runNumberFilter,
format: (_, run) => infoLoggerButtonGroup(run),
format: (runNumber) => infoLoggerButtonGroup({ runNumber }),
profiles: {
lhcFill: true,
environment: true,
Expand All @@ -81,13 +82,8 @@ export const runsActiveColumns = {
name: 'Detectors',
visible: true,
profiles: [profiles.none, 'lhcFill'],
classes: 'w-15 f6',
format: (detectors, run) => {
if (detectors && detectors.length > 0) {
return [h('.badge.bg-gray-light.mh2.nDetectors-badge', run.nDetectors), `${detectors.toString()}`];
}
return '-';
},
size: 'w-15 f6',
format: (_, run) => formatRunDetectorsInline(run.detectorsQualities, run.nDetectors),
filter: detectorsFilterComponent,
balloon: true,
},
Expand Down
14 changes: 8 additions & 6 deletions lib/public/views/Runs/Overview/RunsOverviewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
*/

import { h } from '/js/src/index.js';
import { table } from '../../../components/common/table/table.js';
import { runsActiveColumns } from '../ActiveColumns/runsActiveColumns.js';
import { exportRunsTriggerAndModal } from './exportRunsTriggerAndModal.js';
import { estimateDisplayableRowsCount } from '../../../utilities/estimateDisplayableRowsCount.js';
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
import { exportRunsTriggerAndModal } from './exportRunsTriggerAndModal.js';
import { filtersPanelPopover } from '../../../components/Filters/common/filtersPanelPopover.js';
import { paginationComponent } from '../../../components/Pagination/paginationComponent.js';
import { runsActiveColumns } from '../ActiveColumns/runsActiveColumns.js';
import { showPhysicsButton } from './showPhysicsButton.js';
import { table } from '../../../components/common/table/table.js';
import runNumberFilter from '../../../components/Filters/RunsFilter/runNumber.js';

const TABLEROW_HEIGHT = 59;
Expand All @@ -36,9 +37,10 @@ export const RunsOverviewPage = ({ runs: { overviewModel: runsOverviewModel }, m
));

return h('', [
h('.flex-row.header-container.pv2', [
h('.flex-row.header-container.g2.pv2', [
filtersPanelPopover(runsOverviewModel, runsActiveColumns),
h('.pl2.w-20#runOverviewFilter', runNumberFilter(runsOverviewModel)),
h('.pl2#runOverviewFilter', runNumberFilter(runsOverviewModel)),
showPhysicsButton(runsOverviewModel),
exportRunsTriggerAndModal(runsOverviewModel, modalModel),
]),
h('.flex-column.w-100', [
Expand Down
29 changes: 29 additions & 0 deletions lib/public/views/Runs/Overview/showPhysicsButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* 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 { RunDefinition } from '../../../domain/enums/RunDefinition.js';
import { switchInput } from '../../../components/common/form/switchInput.js';

/**
* Builds a button which will toggle the physics filter
* @param {OverviewModel} runsOverviewModel the model of the runs overview
* @returns {vnode} with button
*/
export const showPhysicsButton = (runsOverviewModel) => {
const isPhysicsActive = runsOverviewModel.isDefinitionInFilter(RunDefinition.Physics);
const onChange = isPhysicsActive ?
() => runsOverviewModel.removeDefinitionFilter(RunDefinition.Physics)
:
() => runsOverviewModel.addDefinitionFilter(RunDefinition.Physics);
return switchInput(isPhysicsActive, onChange, { labelAfter: 'PHYSICS' });
};
48 changes: 48 additions & 0 deletions lib/public/views/Runs/format/formatRunDetectorsInline.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* 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';
import { RunDetectorQualities } from '../../../domain/enums/RunDetectorQualities.js';

/**
* Format a list of detectors inline and underline them based on their quality
*
* @param {RunDetectorQuality[]} detectorsQualities The run detector quality per detector
* @param {number} nDetectors The number of run detectors
* @return {Component} the formatted run detectors inline
*/
export const formatRunDetectorsInline = (detectorsQualities, nDetectors) => {
if (detectorsQualities?.length <= 0) {
return '-';
}

return [
h('.badge.bg-gray-light.mh2.nDetectors-badge', nDetectors),
detectorsQualities.flatMap((detector, index) => {
const detectorClass = detectorStyleClass(detector);

return [
h(`span.${detectorClass}`, detector.name),
h('span', index < detectorsQualities.length - 1 ? ',' : ''),
];
}),
];
};

/**
* Gets the class for the style of the detector
*
* @param {RunDetectorQuality} detectorsQuality The detector with its quality
* @return {string} The class of the detecor
*/
const detectorStyleClass = (detectorsQuality) => detectorsQuality.quality === RunDetectorQualities.GOOD ? 'b-underline-good' : 'b-underline-bad';
Loading

0 comments on commit b4a63a9

Please sign in to comment.