-
Notifications
You must be signed in to change notification settings - Fork 43
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
🐛 Reset wizard form after analysis run #1267
🐛 Reset wizard form after analysis run #1267
Conversation
ibolton336
commented
Aug 8, 2023
•
edited
Loading
edited
- Resolves Sometimes wizard state is persisted between analysis runs #1256
- When closing the wizard, the taskgroup state hangs around between analysis runs causing problems. This PR cleans up the react state when closing/submitting the analysis wizard
86cf127
to
c777e34
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1267 +/- ##
==========================================
- Coverage 43.28% 43.11% -0.18%
==========================================
Files 143 143
Lines 4288 4291 +3
Branches 999 1000 +1
==========================================
- Hits 1856 1850 -6
- Misses 2354 2361 +7
- Partials 78 80 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
although would it make sense to call handleClose
here? does both reset()
and onClose()
, i'm unsure about the delete task group stuff though.
You're right on the money. Our delete task group stuff was very wrong and needs to be refactored. |
a002422
to
bfd1bd3
Compare
@gitdallas Updated - good idea to consolidate that logic. |
680cf97
to
55b59ad
Compare
if (id && stepIdReached < (id as number)) setStepIdReached(id as number); | ||
if (id === 2) { |
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.
What is 2? Any way we can use a step property or something instead?
Looks like id
is a string
, but line 302 is comparing it as a number.
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.
aaf2f70
to
f1a062c
Compare
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.
Please see inline.
client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx
Outdated
Show resolved
Hide resolved
client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx
Outdated
Show resolved
Hide resolved
client/src/app/pages/applications/applications-table-analyze/applications-table-analyze.tsx
Outdated
Show resolved
Hide resolved
@@ -286,28 +280,37 @@ export const AnalysisWizard: React.FC<IAnalysisWizard> = ({ | |||
}; | |||
|
|||
const isModeValid = applications.every((app) => isModeSupported(app, mode)); | |||
const resetWizard = () => { |
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.
as we are only using this on close and reset
doesn't intuitively mean it will close something, i wonder if it should be replacing the close handler as handleClose
("close" including reset logic is more intuitive imo).. and perhaps have the delete stuff as a parameter flag, or have another deleteAndClose
that does the delete and then calls this
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.
@ibolton336 - actually the delete
is more of a cancel right? maybe just handleCancel
which could delete and then call the close function
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.
Ah that is a good idea @gitdallas.
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.
Updated.
ec75830
to
652497c
Compare
Signed-off-by: ibolton336 <ibolton@redhat.com>
652497c
to
f1a9151
Compare
- Improve handling of taskgroup state by using contextAPI - Async create the taskgroup before uploading the custom binary in the single app use case. This is currently broken because we require a task group to exist before navigating to the upload file screen. This regression was caused by the move away from useEffect here #1267 Resolves https://issues.redhat.com/browse/MTA-1175 Signed-off-by: ibolton336 <ibolton@redhat.com>