Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed duplicate code #419

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions src/components/dialog/faultEvent/FaultEventCreation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,18 @@ const FaultEventCreation = ({ useFormMethods, isRootEvent, eventValue, isEditedE
{...register("probability")}
/>

{(gateTypeWatch === GateType.PRIORITY_AND || !gateTypeWatch) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are u sure about removing all conditions? Because in my comment i mentioned only removal of gateTypeWatch === GateType.PRIORITY_AND &&.

To be honest i did not try to understand what is code doing, i just saw redundant line of code ... should i try to understand what it does? How come you can remove all conditions ?

Copy link
Collaborator Author

@LaChope LaChope Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not relevant anymore because the logic was changed quite a lot, so it makes sense to remove duplicate code, but I want to test the scenarios again to make sure, but #406 needs to be solved first.

Copy link
Contributor

@blcham blcham Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaChope #406 is solved now

eventTypeWatch === EventType.INTERMEDIATE &&
gateTypeWatch === GateType.PRIORITY_AND && (
<TextField
label="Sequence Probability"
type="number"
min={0}
max={1}
step={0.01}
error={!!errors.sequenceProbability}
helperText={errors.sequenceProbability?.message}
className={classes.sequenceProbability}
defaultValue=""
{...register("sequenceProbability")}
/>
)}
<TextField
label="Sequence Probability"
type="number"
min={0}
max={1}
step={0.01}
error={!!errors.sequenceProbability}
helperText={errors.sequenceProbability?.message}
className={classes.sequenceProbability}
defaultValue=""
{...register("sequenceProbability")}
/>
</>
)}
</>
Expand Down
Loading