Skip to content

Commit ea82633

Browse files
[O2B-1140] Create RC daily meeting template (#1463)
* [O2B-1140] Create RC daily meeting template * Remove default log template * Add global run quality and make logs editable * Remove dead code and fix mithril bug not applying classes * Fix linter again * Simplify
1 parent 76225f1 commit ea82633

21 files changed

Lines changed: 788 additions & 46 deletions

File tree

lib/domain/dtos/GetAllLogsDto.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const FilterDto = Joi.object({
4141
.valid('human', 'process'),
4242
parentLog: EntityIdDto,
4343
rootLog: EntityIdDto,
44+
rootOnly: Joi.boolean(),
4445
environments: EnvironmentsFilterDto,
4546
});
4647

lib/domain/entities/LhcFill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
* @property {number|null} stableBeamsDuration
2121
* @property {string|null} beamType
2222
* @property {string|null} fillingSchemeName
23-
* @property {LhcFillStatistics} statistics
23+
* @property {LhcFillStatistics|null} statistics
2424
* @property {Run[]} runs
2525
*/

lib/public/app.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ html, body {
124124
.justify-end { justify-content: end; }
125125

126126
.flex-grow.grow2 { flex-grow: 2; }
127+
.flex-ratio-6 {flex: 6 0;}
128+
.flex-ratio-4 {flex: 4 0;}
127129

128130
.flex-shrink-0 { flex-shrink: 0; }
129131

lib/public/components/common/badge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* @license
33
* Copyright CERN and copyright holders of ALICE O2. This software is
44
* distributed under the terms of the GNU General Public License v3 (GPL

lib/public/components/common/chart/rendering/BarChartRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* @license
33
* Copyright CERN and copyright holders of ALICE O2. This software is
44
* distributed under the terms of the GNU General Public License v3 (GPL

lib/public/components/common/panel/PanelComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { h } from '/js/src/index.js';
1818
*/
1919
export const PanelComponent = {
2020
// eslint-disable-next-line require-jsdoc
21-
view: function ({ children, attrs }) {
22-
return h('.panel', attrs, children);
21+
view: function ({ children, attrs: { class: classNames = '', ...attrs } }) {
22+
return h('.panel', { ...attrs, class: ['panel', classNames.split(' ')].join(' ') }, children);
2323
},
2424
};

lib/public/components/common/table/rows.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ const cell = (rowId, column, rowData) => {
5555
* @typedef RowsConfiguration
5656
* @property {function(Array):Object} [callback] a callback called on each row's data, and whose result will be added to the row component's
5757
* attributes
58-
* * @property {string} [classes] the css classes to apply to each row.
58+
* @property {string|function} [classes] the css classes to apply to each row.
5959
* If it is a string, use it as is(separated by a dot)
6060
* If it is a function, call the function with the row as argument and use the result as a class
61-
* * @property {function} [classes] the css classes to apply to each row,
62-
* * returned from a callback function based off given parameters (separated by a dot)
6361
*/
6462

6563
/**
@@ -83,7 +81,7 @@ export const rows = (data, idKey, columns, configuration) => {
8381
const rowId = `row${rowData[idKey]}`;
8482
return h(`tr#${rowId}.${typeof rowClasses === 'function' ? rowClasses(rowData) : rowClasses}`, {
8583
key: rowId,
86-
...rowConfigurationCallback && rowConfigurationCallback(rowData),
84+
...rowConfigurationCallback?.(rowData),
8785
}, columns.map((column) => cell(rowId, column, rowData)));
8886
});
8987
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
/**
15+
* Format a date in its full format, for example `Monday January 1, 2024`
16+
*
17+
* @param {Date} date the date to format
18+
* @return {string} the formatted date
19+
*/
20+
export const formatFullDate = (date) => {
21+
const year = date.getFullYear();
22+
const day = date.getDate();
23+
const dayOfWeek = date.toLocaleString('en', { weekday: 'long' });
24+
const month = date.toLocaleString('en', { month: 'long' });
25+
26+
return `${dayOfWeek} ${month} ${day}, ${year}`;
27+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 { formatDuration } from './formatDuration.mjs';
15+
import { formatPercentage } from './formatPercentage.js';
16+
17+
/**
18+
* Format the given time and efficiency loss into a human-readable string
19+
*
20+
* @param {number} timeLoss the time loss to format
21+
* @param {number} efficiencyLoss the efficiency loss (percentage)
22+
* @return {string} the formatted result
23+
*/
24+
export const formatTimeAndEfficiencyLoss = (timeLoss, efficiencyLoss) => {
25+
if ((timeLoss ?? efficiencyLoss ?? null) === null) {
26+
return '-';
27+
}
28+
return `${formatDuration(timeLoss)} (${formatPercentage(efficiencyLoss)})`;
29+
};

lib/public/views/Logs/Create/TemplatedLogCreationModel.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,16 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313
import { LogCreationModel } from './LogCreationModel.js';
14-
import { OnCallLogTemplate } from './OnCallLogTemplate.js';
15-
16-
/**
17-
* @typedef OnCallLogTemplateFormData
18-
* @property {string} shortDescription
19-
* @property {string} detectorOrSubsystem
20-
* @property {string} severity
21-
* @property {string} scope
22-
* @property {string} shifterName
23-
* @property {string} shifterPosition
24-
* @property {string} lhcBeamMode
25-
* @property {string} issueDescription
26-
* @property {string} reason
27-
* @property {string} alreadyTakenActions
28-
*/
14+
import { OnCallLogTemplate } from './templates/OnCallLogTemplate.js';
15+
import { RcDailyMeetingTemplate } from './templates/RcDailyMeetingTemplate.js';
2916

3017
// Only one template for now
3118
/**
32-
* @typedef {OnCallLogTemplate} LogTemplate
19+
* @typedef {OnCallLogTemplate|RcDailyMeetingTemplate} LogTemplate
3320
*/
3421

3522
/**
36-
* @typedef {'on-call'} logTemplateKey
23+
* @typedef {'on-call'|'rc-daily-meeting'} logTemplateKey
3724
*/
3825

3926
/**
@@ -43,7 +30,10 @@ import { OnCallLogTemplate } from './OnCallLogTemplate.js';
4330
* @return {LogTemplate|null} the new log template
4431
*/
4532
const logTemplatesFactory = (key) => {
46-
const templateClass = { ['on-call']: OnCallLogTemplate }[key] ?? null;
33+
const templateClass = {
34+
['on-call']: OnCallLogTemplate,
35+
['rc-daily-meeting']: RcDailyMeetingTemplate,
36+
}[key] ?? null;
4737
if (templateClass) {
4838
return new templateClass();
4939
}
@@ -116,7 +106,7 @@ export class TemplatedLogCreationModel extends LogCreationModel {
116106
/**
117107
* Set the current template key
118108
*
119-
* @return {logTemplateKey} the current key
109+
* @return {logTemplateKey|null} the current key
120110
*/
121111
get templateKey() {
122112
return this._templateKey;

0 commit comments

Comments
 (0)