The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
02fe9c7cb5dabe5374b3e858660e0b85890da57d / Eugene Gu <[email protected]>
chore(frontend): remove the workspace toolbar "Import Workflow" button (#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)

Report URL: https://github.com/apache/texera/actions/runs/30961247638

With regards,
GitHub Actions via GitBox

Reply via email to