eugenegujing opened a new pull request, #7310:
URL: https://github.com/apache/texera/pull/7310

   ### What changes were proposed in this PR?
   
   This PR removes the "Import Workflow" button from the workspace toolbar.
   
   The button imported a workflow JSON file into the currently opened workflow, 
but it fabricated the workflow's metadata from scratch: it set `wid` to 
`undefined`, renamed the workflow to the imported file's name, and reset 
`description` and the published state. Because `wid` was wiped, the 
auto-persist that fired after the import sent no wid to `/workflow/persist`, so 
the backend inserted a brand-new workflow: every import silently created a 
duplicate workflow in the user's list and switched the editor URL to it, while 
the originally opened workflow's content had already been overwritten (#6846).
   
   In discussion #6873 the button should simply be removed instead of patched: 
the dashboard workflow-list page already has an upload button that covers 
"create a workflow from a JSON file" (single JSON or a zip of several), so the 
toolbar button provides no capability that is lost by removing it.
   
   Concretely:
   
   - `menu.component.html`: remove the `<nz-upload>` block wrapping the import 
button.
   - `menu.component.ts`: remove the `onClickImportWorkflow` handler and the 
imports only it used (`NzUploadFile`/`NzUploadComponent` from ng-zorro, 
`NzUploadComponent` in the standalone `imports` array, `DEFAULT_WORKFLOW_NAME`).
   - `menu.component.scss`: remove the now-dead `nz-upload` selector.
   - `menu.component.spec.ts`: add regression tests asserting the toolbar 
renders no `nz-upload` control / no `button[title="import workflow"]`, and the 
component defines no `onClickImportWorkflow` member.
   
   No backend changes. The dashboard upload feature is untouched.
   
   After (import button removed):
   
   <img width="1512" height="900" alt="Screenshot 2026-08-04 at 1 50 51 PM" 
src="https://github.com/user-attachments/assets/84bdcfa7-ac66-42f9-8f1e-dfe255f4a7da";
 />
   
   ### Any related issues, documentation, discussions?
   
   Fixes #6846. Implements the outcome of discussion #6873.
   
   ### How was this PR tested?
   
   New regression tests were written first and confirmed failing against the 
pre-change code, then passing after the removal; a mutation check (temporarily 
re-adding the button) confirmed the tests catch a re-introduction. The full 
`menu.component.spec.ts` passes (57/57), all specs under 
`workspace/component/menu` and `workspace/component/left-panel` pass (116/116), 
`tsc --noEmit` reports zero errors, and the CI-equivalent production build (`ng 
build --configuration=production`) completes with zero errors. Manually 
verified in the local dev environment that the toolbar no longer shows the 
import button and that the dashboard workflow-list upload button still creates 
a workflow from a JSON file.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Co-authored by: Claude Code (Claude Fable 5)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to