-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
refactor(ui): workflow panel components from class to functional #11803
Merged
terrytangyuan
merged 10 commits into
argoproj:master
from
tetora1053:refactor-ui-workflow-panel-components-functional
Sep 15, 2023
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
67abb6a
refactor(ui): workflow panel components from class to functional
tetora1053 9db7933
fix: remove a state just set but not used
tetora1053 3829568
refactor: from anonymous function to named function
tetora1053 6737c3b
refactor: from anonymous function to named function
tetora1053 9e1fd46
refactor: remove type annotations for primitives
tetora1053 48e214d
refactor: use async/await instead of chaining promise callbacks
tetora1053 eb59c26
refactor: use optional chanining instead of &&
tetora1053 6634c0a
refactor: memoize templateOptions in entrypoint select options
tetora1053 0e47525
refactor: hoist up static variable out of component
tetora1053 106027a
fix: variables memoization
tetora1053 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this did not change, but shouldn't this use react-router navigation instead?
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 I think the current pattern is to use the History API with
history.push
. We are on an older version of react-router though (I'm working on upgrading it -- have to finish removingBasePage
first), so I don't think theuseHistory
hook is available. Other components usehistory
from props currentlyThere 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.
thanks! I was just researching how to write in current react router version.
I'll try!
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.
I tryed passing
history
in props and replaced 'document.location.href' with 'history.push', but it didn't work as I expected :(props.history.push(`workflows/${submitted.metadata.namespace}/${submitted.metadata.name}`);
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.
If the scope of the changes is likely to be larger than initially expected, it might be good to reconsider the approach after your react-router version up I think.
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.
no, the icon does not change at all from this image
before the modification, the icon had changed yellow -> blue -> green
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.
Huh. Since this is on the same page (just different Workflow), I wonder if maybe the page is not quite unloading correctly and still has the old state. The effects seem to have proper disposers and dependencies, so I don't see anything strange off the top of my head.
At this point, especially since it potentially involves a whole other page's logic, I think we should punt on the navigation improvements for now. Appreciate your efforts and investigation here! Hopefully that will help the next person to tackle this too (which could be yourself 😉 ).
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.
In the retry component, the state appears to be changing as expected, so the difference in implementation between retry and resubmit may be a clue, though I haven't been able to found out.
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.
If I figure it out, I'll make a PR🔥
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 a retry does not create a new Workflow, it just reruns failed steps. A resubmit creates a wholly new Workflow, effectively a clone of the old one.
So for a retry, the URL does not change. For a resubmit it does.
For the retry, the existing
ListWatch
might be able to pick up the change automatically. For a resubmit, an entirely new request is needed for the new Workflow.Maybe those details may help you debug?
I already knew that though (I wrote a bit of the documentation on retry vs resubmit in #11625) and couldn't figure it out, though I didn't stare too hard