Skip to content

Commit 7b7a799

Browse files
Merge branch 'main' into mboulais/O2B-1393/use-certificate-when-handling-lost-runs-and-envs
2 parents 710d724 + 7a878e1 commit 7b7a799

24 files changed

Lines changed: 367 additions & 112 deletions

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
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.
44

5+
## [1.5.0](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%401.5.0)
6+
* Notable changes for users:
7+
* Added nTF orbits to runs updated runs API endpoints accordingly
8+
* Added a global error page, displaying amongst other 404 error
9+
* Notable changes for developers:
10+
* Fixed randomly failing runs test based on timerange selection (start/stop)
11+
* Fixed randomly failing QC tests
12+
* Updated docker ca-certificate dependency
13+
* Allow to prefill of on-call template through URL parameters:
14+
* In log creation page, query parameters `templateKey`, `issueDescription`, `detectorOrSubsystem` allow
15+
respectively to pre-chose a log template and define the issue description and detector or subsystem in the
16+
case of on-call template
17+
518
## [1.4.1](https://github.com/AliceO2Group/Bookkeeping/releases/tag/%40aliceo2%2Fbookkeeping%401.4.1)
619
* Notable changes for developers:
720
* Fixed the runs start/stop extraction from AliECS kafka messages

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apk add --no-cache \
2222
freetype=2.13.0-r5 \
2323
freetype-dev=2.13.0-r5 \
2424
harfbuzz=7.3.0-r0 \
25-
ca-certificates=20241121-r0
25+
ca-certificates=20241121-r1
2626

2727
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
2828
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

lib/public/Model.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { ObservableData } from './utilities/ObservableData.js';
3838
import { BkpRoles } from './domain/enums/BkpRoles.js';
3939
import { getRoleForDetector } from './utilities/getRoleForDetector.js';
4040
import { detectorsProvider } from './services/detectors/detectorsProvider.js';
41+
import { ErrorModel } from './views/Error/ErrorModel.js';
4142

4243
/**
4344
* Root of model tree
@@ -168,6 +169,12 @@ export default class Model extends Observable {
168169
this.aboutModel = new AboutModel();
169170
this.aboutModel.bubbleTo(this);
170171

172+
/**
173+
* @type {ErrorModel}
174+
*/
175+
this.errorModel = new ErrorModel();
176+
this.errorModel.bubbleTo(this);
177+
171178
// Setup router
172179
this.router = new QueryRouter();
173180
this.router.observe(this.handleLocationChange.bind(this));
@@ -309,9 +316,22 @@ export default class Model extends Observable {
309316
case 'eos-report-create':
310317
this.eosReportModel.loadCreation(this.router.params.shiftType);
311318
break;
312-
default:
313-
this.router.go('?page=home');
319+
case 'error':
314320
break;
321+
default:
322+
if (this.router.params.page) {
323+
this.errorModel.setError({
324+
code: '404',
325+
codeDescription: 'Page not found',
326+
message: 'The page you are looking for might have been removed, had its name changed or is temorarily unavailable.',
327+
});
328+
this.router.params.page = 'error';
329+
this.router.notify();
330+
break;
331+
} else {
332+
this.router.go('?page=home');
333+
break;
334+
}
315335
}
316336
}
317337

lib/public/components/qcFlags/qcFlagsBreadcrumbs.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,33 @@ export const qcFlagsBreadcrumbs = ({ remoteDataPass, remoteSimulationPass, remot
2222
}
2323

2424
return breadcrumbs([
25-
h('h2', header),
26-
remoteDataPass && remoteDataPass.match({
27-
Success: ({ id, name }) => h('h2', frontLink(name, 'runs-per-data-pass', { dataPassId: id })),
25+
h('h2#breadcrumb-header', header),
26+
remoteDataPass?.match({
27+
Success: ({ id, name }) => h('h2#breadcrumb-data-pass-name', frontLink(name, 'runs-per-data-pass', { dataPassId: id })),
2828
Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load data pass info'),
2929
Loading: () => h('', spinner({ size: 2, absolute: false })),
3030
NotAsked: () => tooltip(h('.f3', iconWarning()), 'No data pass data was asked for'),
3131
}),
32-
remoteSimulationPass && remoteSimulationPass.match({
33-
Success: ({ id, name }) => h('h2', frontLink(name, 'runs-per-simulation-pass', { simulationPassId: id })),
32+
remoteSimulationPass?.match({
33+
Success: ({ id, name }) => h(
34+
'h2#breadcrumb-simulation-pass-name',
35+
frontLink(name, 'runs-per-simulation-pass', { simulationPassId: id }),
36+
),
3437
Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load simulation pass info'),
3538
Loading: () => h('', spinner({ size: 2, absolute: false })),
3639
NotAsked: () => tooltip(h('.f3', iconWarning()), 'No simulation pass data was asked for'),
3740
}),
3841
remoteRun.match({
39-
Success: ({ runNumber, runQuality }) => runQuality === RunQualities.BAD
40-
? h('h2.danger', frontLink(runNumber, 'run-detail', { runNumber }))
41-
: h('h2', frontLink(runNumber, 'run-detail', { runNumber })),
42+
Success: ({ runNumber, runQuality }) => h(
43+
`h2#breadcrumb-run-number${runQuality === RunQualities.BAD ? '.danger' : ''}`,
44+
frontLink(runNumber, 'run-detail', { runNumber }),
45+
),
4246
Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load run info'),
4347
Loading: () => h('', spinner({ size: 2, absolute: false })),
4448
NotAsked: () => tooltip(h('.f3', iconWarning()), 'No run data was asked for'),
4549
}),
46-
remoteDplDetector && remoteDplDetector.match({
47-
Success: (dplDetector) => h('h2', dplDetector.name),
50+
remoteDplDetector?.match({
51+
Success: (dplDetector) => h('h2#breadcrumb-detector-name', dplDetector.name),
4852
Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load detector info'),
4953
Loading: () => h('', spinner({ size: 2, absolute: false })),
5054
NotAsked: () => tooltip(h('.f3', iconWarning()), 'No detector data was asked for'),

lib/public/view.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { QcFlagDetailsForDataPassPage } from './views/QcFlags/details/forDataPas
5353
import { QcFlagDetailsForSimulationPassPage } from './views/QcFlags/details/forSimulationPass/QcFlagDetailsForSimulationPassPage.js';
5454
import { GaqFlagsOverviewPage } from './views/QcFlags/GaqFlags/GaqFlagsOverviewPage.js';
5555
import { SynchronousQcFlagsOverviewPage } from './views/QcFlags/Synchronous/SynchronousQcFlagsOverviewPage.js';
56+
import { ErrorPage } from './views/Error/index.js';
5657

5758
/**
5859
* Main view layout
@@ -114,6 +115,8 @@ export default (model) => {
114115
'tag-create': TagCreate,
115116

116117
'eos-report-create': EosReportCreationPage,
118+
119+
error: ErrorPage,
117120
};
118121

119122
return [

lib/public/views/DataPasses/PerSimulationPassOverview/DataPassesPerSimulationPassOverviewPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const DataPassesPerSimulationPassOverviewPage = ({ dataPasses: {
5353

5454
const { items, simulationPass, pagination } = dataPassesPerSimulationPassOverviewModel;
5555

56-
const commonTitle = h('h2', 'Data Passes per MC');
56+
const commonTitle = h('h2#breadcrumb-header', 'Data Passes per MC');
5757

5858
return h('', {
5959
onremove: () => dataPassesPerSimulationPassOverviewModel.reset(),
@@ -63,7 +63,7 @@ export const DataPassesPerSimulationPassOverviewPage = ({ dataPasses: {
6363
h(
6464
'.flex-row.g1.items-center',
6565
simulationPass.match({
66-
Success: (payload) => breadcrumbs([commonTitle, h('h2', payload.name)]),
66+
Success: (payload) => breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', payload.name)]),
6767
Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load simulation pass info')],
6868
Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))],
6969
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 { Observable } from '/js/src/index.js';
15+
16+
/**
17+
* Model representing handlers for errorPage.js
18+
*/
19+
export class ErrorModel extends Observable {
20+
/**
21+
* The ApplicationError object.
22+
* @typedef {(object)} ApplicationError
23+
* @property {string} code - The error code
24+
* @property {string} codeDescription - The description of the error code
25+
* @property {string} message - The error message
26+
*/
27+
28+
/**
29+
* The constructor for the Error model object
30+
* @returns {object} Constructs the Error model
31+
*/
32+
constructor() {
33+
super();
34+
this.error = {
35+
code: 'Unknown Error',
36+
codeDescription: 'Something unexpected happened.',
37+
message: 'Please try again later.',
38+
};
39+
}
40+
41+
/**
42+
* Sets the error object for the model
43+
* @param {ApplicationError} error The error object
44+
* @returns {void}
45+
*/
46+
setError(error) {
47+
if (!error.code || !error.codeDescription || !error.message) {
48+
return;
49+
}
50+
this.error = error;
51+
this.notify();
52+
}
53+
54+
/**
55+
* Returns the error object for the model
56+
* @returns {ApplicationError} The error object
57+
*/
58+
getError() {
59+
return this.error;
60+
}
61+
}

lib/public/views/Error/index.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
import { frontLink } from '../../components/common/navigation/frontLink.js';
14+
import { h, iconHome } from '/js/src/index.js';
15+
16+
/**
17+
* Error page component that dynamically displays error details based on the model
18+
* @param {Model} model - Represents the current application state
19+
* @returns {Component} Error page component
20+
*/
21+
export const ErrorPage = (model) => {
22+
const { code, codeDescription, message } = model.errorModel.error;
23+
return h('div.flex-column.justify-center ', [
24+
h('.flex-column.items-center.g3.mv4', [
25+
h('img', {
26+
src: 'assets/alice.png',
27+
alt: 'Alice logo',
28+
style: 'width: 200px',
29+
}),
30+
h('h2', 'Oops! Something went wrong.'),
31+
h('h3', `${code} - ${codeDescription}`),
32+
h('.f5', message),
33+
frontLink(
34+
h('div.flex-row.justify-center.items-center.g1', [
35+
iconHome(),
36+
'Go to Home Page',
37+
]),
38+
'home',
39+
),
40+
]),
41+
]);
42+
};

lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export const RunsPerDataPassOverviewPage = ({
200200
),
201201
};
202202

203-
const commonTitle = h('h2', { style: 'white-space: nowrap;' }, 'Physics Runs');
203+
const commonTitle = h('h2#breadcrumb-header', { style: 'white-space: nowrap;' }, 'Physics Runs');
204204

205205
return h('', { onremove: () => perDataPassOverviewModel.reset(false) }, [
206206
h('.flex-row.justify-between.items-center.g2', [
@@ -210,7 +210,7 @@ export const RunsPerDataPassOverviewPage = ({
210210
'.flex-row.g1.items-center',
211211
remoteDataPass.match({
212212
Success: (dataPass) => h('.flex-row.items-center.g1', [
213-
breadcrumbs([commonTitle, h('h2', dataPass.name)]),
213+
breadcrumbs([commonTitle, h('h2#breadcrumb-data-pass-name', dataPass.name)]),
214214
h('#skimmableControl', skimmableControl(
215215
dataPass,
216216
() => {

lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ export const RunsPerSimulationPassOverviewPage = ({
9595
),
9696
};
9797

98-
const commonTitle = h('h2', 'Runs per MC');
98+
const commonTitle = h('h2#breadcrumb-header', 'Runs per MC');
9999
return h('', [
100100
h('.flex-row.justify-between.items-center.g2', [
101101
h(
102102
'.flex-row.g1.items-center',
103103
remoteSimulationPass.match({
104-
Success: ({ name }) => breadcrumbs([commonTitle, h('h2', name)]),
104+
Success: ({ name }) => breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', name)]),
105105
Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load simulation pass info')],
106106
Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))],
107107
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],

0 commit comments

Comments
 (0)