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

feat: Add basic variables support #5602

Merged
merged 35 commits into from
Apr 18, 2023
Merged

feat: Add basic variables support #5602

merged 35 commits into from
Apr 18, 2023

Conversation

valya
Copy link
Contributor

@valya valya commented Mar 2, 2023

Github issue / Community forum post (link here to close automatically):

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request labels Mar 2, 2023
@valya valya marked this pull request as ready for review March 3, 2023 14:26
@valya valya requested a review from a team as a code owner March 13, 2023 15:56
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 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 packages/**/*.ts:

  • Added unit tests to cover new or updated functionality.

Files matching packages/cli/src/databases/migrations/**:

  • Requested review from at least two engineers on migration.
  • Avoided irreversible data migrations.
  • Avoided deleting or updating data keys.
  • Wrote 'down' migration if possible.

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

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Patch coverage: 63.86% and project coverage change: +0.50 🎉

Comparison is base (ee7d5a8) 18.00% compared to head (fc2d69d) 18.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5602      +/-   ##
==========================================
+ Coverage   18.00%   18.50%   +0.50%     
==========================================
  Files        2539     2562      +23     
  Lines      115306   116028     +722     
  Branches    17989    18119     +130     
==========================================
+ Hits        20757    21472     +715     
- Misses      93921    93926       +5     
- Partials      628      630       +2     
Impacted Files Coverage Δ
packages/cli/src/InternalHooks.ts 6.70% <0.00%> (-0.07%) ⬇️
packages/cli/src/Server.ts 0.00% <0.00%> (ø)
packages/cli/src/requests.ts 100.00% <ø> (ø)
packages/core/src/NodeExecuteFunctions.ts 14.59% <ø> (ø)
...n-system/src/components/N8nFormInput/validators.ts 0.00% <0.00%> (ø)
...ackages/design-system/src/plugins/n8nComponents.ts 0.00% <0.00%> (ø)
packages/design-system/src/types/datatable.ts 0.00% <0.00%> (ø)
packages/design-system/src/types/form.ts 0.00% <0.00%> (ø)
packages/design-system/src/types/index.ts 0.00% <0.00%> (ø)
...nts/CodeNodeEditor/completions/base.completions.ts 18.40% <0.00%> (-0.47%) ⬇️
... and 39 more

... and 27 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.

alexgrozav and others added 5 commits March 28, 2023 10:44
* feat: add support for row slot to datatable

* feat: add variables create, read, update, delete

* feat: add vars autocomplete

* chore: remove alert

* feat: add variables autocomplete for code and expressions

* feat: add tests for variable components

* feat: add variables search and sort

* test: update tests for variables view

* chore: fix test and linting issue
@valya valya force-pushed the pay-230-p0-variables branch from fb56535 to 4aadc91 Compare April 4, 2023 12:37
alexgrozav and others added 2 commits April 4, 2023 16:56
…g (no-changelog) (#5903)

* fix: Improve variables disabled experience and fix sorting

* fix: update action box margin

* test: update tests for variables row and datatable
valya and others added 10 commits April 5, 2023 12:08
…5910)

* feat: add input validation

* feat: handle variables view for non-instance-owner users

* test: update variables tests

* fix: fix data-testid pattern

* feat: improve overflow styles

* test: fix variables row snapshot

* feat: update sorting to take newly created variables into account

* fix: fix list layout overflow

* fix: fix adding variables on page other than 1. fix validation

* feat: add docs link

* fix: fix default displayName function for resource-list-layout

* feat: improve vars expressions ux, cm-tooltip

* test: fix datatable test

* feat: add MATCH_REGEX validation rule

* fix: overhaul how datatable pagination selector works

* feat: update  completer description

* fix: conditionally update usage syntax based on key validation

* test: update datatable snapshot

* fix: fix variables-row button margins

* fix: fix pagination overflow
krynble
krynble previously approved these changes Apr 14, 2023
@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

krynble
krynble previously approved these changes Apr 14, 2023
@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

@krynble krynble merged commit 1bb9871 into master Apr 18, 2023
@krynble krynble deleted the pay-230-p0-variables branch April 18, 2023 10:41
MiloradFilipovic added a commit that referenced this pull request Apr 18, 2023
* master: (30 commits)
  feat(core): Add versionControl feature flag (#6000)
  fix: Small changes to user activation modal (no-changelog) (#5962)
  fix(editor): Cleanup demo/video experiment (#5974)
  feat: Add variables feature (#5602)
  ci: Improve test for wait node (#5997)
  fix(editor): Fix moving canvas on middle click preventing lasso selection (#5996)
  fix(HTTP Request Node): Fix itemIndex in HTTP Request errors (#5991)
  refactor(editor): Refactor history and debounce mixins to composables (no-changelog) (#5930)
  feat(GitLab Node): Add Additional parameters for File List (#5621)
  build: Update license SDK to v2.1.0 (no-changelog) (#5987)
  fix(OpenAI Node): Update OpenAI Text Moderate input placeholder text (#5823)
  fix(Code Node): Handle user code returning `null` and `undefined` (#5989)
  fix(Google Sheets Trigger Node): Return actual error message
  fix(core): Make `getExecutionId` available on all nodes types (#5990)
  ci: Add checklist item hinting at not adding new dependencies for nodes (no-changelog) (#5985)
  fix(core): Improve SAML connection test result views (#5981)
  fix(IF Node): Fix typo in combine description (no-changelog) (#5964)
  ci: Add a workflow to push n8n releases to release channels (no-changelog) (#5839)
  fix(editor): Make sure to redirect to blank canvas after personalisation modal (#5980)
  fix(core): Fix paired item returning wrong data (#5898)
  ...

# Conflicts:
#	packages/editor-ui/src/Interface.ts
MiloradFilipovic added a commit that referenced this pull request Apr 18, 2023
…rce-mapper-ui

* feature/resource-mapping-component: (30 commits)
  feat(core): Add versionControl feature flag (#6000)
  fix: Small changes to user activation modal (no-changelog) (#5962)
  fix(editor): Cleanup demo/video experiment (#5974)
  feat: Add variables feature (#5602)
  ci: Improve test for wait node (#5997)
  fix(editor): Fix moving canvas on middle click preventing lasso selection (#5996)
  fix(HTTP Request Node): Fix itemIndex in HTTP Request errors (#5991)
  refactor(editor): Refactor history and debounce mixins to composables (no-changelog) (#5930)
  feat(GitLab Node): Add Additional parameters for File List (#5621)
  build: Update license SDK to v2.1.0 (no-changelog) (#5987)
  fix(OpenAI Node): Update OpenAI Text Moderate input placeholder text (#5823)
  fix(Code Node): Handle user code returning `null` and `undefined` (#5989)
  fix(Google Sheets Trigger Node): Return actual error message
  fix(core): Make `getExecutionId` available on all nodes types (#5990)
  ci: Add checklist item hinting at not adding new dependencies for nodes (no-changelog) (#5985)
  fix(core): Improve SAML connection test result views (#5981)
  fix(IF Node): Fix typo in combine description (no-changelog) (#5964)
  ci: Add a workflow to push n8n releases to release channels (no-changelog) (#5839)
  fix(editor): Make sure to redirect to blank canvas after personalisation modal (#5980)
  fix(core): Fix paired item returning wrong data (#5898)
  ...

import type { AuthAgent } from './shared/types';

// mock that credentialsSharing is not enabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a copy-paste comment? there is no code testing credentialsSharing here.

const tablePrefix = getTablePrefix();

await queryRunner.query(`
CREATE TABLE public.variables (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be CREATE TABLE ${tablePrefix}variables.

Fixed here #6011

@github-actions
Copy link
Contributor

✅ All Cypress E2E specs passed

sunilrr pushed a commit to fl-g6/qp-n8n that referenced this pull request Apr 24, 2023
* feat: add variables db models and migrations

* feat: variables api endpoints

* feat: add $variables to expressions

* test: fix ActiveWorkflowRunner tests failing

* test: a different fix for the tests broken by $variables

* feat: variables licensing

* fix: could create one extra variable than licensed for

* feat: Add Variables UI page and $vars global property (n8n-io#5750)

* feat: add support for row slot to datatable

* feat: add variables create, read, update, delete

* feat: add vars autocomplete

* chore: remove alert

* feat: add variables autocomplete for code and expressions

* feat: add tests for variable components

* feat: add variables search and sort

* test: update tests for variables view

* chore: fix test and linting issue

* refactor: review changes

* feat: add variable creation telemetry

* fix: Improve variables listing and disabled case, fix resource sorting (no-changelog) (n8n-io#5903)

* fix: Improve variables disabled experience and fix sorting

* fix: update action box margin

* test: update tests for variables row and datatable

* fix: Add ee controller to base controller

* fix: variables.ee routes not being added

* feat: add variables validation

* fix: fix vue-fragment bug that breaks everything

* chore: Update lock

* feat: Add variables input validation and permissions (no-changelog) (n8n-io#5910)

* feat: add input validation

* feat: handle variables view for non-instance-owner users

* test: update variables tests

* fix: fix data-testid pattern

* feat: improve overflow styles

* test: fix variables row snapshot

* feat: update sorting to take newly created variables into account

* fix: fix list layout overflow

* fix: fix adding variables on page other than 1. fix validation

* feat: add docs link

* fix: fix default displayName function for resource-list-layout

* feat: improve vars expressions ux, cm-tooltip

* test: fix datatable test

* feat: add MATCH_REGEX validation rule

* fix: overhaul how datatable pagination selector works

* feat: update  completer description

* fix: conditionally update usage syntax based on key validation

* test: update datatable snapshot

* fix: fix variables-row button margins

* fix: fix pagination overflow

* test: Fix broken test

* test: Update snapshot

* fix: Remove duplicate declaration

* feat: add custom variables icon

---------

Co-authored-by: Alex Grozav <[email protected]>
Co-authored-by: Omar Ajoue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants