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

🐛 Reset wizard form after analysis run #1267

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

ibolton336
Copy link
Member

@ibolton336 ibolton336 commented Aug 8, 2023

@ibolton336 ibolton336 force-pushed the reset-form-after-analysis-run branch 2 times, most recently from 86cf127 to c777e34 Compare August 8, 2023 17:35
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch coverage: 8.33% and project coverage change: -0.18% ⚠️

Comparison is base (e47565e) 43.28% compared to head (f1a9151) 43.11%.

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     
Flag Coverage Δ
client 43.11% <8.33%> (-0.18%) ⬇️
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...s/applications/analysis-wizard/analysis-wizard.tsx 62.99% <8.33%> (-5.56%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

gitdallas
gitdallas previously approved these changes Aug 8, 2023
Copy link
Collaborator

@gitdallas gitdallas left a 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.

@ibolton336 ibolton336 marked this pull request as draft August 8, 2023 18:21
@ibolton336
Copy link
Member Author

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.

@ibolton336 ibolton336 marked this pull request as ready for review August 8, 2023 18:25
@ibolton336 ibolton336 force-pushed the reset-form-after-analysis-run branch from a002422 to bfd1bd3 Compare August 8, 2023 18:25
@ibolton336
Copy link
Member Author

@gitdallas Updated - good idea to consolidate that logic.

@ibolton336 ibolton336 force-pushed the reset-form-after-analysis-run branch from 680cf97 to 55b59ad Compare August 8, 2023 18:41
@gitdallas gitdallas self-requested a review August 8, 2023 18:41
Comment on lines 301 to 302
if (id && stepIdReached < (id as number)) setStepIdReached(id as number);
if (id === 2) {
Copy link
Collaborator

@gitdallas gitdallas Aug 8, 2023

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.

Copy link
Member Author

@ibolton336 ibolton336 Aug 8, 2023

Choose a reason for hiding this comment

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

Updated to use the enum to identify the step as
Screenshot 2023-08-08 at 2 56 14 PM

StepId.SetTargets (2)

Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2023-08-08 at 2 54 07 PM
Looks like the string/number type is coming from PF.

Copy link
Contributor

@gildub gildub left a comment

Choose a reason for hiding this comment

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

Please see inline.

@gildub gildub dismissed gitdallas’s stale review August 8, 2023 19:30

Sorry but some changes are needed

@@ -286,28 +280,37 @@ export const AnalysisWizard: React.FC<IAnalysisWizard> = ({
};

const isModeValid = applications.every((app) => isModeSupported(app, mode));
const resetWizard = () => {
Copy link
Collaborator

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

Copy link
Collaborator

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

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

@ibolton336 ibolton336 force-pushed the reset-form-after-analysis-run branch 2 times, most recently from ec75830 to 652497c Compare August 8, 2023 20:25
Signed-off-by: ibolton336 <ibolton@redhat.com>
@ibolton336 ibolton336 merged commit 3d72ff9 into konveyor:main Aug 8, 2023
6 checks passed
@ibolton336 ibolton336 deleted the reset-form-after-analysis-run branch August 8, 2023 23:26
ibolton336 added a commit that referenced this pull request Aug 17, 2023
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sometimes wizard state is persisted between analysis runs
3 participants