Skip to content

Commit 4cd301a

Browse files
author
NarrowsProjects
committed
fix lint problems
1 parent 6c8a17f commit 4cd301a

15 files changed

Lines changed: 52 additions & 57 deletions

File tree

lib/database/adapters/DataPassAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DataPassAdapter {
3636
const entity = this.toSummary(databaseObject);
3737
entity.versions = versions.map(this.dataPassVersionAdapter.toEntity);
3838

39-
return entity
39+
return entity;
4040
}
4141

4242
/**

lib/database/adapters/DataPassVersionAdapter.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DataPassVersionAdapter {
3131
* @returns {DataPass} Converted entity object.
3232
*/
3333
toEntity(databaseObject) {
34-
const entity = this.toSummary(databaseObject)
34+
const entity = this.toSummary(databaseObject);
3535
const { id, dataPassId, lastSeen, statusHistory = [], createdAt, updatedAt } = databaseObject;
3636

3737
entity.statusHistory = statusHistory.map(this.dataPassVersionStatusAdapter.toEntity);
@@ -41,7 +41,6 @@ class DataPassVersionAdapter {
4141
entity.createdAt = createdAt ? new Date(createdAt).getTime() : null;
4242
entity.updatedAt = updatedAt ? new Date(updatedAt).getTime() : null;
4343

44-
4544
return entity;
4645
}
4746

lib/database/adapters/EorReasonAdapter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ class EorReasonAdapter {
3535
* @returns {EorReason} Converted entity object.
3636
*/
3737
toEntity({ id, description, runId, reasonTypeId, reasonType, lastEditedName, createdAt, updatedAt }) {
38-
return {
38+
return {
3939
...this.toSummary({ description, reasonType }),
4040
id,
4141
runId,
4242
reasonTypeId,
4343
lastEditedName,
4444
createdAt: new Date(createdAt).getTime(),
4545
updatedAt: new Date(updatedAt).getTime(),
46-
}
46+
};
4747
}
4848

4949
/**
5050
* Converts the given end of run reason database object to an summary reason object.
5151
* @param {SequelizeEorReason} databaseObject Object to convert.
5252
* @returns {EorReason} Converted summary object.
5353
*/
54-
toSummary({ description, reasonType}) {
54+
toSummary({ description, reasonType }) {
5555
const entityObject = { description };
5656

5757
if (reasonType) {

lib/database/adapters/QcFlagTypeAdapter.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class QcFlagTypeAdapter {
7171
archivedAt: archivedAt ? new Date(archivedAt).getTime() : null,
7272
};
7373
}
74-
74+
7575
/**
7676
* Converts the given database object to an summary object.
7777
*
@@ -82,14 +82,14 @@ class QcFlagTypeAdapter {
8282
const { id, bad, color, method, name, createdBy, lastUpdatedBy, createdAt, updatedAt } = databaseObject;
8383

8484
return {
85-
id,
86-
bad,
87-
color,
88-
method,
89-
name,
90-
createdBy: createdBy? this.userAdapter.toNameOnly(createdBy) :null,
85+
id,
86+
bad,
87+
color,
88+
method,
89+
name,
90+
createdBy: createdBy ? this.userAdapter.toNameOnly(createdBy) : null,
9191
createdAt: createdAt,
92-
lastUpdatedBy: lastUpdatedBy? this.userAdapter.toNameOnly(lastUpdatedBy) :null,
92+
lastUpdatedBy: lastUpdatedBy ? this.userAdapter.toNameOnly(lastUpdatedBy) : null,
9393
updatedAt,
9494
};
9595
}

lib/database/adapters/RunAdapter.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class RunAdapter {
9898
*
9999
* @param {Detector[]} detectors the list of detector models
100100
* @param {object} entityObject the entity object that is to be modified
101-
* @param {boolean} [addDetectorQuality = true] if detectorQuality should be included
101+
* @param {boolean} [addDetectorQuality = true] if detectorQuality should be included
102102
* @returns {void}
103103
*/
104104
_addDetectorsToObject(detectors, entityObject, addDetectorQuality = true) {
@@ -113,11 +113,10 @@ class RunAdapter {
113113

114114
if (addDetectorQuality) {
115115
entityObject.detectorsQualities = detectors.map((detector) => {
116-
return !detector.RunDetectors
117-
? null
118-
: { id: detector.id, name: detector.name, quality: detector.RunDetectors.quality };
119-
})
120-
.filter((item) => Boolean(item));
116+
const { id, name, RunDetectors: { quality } } = detector;
117+
118+
return detector.RunDetectors ? { id, name, quality } : null;
119+
}).filter((item) => Boolean(item));
121120
} else {
122121
entityObject.detectorsQualities = [];
123122
}
@@ -128,11 +127,11 @@ class RunAdapter {
128127
*
129128
* @param {Detector[]} detectors the list of detector models
130129
* @param {object} entityObject the entity object that is to be modified
131-
* @param {boolean} [addDetectorQuality = true] if detectorQuality should be included
130+
* @param {boolean} [addDetectorQuality = true] if detectorQuality should be included
132131
* @returns {void}
133132
*/
134133
_computeQcFlags(qcFlags = [], entityObject, isSummary = false) {
135-
const adaptedQcFlags = isSummary
134+
const adaptedQcFlags = isSummary
136135
? qcFlags.map(this.qcFlagAdapter.toSummary)
137136
: qcFlags.map(this.qcFlagAdapter.toEntity);
138137

@@ -370,7 +369,7 @@ class RunAdapter {
370369
qcFlags = [],
371370
} = databaseObject;
372371

373-
/**
372+
/**
374373
* @type {Run}
375374
*/
376375
const entityObject = {
@@ -405,7 +404,6 @@ class RunAdapter {
405404
triggerValue: databaseObject.triggerValue,
406405
tags: databaseObject.tags,
407406
pdpBeamType: databaseObject.pdpBeamType,
408-
runType: databaseObject.runType,
409407
lhcPeriod: databaseObject.lhcPeriod,
410408
aliceL3Polarity,
411409
aliceL3Current,

lib/database/utilities/QueryBuilder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class QueryBuilder {
481481
this.options.order = [];
482482
}
483483

484-
this.options.order = this.options.order.concat(orders)
484+
this.options.order = this.options.order.concat(orders);
485485
return this;
486486
}
487487

@@ -581,7 +581,7 @@ class QueryBuilder {
581581
}
582582

583583
return attribute;
584-
})
584+
});
585585

586586
for (const column of columns) {
587587
if (existing.includes(columns)) {
@@ -641,7 +641,7 @@ class QueryBuilder {
641641
const alreadyOrdered = options.order?.some(([column]) => column === primaryKey);
642642

643643
if (!alreadyOrdered) {
644-
this.orderBy(primaryKey, 'ASC')
644+
this.orderBy(primaryKey, 'ASC');
645645
}
646646
}
647647

lib/server/services/dataPasses/DataPassService.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313

14-
const { Op } = require('sequelize');
1514
const { repositories: { DataPassRepository, LhcPeriodRepository } } = require('../../../database');
1615
const { dataSource } = require('../../../database/DataSource.js');
1716
const { dataPassAdapter } = require('../../../database/adapters');
@@ -142,7 +141,7 @@ class DataPassService {
142141
queryBuilder.where('name').not().substring(`\\_${NonPhysicsProductionsNamesWords.DEBUG}`);
143142
}
144143

145-
queryBuilder.selectAttributes([...dataPassSumary.attributes])
144+
queryBuilder.selectAttributes([...dataPassSumary.attributes]);
146145

147146
const { count, rows } = await DataPassRepository.findAndCountAll(queryBuilder);
148147
const dataPassVersionsQueryBuilder = dataSource.createQueryBuilder();

lib/server/views/dataPasses/summary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ export const dataPassSumary = {
1818
export const dataPassVersionSummary = {
1919
attributes: ['outputSize', 'reconstructedEventsCount', 'description', 'dataPassId'],
2020
include: [{ association: 'statusHistory', attributes: ['status'] }],
21-
order: [['statusHistory', 'createdAt', 'ASC']]
21+
order: [['statusHistory', 'createdAt', 'ASC']],
2222
};

lib/server/views/environments/summary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* or submit itself to any jurisdiction.
1212
*/
1313

14-
import database from "../../../database/index.js";
14+
import database from '../../../database/index.js';
1515

1616
const { Run, EnvironmentHistoryItem } = database.sequelize.models;
1717

lib/server/views/logs/summary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ export const logSummary = {
2626
{ association: 'tags', attributes: ['text', 'id'] },
2727
{ association: 'lhcFills', attributes: ['fillNumber'] },
2828
{ association: 'attachments', attributes: ['id'] },
29-
]
29+
],
3030
};

0 commit comments

Comments
 (0)