-
Notifications
You must be signed in to change notification settings - Fork 793
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
Fix bug where we can't change tab from attack to another tab in Configure #1331
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1331 +/- ##
========================================
Coverage 40.25% 40.25%
========================================
Files 474 474
Lines 13860 13860
========================================
Hits 5579 5579
Misses 8281 8281 Continue to review full report at Codecov.
|
This is the issue #1293, right? |
Yep, changed it. |
@@ -234,7 +236,11 @@ class ConfigurePageComponent extends AuthComponent { | |||
|
|||
updateConfigSection = () => { | |||
let newConfig = this.state.configuration; | |||
if (Object.keys(this.state.currentFormData).length > 0) { | |||
|
|||
if (this.currentSection === 'attack' && this.state.currentFormData === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check if this.state.currentFormData === undefined
? how did it get undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So maybe when setting the attack
tab we should set form data to {}
so the check of Object.keys(this.state.currentFormData).length > 0
would work again?
if (Object.keys(this.state.currentFormData).length > 0) { | ||
|
||
if (this.currentSection === 'attack' && this.state.currentFormData === undefined) { | ||
this.state.currentFormData = this.state.attackConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this.state.currentFormData
to be set to this.state.attackConfig
, because this.state.attackConfig;
is a separate thing. On attack matrix we don't submit the form data, thus we don't need to track it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe set it to empty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've tried it, but still run into bugs
f2caa09
to
1eb0c7b
Compare
…igurePage.js because it's a state variable
1eb0c7b
to
491c44a
Compare
What does this PR do?
Fixes #1293 .
Add any further explanations here.
PR Checklist
Was the CHANGELOG.md updated to reflect the changes?Was the documentation framework updated to reflect the changes?Testing Checklist
Added relevant unit tests?Explain Changes
Note: I didn't do the test on Network or Ransomware. Check the fix in #1330 .