Skip to content

Commit 60a0324

Browse files
authored
Merge branch 'main' into improv/O2B-1578/Change-timeRange-filters-to-only-trigger-filters-when-both-time-and-date-have-been-filled-in
2 parents 74b504a + f5ffe24 commit 60a0324

146 files changed

Lines changed: 3664 additions & 3657 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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: 6 additions & 2 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 }}
@@ -39,7 +43,7 @@ jobs:
3943
steps:
4044
- uses: actions/checkout@v6
4145
- name: Set up Docker
42-
uses: docker/setup-buildx-action@v3
46+
uses: docker/setup-buildx-action@v4
4347
- name: Create Coverage Directory
4448
run: mkdir -p ${{ github.workspace }}/coverage
4549

@@ -71,7 +75,7 @@ jobs:
7175
env:
7276
TEST_TYPE: ${{ matrix.test_type }}
7377
- name: Upload Coverage to Codecov
74-
uses: codecov/codecov-action@v5
78+
uses: codecov/codecov-action@v6
7579
with:
7680
files: ./coverage/lcov.info
7781
env:

.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

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.2-r0 \
2323
freetype-dev=2.13.2-r0 \
2424
harfbuzz=8.5.0-r0 \
25-
ca-certificates=20250911-r0
25+
ca-certificates=20260413-r0
2626

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

lib/domain/dtos/GetAllLogsDto.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,25 @@ const PaginationDto = require('./PaginationDto');
1717
const { CustomJoi } = require('./CustomJoi.js');
1818
const { TagsFilterDto } = require('./filters/TagsFilterDto.js');
1919
const { FromToFilterDto } = require('./filters/FromToFilterDto.js');
20-
const { EnvironmentsFilterDto } = require('./filters/EnvironmentsFilterDto');
2120

22-
const RunFilterDto = Joi.object({
23-
values: CustomJoi.stringArray().items(EntityIdDto).single().required(),
24-
operation: Joi.string().valid('and', 'or').required(),
25-
});
26-
27-
const LhcFillFilterDto = Joi.object({
28-
values: CustomJoi.stringArray().items(EntityIdDto).single().required(),
29-
operation: Joi.string().valid('and', 'or').required(),
30-
});
21+
const RunFilterDto = CustomJoi.stringArray().items(EntityIdDto).single();
22+
const EnvironmentsFilterDto = CustomJoi.stringArray().items(Joi.string()).single();
23+
const LhcFillFilterDto = CustomJoi.stringArray().items(EntityIdDto).single();
3124

3225
const FilterDto = Joi.object({
3326
title: Joi.string().trim(),
3427
content: Joi.string().trim(),
3528
author: Joi.string().trim(),
3629
created: FromToFilterDto,
3730
tags: TagsFilterDto,
38-
lhcFills: LhcFillFilterDto,
39-
run: RunFilterDto,
31+
fillNumbers: LhcFillFilterDto,
32+
runNumbers: RunFilterDto,
4033
origin: Joi.string()
4134
.valid('human', 'process'),
4235
parentLog: EntityIdDto,
4336
rootLog: EntityIdDto,
4437
rootOnly: Joi.boolean(),
45-
environments: EnvironmentsFilterDto,
38+
environmentIds: EnvironmentsFilterDto,
4639
});
4740

4841
const SortDto = Joi.object({

lib/domain/dtos/filters/RunFilterDto.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,27 @@ exports.RunFilterDto = Joi.object({
8888
inelasticInteractionRateAtEnd: FloatComparisonDto,
8989

9090
gaq: Joi.object({
91-
notBadFraction: FloatComparisonDto.when(
92-
'dataPassIds',
93-
{
94-
is: Joi.array().length(1),
95-
then: FloatComparisonDto,
96-
otherwise: Joi.forbidden().error(new Error('Filtering by GAQ is enabled only when filtering with one dataPassId')),
97-
},
98-
),
91+
notBadFraction: FloatComparisonDto.custom((value, helpers) => {
92+
const [, { dataPassIds }] = helpers.state.ancestors;
93+
94+
if (!dataPassIds || dataPassIds.length !== 1) {
95+
return helpers.message('Filtering by GAQ is enabled only when filtering with one dataPassId');
96+
}
97+
98+
return value;
99+
}),
99100
mcReproducibleAsNotBad: Joi.boolean().optional(),
100101
}),
101102

102-
detectorsQc: Joi.object()
103+
detectorsQcNotBadFraction: Joi.object()
103104
.pattern(
104105
Joi.string().regex(/^_\d+$/), // Detector id with '_' prefix
105-
Joi.object({ notBadFraction: FloatComparisonDto }),
106+
FloatComparisonDto,
106107
)
107108
.keys({
108109
mcReproducibleAsNotBad: Joi.boolean().optional(),
109110
})
110-
.custom((detectorsQcObj, helpers) => {
111+
.custom((detectorsQcNotBadFractionObj, helpers) => {
111112
const [{ dataPassIds, simulationPassIds, lhcPeriodIds }] = helpers.state.ancestors;
112113

113114
singleRunsCollectionCustomCheck(
@@ -117,6 +118,6 @@ exports.RunFilterDto = Joi.object({
117118
'the dataPassIds, simulationPassIds and lhcPeriodIds filters collectively contain exactly one ID',
118119
);
119120

120-
return detectorsQcObj;
121+
return detectorsQcNotBadFractionObj;
121122
}),
122123
});

lib/domain/enums/NonPhysicsProductionsNamesWords.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ const NonPhysicsProductionsNamesWords = Object.freeze({
2323
module.exports.NonPhysicsProductionsNamesWords = NonPhysicsProductionsNamesWords;
2424

2525
module.exports.NON_PHYSICS_PRODUCTIONS_NAMES_WORDS = Object.values(NonPhysicsProductionsNamesWords);
26+
27+
module.exports.NON_PHYSICS_PRODUCTIONS_NAMES_TOTAL_LENGTH = Object.values(NonPhysicsProductionsNamesWords).join(',').length;

lib/public/Model.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,27 @@ export default class Model extends Observable {
9595
this._appConfiguration$ = new Observable();
9696
this._inputDebounceTime = INPUT_DEBOUNCE_TIME;
9797

98+
// Setup router
99+
this.router = new QueryRouter();
100+
this.router.observe(this.handleLocationChange.bind(this));
101+
this.router.bubbleTo(this);
102+
registerFrontLinkListener((e) => this.router.handleLinkEvent(e));
103+
98104
// Models
99105

100106
this.home = new HomePageModel(this);
101107
this.home.bubbleTo(this);
102108

103-
this.lhcPeriods = new LhcPeriodsModel(this);
109+
this.lhcPeriods = new LhcPeriodsModel(this.router);
104110
this.lhcPeriods.bubbleTo(this);
105111

106-
this.dataPasses = new DataPassesModel(this);
112+
this.dataPasses = new DataPassesModel(this.router);
107113
this.dataPasses.bubbleTo(this);
108114

109115
this.qcFlags = new QcFlagsModel(this);
110116
this.qcFlags.bubbleTo(this);
111117

112-
this.simulationPasses = new SimulationPassesModel(this);
118+
this.simulationPasses = new SimulationPassesModel(this.router);
113119
this.simulationPasses.bubbleTo(this);
114120

115121
this.qcFlagTypes = new QcFlagTypesModel(this);
@@ -178,12 +184,6 @@ export default class Model extends Observable {
178184
this.errorModel = new ErrorModel();
179185
this.errorModel.bubbleTo(this);
180186

181-
// Setup router
182-
this.router = new QueryRouter();
183-
this.router.observe(this.handleLocationChange.bind(this));
184-
this.router.bubbleTo(this);
185-
registerFrontLinkListener((e) => this.router.handleLinkEvent(e));
186-
187187
// Init pages
188188
this.handleLocationChange();
189189
this.window.addEventListener('resize', debounce(() => this.notify(), 100));

lib/public/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ th.text-center, td.text-center {
266266
border-color: #f5c6cb;
267267
}
268268

269+
.alert-warning {
270+
color: var(--color-warning);
271+
background-color: #ffe8c8;
272+
border-color: #fdd69f;
273+
}
274+
269275
.alert-danger hr {
270276
border-top-color: #f1b0b7;
271277
}

lib/public/components/Filters/LhcFillsFilter/BeamTypeFilterModel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
*/
1313

1414
import { beamTypesProvider } from '../../../services/beamTypes/beamTypesProvider.js';
15-
import { SelectionFilterModel } from '../common/filters/SelectionFilterModel.js';
15+
import { SelectionModel } from '../../common/selection/SelectionModel.js';
1616

1717
/**
1818
* Beam type filter model
1919
*/
20-
export class BeamTypeFilterModel extends SelectionFilterModel {
20+
export class BeamTypeFilterModel extends SelectionModel {
2121
/**
2222
* Constructor
2323
*/
@@ -28,7 +28,7 @@ export class BeamTypeFilterModel extends SelectionFilterModel {
2828
beamTypesProvider.items$.getCurrent().apply({
2929
Success: (types) => {
3030
const beamTypes = types.map((type) => ({ value: type.beam_type }));
31-
this._selectionModel.setAvailableOptions(beamTypes);
31+
this.setAvailableOptions(beamTypes);
3232
},
3333
});
3434
});

0 commit comments

Comments
 (0)