Skip to content

Commit 274ac99

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/aliceo2/web-ui-2.10.0
2 parents 688982b + c06c2e3 commit 274ac99

7 files changed

Lines changed: 22 additions & 30 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* @graduta
2+
* @isaachilly

.github/workflows/bookkeeping.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
parallel_tests:
1519
name: ${{ matrix.test_type }}

.github/workflows/docker.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
permissions:
1010
contents: read
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
linter:
1418
runs-on: ubuntu-latest

lib/server/controllers/lhcPeriodStatistics.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const listLhcPeriodStatisticsHandler = async (req, res) => {
4242
);
4343
if (validatedDTO) {
4444
try {
45-
const { filter, page: { limit = ApiConfig.pagination.limit, offset } = {}, sort = { name: 'DESC' } } = validatedDTO.query;
45+
const { filter, page: { limit = ApiConfig.pagination.limit, offset } = {}, sort = { id: 'DESC' } } = validatedDTO.query;
4646
const { count, rows: items } = await lhcPeriodStatisticsService.getAllForPhysicsRuns({
4747
filter,
4848
limit,

lib/server/services/lhcPeriod/LhcPeriodStatisticsService.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ const { NotFoundError } = require('../../errors/NotFoundError');
2121
const { RunDefinition } = require('../../../domain/enums/RunDefinition.js');
2222
const { NonPhysicsProductionsNamesWords } = require('../../../domain/enums/NonPhysicsProductionsNamesWords.js');
2323

24+
const sortExpressionMap = {
25+
name: (sequelize) => sequelize.col('`lhcPeriod`.`name`'),
26+
year: (sequelize) => sequelize.literal('SUBSTRING(lhcPeriod.name, 4, 2)'),
27+
pdpBeamTypes: (sequelize) => sequelize.literal('pdpBeamTypes'),
28+
};
29+
2430
/**
2531
* @typedef LhcPeriodIdentifier object to uniquely identify a lhc period
2632
* @property {string} [name] the lhc period name
@@ -85,22 +91,9 @@ class LhcPeriodStatisticsService {
8591
sort,
8692
} = {}) {
8793
const queryBuilder = this.prepareQueryBuilder();
88-
8994
if (sort) {
9095
for (const property in sort) {
91-
let expression;
92-
switch (property) {
93-
case 'name':
94-
expression = (sequelize) => sequelize.col('`lhcPeriod`.`name`');
95-
break;
96-
case 'year':
97-
expression = (sequelize) => sequelize.literal('SUBSTRING(lhcPeriod.name, 4, 2)');
98-
break;
99-
case 'pdpBeamTypes':
100-
expression = (sequelize) => sequelize.literal('pdpBeamTypes');
101-
break;
102-
}
103-
96+
const expression = sortExpressionMap[property];
10497
queryBuilder.orderBy(expression ?? property, sort[property]);
10598
}
10699
}

package-lock.json

Lines changed: 4 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"mkdirp": "3.0.1",
4040
"multer": "2.1.1",
4141
"node-fetch": "3.3.1",
42-
"protobufjs": "8.0.1",
42+
"protobufjs": "8.0.2",
4343
"sequelize": "6.37.8",
4444
"umzug": "3.8.2"
4545
},

0 commit comments

Comments
 (0)