n8n/packages/cli/test/integration/workflows.controller.test.ts

116 lines
3.3 KiB
TypeScript
Raw Normal View History

feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
import express from 'express';
import * as utils from './shared/utils';
import * as testDb from './shared/testDb';
import { WorkflowEntity } from '../../src/databases/entities/WorkflowEntity';
import * as UserManagementHelpers from '../../src/UserManagement/UserManagementHelper';
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
import type { Role } from '../../src/databases/entities/Role';
import type { IPinData } from 'n8n-workflow';
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
jest.mock('../../src/telemetry');
let app: express.Application;
let testDbName = '';
let globalOwnerRole: Role;
// mock whether sharing is enabled or not
jest.spyOn(UserManagementHelpers, 'isSharingEnabled').mockReturnValue(false);
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
beforeAll(async () => {
app = await utils.initTestServer({
endpointGroups: ['workflows'],
applyAuth: true,
});
const initResult = await testDb.init();
testDbName = initResult.testDbName;
globalOwnerRole = await testDb.getGlobalOwnerRole();
utils.initTestLogger();
utils.initTestTelemetry();
});
beforeEach(async () => {
await testDb.truncate(['User', 'Workflow', 'SharedWorkflow'], testDbName);
});
afterAll(async () => {
await testDb.terminate(testDbName);
});
test('POST /workflows should store pin data for node in workflow', async () => {
const ownerShell = await testDb.createUserShell(globalOwnerRole);
const authOwnerAgent = utils.createAgent(app, { auth: true, user: ownerShell });
const workflow = makeWorkflow({ withPinData: true });
const response = await authOwnerAgent.post('/workflows').send(workflow);
expect(response.statusCode).toBe(200);
2022-07-22 03:19:45 -07:00
const { pinData } = response.body.data as { pinData: IPinData };
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
expect(pinData).toMatchObject(MOCK_PINDATA);
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
});
test('POST /workflows should set pin data to null if no pin data', async () => {
const ownerShell = await testDb.createUserShell(globalOwnerRole);
const authOwnerAgent = utils.createAgent(app, { auth: true, user: ownerShell });
const workflow = makeWorkflow({ withPinData: false });
const response = await authOwnerAgent.post('/workflows').send(workflow);
expect(response.statusCode).toBe(200);
2022-07-22 03:19:45 -07:00
const { pinData } = response.body.data as { pinData: IPinData };
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
expect(pinData).toBeNull();
});
test('GET /workflows/:id should return pin data', async () => {
const ownerShell = await testDb.createUserShell(globalOwnerRole);
const authOwnerAgent = utils.createAgent(app, { auth: true, user: ownerShell });
const workflow = makeWorkflow({ withPinData: true });
const workflowCreationResponse = await authOwnerAgent.post('/workflows').send(workflow);
const { id } = workflowCreationResponse.body.data as { id: string };
const workflowRetrievalResponse = await authOwnerAgent.get(`/workflows/${id}`);
expect(workflowRetrievalResponse.statusCode).toBe(200);
2022-07-22 03:19:45 -07:00
const { pinData } = workflowRetrievalResponse.body.data as { pinData: IPinData };
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
expect(pinData).toMatchObject(MOCK_PINDATA);
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
});
function makeWorkflow({ withPinData }: { withPinData: boolean }) {
const workflow = new WorkflowEntity();
workflow.name = 'My Workflow';
workflow.active = false;
workflow.connections = {};
workflow.nodes = [
{
id: 'uuid-1234',
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
name: 'Spotify',
type: 'n8n-nodes-base.spotify',
parameters: { resource: 'track', operation: 'get', id: '123' },
typeVersion: 1,
position: [740, 240],
},
];
if (withPinData) {
workflow.pinData = MOCK_PINDATA;
feat(editor): Add data pinning functionality (#3511) * feat: Design system color improvements and button component redesign. * feat: Added button focus state and unit tests. * refactor: Aligned n8n-button usage inside of editor-ui. * test: Updated snapshots. * refactor: Extracted focus outline width into scss variable. * fix: Fixed select input border-radius. * refactor: Removed element-ui references in button. * fix: Fixed scss variable imports. * feat: Added color-neutral variable story. * fix: Fixed color-secondary variable definition. * feat: Added color-white story. * test: Updated button snapshot. * feat: Replaced zoom buttons with new n8n-icon-button. * feat: Added stories for float utilities. * chore: Updated color shades generation code for later use. * chore: Removed color-white code. * chore: Updated story properties for button components. * fix: Added el-button fallback for places where el-button is not replaceable (messagebox). * feat: Reverted to css modules. Replaced el-button with n8n-button at application level. * test: Updated button snapshot. * fix: Fixed element-ui locally referenced buttons (via components: {}). * fix: Updated colors. Removed irrelevant validation. Added ElButton override component. * test: Updated button override snapshot. * fix: Various button adjustments and fixes. * fix: Updated button disabled state. * test: Updated snapshots. * fix: Consolidated css variables changes. * Data pinning (#3512) * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :shirt: Add lint exception * :shirt: Fix header * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * fix: Fixed workflow saving. * fix: Removed pinData hoisting (no longer necessary). * feat: Added canPinData flag to hide for input pane and binary data. Fixed unpin and execute flow. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * :zap: Output same pindata for every run * :art: Fix cropping * :fire: Remove unrelated logging * feat: Moved edit button next to pin button. * feat: Changed data to be inserted for empty state. * chore: Changed invalid editor output translation. * feat: Added error line reporting on JSON Validation. * feat: Migrated pinData edit mode to store. * chore: Merged duplicate node border color condition. * feat: Moved pin data validation to mixin. Added check before closing ndv modal. * fix: Changed pinned data size calculation to discard active node pin data. * feat: Added support for rename and delete node with pin data. * feat: Simplified editing state. Fixed edit mode in input panel after store migration. * feat: Various data pinning improvements. * fix: Fixed callout link underline. * refactor: Added support for both string and objects for data size check. * feat: Added disabled node check for input panel. Fixed monaco editor resizing. * fix: Fixed edit mode footer size. * :zap: Fix pindata items per run * :shirt: Remove unneeded exception * refactor: Added isValidPinData() helper method. * refactor: Changed how string size in bytes in calculated.g * refactor: Updated pinData mixin interface. * refactor: Merged filter and reduce in pinDataSize calculation. * fix: Changed code-editor to correct type. * fix: Added insert test data message to trigger nodes. * feat: Disabled data pinning for multiple output nodes. * refactor: Updated ndv.input.disabled translation to include node name. * refactor: Aligned n8n-button usage inside of editor-ui. * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * feat: Added pinData and edit mode methods. * :fire: Remove conflict markers * :pencil2: Update i18n keys * :zap: Add JSON validation * :card_file_box: Add `pinData` column to `workflow_entity` * :blue_book: Tighten type * :zap: Make `pinData` column nullable * :zap: Adjust workflow endpoints for pin data * :blue_book: Improve types * :pencil2: Improve wording * Inject pindata into items flow (#3420) * :zap: Inject pin data - Second approach * :fire: Remove unneeded lint exception * feat: Added edit data button on json hover. * feat: Extracted code editor into separate form component. * feat: Added edit data button on json hover. * fix: Fixed rebase conflicts. * :rewind: Undo button change * :bug: Fix runNode call Adjust per update in bdb84130d687811d65337ff6b025e7cb0eae8256 * :test_tube: Fix workflow tests * :bug: More merge conflict fixes * feat: Added pin/unpin button and store mutations. * feat: Size check. Various design and ux improvements. * :zap: Add transformer * :zap: Hoist pin data * :zap: Adjust endpoints for hoisted pin data * :blue_book: Expand interface * :bug: Fix stray array * :shirt: Fix build * :art: Add color secondary tints * :sparkles: Create `HeaderMessage` component * :zap: Adjust `InfoTip` component * :sparkles: Add `HeaderMessage` to `RunData` * :bug: Fix console error * :shirt: Fix lint * :zap: Consolidate `HeaderMessage` and `Callout` * :rewind: Undo `InfoTip` changes * :fire: Remove duplicate icons * :zap: Simplify template * :art: Change cursor for action text * :shirt: Fix lint * :zap: Add URL * :bug: Fix handler name * :zap: Use constant * :recycle: Refactor per feedback * fix: Various fixes after data pinning relocation. * fix: Added store mutation for setting pinned data. * feat: Added pinned state for workflow canvas node. * :zap: Fixes for canvas pin data (#3587) * :zap: Fixes for canvas pin data * :blue_book: Rename type * :test_tube: Fix unrelated Public API test * :fire: Remove logging * feat: Updated pinData mixin to no longer include extra fields. * fix: Removed pinData hoisting (no longer necessary). * chore: Merged duplicate node border color condition. * :zap: Output same pindata for every run * :art: Fix cropping * :bug: Fix excess closing template tag * fix: Removed rogue template tag after merge. * fix: Fixed code-editor resizing when moving ndv panel. * feat: Added node duplication pin data. * :zap: Implement telemetry * :recycle: Add clarifications from call * fix: Fixed run data header height. * feat: Removed border from pin data callout. * feat: Added line-break before 'or insert pin data'. * feat: Changed enterEditMode to always insert test data if there's no execution data. * feat: Removed copy output tooltip. * feat: Removed unpin tooltip. * fix: Removed thumbtack icon rotation. * fix: Removed run info from Edit Output title. * feat: Hid edit and pin buttons when editing. * feat: Updated monaco code-editor padding and borders. * feat: Progress on pinData error message format * feat: Updated copy feature to work without any selected value. * feat: Moved save and cancel buttons. Cleared notifications on save. * feat: Changed pin data beforeClosing confirm text. * feat: Closing ndv when discarding or saving pindata on close. * feat: Added split in batches node to pin data denylist. * fix: Added missing margin-bottom to webhook node. * feat: Moved thumbtack icon to the right, replacing the checkmark. * fix: Hid pagination while editing. * feat: Added pin data discovery flow. * feat: Changed pin data discovery flow to avoid tooltip glitching. * fix: Changed copy selection to copy all input data. * feat: Updated pin data validation error message for unexpected single quotes. * fix: Replaced :manual='true' prop with manual shorthand. * fix: Removed unused variable. * chore: Renamed translation key to node.discovery.pinData. * refactor: Extracted isPinDataNodeType to pinData mixin. * fix: Updated watch condition to improve performance. * refactor: Renamed some pin data variables and methods as per review. * fix: Added partial translation for JSON.parse pin data error messages. * chore: Temporarily disabled failing unit test. * :test_tube: Fix data pinning workflow retrieval test * :fire: Remove unused imports * :fire: Remove leftover line * :zap: Skip pindata node issues on BE * :zap: Skip pindata node issues on FE * :zap: Hide `RunInfo` for pindata node * :zap: Hide purple banner in edit output mode * feat: Updated data pinning discoverability flow. * fix: Fixed paginated data pinning. * fix: Disabled pin data in read only mode. * :bug: Fix runtime error with non-array * fix: Loading pin data when opening execution. * :zap: Adjust stale data warning for pinned data * :zap: Skip auth in endpoint * :zap: Mark start node for pinned trigger * :pencil2: Comment on passthrough * :fire: Remove comment * Final pindata metrics changes (#3673) * :bug: Fix `pinData` tracked as `0` * :zap: Add `is_pinned` to `nodesGraph` * :blue_book: Extend `IWorkflowBase` * :zap: Handle `pinData` being `undefined` * :zap: Add `data_pinning_tooltip_presented` * :recycle: Refactor to remove circular dependency * fix: Added pin data handling when importing workflow. (#3698) * :fire: Remove helper from WorkflowExecute * :zap: Add logic for single pinned trigger * :shirt: Remove lint exception * fix: Added pin data handling in importWorkflowExact. * N8N-4077 data pinning discoverability part 2 (#3701) * fix: Fixed pin data discovery tooltip position when moving canvas. * feat: Updated data pinning discovery tooltip copy. * Fix data pinning build (#3702) * :zap: Disable edit button for disabled node * :zap: Ensure disabled pinned nodes are passthrough * :bug: Fix JSON key unfurling in edit mode * :zap: Improve implementation * :bug: Fix console error * fix: Fixed copying pinned output data. (#3715) * Fix pinning for webhook responding with output from last node (#3719) * fix: Fixed entering edit mode after refresh. * fix: Fixed type error during build. * fix: RunData import formatting. * chore: Updated pin data types. * fix: Added missing type to stringSizeInBytes. Co-authored-by: Iván Ovejero <ivov.src@gmail.com> * fix: Showing pin data without executing the node only in output pane. * fix: Updated no data message when previous node not executed. * feat: Added expression input and evaluation for pin data nodes without execution. * chore: Fixed linting issues and removed remnant console.log(). * chore: Undone package-lock changes. * fix: Removed pin data store changes. * fix: Created a new object using vuex runExecutionData. * fix: Fixed bug appearing when adding a new node after executing. * fix: Fix editor-ui build * feat: Added green node connectors when having pin data output. * chore: Fixed linting errors. * fix: Added pin data eventBus unsubscribe. * fix: Added pin data color check after adding a connection. * :art: Add pindata styles Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
2022-07-20 08:50:39 -07:00
}
return workflow;
}
const MOCK_PINDATA = { Spotify: [{ json: { myKey: 'myValue' } }] };