Skip to content

Commit

Permalink
Clean code implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Clementlgz committed Jun 16, 2022
1 parent aa0f0c6 commit 86362dd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/Selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export default class Selection {
if ([...existingClause.selection, ...existingClause.exclusion].length === 0)
this.selectionJSON.data.splice(this.selectionJSON.data.indexOf(existingClause), 1);
} else {
console.log('add topic');
this.addTopic(topicID);
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/components/portfolioPage/Corpora.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class Corpora extends Component {
let count = this.props.items.length;
let total = this.props.from;
let listIds = this.props.ids.map((corpus) =>{
corpus = 'corpus : '.concat(corpus);
return <div key={corpus}> <input type="checkbox" value={corpus} onChange={this.handleChange} checked={this.isChecked(corpus)}/>{corpus} <ItemCreator corpus={corpus} conf={this.props.conf} /></div>;
let corpusFormated = 'corpus : '.concat(corpus);
return <div key={corpusFormated}> <input class="corpus_checkbox" type="checkbox" value={corpusFormated} onChange={this.handleChange} checked={this.isChecked(corpusFormated)}/> {corpus} <ItemCreator corpus={corpus} conf={this.props.conf} /></div>;
}
);
return (
Expand Down Expand Up @@ -99,8 +99,7 @@ class Corpora extends Component {

isChecked(corpus) {
const selection = Selection.fromURI();
let list = this.state.listCorpus;
return selection.isSelectedOrExcluded(corpus) !== 'Excluded' || list.length === 0;
return selection.isSelectedOrExcluded(corpus) !== 'Excluded';
}

handleCorpusSelected(corpusId) {
Expand Down
1 change: 0 additions & 1 deletion src/components/portfolioPage/Portfolio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ class Portfolio extends Component {
[item]
).getAttributes()
.map(([key, value]) => key.concat(' : ', value.replace('\'', '’')));
console.log(result);
return result;
}

Expand Down
2 changes: 0 additions & 2 deletions src/components/portfolioPage/Status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Status extends Component {
.sort(filter)
.map(
t => {
console.log('t=', t);
let res = (t.topic === null) ? <Trans>Rubrique inconnue</Trans> : <Badge exclusion={t.excluded} id={t.id} name={t.topic.name} _changeItemState={this._changeItemState}/>;
return res;
}
Expand All @@ -38,7 +37,6 @@ class Status extends Component {
}

_getCandidate(id) {
console.log('id=', id);
for (let v of this.props.candidates) {
if (v[id]) {
return v[id];
Expand Down

0 comments on commit 86362dd

Please sign in to comment.