Skip to content

feat: Add Dataflow combined create/import dialog (closes #2126) - #3216

Open
ohdsi-trex wants to merge 1 commit into
developfrom
ohdsi-trex/add-dataflow-dialog-clean
Open

feat: Add Dataflow combined create/import dialog (closes #2126)#3216
ohdsi-trex wants to merge 1 commit into
developfrom
ohdsi-trex/add-dataflow-dialog-clean

Conversation

@ohdsi-trex

Copy link
Copy Markdown
Collaborator

$## Summary\n\nCloses #2126.\n\n- Replaces separate Create new dataflow and Import flow actions with a unified Add Dataflow dialog.\n- Adds create/import radio modes, optional template selection, and drag-and-drop JSON upload with uploading, success, and error states.\n- Imports through the create-dataflow API so a persisted new flow is opened without overwriting the active canvas.\n- Updates the ETL E2E workflow for the combined dialog.\n\n## Screenshots\n\nScreenshots were captured during the original implementation but are intentionally not included in this replacement branch so no trex/ artifacts appear in the pull request diff.\n\n- Toolbar with Add Dataflow\n- Create mode dialog\n- Import mode: idle, success, and error states\n\n## Verification\n\nDesign review selected; runtime checks intentionally skipped because the dev server was not available.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Unifies dataflow creation and import into the Add Dataflow dialog.

Changes:

  • Adds create, template, and JSON import modes.
  • Removes the standalone import toolbar action.
  • Updates export/import E2E coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
export-import-dataflow.spec.ts Tests the unified workflow.
FlowLayout.tsx Removes standalone import action.
SaveNewFlowButton.tsx Renames the creation action.
SaveFlowDialog.tsx Implements import modes and validation.
SaveFlowDialog.scss Styles the redesigned dialog.
ImportFlowButton.tsx Removes legacy import implementation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +165 to 169
if (!file.name.toLowerCase().endsWith(".json")) {
setUploadState("error");
setUploadError("Choose a JSON dataflow export file.");
setImportedDataflow(undefined);
return;
Comment on lines +14 to +16
<Tooltip title="Add Dataflow">
<div>
<IconButton startIcon={<EmptyFileIcon />} onClick={handleClick} />
<IconButton aria-label="Add Dataflow" startIcon={<EmptyFileIcon />} onClick={handleClick} />
Comment on lines +177 to +183
const reader = new FileReader();
reader.onload = () => {
try {
const parsed = getImportedDataflow(JSON.parse(String(reader.result)));
setImportedDataflow(parsed);
setUploadedFileName(file.name);
setUploadState("success");
<input ref={hiddenFileInput} className="save-flow-dialog__file-input" type="file" accept=".json,application/json" onChange={handleFileChange} />
<div className={`save-flow-dialog__drop-zone save-flow-dialog__drop-zone--${uploadState}${dragActive ? " save-flow-dialog__drop-zone--active" : ""}`} role="button" tabIndex={0} onClick={() => hiddenFileInput.current?.click()} onKeyDown={(event) => { if (event.key === "Enter" || event.key === " ") hiddenFileInput.current?.click(); }} onDragEnter={(event) => { event.preventDefault(); setDragActive(true); }} onDragOver={(event) => event.preventDefault()} onDragLeave={(event) => { event.preventDefault(); setDragActive(false); }} onDrop={handleDrop}>
{uploadState === "success" ? <CheckCircleOutlineIcon /> : uploadState === "error" ? <ErrorOutlineIcon /> : <UploadFileOutlinedIcon />}
<div>{uploadState === "uploading" ? "Uploading dataflow…" : uploadState === "success" ? uploadedFileName : uploadState === "error" ? uploadError : <>Add by importing <button type="button" onClick={(event) => { event.stopPropagation(); hiddenFileInput.current?.click(); }}>Browse</button> or drag and drop</>}</div>
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.

2 participants