From d6bdd2c465c2e4a7c202d45c4d31aa21c8a86225 Mon Sep 17 00:00:00 2001 From: Ashwini Date: Tue, 8 Oct 2024 08:01:47 +0000 Subject: [PATCH] code cleanup --- .../analysesTab/ReactionDetailsContainers.js | 104 +++++++++--------- .../ResearchPlanDetailsContainers.js | 57 +++++----- 2 files changed, 81 insertions(+), 80 deletions(-) diff --git a/app/packs/src/apps/mydb/elements/details/reactions/analysesTab/ReactionDetailsContainers.js b/app/packs/src/apps/mydb/elements/details/reactions/analysesTab/ReactionDetailsContainers.js index d4a141822f..d6814949dd 100644 --- a/app/packs/src/apps/mydb/elements/details/reactions/analysesTab/ReactionDetailsContainers.js +++ b/app/packs/src/apps/mydb/elements/details/reactions/analysesTab/ReactionDetailsContainers.js @@ -107,11 +107,11 @@ export default class ReactionDetailsContainers extends Component { }); } - handleChange(container) { + handleChange = () => { const { handleReactionChange } = this.props; const { reaction } = this.state; handleReactionChange(reaction); - } + }; handleSpChange(reaction, cb) { const { handleReactionChange } = this.props; @@ -352,57 +352,57 @@ export default class ReactionDetailsContainers extends Component { if (analyses_container.length === 1 && analyses_container[0].children.length > 0) { return ( -
-
- {this.addButton()} -
- - {analyses_container[0].children.map((container, key) => { - const isFirstTab = key === 0; - return ( - { this.containerRefs[key] = element; }} - key={`reaction_container_${container.id}`} - className={"rounded-0 border-0" + (isFirstTab ? '' : ' border-top')} - > - - - {container.is_deleted ? containerHeaderDeleted(container) : containerHeader(container)} - - - - {!container.is_deleted && - - - - - - - - } - - ); - })} - +
+
+ {this.addButton()}
+ + {analyses_container[0].children.map((container, key) => { + const isFirstTab = key === 0; + return ( + { this.containerRefs[key] = element; }} + key={`reaction_container_${container.id}`} + className={`rounded-0 border-0${isFirstTab ? '' : ' border-top'}`} + > + + + {container.is_deleted ? containerHeaderDeleted(container) : containerHeader(container)} + + + + {!container.is_deleted && ( + + + this.handleChange(container)} + /> + + + + + )} + + ); + })} + +
); } diff --git a/app/packs/src/apps/mydb/elements/details/researchPlans/analysesTab/ResearchPlanDetailsContainers.js b/app/packs/src/apps/mydb/elements/details/researchPlans/analysesTab/ResearchPlanDetailsContainers.js index 54fde9b8d5..2ffa2198f7 100644 --- a/app/packs/src/apps/mydb/elements/details/researchPlans/analysesTab/ResearchPlanDetailsContainers.js +++ b/app/packs/src/apps/mydb/elements/details/researchPlans/analysesTab/ResearchPlanDetailsContainers.js @@ -241,13 +241,13 @@ export default class ResearchPlanDetailsContainers extends Component { return (
- + {container.name} {titleKind} {titleStatus} - +
{analysesContainer[0].children.map((container, key) => { + const isFirstTab = key === 0; return ( @@ -287,30 +288,30 @@ export default class ResearchPlanDetailsContainers extends Component { - {!container.is_deleted && - - - - - - + {!container.is_deleted && ( + + + + + + - } - + )} + ); })}