Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[O2B-1145] Add QC flags overview page #1390

Merged
merged 688 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
688 commits
Select commit Hold shift + click to select a range
72289ee
docs
xsalonx Feb 12, 2024
23a1986
extract proper timestamp from run
xsalonx Feb 12, 2024
097f1ff
cleanup
xsalonx Feb 12, 2024
3545e7a
typedefs
xsalonx Feb 12, 2024
bd0f74e
typdefs
xsalonx Feb 12, 2024
66c806a
split
xsalonx Feb 12, 2024
8b1a3de
squash code
xsalonx Feb 13, 2024
fce9a46
hadle incorrect states
xsalonx Feb 13, 2024
10a9f44
add seeder
xsalonx Feb 13, 2024
95d7aa8
time range
xsalonx Feb 13, 2024
ae9dd7a
fix timestamp format
xsalonx Feb 13, 2024
4cff300
add timestamps to seeder
xsalonx Feb 13, 2024
399e9b1
test WIP
xsalonx Feb 13, 2024
d1bfe19
fetching tests ok
xsalonx Feb 13, 2024
0b2693a
WIP
xsalonx Feb 13, 2024
7c82233
amend test
xsalonx Feb 13, 2024
1da66be
test passing
xsalonx Feb 13, 2024
32946d1
amend linter
xsalonx Feb 13, 2024
6d4a53e
docs
xsalonx Feb 13, 2024
bf40fba
ver test WIP
xsalonx Feb 13, 2024
c24960b
ver test OK
xsalonx Feb 13, 2024
845b78d
add addociation name
xsalonx Feb 13, 2024
cc80b9f
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 13, 2024
619b14e
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 13, 2024
8cedb43
Merge branch 'xsalonx/QCF/O2B-1120/qcf-api' into xsalonx/QCF/O2B-1145…
xsalonx Feb 13, 2024
b4dd3ed
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 13, 2024
1df373a
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 13, 2024
3d81d67
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 13, 2024
8aa3c76
merge main
xsalonx Feb 13, 2024
4618226
add controller
xsalonx Feb 13, 2024
da5ff0f
add router
xsalonx Feb 13, 2024
9ff139d
refactor load
xsalonx Feb 13, 2024
dbd0682
amend
xsalonx Feb 13, 2024
40d6ac9
fetching works
xsalonx Feb 13, 2024
cd78155
add getter
xsalonx Feb 13, 2024
26a56f8
docs
xsalonx Feb 13, 2024
c028c28
add breadcramps
xsalonx Feb 13, 2024
822828c
add repo
xsalonx Feb 14, 2024
0250065
add repo
xsalonx Feb 14, 2024
a25c96f
get all reasons service function
xsalonx Feb 14, 2024
0d5903d
add test
xsalonx Feb 14, 2024
da86a6d
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
9cc5a85
add ep,; test WIP
xsalonx Feb 14, 2024
4523c64
add provenenace
xsalonx Feb 14, 2024
eeafc19
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
a2cf638
revoke
xsalonx Feb 14, 2024
78a9a09
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
818022e
test WIP
xsalonx Feb 14, 2024
0d9166b
t WIP
xsalonx Feb 14, 2024
70310df
test
xsalonx Feb 14, 2024
5b1dd31
WIP
xsalonx Feb 14, 2024
d576f5e
simplify test
xsalonx Feb 14, 2024
e25b183
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
a8f6407
wIP
xsalonx Feb 14, 2024
2088433
WIP
xsalonx Feb 14, 2024
961b386
change error messages
xsalonx Feb 14, 2024
47b48ee
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
ef7ab25
qcf creation test ok
xsalonx Feb 14, 2024
26d7287
add coalesc comment to null
xsalonx Feb 14, 2024
631fcd5
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
c946bcb
expose ep
xsalonx Feb 14, 2024
2bb5574
a
xsalonx Feb 14, 2024
e786461
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
e9ab92d
add test ok
xsalonx Feb 14, 2024
748917e
typo
xsalonx Feb 14, 2024
786fa0b
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Feb 14, 2024
0ea4d0f
typo
xsalonx Feb 14, 2024
41e17da
Merge branch 'xsalonx/QCF/O2B-1120/qcf-api' into xsalonx/QCF/O2B-1145…
xsalonx Feb 14, 2024
f34edb8
cherry pick colouring
xsalonx Feb 20, 2024
a5575bd
del
xsalonx Feb 20, 2024
ef51e39
merge main
xsalonx Feb 20, 2024
1f9fd69
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 20, 2024
cd4adba
miss
xsalonx Feb 20, 2024
6eae272
fixed
xsalonx Feb 20, 2024
9be4461
revoke
xsalonx Feb 20, 2024
e6481b9
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 21, 2024
12b22a3
rm verifications
xsalonx Feb 21, 2024
b5b40ca
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 21, 2024
a1a7c8e
cherry-pick
xsalonx Feb 21, 2024
fb02386
name archived
xsalonx Feb 23, 2024
9cd4bd6
obsolate to archived
xsalonx Feb 23, 2024
ad453da
simplify association
xsalonx Feb 23, 2024
a7b880c
a
xsalonx Feb 23, 2024
994f92f
Revert "a"
xsalonx Feb 23, 2024
da61477
Revert "simplify association"
xsalonx Feb 23, 2024
cda8a13
docs
xsalonx Feb 23, 2024
5c057be
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 23, 2024
87e91ee
rename
xsalonx Feb 26, 2024
9c69a94
simplify
xsalonx Feb 26, 2024
a96cf0d
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 26, 2024
c289bbd
refactor
xsalonx Feb 26, 2024
59e6c78
refactor
xsalonx Feb 26, 2024
e05b9ad
refactor
xsalonx Feb 26, 2024
3f42609
a
xsalonx Feb 26, 2024
967a5a0
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 26, 2024
80e32bc
add assoc
xsalonx Feb 26, 2024
5f9f02c
rename
xsalonx Feb 26, 2024
b6895c4
cleanup
xsalonx Feb 26, 2024
2302cf7
fix associations
xsalonx Feb 26, 2024
dc7a8bc
comment
xsalonx Feb 26, 2024
0357af6
rename table
xsalonx Feb 27, 2024
ac18f63
reason to type
xsalonx Feb 27, 2024
7fec93c
rename
xsalonx Feb 27, 2024
9894f1d
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Feb 27, 2024
ec2a0b1
merge main
xsalonx Feb 27, 2024
bf80ec9
rename
xsalonx Feb 27, 2024
4f111dc
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 27, 2024
208204e
docs
xsalonx Feb 27, 2024
c6cac22
cleanup
xsalonx Feb 27, 2024
2bd5f1b
refactor
xsalonx Feb 27, 2024
325df0e
rename
xsalonx Feb 27, 2024
fd85a90
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 27, 2024
9268c73
fix
xsalonx Feb 27, 2024
dac6b06
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 27, 2024
5ec7dbf
WIP
xsalonx Feb 27, 2024
995cc2b
typo
xsalonx Feb 27, 2024
548f461
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 27, 2024
f2bffad
fix
xsalonx Feb 27, 2024
fc2d2fe
WIP
xsalonx Feb 27, 2024
a719283
typo
xsalonx Feb 27, 2024
7e8439d
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 27, 2024
f5cf292
rename
xsalonx Feb 27, 2024
17789b1
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Feb 27, 2024
ab31a38
serv fixed
xsalonx Feb 27, 2024
e19a245
seeders
xsalonx Feb 27, 2024
e7b9aab
fix Test
xsalonx Feb 27, 2024
03922a7
simp
xsalonx Feb 28, 2024
86f3163
docs
xsalonx Feb 28, 2024
7c6c4c3
WIP
xsalonx Mar 1, 2024
4f14b15
add test
xsalonx Mar 1, 2024
e9d5fe8
rename
xsalonx Mar 1, 2024
d8e67d9
fix test
xsalonx Mar 4, 2024
5b15077
Merge branch 'main' into xsalonx/QCF/O2B-1118/migration-files-and-models
xsalonx Mar 4, 2024
abfc255
Merge branch 'xsalonx/QCF/O2B-1118/migration-files-and-models' into x…
xsalonx Mar 4, 2024
6d4e171
merge main WIP
xsalonx Apr 3, 2024
7377141
merge WIP
xsalonx Apr 3, 2024
552303b
Merge branch 'main' into xsalonx/QCF/O2B-1119/qcf-service
xsalonx Apr 3, 2024
58cfe2b
rename
xsalonx Apr 4, 2024
5197ffb
cleanup
xsalonx Apr 4, 2024
9389fdb
rename
xsalonx Apr 4, 2024
2fe02d3
seeders and test
xsalonx Apr 4, 2024
932b9e2
cleanup
xsalonx Apr 4, 2024
f6d5ad0
cleanup
xsalonx Apr 4, 2024
284e133
split
xsalonx Apr 4, 2024
7a34335
test
xsalonx Apr 4, 2024
f6c5fa2
rename
xsalonx Apr 4, 2024
d45597d
fix
xsalonx Apr 4, 2024
d985c1e
Merge branch 'main' into xsalonx/QCF/O2B-1119/qcf-service
xsalonx Apr 4, 2024
1baf735
comment
xsalonx Apr 4, 2024
020853e
fix
xsalonx Apr 4, 2024
b5a1440
f
xsalonx Apr 4, 2024
8164134
docs
xsalonx Apr 4, 2024
f5cae3d
cleaunp
xsalonx Apr 4, 2024
d46eebb
docs
xsalonx Apr 4, 2024
d10c5c2
tfix
xsalonx Apr 4, 2024
9fde51a
fix test
xsalonx Apr 4, 2024
cdfd061
add st wip
xsalonx Apr 4, 2024
cdaf988
restyle'
xsalonx Apr 4, 2024
e2d3cf3
add controller
xsalonx Apr 4, 2024
7912e0a
fix sorting
xsalonx Apr 4, 2024
a709fcf
typo
xsalonx Apr 4, 2024
58383d3
test
xsalonx Apr 4, 2024
46292e2
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Apr 4, 2024
98a787b
extend sorting
xsalonx Apr 4, 2024
9cea08e
test
xsalonx Apr 4, 2024
8de2625
test'
xsalonx Apr 4, 2024
e7a3568
fix test
xsalonx Apr 4, 2024
020c0d0
Merge branch 'xsalonx/QCF/O2B-1119/qcf-service' into xsalonx/QCF/O2B-…
xsalonx Apr 4, 2024
3a91c09
tess wip
xsalonx Apr 4, 2024
e13052c
fix
xsalonx Apr 4, 2024
d97e605
test
xsalonx Apr 4, 2024
86f2d50
test ok
xsalonx Apr 4, 2024
096ab5b
test ok
xsalonx Apr 4, 2024
5df4e5d
revoke
xsalonx Apr 4, 2024
8d196ea
revoke
xsalonx Apr 4, 2024
373055e
revoke
xsalonx Apr 4, 2024
d0217f7
merge main
xsalonx Apr 5, 2024
784ae6a
Merge branch 'main' into xsalonx/QCF/O2B-1119/qcf-fetch-endpoint
xsalonx Apr 5, 2024
b1cf9de
cleanup
xsalonx Apr 5, 2024
f9f8ec3
use dates
xsalonx Apr 5, 2024
4ec3008
desc order
xsalonx Apr 5, 2024
b08591a
test
xsalonx Apr 5, 2024
665e1fb
test
xsalonx Apr 5, 2024
a74b7d3
merge main
xsalonx Apr 5, 2024
0d763b0
rename
xsalonx Apr 5, 2024
eeafbbe
simp, rename
xsalonx Apr 5, 2024
b27ee9c
refactor
xsalonx Apr 5, 2024
79c96f8
a
xsalonx Apr 5, 2024
2963b8a
rename
xsalonx Apr 5, 2024
393564d
docs
xsalonx Apr 5, 2024
c0ea82c
rename
xsalonx Apr 5, 2024
e299f48
expo
xsalonx Apr 5, 2024
f6d8a36
breadcrumbs
xsalonx Apr 5, 2024
9176b5c
cleanup
xsalonx Apr 5, 2024
7adb11a
cleanup
xsalonx Apr 5, 2024
e5e629e
split
xsalonx Apr 9, 2024
de7dd00
a
xsalonx Apr 9, 2024
5c207d6
s
xsalonx Apr 9, 2024
ecebdfe
active columns
xsalonx Apr 9, 2024
8d27706
fix
xsalonx Apr 9, 2024
c3d65a6
cleanup
xsalonx Apr 9, 2024
b510101
revert to main
xsalonx Apr 9, 2024
b258a37
revert to main
xsalonx Apr 9, 2024
868fcab
ref
xsalonx Apr 9, 2024
d7413cd
a
xsalonx Apr 9, 2024
eb15618
a
xsalonx Apr 9, 2024
333320b
cleanup
xsalonx Apr 9, 2024
3253ef1
tesst
xsalonx Apr 9, 2024
f3e072b
t
xsalonx Apr 9, 2024
b79dc12
a
xsalonx Apr 9, 2024
fcd249b
fix
xsalonx Apr 9, 2024
a52ef59
test
xsalonx Apr 9, 2024
e1e99d2
fix
xsalonx Apr 9, 2024
d2821be
test
xsalonx Apr 9, 2024
f027ad0
cleanup
xsalonx Apr 9, 2024
d993d8f
fix detectors list
xsalonx Apr 9, 2024
a93068f
ch dets
xsalonx Apr 9, 2024
6ed2c8e
comment
xsalonx Apr 9, 2024
b4bcf28
cleanup
xsalonx Apr 9, 2024
b0a788e
test
xsalonx Apr 9, 2024
70cd462
Merge branch 'main' into xsalonx/QCF/O2B-1145/implement-view
xsalonx Apr 9, 2024
1ddc1a9
cleanup
xsalonx Apr 9, 2024
07850bc
Merge branch 'main' into xsalonx/QCF/O2B-1145/implement-view
xsalonx Apr 9, 2024
54838a2
amend test
xsalonx Apr 9, 2024
9025f24
fix
xsalonx Apr 9, 2024
f887fbc
docs
xsalonx Apr 9, 2024
9baee59
rename
xsalonx Apr 9, 2024
51ec9f8
fix
xsalonx Apr 9, 2024
27c48da
rename
xsalonx Apr 9, 2024
38e0b69
Merge branch 'main' into xsalonx/QCF/O2B-1145/implement-view
xsalonx Apr 9, 2024
0f31e35
docs
xsalonx Apr 9, 2024
38772d3
cut abstractyion
xsalonx Apr 9, 2024
f3b8c1a
docs
xsalonx Apr 9, 2024
81da73c
cleanup
xsalonx Apr 9, 2024
436afd1
fix
xsalonx Apr 9, 2024
4df9113
refactor
xsalonx Apr 9, 2024
3fcfb43
mix
xsalonx Apr 9, 2024
5836106
Merge branch 'main' into xsalonx/QCF/O2B-1145/implement-view
xsalonx Apr 9, 2024
abe264e
docs
xsalonx Apr 10, 2024
1ee6cac
refactor
xsalonx Apr 10, 2024
7c7fe47
split RCT active columns
xsalonx Apr 10, 2024
dce1389
cleanup
xsalonx Apr 10, 2024
fc75435
revert
xsalonx Apr 10, 2024
d19a685
use dpl
xsalonx Apr 10, 2024
b097c2a
refactor'
xsalonx Apr 10, 2024
89b0d9c
typo
xsalonx Apr 10, 2024
8f532c1
fix
xsalonx Apr 10, 2024
3a19edf
rename
xsalonx Apr 10, 2024
a1f1c70
handle no detector
xsalonx Apr 10, 2024
dcf425e
fix
xsalonx Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions lib/public/services/detectors/detectorsProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ export class DetectorsProvider extends Observable {
Success: (detectors) => detectors.filter(({ name }) => name !== TST_DETECTOR_NAME),
}))
.build();
this._dpl$ = new ObservableData(RemoteData.notAsked());
this._physicalDpl$ = ObservableData.builder()
.source(this._dpl$)
.apply((remoteDetectors) => remoteDetectors.apply({
Success: (detectors) => detectors.filter(({ name }) => name && name !== TST_DETECTOR_NAME),
}))
.build();
}

/**
Expand Down Expand Up @@ -82,30 +75,6 @@ export class DetectorsProvider extends Observable {
return this._physical$;
}

/**
* Return all DPL detectors
*
* @return {ObservableData<RemoteData<DplDetector[], ApiError>>} the observable DPL detectors list
*/
get dpl$() {
if (this._isStale()) {
this._load();
}
return this._dpl$;
}

/**
* Return physical (meaning actual detectors, for example excluding TST) DPL detectors list observable data
*
* @return {ObservableData<RemoteData<Detector[], ApiError>>} the observable physical DPL detectors list
*/
get physicalDpl$() {
if (this._isStale()) {
this._load();
}
return this._physicalDpl$;
}

/**
* States if the cached detectors list need to be created or updated
*
Expand All @@ -116,9 +85,6 @@ export class DetectorsProvider extends Observable {
return this._all$.getCurrent().match({
NotAsked: () => true,
Other: () => false,
}) || this._dpl$.getCurrent().match({
NotAsked: () => true,
Other: () => false,
});
}

Expand All @@ -134,12 +100,6 @@ export class DetectorsProvider extends Observable {
({ data: detectors }) => this._all$.setCurrent(RemoteData.success(detectors)),
(error) => this._all$.setCurrent(RemoteData.failure(error)),
);

this._dpl$.setCurrent(RemoteData.loading());
getRemoteData('/api/dpl-detectors').then(
({ data: detectors }) => this._dpl$.setCurrent(RemoteData.success(detectors)),
(error) => this._dpl$.setCurrent(RemoteData.failure(error)),
);
}
}

Expand Down
90 changes: 90 additions & 0 deletions lib/public/services/detectors/dplDetectorsProvider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**
* @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 { Observable, RemoteData } from '/js/src/index.js';
import { getRemoteData } from '../../utilities/fetch/getRemoteData.js';
import { ObservableData } from '../../utilities/ObservableData.js';

const TST_DETECTOR_NAME = 'TST';

Check warning on line 18 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L18

Added line #L18 was not covered by tests

/**
* Service class to fetch DPL detectors from the backend
*/
export class DplDetectorsProvider extends Observable {
/**
* Constructor
*/
constructor() {
super();
this._all$ = new ObservableData(RemoteData.notAsked());
this._physical$ = ObservableData.builder()

Check warning on line 30 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L27-L30

Added lines #L27 - L30 were not covered by tests
.source(this._all$)
.apply((remoteDetectors) => remoteDetectors.apply({
Success: (detectors) => detectors.filter(({ name }) => name && name !== TST_DETECTOR_NAME),

Check warning on line 33 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L32-L33

Added lines #L32 - L33 were not covered by tests
}))
.build();
}

/**
* Return all DPL detectors observable data
*
* @return {ObservableData<RemoteData<DplDetector[], ApiError>>} the observable DPL detectors list
*/
get all$() {
if (this._isStale()) {
this._load();

Check warning on line 45 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L43-L45

Added lines #L43 - L45 were not covered by tests
}
return this._all$;

Check warning on line 47 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L47

Added line #L47 was not covered by tests
}

/**
* Return physical (meaning actual detectors, for example excluding TST) DPL detectors list observable data
*
* @return {ObservableData<RemoteData<Detector[], ApiError>>} the observable physical DPL detectors list
*/
get physical$() {
if (this._isStale()) {
this._load();

Check warning on line 57 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L55-L57

Added lines #L55 - L57 were not covered by tests
}
return this._physical$;

Check warning on line 59 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L59

Added line #L59 was not covered by tests
}

/**
* States if the cached detectors list need to be created or updated
*
* @return {boolean} true if the detectors list must be refreshed
* @private
*/
_isStale() {
return this._all$.getCurrent().match({
NotAsked: () => true,
Other: () => false,

Check warning on line 71 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L68-L71

Added lines #L68 - L71 were not covered by tests
});
}

/**
* Load all the detectors and feed the observable data
*
* @return {void}
* @private
*/
_load() {
this._all$.setCurrent(RemoteData.loading());
getRemoteData('/api/dpl-detectors').then(
({ data: detectors }) => this._all$.setCurrent(RemoteData.success(detectors)),
(error) => this._all$.setCurrent(RemoteData.failure(error)),

Check warning on line 85 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L81-L85

Added lines #L81 - L85 were not covered by tests
);
}
}

export const dplDetectorsProvider = new DplDetectorsProvider();

Check warning on line 90 in lib/public/services/detectors/dplDetectorsProvider.js

View check run for this annotation

Codecov / codecov/patch

lib/public/services/detectors/dplDetectorsProvider.js#L90

Added line #L90 was not covered by tests
17 changes: 9 additions & 8 deletions lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

import { h } from '/js/src/index.js';
import { formatTimestamp } from '../../../utilities/formatting/formatTimestamp.js';
import { qcFlagColoredBadge } from '../common/qcFlagColoredBadge.js';
import { qcFlagTypeColoredBadge } from '../common/qcFlagTypeColoredBadge.js';

/**
* List of active columns for a generic periods table
* Active columns configuration for QC flags pages
martinboulais marked this conversation as resolved.
Show resolved Hide resolved
*/
export const qcFlagsActiveColumns = {

Check warning on line 21 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L21

Added line #L21 was not covered by tests
id: {
name: 'Id',
visible: false,
Expand All @@ -27,22 +27,23 @@
flagType: {
name: 'Type',
visible: true,
format: (flagType) => h('.flex-row.g1', [flagType.name, qcFlagColoredBadge(flagType)]),
format: (flagType) => h('.flex-row.g1', [flagType.name, qcFlagTypeColoredBadge(flagType)]),

Check warning on line 30 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L30

Added line #L30 was not covered by tests
},

from: {
name: 'From',
visible: true,
format: (timestamp) => timestamp ?
formatTimestamp(timestamp, false)
format: (timestamp) => timestamp
? formatTimestamp(timestamp, false)
: 'Whole run coverage',

Check warning on line 38 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L36-L38

Added lines #L36 - L38 were not covered by tests
},

to: {
name: 'To',
visible: true,
format: (timestamp) => timestamp ?
formatTimestamp(timestamp, false)
format: (timestamp) => timestamp
? formatTimestamp(timestamp, false)
: 'Whole run coverage',

Check warning on line 46 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L44-L46

Added lines #L44 - L46 were not covered by tests
},

comment: {
Expand All @@ -53,18 +54,18 @@
createdBy: {
name: 'Created by',
visible: true,
format: (_, { createdBy }) => createdBy?.name || '-',
format: (createdBy) => createdBy?.name || '-',

Check warning on line 57 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L57

Added line #L57 was not covered by tests
},

createdAt: {
name: 'Created at',
visible: true,
format: (timestamp) => formatTimestamp(timestamp, false),

Check warning on line 63 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L63

Added line #L63 was not covered by tests
},

updatedAt: {
name: 'Updated at',
visible: true,
format: (timestamp) => formatTimestamp(timestamp, false),

Check warning on line 69 in lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ActiveColumns/qcFlagsActiveColumns.js#L69

Added line #L69 was not covered by tests
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import { RemoteData } from '/js/src/index.js';
import { getRemoteData } from '../../../utilities/fetch/getRemoteData.js';
import { QcFlagsOverviewModel } from '../Overview/QcFlagsOverviewModel.js';
import { ObservableData } from '../../../utilities/ObservableData.js';

/**
* Quality Control Flags for data pass overview model
Expand All @@ -25,34 +26,61 @@
/**
* The constructor of the Overview model object
*/
constructor() {
super();
this._dataPass$ = new ObservableData(RemoteData.notAsked());
this._dataPass$.bubbleTo(this);

Check warning on line 32 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L29-L32

Added lines #L29 - L32 were not covered by tests
}

// eslint-disable-next-line valid-jsdoc
/**
* @inheritdoc
*/
getRootEndpoint() {
const params = {

Check warning on line 40 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L39-L40

Added lines #L39 - L40 were not covered by tests
filter: {
dataPassIds: [this._dataProductionId],
dataPassIds: [this._dataPassId],
},
};
return buildUrl(super.getRootEndpoint(), params);

Check warning on line 45 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L45

Added line #L45 was not covered by tests
}

// eslint-disable-next-line valid-jsdoc
/**
* @inheritdoc
*/
async _fetchDataProduction() {
this._dataProduction$.setCurrent(RemoteData.loading());
load() {
this._fetchDataPass();
super.load();

Check warning on line 54 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L52-L54

Added lines #L52 - L54 were not covered by tests
}

/**
* Fetch data pass data which QC glags are fetched
* @return {Promise<void>} promise
*/
async _fetchDataPass() {
this._dataPass$.setCurrent(RemoteData.loading());
try {
const { data: [dataPass] } = await getRemoteData(`/api/dataPasses/?filter[ids][]=${this._dataProductionId}`);
this._dataProduction$.setCurrent(RemoteData.success(dataPass));
const { data: [dataPass] } = await getRemoteData(`/api/dataPasses/?filter[ids][]=${this._dataPassId}`);
this._dataPass$.setCurrent(RemoteData.success(dataPass));

Check warning on line 65 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L61-L65

Added lines #L61 - L65 were not covered by tests
} catch (error) {
this._dataProduction$.setCurrent(RemoteData.failure(error));
this._dataPass$.setCurrent(RemoteData.failure(error));

Check warning on line 67 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L67

Added line #L67 was not covered by tests
}
}

/**
* Set id of data pass which for QC flags should be fetched
* @param {number} dataPassId data pass id
*/
set dataPassId(dataPassId) {
this._dataPassId = dataPassId;

Check warning on line 76 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L75-L76

Added lines #L75 - L76 were not covered by tests
}

/**
* Get current data pass which QC flags are fetched
* @return {RemoteData<SimulationPass>} data pass remote data
*/
get dataPass() {
return this._dataPass$.getCurrent();

Check warning on line 84 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewModel.js#L83-L84

Added lines #L83 - L84 were not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,54 @@
* or submit itself to any jurisdiction.
*/

import { h } from '/js/src/index.js';
import { h, iconWarning } from '/js/src/index.js';
import { QcFlagsOverviewComponenet } from '../Overview/qcFlagOverviewComponent.js';
import { frontLink } from '../../../components/common/navigation/frontLink.js';
import { tooltip } from '../../../components/common/popover/tooltip.js';
import { breadcrumbs } from '../../../components/common/navigation/breadcrumbs.js';
import spinner from '../../../components/common/spinner.js';

/**
* Render Quality Control Flags For Data Pass Overview page
* @param {Model} model The overall model object.
* @returns {Component} The overview page
*/
export const QcFlagsForDataPassOverviewPage = ({ qcFlags: { forDataPassOverviewModel: qcFlagsForDataPassOverviewModel } }) => {

Check warning on line 27 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L27

Added line #L27 was not covered by tests
/**
* Create links to runs per Data pass
* @param {DataPass} dataPass the Data pass
* @return {Componenet} in-breadcrumbs link to runs per Data page
*/
const productionLinkFactory = (dataPass) =>
h('h2', frontLink(dataPass.name, 'runs-per-data-pass', { dataPassId: dataPass.id }));
return QcFlagsOverviewComponenet(qcFlagsForDataPassOverviewModel, { productionLinkFactory });
const {
run: remoteRun,
dplDetector: remoteDplDetector,
dataPass: remoteDataPass,
} = qcFlagsForDataPassOverviewModel;

Check warning on line 32 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L32

Added line #L32 was not covered by tests

const commonTitle = h('h2', 'QC');
return h('', {
onremove: () => qcFlagsForDataPassOverviewModel.reset(),

Check warning on line 36 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L34-L36

Added lines #L34 - L36 were not covered by tests
}, [
h('.flex-row.justify-between.items-center', [
h('.flex-row.g1.items-center', [
remoteDataPass.match({
Success: (dataPass) => remoteRun.match({
Success: (run) => remoteDplDetector.match({
Success: (dplDetector) => breadcrumbs([

Check warning on line 43 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L41-L43

Added lines #L41 - L43 were not covered by tests
commonTitle,
h('h2', frontLink(dataPass.name, 'runs-per-data-pass', { dataPassId: dataPass.id })),
h('h2', frontLink(run.runNumber, 'run-detail', { runNumber: run.runNumber })),
h('h2', dplDetector.name),
]),
Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load detector info')],
Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))],
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],

Check warning on line 51 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L49-L51

Added lines #L49 - L51 were not covered by tests
martinboulais marked this conversation as resolved.
Show resolved Hide resolved
}),
Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load run info')],
Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))],
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],

Check warning on line 55 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L53-L55

Added lines #L53 - L55 were not covered by tests
}),
Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load data pass info')],
Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))],
NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')],

Check warning on line 59 in lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js

View check run for this annotation

Codecov / codecov/patch

lib/public/views/QcFlags/ForDataPass/QcFlagsForDataPassOverviewPage.js#L57-L59

Added lines #L57 - L59 were not covered by tests
}),
]),
]),
QcFlagsOverviewComponenet(qcFlagsForDataPassOverviewModel),
]);
};
Loading
Loading