Skip to content
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

fix(editor): Prevent error from showing-up when duplicating unsaved workflow #5833

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

OlegIvaniv
Copy link
Contributor

In the DuplicateWorkflowDialog modal we were using getWorkflowById to get the current workflow data. But if the workflow is not saved, it's not stored in workflowsById so it can't be retrieved and would throw an error. Instead, we use the current workflow data(workflowsStore.workflow) if the id is PLACEHOLDER_EMPTY_WORKFLOW_ID and current workflows id is also PLACEHOLDER_EMPTY_WORKFLOW_ID.
Github issue / Community forum post (link here to close automatically):

@github-actions
Copy link
Contributor

github-actions bot commented Mar 30, 2023

Great PR! Please pay attention to the following items before merging:

Files matching packages/**:

  • If fixing bug, added test to cover scenario.
  • If addressing forum or Github issue, added link to description.

Files matching **/*.vue:

  • Used composition API for all new components.
  • Added component or unit tests to cover functionality.

Files matching packages/editor-ui/**/*.vue:

  • Added E2E if adding new features.
  • Used design system tokens (colors, spacings...) where possible.

Files matching cypress/e2e/**:

  • Avoided chaining commands more than two or three times (to avoid flakiness because only last one will be retried).
  • Spoofed endpoints that are not critical for the test (to avoid flakiness).
  • Picked most efficient path to start the test (for example skipped account setup and starting at /workflow/new for a canvas test).
  • Avoided adding waits on time (use request intercepts instead).
  • Ensured each spec does not depend on any another spec to pass.

Make sure to check off this list before asking for review.

mutdmour
mutdmour previously approved these changes Mar 30, 2023
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (58fda25) 14.84% compared to head (46c9f49) 14.84%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5833   +/-   ##
=======================================
  Coverage   14.84%   14.84%           
=======================================
  Files        2475     2475           
  Lines      113363   113371    +8     
  Branches    17702    17704    +2     
=======================================
+ Hits        16826    16829    +3     
- Misses      95993    95997    +4     
- Partials      544      545    +1     

see 7 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team ui Enhancement in /editor-ui or /design-system labels Mar 30, 2023
@OlegIvaniv OlegIvaniv merged commit 0b0024d into master Mar 30, 2023
@OlegIvaniv OlegIvaniv deleted the ado-107-bug-duplicating-an-unsaved-workflow branch March 30, 2023 12:34
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Mar 30, 2023
believe-Mahesh pushed a commit to believe-Mahesh/n8n that referenced this pull request Apr 4, 2023
…orkflow (n8n-io#5833)

* fix(editor): Prevent error from showing-up when duplicating unsaved workflow

* Add unsaved workflow duplicate test
@janober
Copy link
Member

janober commented Apr 19, 2023

Got released with [email protected]

sunilrr pushed a commit to fl-g6/qp-n8n that referenced this pull request Apr 24, 2023
…orkflow (n8n-io#5833)

* fix(editor): Prevent error from showing-up when duplicating unsaved workflow

* Add unsaved workflow duplicate test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team Released ui Enhancement in /editor-ui or /design-system Upcoming Release Will be part of the upcoming release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants