n8n/packages/editor-ui/src
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
..
__tests__ fix(editor): Move versions check to init function and refactor store (no-changelog) (#8067) 2023-12-20 12:49:40 +02:00
api feat(editor): Add lead enrichment suggestions to workflow list (#8042) 2023-12-19 09:10:03 -05:00
assets/images feat: External Secrets storage for credentials (#6477) 2023-08-25 10:33:46 +02:00
components fix(editor): Fix operation change failing in certain conditions (#8114) 2023-12-22 08:41:20 +01:00
composables feat(editor): Add lead enrichment suggestions to workflow list (#8042) 2023-12-19 09:10:03 -05:00
event-bus feat(core): Add support for building LLM applications (#7235) 2023-10-02 17:33:43 +02:00
hooks fix(editor): Fix dialogVisibleChanged hooks event when meta.value is undefined (no-changelog) (#7986) 2023-12-14 13:13:02 +02:00
mixins fix(editor): Move versions check to init function and refactor store (no-changelog) (#8067) 2023-12-20 12:49:40 +02:00
models refactor: Run lintfix (no-changelog) (#7537) 2023-10-27 14:15:02 +02:00
plugins feat(editor): Finalize workers view (#8052) 2023-12-20 17:49:14 +01:00
rbac fix(editor): Replace isInstanceOwner checks with scopes where applicable (#7858) 2023-12-04 10:02:54 +01:00
stores feat(editor): Finalize workers view (#8052) 2023-12-20 17:49:14 +01:00
styles refactor(editor): Color palette updates, introduce dark mode (#6980) 2023-11-01 13:33:36 +01:00
types fix(editor): Replace isInstanceOwner checks with scopes where applicable (#7858) 2023-12-04 10:02:54 +01:00
utils fix: Upgrade axios to address CVE-2023-45857 (#7713) 2023-12-19 16:17:01 +01:00
views fix: Show public API upgrade CTA when feature is not enabled (#8109) 2023-12-21 09:06:54 -05:00
App.vue fix(editor): Move versions check to init function and refactor store (no-changelog) (#8067) 2023-12-20 12:49:40 +02:00
constants.ts feat(editor): Add lead enrichment suggestions to workflow list (#8042) 2023-12-19 09:10:03 -05:00
init.ts fix(editor): Move versions check to init function and refactor store (no-changelog) (#8067) 2023-12-20 12:49:40 +02:00
Interface.ts refactor: Add telemetry for RBAC (no-changelog) (#8056) 2023-12-19 17:02:52 +01:00
main.ts fix(editor): Remove n8nHooksNext flag (no-changelog) (#7733) 2023-11-17 14:44:28 +01:00
n8n-theme-variables.scss refactor(editor): Color palette updates, introduce dark mode (#6980) 2023-11-01 13:33:36 +01:00
n8n-theme.scss fix(editor): Dark mode switch style fix and other tweaks (no-changelog) (#7599) 2023-11-14 17:13:30 +01:00
permissions.ts fix(editor): Add back credential use permission (#8023) 2023-12-14 13:36:36 +01:00
router.ts fix: Show public API upgrade CTA when feature is not enabled (#8109) 2023-12-21 09:06:54 -05:00
shims-vue.d.ts feat(editor): Migrate Design System and Editor UI to Vue 3 (#6476) 2023-07-28 09:51:07 +02:00
shims.d.ts fix(editor): Remove n8nHooksNext flag (no-changelog) (#7733) 2023-11-17 14:44:28 +01:00