n8n/cypress
Milorad FIlipović 711fa2b925
fix(editor): Fix operation change failing in certain conditions (#8114)
## Summary
This PR handles the case when there are multiple parameters with the
same name but different `options` and `displayOptions`. In this case, if
one of such fields is set, changing the dependent parameter value so the
other should be shown causes an error in case their options are not
compatible (this
[check](7806a65229/packages/workflow/src/NodeHelpers.ts (L786))).

#### Example:
LDAP node has two `options` properties with the same name:
1. `attributes` with predefined options (`add`, `replace`, `delete`).
Shown when **Update** operation is selected
2. `attributes` with a collection of `attribute` objects. Shows for the
**Create** operation

Setting one of these parameter values and switching operation so the
other is shown breaks the app.
This PR checks if there is a value saved for such parameter and removes
it before calling `getNodeParameters` in `valueChanged` handler.

## Related tickets and issues
Fixes ADO-1589

## Review / Merge checklist
- [x] PR title and summary are descriptive. **Remember, the title
automatically goes into the changelog. Use `(no-changelog)` otherwise.**
([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md))
- [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up
ticket created.
- [x] Tests included.
> A bug is not considered fixed, unless a test is added to prevent it
from happening again.
   > A feature is not complete without tests.
2023-12-22 08:41:20 +01:00
..
composables fix(editor): Move versions check to init function and refactor store (no-changelog) (#8067) 2023-12-20 12:49:40 +02:00
e2e fix(editor): Fix operation change failing in certain conditions (#8114) 2023-12-22 08:41:20 +01:00
fixtures fix: Show public API upgrade CTA when feature is not enabled (#8109) 2023-12-21 09:06:54 -05:00
pages fix(editor): Fix operation change failing in certain conditions (#8114) 2023-12-22 08:41:20 +01:00
support feat(editor): Show template credential setup based on feature flag (#7989) 2023-12-11 20:21:10 +02:00
utils feat: Add AI tool building capabilities (#7336) 2023-11-29 12:13:55 +01:00
constants.ts feat(editor): Filter component + implement in If node (#7490) 2023-12-13 14:45:22 +01:00
tsconfig.json fix: Include cypress TypeScript types in /cypress folder (no-changelog) (#7746) 2023-11-20 09:26:25 +01:00
types.ts refactor: Format root-level dirs (no-changelog) (#4938) 2022-12-15 16:39:59 +01:00