Skip to content

Commit b2d8735

Browse files
committed
rename
1 parent 8e98071 commit b2d8735

7 files changed

Lines changed: 46 additions & 38 deletions

File tree

lib/domain/entities/QcFlagType.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@
3030
* @property {QcFlagVerification[]} verifications
3131
* @property {User} lastUpdatedBy
3232
*/
33+
34+
/**
35+
* @typedef MinifiedQcFlagType
36+
*
37+
* @property {string} name
38+
* @property {string} color as hex
39+
*/

lib/domain/entities/QcSummary.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/**
2-
* @typedef QcFlagComment
2+
* @typedef MinifiedQcSummaryFlag
33
*
44
* @property {number} id - QC flag identifier
55
* @property {string} comment - QC flag comment
6+
* @property {MinifiedQcFlagType} flagType - flag type
67
*/
78

89
/**
@@ -12,7 +13,7 @@
1213
* @property {number} explicitlyNotBadEffectiveRunCoverage - fraction of run's data, marked explicitly with good QC flag
1314
* @property {boolean} mcReproducible - if true states that some Limited Acceptance MC Reproducible flag was assigned
1415
* @property {number} missingVerificationsCount - number of QC flags that are unverified and have not been discarded
15-
* @property {QcFlagComment[]} flagComments - comments associated with QC flags contributing to the summary
16+
* @property {MinifiedQcSummaryFlag[]} minfiedFlags - flag with only necessary properties for QC summary display
1617
*/
1718

1819
/**

lib/domain/enums/QcSummaryProperties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ exports.QcSummarProperties = {
1616
EXPLICITELY_NOT_BAD_EFFECTIVE_RUN_COVERAGE: 'explicitlyNotBadEffectiveRunCoverage',
1717
MISSING_VERIFICATIONS: 'missingVerificationsCount',
1818
MC_REPRODUCIBLE: 'mcReproducible',
19-
FLAG_COMMENTS: 'flagComments',
19+
MINIFIED_FLAGS: 'minfiedFlags',
2020
UNDEFINED_QUALITY_PERIODS_COUNT: 'undefinedQualityPeriodsCount',
2121
};

lib/public/views/Runs/ActiveColumns/getQcSummaryDisplay.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const getQcSummaryDisplay = (summary) => {
3939
explicitlyNotBadEffectiveRunCoverage,
4040
missingVerificationsCount,
4141
mcReproducible,
42-
flagComments = [],
42+
minfiedFlags = [],
4343
} = summary;
4444

4545
const missingVerificationDisplay = missingVerificationsCount
@@ -111,10 +111,10 @@ export const getQcSummaryDisplay = (summary) => {
111111
);
112112
}
113113

114-
if (flagComments.length > 0) {
114+
if (minfiedFlags.length > 0) {
115115
const commentsContent = h(
116116
'.p2.flex-column.g2',
117-
flagComments.map(({ id, comment, flagType }) => h('.flex-column.g1', { key: id }, [
117+
minfiedFlags.map(({ id, comment, flagType }) => h('.flex-column.g1', { key: id }, [
118118
h('.f7.gray.flex-row.g1', [`Flag ${id}`, qcFlagTypeColoredBadge(flagType)]),
119119
h('.f6', { style: { whiteSpace: 'pre-wrap' } }, comment),
120120
h('.section-divider'),

lib/server/services/qualityControlFlag/QcFlagSummaryService.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class QcFlagSummaryService {
192192
}
193193

194194
for (const summaryUnit of runDetectorSummaryList) {
195-
summaryUnit.flagComments = summaryUnit.flagIds
195+
summaryUnit.minfiedFlags = summaryUnit.flagIds
196196
.map((id) => ({ id, ...miniCommentedFlagByFlagId.get(id) }))
197197
.filter(({ comment }) => Boolean(comment));
198198
}
@@ -214,7 +214,7 @@ class QcFlagSummaryService {
214214
runNumber,
215215
detectorId,
216216
flagIds,
217-
flagComments,
217+
minfiedFlags,
218218
} = runDetectorSummaryForFlagTypesClass;
219219
const missingVerificationsCount = flagIds.filter((id) => notVerifiedFlagsIds.has(id)).length;
220220

@@ -224,7 +224,7 @@ class QcFlagSummaryService {
224224
if (!summary[runNumber][detectorId]) {
225225
summary[runNumber][detectorId] = {
226226
[QcSummarProperties.MC_REPRODUCIBLE]: false,
227-
[QcSummarProperties.FLAG_COMMENTS]: [],
227+
[QcSummarProperties.MINIFIED_FLAGS]: [],
228228
};
229229
}
230230

@@ -233,13 +233,13 @@ class QcFlagSummaryService {
233233
runDetectorSummary[QcSummarProperties.MISSING_VERIFICATIONS] =
234234
(runDetectorSummary[QcSummarProperties.MISSING_VERIFICATIONS] ?? 0) + missingVerificationsCount;
235235

236-
if (!runDetectorSummary[QcSummarProperties.FLAG_COMMENTS]) {
237-
runDetectorSummary[QcSummarProperties.FLAG_COMMENTS] = [];
236+
if (!runDetectorSummary[QcSummarProperties.MINIFIED_FLAGS]) {
237+
runDetectorSummary[QcSummarProperties.MINIFIED_FLAGS] = [];
238238
}
239-
if (flagComments.length > 0) {
240-
const existingFlagComments = runDetectorSummary[QcSummarProperties.FLAG_COMMENTS];
239+
if (minfiedFlags.length > 0) {
240+
const existingFlagComments = runDetectorSummary[QcSummarProperties.MINIFIED_FLAGS];
241241
const existingIds = new Set(existingFlagComments.map(({ id }) => id));
242-
for (const miniCommentedFlagByFlagId of flagComments) {
242+
for (const miniCommentedFlagByFlagId of minfiedFlags) {
243243
if (!existingIds.has(miniCommentedFlagByFlagId.id)) {
244244
existingFlagComments.push(miniCommentedFlagByFlagId);
245245
existingIds.add(miniCommentedFlagByFlagId.id);

test/api/qcFlags.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module.exports = () => {
8282
mcReproducible: true,
8383
badEffectiveRunCoverage: 0.3333333,
8484
explicitlyNotBadEffectiveRunCoverage: 0,
85-
flagComments: [
85+
minfiedFlags: [
8686
{
8787
id: 1,
8888
comment: "Some qc comment 1",
@@ -114,7 +114,7 @@ module.exports = () => {
114114
explicitlyNotBadEffectiveRunCoverage: 1,
115115
mcReproducible: false,
116116
missingVerificationsCount: 1,
117-
flagComments: [
117+
minfiedFlags: [
118118
{
119119
id: 7,
120120
comment: "Some qc comment 7",
@@ -132,7 +132,7 @@ module.exports = () => {
132132
explicitlyNotBadEffectiveRunCoverage: 0.7596538,
133133
mcReproducible: true,
134134
missingVerificationsCount: 2,
135-
flagComments: [
135+
minfiedFlags: [
136136
{
137137
id: 202,
138138
comment: "Some qc comment 1",
@@ -156,7 +156,7 @@ module.exports = () => {
156156
explicitlyNotBadEffectiveRunCoverage: 1,
157157
mcReproducible: false,
158158
missingVerificationsCount: 1,
159-
flagComments: [
159+
minfiedFlags: [
160160
{
161161
id: 203,
162162
comment: "Some qc comment 1",
@@ -182,7 +182,7 @@ module.exports = () => {
182182
mcReproducible: true,
183183
badEffectiveRunCoverage: 0.1111111,
184184
explicitlyNotBadEffectiveRunCoverage: 0.2222222,
185-
flagComments: [
185+
minfiedFlags: [
186186
{
187187
id: 1,
188188
comment: 'Some qc comment 1',
@@ -205,7 +205,7 @@ module.exports = () => {
205205
explicitlyNotBadEffectiveRunCoverage: 1,
206206
mcReproducible: false,
207207
missingVerificationsCount: 1,
208-
flagComments: [
208+
minfiedFlags: [
209209
{
210210
id: 7,
211211
comment: 'Some qc comment 7',
@@ -220,7 +220,7 @@ module.exports = () => {
220220
explicitlyNotBadEffectiveRunCoverage: 1,
221221
mcReproducible: true,
222222
missingVerificationsCount: 2,
223-
flagComments: [
223+
minfiedFlags: [
224224
{
225225
id: 201,
226226
comment: 'Some qc comment 1',
@@ -238,7 +238,7 @@ module.exports = () => {
238238
explicitlyNotBadEffectiveRunCoverage: 1,
239239
mcReproducible: false,
240240
missingVerificationsCount: 1,
241-
flagComments: [
241+
minfiedFlags: [
242242
{
243243
id: 203,
244244
comment: 'Some qc comment 1',
@@ -261,7 +261,7 @@ module.exports = () => {
261261
mcReproducible: false,
262262
badEffectiveRunCoverage: 0.9288889,
263263
explicitlyNotBadEffectiveRunCoverage: 0,
264-
flagComments: [
264+
minfiedFlags: [
265265
{
266266
id: 5,
267267
comment: 'Some qc comment 4',
@@ -290,7 +290,7 @@ module.exports = () => {
290290
mcReproducible: false,
291291
badEffectiveRunCoverage: 0.1666667,
292292
explicitlyNotBadEffectiveRunCoverage: 0.8333333,
293-
flagComments: [
293+
minfiedFlags: [
294294
{
295295
id: 100,
296296
comment: 'first part good',
@@ -310,7 +310,7 @@ module.exports = () => {
310310
mcReproducible: false,
311311
badEffectiveRunCoverage: 0,
312312
explicitlyNotBadEffectiveRunCoverage: 1,
313-
flagComments: [
313+
minfiedFlags: [
314314
{
315315
id: 102,
316316
comment: 'all good',

test/lib/server/services/qualityControlFlag/QcFlagService.test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ module.exports = () => {
169169
mcReproducible: true,
170170
badEffectiveRunCoverage: 0.3333333,
171171
explicitlyNotBadEffectiveRunCoverage: 0,
172-
flagComments: [
172+
minfiedFlags: [
173173
{
174174
id: 1,
175175
comment: "Some qc comment 1",
@@ -201,7 +201,7 @@ module.exports = () => {
201201
explicitlyNotBadEffectiveRunCoverage: 1,
202202
mcReproducible: false,
203203
missingVerificationsCount: 1,
204-
flagComments: [
204+
minfiedFlags: [
205205
{
206206
id: 7,
207207
comment: "Some qc comment 7",
@@ -219,7 +219,7 @@ module.exports = () => {
219219
explicitlyNotBadEffectiveRunCoverage: 0.7596538,
220220
mcReproducible: true,
221221
missingVerificationsCount: 2,
222-
flagComments: [
222+
minfiedFlags: [
223223
{
224224
id: 202,
225225
comment: "Some qc comment 1",
@@ -243,7 +243,7 @@ module.exports = () => {
243243
explicitlyNotBadEffectiveRunCoverage: 1,
244244
mcReproducible: false,
245245
missingVerificationsCount: 1,
246-
flagComments: [
246+
minfiedFlags: [
247247
{
248248
id: 203,
249249
comment: "Some qc comment 1",
@@ -266,7 +266,7 @@ module.exports = () => {
266266
mcReproducible: true,
267267
badEffectiveRunCoverage: 0.1111111,
268268
explicitlyNotBadEffectiveRunCoverage: 0.2222222,
269-
flagComments: [
269+
minfiedFlags: [
270270
{
271271
id: 1,
272272
comment: 'Some qc comment 1',
@@ -289,7 +289,7 @@ module.exports = () => {
289289
explicitlyNotBadEffectiveRunCoverage: 1,
290290
mcReproducible: false,
291291
missingVerificationsCount: 1,
292-
flagComments: [
292+
minfiedFlags: [
293293
{
294294
id: 7,
295295
comment: 'Some qc comment 7',
@@ -304,7 +304,7 @@ module.exports = () => {
304304
explicitlyNotBadEffectiveRunCoverage: 1,
305305
mcReproducible: true,
306306
missingVerificationsCount: 2,
307-
flagComments: [
307+
minfiedFlags: [
308308
{
309309
id: 201,
310310
comment: 'Some qc comment 1',
@@ -322,7 +322,7 @@ module.exports = () => {
322322
explicitlyNotBadEffectiveRunCoverage: 1,
323323
mcReproducible: false,
324324
missingVerificationsCount: 1,
325-
flagComments: [
325+
minfiedFlags: [
326326
{
327327
id: 203,
328328
comment: 'Some qc comment 1',
@@ -367,7 +367,7 @@ module.exports = () => {
367367
mcReproducible: false,
368368
badEffectiveRunCoverage: 0.0769231,
369369
explicitlyNotBadEffectiveRunCoverage: 0,
370-
flagComments: [
370+
minfiedFlags: [
371371
{
372372
id: 4,
373373
comment: 'Some qc comment 4',
@@ -391,7 +391,7 @@ module.exports = () => {
391391
mcReproducible: false,
392392
badEffectiveRunCoverage: 0.0769231,
393393
explicitlyNotBadEffectiveRunCoverage: 0,
394-
flagComments: [
394+
minfiedFlags: [
395395
{
396396
id: 4,
397397
comment: 'Some qc comment 4',
@@ -415,7 +415,7 @@ module.exports = () => {
415415
mcReproducible: false,
416416
badEffectiveRunCoverage: 0.9288889,
417417
explicitlyNotBadEffectiveRunCoverage: 0,
418-
flagComments: [
418+
minfiedFlags: [
419419
{
420420
id: 5,
421421
comment: 'Some qc comment 4',
@@ -445,7 +445,7 @@ module.exports = () => {
445445
mcReproducible: false,
446446
badEffectiveRunCoverage: 0.1666667,
447447
explicitlyNotBadEffectiveRunCoverage: 0.8333333,
448-
flagComments: [
448+
minfiedFlags: [
449449
{
450450
id: 100,
451451
comment: 'first part good',
@@ -465,7 +465,7 @@ module.exports = () => {
465465
mcReproducible: false,
466466
badEffectiveRunCoverage: 0,
467467
explicitlyNotBadEffectiveRunCoverage: 1,
468-
flagComments: [
468+
minfiedFlags: [
469469
{
470470
id: 102,
471471
comment: 'all good',

0 commit comments

Comments
 (0)