-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat(ui-study): add button to display display 'digest' file on successful tasks in task list #2101
Conversation
await new Promise((res) => { | ||
setTimeout(() => { | ||
res(1); | ||
}, 5000); | ||
}); |
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 that for dev testing ? consider removing 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.
Thanks
@@ -37,6 +39,15 @@ export const ColorStatus = { | |||
failed: "error.main", | |||
}; | |||
|
|||
const iconSx = { |
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.
optional: iconStyles
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.
Ok
const [openDigestDialog, setOpenDigestDialog] = useState<LaunchJob | null>( | ||
null, | ||
); |
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.
Instead of using a single state to manage both the visibility and the data of the dialog, you should use two states: one for controlling the visibility and another for storing the data to be passed to the dialog.
const [openDigestDialog, setOpenDigestDialog] = useState(false);
const [selectedJob, setSelectedJob] = useState<LaunchJob | null>(null);
then adapt the rest:
// add the event handler
const handleOpenDigestDialog = (job: LaunchJob) => {
setSelectedJob(job);
setOpenDigestDialog(true);
};
// use it here
{job.status === "success" && (
<Tooltip title="Digest">
<EqualizerIcon
onClick={handleOpenDigestDialog}
sx={iconSx}
/>
</Tooltip>
)}
adapt this too/
{openDigestDialog && selectedJob && (
<DigestDialog
open
studyId={selectedJob.studyId}
outputId={selectedJob.outputId}
onOk={() => setOpenDigestDialog(false)}
/>
)}
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 wanted to change few codes because the view must be redesigned, but I will make a change.
870ef94
to
177ebb8
Compare
…sful tasks in task list
177ebb8
to
2f0ae26
Compare
ANT-1905