-
Notifications
You must be signed in to change notification settings - Fork 113
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
[Kedro-viz-890]/run-export-modal #898
Conversation
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
import { configure, mount, shallow } from 'enzyme'; | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
// to help find text which is made by multiple HTML elements |
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.
Is there a place I can put this util function? I think we can re-use it somewhere else 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.
i was thinking maybe in src/components/ui/button we could add a success button?
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.
yeah i was thinking the same, what do you think of naming it button-success
. It sounds weird but if we name it this way, all the button components display next to each other.
eg
- button
- button-success
what do you think @rashidakanchwala @tynandebold ?
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 should probably generalize it more than that. At some point we'll probably need to supply a fail
state, too. So maybe we do something like button-message
or similar.
Also to your original question about the utility function: you could just export const findTextWithTags
for now, because at the moment I don't think we need it anywhere else, so it may be premature to move it elsewhere. If you want to move it though, somewhere in one of the utils files would be best, but you'd probably want to create a new file, like test-utils.js
, so maybe we hold off for now.
const [exportData, setExportData] = useState([]); | ||
const [isExported, setIsExported] = useState(false); | ||
|
||
const updateExportData = useCallback(() => { |
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 decided to leave
this function here locally in the component itself, rather than in the parent component experiment-primary-toolbar
, or experiment-wrapper
, as it's easier to manage local state, rather than passing it down through props
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
…/kedro-viz into kedro-viz-890/run-export-modal Signed-off-by: huongg <[email protected]>
src/components/experiment-tracking/experiment-primary-toolbar/experiment-primary-toolbar.js
Outdated
Show resolved
Hide resolved
src/components/experiment-tracking/experiment-primary-toolbar/experiment-primary-toolbar.js
Outdated
Show resolved
Hide resolved
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
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.
thanks @Huongg -- LGTM :)
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.
Great work here! It's nearly good to go.
I'm requesting changes and writing only one comment for now. This implementation changes the way to modals are animating in/out, and I don't think it should. We'll need to tweak the changes to somehow fix that.
{showRunDetailsModal && ( | ||
<RunDetailsModal | ||
runMetadataToEdit={runMetadataToEdit} | ||
runs={runMetadata} | ||
setShowRunDetailsModal={setShowRunDetailsModal} | ||
theme={theme} | ||
visible={showRunDetailsModal} | ||
/> | ||
)} | ||
{showRunExportModal && ( | ||
<RunExportModal | ||
theme={theme} | ||
visible={showRunExportModal} | ||
setShowRunExportModal={setShowRunExportModal} | ||
runMetadata={runMetadata} | ||
runTrackingData={runTrackingData} | ||
/> | ||
)} |
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 asked about this yesterday when you were getting a sense check on this approach, and now looking at this work locally it seems that this does change the behavior of the modals animating in and out.
If you look on the main
branch you'll see that when they enter there's a fade in and up, and when they disappear it's down and out. We'll need to keep that UX here, too, which means we'll have to find a way not to do this showRunExportModal &&
or do that and still animate.
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.
hey @tynandebold such a good spot, you're right. We should not remove the animation, sorry i didnt realise it yesterday. Actually, i can just use the existing props visible
to apply the context, rather than check with props to render a specific component
Let me know what you think about the latest changes? Happy to discuss further
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
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.
Excellent changes. The animations are back! Thank you for that. I'm approving now with some comments and a couple of thoughts:
- When I toggle through the
RunExportModal
with my keyboard and export the data the modal animation doesn't fire nor does the modal close. It does work on theRunDetailsModal
though. - I like the use of context, I just hope that if we need to react to a failed API request and then show a failed state in the button instead of the success we'll be able to. We will, right?
src/components/experiment-tracking/run-export-modal.js/run-export-modal.js
Outdated
Show resolved
Hide resolved
src/components/experiment-tracking/run-export-modal.js/run-export-modal.js
Outdated
Show resolved
Hide resolved
src/components/experiment-tracking/run-export-modal.js/run-export-modal.scss
Show resolved
Hide resolved
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
Signed-off-by: huongg <[email protected]>
hey to answer your question as below
|
Perfect Yes, let's create a new ticket to track that keyboard bug. And good to know about the failed state. Thanks for confirming. Merge this whenever you can! |
Description
Resolves #890: To create a modal to notify users when they download a run in the experiment tracking
Development notes
QA notes
There are tests to ensure both buttons work as expected
Checklist
RELEASE.md
file