Skip to content

Commit

Permalink
Eslint / lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jbflo committed Oct 17, 2023
1 parent 459ee48 commit 0b6240e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions mxcube3/core/components/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,9 @@ def delete_entry(self, entry):
parent_entry.dequeue(entry)
model = entry.get_data_model()
HWR.beamline.queue_model.del_child(model.get_parent(), model)
logging.getLogger("MX3.HWR").info("[DELETE QUEUE] FROM:\n%s " % model.get_parent().get_name())
logging.getLogger("MX3.HWR").info(
"[DELETE QUEUE] FROM:\n%s " % model.get_parent().get_name()
)

def delete_entry_at(self, item_pos_list):
current_queue = self.queue_to_dict()
Expand Down Expand Up @@ -2241,7 +2243,6 @@ def queue_enable_item(self, qid_list, enabled):
for qid in qid_list:
self.set_enabled_entry(qid, enabled)


def update_sample(self, sid, params):
sample_node = HWR.beamline.queue_model.get_node(sid)

Expand Down
8 changes: 4 additions & 4 deletions ui/src/containers/SampleGridTableContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ class SampleGridTableContainer extends React.Component {

renderPuckSampleItems(puck, sampleNumber) {
const sample = Object.values(this.props.sampleList).find(
(sample) => sample.location === puck + ':' + sampleNumber,
(sample) => sample.location === `${puck}:${sampleNumber}`,
);
if (sample === undefined) {
return null;
Expand Down Expand Up @@ -781,14 +781,14 @@ class SampleGridTableContainer extends React.Component {
return null;
}

// eslint-disable-next-line sonarjs/cognitive-complexity
renderSampleTable(colsm) {
const scContent = this.props.sampleChanger.contents;

if (scContent.children === undefined) {
return null;
}

// eslint-disable-next-line sonarjs/cognitive-complexity
return scContent.children.map((cell) => {
if (
this.props.filterOptions.cellFilter.toLowerCase() === cell.name ||
Expand Down Expand Up @@ -1000,6 +1000,7 @@ class SampleGridTableContainer extends React.Component {
return null;
}

// eslint-disable-next-line sonarjs/cognitive-complexity
renderSampleTableSingleCell(colsm) {
const scContent = this.props.sampleChanger.contents;
const nbpuck = [];
Expand Down Expand Up @@ -1061,9 +1062,8 @@ class SampleGridTableContainer extends React.Component {
return null;
}
return (
<tr>
<tr key={`${puck.name}-td-${puck.name}`}>
<td
key={`${puck.name}-td-${puck.name}`}
className={`sample-items-table-column-body custom-table-border-${
idxtd + 1
}`}
Expand Down
2 changes: 2 additions & 0 deletions ui/src/containers/SampleListViewContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,11 @@ class SampleListViewContainer extends React.Component {
hasLimsData,
);
if (this.props.filterOptions.cellFilter !== '') {
// eslint-disable-next-line no-bitwise
fi &= sample.cell_no === Number(this.props.filterOptions.cellFilter);
}
if (this.props.filterOptions.puckFilter !== '') {
// eslint-disable-next-line no-bitwise
fi &= sample.puck_no === Number(this.props.filterOptions.puckFilter);
}
}
Expand Down

0 comments on commit 0b6240e

Please sign in to comment.