2022-10-12 05:06:28 -07:00
|
|
|
<template>
|
2023-12-13 05:45:22 -08:00
|
|
|
<div :class="$style.parameterInput" data-test-id="parameter-input">
|
2023-12-28 00:49:58 -08:00
|
|
|
<ParameterInput
|
2022-10-12 05:06:28 -07:00
|
|
|
ref="param"
|
2023-12-28 00:49:58 -08:00
|
|
|
:input-size="inputSize"
|
2022-10-12 05:06:28 -07:00
|
|
|
:parameter="parameter"
|
2023-12-28 00:49:58 -08:00
|
|
|
:model-value="modelValue"
|
2022-10-12 05:06:28 -07:00
|
|
|
:path="path"
|
2023-12-28 00:49:58 -08:00
|
|
|
:is-read-only="isReadOnly"
|
2024-02-06 09:34:34 -08:00
|
|
|
:is-assignment="isAssignment"
|
2022-10-12 05:06:28 -07:00
|
|
|
:droppable="droppable"
|
2023-12-28 00:49:58 -08:00
|
|
|
:active-drop="activeDrop"
|
|
|
|
:force-show-expression="forceShowExpression"
|
|
|
|
:hide-issues="hideIssues"
|
|
|
|
:documentation-url="documentationUrl"
|
|
|
|
:error-highlight="errorHighlight"
|
|
|
|
:is-for-credential="isForCredential"
|
|
|
|
:event-source="eventSource"
|
2024-02-06 09:34:34 -08:00
|
|
|
:expression-evaluated="evaluatedExpressionValue"
|
2023-12-28 00:49:58 -08:00
|
|
|
:additional-expression-data="resolvedAdditionalExpressionData"
|
feat(editor): Implement Resource Mapper component (#6207)
* :zap: scaffolding
* :zap: finished scaffolding
* :zap: renamed types
* :zap: updated subtitle
* :zap: renamed functions file, UI updates
* :zap: query parameters fixes, ui updates, refactoring
* :zap: fixes for credentials test, setup for error parsing
* :zap: rlc for schema and table, error handling tweaks
* :zap: delete operation, new options
* :zap: columns loader
* :zap: linter fixes
* :zap: where clauses setup
* :zap: logic for processing where clauses
* :zap: select operation
* :zap: refactoring
* :zap: data mode for insert and update, wip
* :zap: data mapping, insert update, skip on conflict option
* :zap: select columns with spaces fix
* :zap: update operation update, wip
* :zap: finished update operation
* :zap: upsert operation
* :zap: ui fixes
* Copy updates.
* Copy updates.
* :zap: option to convert empty strings to nulls, schema checks
* :zap: UI requested updates
* :zap: ssh setup WIP
* :zap: fixes, ssh WIP
* :zap: ssh fixes, credentials
* :zap: credentials testing update
* :zap: uncaught error fix
* :zap: clean up
* :zap: address in use fix
* :zap: improved error message
* :zap: tests setup
* :zap: unit tests wip
* :zap: config files clean up
* :zap: utils unit tests
* :zap: refactoring
* :zap: setup for testing operations, tests for deleteTable operation
* :zap: executeQuery and insert operations tests
* :zap: select, update, upsert operations tests
* :zap: runQueries tests setup
* :zap: hint to query
* Copy updates.
* :zap: ui fixes
* :zap: clean up
* :zap: error message update
* :zap: ui update
* Minor tweaks to query params decription.
* feat(Google Sheets Node): Implement Resource mapper in Google Sheets node (#5752)
* ✨ Added initial resource mapping support in google sheets node
* ✨ Wired mapping API endpoint with node-specific logic for fetching mapping fields
* ✨ Implementing mapping fields logic for google sheets
* ✨ Updating Google Sheets execute methods to support resource mapper fields
* 🚧 Added initial version of `ResourceLocator` component
* 👌 Added `update` mode to resource mapper modes
* 👌 Addressing PR feedback
* 👌 Removing leftover const reference
* 👕 Fixing lint errors
* :zap: singlton for conections
* :zap: credentials test fix, clean up
* feat(Postgres Node): Add resource mapper to new version of Postgres node (#5814)
* :zap: scaffolding
* :zap: finished scaffolding
* :zap: renamed types
* :zap: updated subtitle
* :zap: renamed functions file, UI updates
* :zap: query parameters fixes, ui updates, refactoring
* :zap: fixes for credentials test, setup for error parsing
* :zap: rlc for schema and table, error handling tweaks
* :zap: delete operation, new options
* :zap: columns loader
* :zap: linter fixes
* :zap: where clauses setup
* :zap: logic for processing where clauses
* :zap: select operation
* :zap: refactoring
* :zap: data mode for insert and update, wip
* :zap: data mapping, insert update, skip on conflict option
* :zap: select columns with spaces fix
* :zap: update operation update, wip
* :zap: finished update operation
* :zap: upsert operation
* :zap: ui fixes
* Copy updates.
* Copy updates.
* :zap: option to convert empty strings to nulls, schema checks
* :zap: UI requested updates
* :zap: ssh setup WIP
* :zap: fixes, ssh WIP
* :zap: ssh fixes, credentials
* :zap: credentials testing update
* :zap: uncaught error fix
* :zap: clean up
* :zap: address in use fix
* :zap: improved error message
* :zap: tests setup
* :zap: unit tests wip
* :zap: config files clean up
* :zap: utils unit tests
* :zap: refactoring
* :zap: setup for testing operations, tests for deleteTable operation
* :zap: executeQuery and insert operations tests
* :zap: select, update, upsert operations tests
* :zap: runQueries tests setup
* :zap: hint to query
* Copy updates.
* :zap: ui fixes
* :zap: clean up
* :zap: error message update
* :zap: ui update
* Minor tweaks to query params decription.
* ✨ Updated Postgres node to use resource mapper component
* ✨ Implemented postgres <-> resource mapper type mapping
* ✨ Updated Postgres node execution to use resource mapper fields in v3
* 🔥 Removing unused import
---------
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
* feat(core): Resource editor componend P0 (#5970)
* ✨ Added inital value of mapping mode dropdown
* ✨ Finished mapping mode selector
* ✨ Finished implementing mapping mode selector
* ✨ Implemented 'Columns to match on' dropdown
* ✨ Implemented `loadOptionsDependOn` support in resource mapper
* ✨ Implemented initial version of mapping fields
* ✨ Implementing dependant fields watcher in new component setup
* ✨ Generating correct resource mapper field types. Added `supportAutoMap` to node specification and UI. Not showing fields with `display=false`. Pre-selecting matching columns if it's the only one
* ✨ Handling matching columns correctly in UI
* ✨ Saving and loading resourceMapper values in component
* ✨ Implemented proper data saving and loading
* ✨ ResourceMapper component refactor, fixing value save/load
* ✨ Refactoring MatchingColumnSelect component. Updating Sheets node to use single key match and Postgres to use multi key
* ✨ Updated Google Sheets node to work with the new UI
* ✨ Updating Postgres Node to work with new UI
* ✨ Additional loading indicator that shown if there is no mapping mode selector
* ✨ Removing hard-coded values, fixing matching columns ordering, refactoring
* ✨ Updating field names in nodes
* ✨ Fixing minor UI issues
* ✨ Implemented matching fields filter logic
* ✨ Moving loading label outside of fields list
* ✅ Added initial unit tests for resource mapper
* ✅ Finished default rendering test
* ✅ Test refactoring
* ✅ Finished unit tests
* 🔨 Updating the way i18n is used in resource mapper components
* ✔️ Fixing value to match on logic for postgres node
* ✨ Hiding mapping fields when auto-map mode is selected
* ✨ Syncing selected mapping mode between components
* ✨ Fixing dateTime input rendering and adding update check to Postgres node
* ✨ Properly handling database connections. Sending null for empty string values.
* 💄 Updated wording in the error message for non-existing rows
* ✨ Fixing issues with selected matching values
* ✔️ Updating unit tests after matching logic update
* ✨ Updating matching columns when new fields are loaded
* ✨ Defaulting to null for empty parameter values
* ✨ Allowing zero as valid value for number imputs
* ✨ Updated list of types that use datepicker as widger
* ✨ Using text inputs for time types
* ✨ Initial mapping field rework
* ✨ Added new component for mapping fields, moved bit of logic from root component to matching selector, fixing some lint errors
* ✨ Added tooltip for columns that cannot be deleted
* ✨ Saving deleted values in parameter value
* ✨ Implemented control to add/remove mapping fields
* ✨ Syncing field list with add field dropdown when changing dependent values
* ✨ Not showing removed fields in matching columns selector. Updating wording in matching columns selector description
* ✨ Implementing disabled states for add/remove all fields options
* ✨ Saving removed columns separately, updating copy
* ✨ Implemented resource mapper values validation
* ✨ Updated validation logic and error input styling
* ✨ Validating resource mapper fields when new nodes are added
* ✨ Using node field words in validation, refactoring resource mapper component
* ✨ Implemented schema syncing and add/remove all fields
* ✨ Implemented custom parameter actions
* ✨ Implemented loading indicator in parameter options
* 🔨 Removing unnecessary constants and vue props
* ✨ Handling default values properly
* ✨ Fixing validation logic
* 👕 Fixing lint errors
* ⚡ Fixing type issues
* ⚡ Not showing fields by default if `addAllFields` is set to `false`
* ✨ Implemented field type validation in resource mapper
* ✨ Updated casing in copy, removed all/remove all option from bottom menu
* ✨ Added auto mapping mode notice
* ✨ Added support for more types in validation
* ✨ Added support for enumerated values
* ✨ Fixing imports after merging
* ✨ Not showing removed fields in matching columns selector. Refactoring validation logic.
* 👕 Fixing imports
* ✔️ Updating unit tests
* ✅ Added resource mapper schema tests
* ⚡ Removing `match` from resource mapper field definition, fixing matching columns loading
* ⚡ Fixed schema merging
* :zap: update operation return data fix
* :zap: review
* 🐛 Added missing import
* 💄 Updating parameter actions icon based on the ui review
* 💄 Updating word capitalisation in tooltips
* 💄 Added empty state to mapping fields list
* 💄 Removing asterisk from fields, updating tooltips for matching fields
* ⚡ Preventing matching fields from being removed by 'Remove All option'
* ⚡ Not showing hidden fields in the `Add field` dropdown
* ⚡ Added support for custom matching columns labels
* :zap: query optimization
* :zap: fix
* ⚡ Optimizing Postgres node enumeration logic
* ⚡ Added empty state for matching columns
* ⚡ Only fully loading fields if there is no schema fetched
* ⚡ Hiding mapping fields if there is no matching columns available in the schema
* ✔️ Fixing minor issues
* ✨ Implemented runtime type validation
* 🔨 Refactoring validation logic
* ✨ Implemented required check, added more custom messages
* ✨ Skipping boolean type in required check
* Type check improvements
* ✨ Only reloading fields if dependent values actually change
* ✨ Adding item index to validation error title
* ✨ Updating Postgres fetching logic, using resource mapper mode to determine if a field can be deleted
* ✨ Resetting field values when adding them via the addAll option
* ⚡ Using minor version (2.2) for new Postgres node
* ⚡ Implemented proper date validation and type casting
* 👕 Consolidating typing
* ✅ Added unit tests for type validations
* 👌 Addressing front-end review comments
* ⚡ More refactoring to address review changes
* ⚡ Updating leftover props
* ⚡ Added fallback for ISO dates with invalid timezones
* Added timestamp to datetime test cases
* ⚡ Reseting matching columns if operation changes
* ⚡ Not forcing auto-increment fields to be filled in in Postgres node. Handling null values
* 💄 Added a custom message for invalid dates
* ⚡ Better handling of JSON values
* ⚡ Updating codemirror readonly stauts based on component property, handling objects in json validation
* Deleting leftover console.log
* ⚡ Better time validation
* ⚡ Fixing build error after merging
* 👕 Fixing lint error
* ⚡ Updating node configuration values
* ⚡ Handling postgres arrays better
* ⚡ Handling SQL array syntax
* ⚡ Updating time validation rules to include timezone
* ⚡ Sending expressions that resolve to `null` or `undefined` by the resource mapper to delete cell content in Google Sheets
* ⚡ Allowing removed fields to be selected for match
* ⚡ Updated the query for fetching unique columns and primary keys
* ⚡ Optimizing the unique query
* ⚡ Setting timezone to all parsed dates
* ⚡ Addressing PR review feedback
* ⚡ Configuring Sheets node for production, minor vue component update
* New cases added to the TypeValidation test.
* ✅ Tweaking validation rules for arrays/objects and updating test cases
---------
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
2023-05-31 02:56:09 -07:00
|
|
|
:label="label"
|
2024-02-06 09:34:34 -08:00
|
|
|
:rows="rows"
|
2023-09-14 01:54:25 -07:00
|
|
|
:data-test-id="`parameter-input-${parsedParameterName}`"
|
2023-07-28 00:51:07 -07:00
|
|
|
:event-bus="eventBus"
|
2022-10-12 05:06:28 -07:00
|
|
|
@focus="onFocus"
|
|
|
|
@blur="onBlur"
|
|
|
|
@drop="onDrop"
|
2024-03-26 06:22:57 -07:00
|
|
|
@text-input="onTextInput"
|
2023-07-28 00:51:07 -07:00
|
|
|
@update="onValueChanged"
|
2022-11-25 04:09:44 -08:00
|
|
|
/>
|
2023-12-13 05:45:22 -08:00
|
|
|
<div v-if="!hideHint && (expressionOutput || parameterHint)" :class="$style.hint">
|
|
|
|
<div>
|
2023-12-28 00:49:58 -08:00
|
|
|
<InputHint
|
2023-12-13 05:45:22 -08:00
|
|
|
v-if="expressionOutput"
|
|
|
|
:class="{ [$style.hint]: true, 'ph-no-capture': isForCredential }"
|
|
|
|
:data-test-id="`parameter-expression-preview-${parsedParameterName}`"
|
|
|
|
:highlight="!!(expressionOutput && targetItem) && isInputParentOfActiveNode"
|
|
|
|
:hint="expressionOutput"
|
2023-12-28 00:49:58 -08:00
|
|
|
:single-line="true"
|
2023-12-13 05:45:22 -08:00
|
|
|
/>
|
2023-12-28 00:49:58 -08:00
|
|
|
<InputHint v-else-if="parameterHint" :render-h-t-m-l="true" :hint="parameterHint" />
|
2023-12-13 05:45:22 -08:00
|
|
|
</div>
|
|
|
|
<slot v-if="$slots.options" name="options" />
|
|
|
|
</div>
|
2022-10-12 05:06:28 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2023-05-16 02:43:46 -07:00
|
|
|
import { mapStores } from 'pinia';
|
2024-02-06 09:34:34 -08:00
|
|
|
import type { PropType } from 'vue';
|
|
|
|
import { defineComponent } from 'vue';
|
2022-10-12 05:06:28 -07:00
|
|
|
|
2024-02-06 09:34:34 -08:00
|
|
|
import type { INodeUi, IUpdateInformation, TargetItem } from '@/Interface';
|
2022-10-12 05:06:28 -07:00
|
|
|
import ParameterInput from '@/components/ParameterInput.vue';
|
2023-05-15 09:41:13 -07:00
|
|
|
import InputHint from '@/components/ParameterInputHint.vue';
|
2024-02-06 09:34:34 -08:00
|
|
|
import { useEnvironmentsStore } from '@/stores/environments.ee.store';
|
|
|
|
import { useExternalSecretsStore } from '@/stores/externalSecrets.ee.store';
|
|
|
|
import { useNDVStore } from '@/stores/ndv.store';
|
|
|
|
import { isValueExpression, parseResourceMapperFieldName } from '@/utils/nodeTypesUtils';
|
2023-04-24 03:18:24 -07:00
|
|
|
import type {
|
2023-08-25 01:33:46 -07:00
|
|
|
IDataObject,
|
2022-10-12 05:06:28 -07:00
|
|
|
INodeProperties,
|
|
|
|
INodePropertyMode,
|
feat(editor): Implement Resource Mapper component (#6207)
* :zap: scaffolding
* :zap: finished scaffolding
* :zap: renamed types
* :zap: updated subtitle
* :zap: renamed functions file, UI updates
* :zap: query parameters fixes, ui updates, refactoring
* :zap: fixes for credentials test, setup for error parsing
* :zap: rlc for schema and table, error handling tweaks
* :zap: delete operation, new options
* :zap: columns loader
* :zap: linter fixes
* :zap: where clauses setup
* :zap: logic for processing where clauses
* :zap: select operation
* :zap: refactoring
* :zap: data mode for insert and update, wip
* :zap: data mapping, insert update, skip on conflict option
* :zap: select columns with spaces fix
* :zap: update operation update, wip
* :zap: finished update operation
* :zap: upsert operation
* :zap: ui fixes
* Copy updates.
* Copy updates.
* :zap: option to convert empty strings to nulls, schema checks
* :zap: UI requested updates
* :zap: ssh setup WIP
* :zap: fixes, ssh WIP
* :zap: ssh fixes, credentials
* :zap: credentials testing update
* :zap: uncaught error fix
* :zap: clean up
* :zap: address in use fix
* :zap: improved error message
* :zap: tests setup
* :zap: unit tests wip
* :zap: config files clean up
* :zap: utils unit tests
* :zap: refactoring
* :zap: setup for testing operations, tests for deleteTable operation
* :zap: executeQuery and insert operations tests
* :zap: select, update, upsert operations tests
* :zap: runQueries tests setup
* :zap: hint to query
* Copy updates.
* :zap: ui fixes
* :zap: clean up
* :zap: error message update
* :zap: ui update
* Minor tweaks to query params decription.
* feat(Google Sheets Node): Implement Resource mapper in Google Sheets node (#5752)
* ✨ Added initial resource mapping support in google sheets node
* ✨ Wired mapping API endpoint with node-specific logic for fetching mapping fields
* ✨ Implementing mapping fields logic for google sheets
* ✨ Updating Google Sheets execute methods to support resource mapper fields
* 🚧 Added initial version of `ResourceLocator` component
* 👌 Added `update` mode to resource mapper modes
* 👌 Addressing PR feedback
* 👌 Removing leftover const reference
* 👕 Fixing lint errors
* :zap: singlton for conections
* :zap: credentials test fix, clean up
* feat(Postgres Node): Add resource mapper to new version of Postgres node (#5814)
* :zap: scaffolding
* :zap: finished scaffolding
* :zap: renamed types
* :zap: updated subtitle
* :zap: renamed functions file, UI updates
* :zap: query parameters fixes, ui updates, refactoring
* :zap: fixes for credentials test, setup for error parsing
* :zap: rlc for schema and table, error handling tweaks
* :zap: delete operation, new options
* :zap: columns loader
* :zap: linter fixes
* :zap: where clauses setup
* :zap: logic for processing where clauses
* :zap: select operation
* :zap: refactoring
* :zap: data mode for insert and update, wip
* :zap: data mapping, insert update, skip on conflict option
* :zap: select columns with spaces fix
* :zap: update operation update, wip
* :zap: finished update operation
* :zap: upsert operation
* :zap: ui fixes
* Copy updates.
* Copy updates.
* :zap: option to convert empty strings to nulls, schema checks
* :zap: UI requested updates
* :zap: ssh setup WIP
* :zap: fixes, ssh WIP
* :zap: ssh fixes, credentials
* :zap: credentials testing update
* :zap: uncaught error fix
* :zap: clean up
* :zap: address in use fix
* :zap: improved error message
* :zap: tests setup
* :zap: unit tests wip
* :zap: config files clean up
* :zap: utils unit tests
* :zap: refactoring
* :zap: setup for testing operations, tests for deleteTable operation
* :zap: executeQuery and insert operations tests
* :zap: select, update, upsert operations tests
* :zap: runQueries tests setup
* :zap: hint to query
* Copy updates.
* :zap: ui fixes
* :zap: clean up
* :zap: error message update
* :zap: ui update
* Minor tweaks to query params decription.
* ✨ Updated Postgres node to use resource mapper component
* ✨ Implemented postgres <-> resource mapper type mapping
* ✨ Updated Postgres node execution to use resource mapper fields in v3
* 🔥 Removing unused import
---------
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
* feat(core): Resource editor componend P0 (#5970)
* ✨ Added inital value of mapping mode dropdown
* ✨ Finished mapping mode selector
* ✨ Finished implementing mapping mode selector
* ✨ Implemented 'Columns to match on' dropdown
* ✨ Implemented `loadOptionsDependOn` support in resource mapper
* ✨ Implemented initial version of mapping fields
* ✨ Implementing dependant fields watcher in new component setup
* ✨ Generating correct resource mapper field types. Added `supportAutoMap` to node specification and UI. Not showing fields with `display=false`. Pre-selecting matching columns if it's the only one
* ✨ Handling matching columns correctly in UI
* ✨ Saving and loading resourceMapper values in component
* ✨ Implemented proper data saving and loading
* ✨ ResourceMapper component refactor, fixing value save/load
* ✨ Refactoring MatchingColumnSelect component. Updating Sheets node to use single key match and Postgres to use multi key
* ✨ Updated Google Sheets node to work with the new UI
* ✨ Updating Postgres Node to work with new UI
* ✨ Additional loading indicator that shown if there is no mapping mode selector
* ✨ Removing hard-coded values, fixing matching columns ordering, refactoring
* ✨ Updating field names in nodes
* ✨ Fixing minor UI issues
* ✨ Implemented matching fields filter logic
* ✨ Moving loading label outside of fields list
* ✅ Added initial unit tests for resource mapper
* ✅ Finished default rendering test
* ✅ Test refactoring
* ✅ Finished unit tests
* 🔨 Updating the way i18n is used in resource mapper components
* ✔️ Fixing value to match on logic for postgres node
* ✨ Hiding mapping fields when auto-map mode is selected
* ✨ Syncing selected mapping mode between components
* ✨ Fixing dateTime input rendering and adding update check to Postgres node
* ✨ Properly handling database connections. Sending null for empty string values.
* 💄 Updated wording in the error message for non-existing rows
* ✨ Fixing issues with selected matching values
* ✔️ Updating unit tests after matching logic update
* ✨ Updating matching columns when new fields are loaded
* ✨ Defaulting to null for empty parameter values
* ✨ Allowing zero as valid value for number imputs
* ✨ Updated list of types that use datepicker as widger
* ✨ Using text inputs for time types
* ✨ Initial mapping field rework
* ✨ Added new component for mapping fields, moved bit of logic from root component to matching selector, fixing some lint errors
* ✨ Added tooltip for columns that cannot be deleted
* ✨ Saving deleted values in parameter value
* ✨ Implemented control to add/remove mapping fields
* ✨ Syncing field list with add field dropdown when changing dependent values
* ✨ Not showing removed fields in matching columns selector. Updating wording in matching columns selector description
* ✨ Implementing disabled states for add/remove all fields options
* ✨ Saving removed columns separately, updating copy
* ✨ Implemented resource mapper values validation
* ✨ Updated validation logic and error input styling
* ✨ Validating resource mapper fields when new nodes are added
* ✨ Using node field words in validation, refactoring resource mapper component
* ✨ Implemented schema syncing and add/remove all fields
* ✨ Implemented custom parameter actions
* ✨ Implemented loading indicator in parameter options
* 🔨 Removing unnecessary constants and vue props
* ✨ Handling default values properly
* ✨ Fixing validation logic
* 👕 Fixing lint errors
* ⚡ Fixing type issues
* ⚡ Not showing fields by default if `addAllFields` is set to `false`
* ✨ Implemented field type validation in resource mapper
* ✨ Updated casing in copy, removed all/remove all option from bottom menu
* ✨ Added auto mapping mode notice
* ✨ Added support for more types in validation
* ✨ Added support for enumerated values
* ✨ Fixing imports after merging
* ✨ Not showing removed fields in matching columns selector. Refactoring validation logic.
* 👕 Fixing imports
* ✔️ Updating unit tests
* ✅ Added resource mapper schema tests
* ⚡ Removing `match` from resource mapper field definition, fixing matching columns loading
* ⚡ Fixed schema merging
* :zap: update operation return data fix
* :zap: review
* 🐛 Added missing import
* 💄 Updating parameter actions icon based on the ui review
* 💄 Updating word capitalisation in tooltips
* 💄 Added empty state to mapping fields list
* 💄 Removing asterisk from fields, updating tooltips for matching fields
* ⚡ Preventing matching fields from being removed by 'Remove All option'
* ⚡ Not showing hidden fields in the `Add field` dropdown
* ⚡ Added support for custom matching columns labels
* :zap: query optimization
* :zap: fix
* ⚡ Optimizing Postgres node enumeration logic
* ⚡ Added empty state for matching columns
* ⚡ Only fully loading fields if there is no schema fetched
* ⚡ Hiding mapping fields if there is no matching columns available in the schema
* ✔️ Fixing minor issues
* ✨ Implemented runtime type validation
* 🔨 Refactoring validation logic
* ✨ Implemented required check, added more custom messages
* ✨ Skipping boolean type in required check
* Type check improvements
* ✨ Only reloading fields if dependent values actually change
* ✨ Adding item index to validation error title
* ✨ Updating Postgres fetching logic, using resource mapper mode to determine if a field can be deleted
* ✨ Resetting field values when adding them via the addAll option
* ⚡ Using minor version (2.2) for new Postgres node
* ⚡ Implemented proper date validation and type casting
* 👕 Consolidating typing
* ✅ Added unit tests for type validations
* 👌 Addressing front-end review comments
* ⚡ More refactoring to address review changes
* ⚡ Updating leftover props
* ⚡ Added fallback for ISO dates with invalid timezones
* Added timestamp to datetime test cases
* ⚡ Reseting matching columns if operation changes
* ⚡ Not forcing auto-increment fields to be filled in in Postgres node. Handling null values
* 💄 Added a custom message for invalid dates
* ⚡ Better handling of JSON values
* ⚡ Updating codemirror readonly stauts based on component property, handling objects in json validation
* Deleting leftover console.log
* ⚡ Better time validation
* ⚡ Fixing build error after merging
* 👕 Fixing lint error
* ⚡ Updating node configuration values
* ⚡ Handling postgres arrays better
* ⚡ Handling SQL array syntax
* ⚡ Updating time validation rules to include timezone
* ⚡ Sending expressions that resolve to `null` or `undefined` by the resource mapper to delete cell content in Google Sheets
* ⚡ Allowing removed fields to be selected for match
* ⚡ Updated the query for fetching unique columns and primary keys
* ⚡ Optimizing the unique query
* ⚡ Setting timezone to all parsed dates
* ⚡ Addressing PR review feedback
* ⚡ Configuring Sheets node for production, minor vue component update
* New cases added to the TypeValidation test.
* ✅ Tweaking validation rules for arrays/objects and updating test cases
---------
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
2023-05-31 02:56:09 -07:00
|
|
|
IParameterLabel,
|
2022-10-12 05:06:28 -07:00
|
|
|
NodeParameterValueType,
|
2024-02-06 09:34:34 -08:00
|
|
|
Result,
|
2022-10-12 05:06:28 -07:00
|
|
|
} from 'n8n-workflow';
|
2023-04-25 02:47:03 -07:00
|
|
|
import { isResourceLocatorValue } from 'n8n-workflow';
|
2023-08-25 01:33:46 -07:00
|
|
|
|
2023-06-20 03:00:53 -07:00
|
|
|
import type { EventBus } from 'n8n-design-system/utils';
|
|
|
|
import { createEventBus } from 'n8n-design-system/utils';
|
2024-02-12 01:45:05 -08:00
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
2024-02-27 01:29:16 -08:00
|
|
|
import { getExpressionErrorMessage, getResolvableState } from '@/utils/expressions';
|
2023-04-21 06:59:04 -07:00
|
|
|
|
2023-05-16 02:43:46 -07:00
|
|
|
export default defineComponent({
|
2023-12-28 00:49:58 -08:00
|
|
|
name: 'ParameterInputWrapper',
|
2022-10-12 05:06:28 -07:00
|
|
|
components: {
|
|
|
|
ParameterInput,
|
|
|
|
InputHint,
|
|
|
|
},
|
|
|
|
props: {
|
2023-08-25 01:33:46 -07:00
|
|
|
additionalExpressionData: {
|
|
|
|
type: Object as PropType<IDataObject>,
|
|
|
|
default: () => ({}),
|
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
isReadOnly: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
2024-02-06 09:34:34 -08:00
|
|
|
rows: {
|
|
|
|
type: Number,
|
|
|
|
default: 5,
|
|
|
|
},
|
|
|
|
isAssignment: {
|
2023-12-13 05:45:22 -08:00
|
|
|
type: Boolean,
|
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
parameter: {
|
|
|
|
type: Object as PropType<INodeProperties>,
|
|
|
|
},
|
|
|
|
path: {
|
|
|
|
type: String,
|
|
|
|
},
|
2023-07-28 00:51:07 -07:00
|
|
|
modelValue: {
|
2022-10-12 05:06:28 -07:00
|
|
|
type: [String, Number, Boolean, Array, Object] as PropType<NodeParameterValueType>,
|
|
|
|
},
|
|
|
|
droppable: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
activeDrop: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
forceShowExpression: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
hint: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
},
|
2023-12-13 05:45:22 -08:00
|
|
|
hideHint: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
inputSize: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
hideIssues: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
documentationUrl: {
|
|
|
|
type: String as PropType<string | undefined>,
|
|
|
|
},
|
|
|
|
errorHighlight: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
isForCredential: {
|
|
|
|
type: Boolean,
|
|
|
|
},
|
|
|
|
eventSource: {
|
|
|
|
type: String,
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
feat(editor): Implement Resource Mapper component (#6207)
* :zap: scaffolding
* :zap: finished scaffolding
* :zap: renamed types
* :zap: updated subtitle
* :zap: renamed functions file, UI updates
* :zap: query parameters fixes, ui updates, refactoring
* :zap: fixes for credentials test, setup for error parsing
* :zap: rlc for schema and table, error handling tweaks
* :zap: delete operation, new options
* :zap: columns loader
* :zap: linter fixes
* :zap: where clauses setup
* :zap: logic for processing where clauses
* :zap: select operation
* :zap: refactoring
* :zap: data mode for insert and update, wip
* :zap: data mapping, insert update, skip on conflict option
* :zap: select columns with spaces fix
* :zap: update operation update, wip
* :zap: finished update operation
* :zap: upsert operation
* :zap: ui fixes
* Copy updates.
* Copy updates.
* :zap: option to convert empty strings to nulls, schema checks
* :zap: UI requested updates
* :zap: ssh setup WIP
* :zap: fixes, ssh WIP
* :zap: ssh fixes, credentials
* :zap: credentials testing update
* :zap: uncaught error fix
* :zap: clean up
* :zap: address in use fix
* :zap: improved error message
* :zap: tests setup
* :zap: unit tests wip
* :zap: config files clean up
* :zap: utils unit tests
* :zap: refactoring
* :zap: setup for testing operations, tests for deleteTable operation
* :zap: executeQuery and insert operations tests
* :zap: select, update, upsert operations tests
* :zap: runQueries tests setup
* :zap: hint to query
* Copy updates.
* :zap: ui fixes
* :zap: clean up
* :zap: error message update
* :zap: ui update
* Minor tweaks to query params decription.
* feat(Google Sheets Node): Implement Resource mapper in Google Sheets node (#5752)
* ✨ Added initial resource mapping support in google sheets node
* ✨ Wired mapping API endpoint with node-specific logic for fetching mapping fields
* ✨ Implementing mapping fields logic for google sheets
* ✨ Updating Google Sheets execute methods to support resource mapper fields
* 🚧 Added initial version of `ResourceLocator` component
* 👌 Added `update` mode to resource mapper modes
* 👌 Addressing PR feedback
* 👌 Removing leftover const reference
* 👕 Fixing lint errors
* :zap: singlton for conections
* :zap: credentials test fix, clean up
* feat(Postgres Node): Add resource mapper to new version of Postgres node (#5814)
* :zap: scaffolding
* :zap: finished scaffolding
* :zap: renamed types
* :zap: updated subtitle
* :zap: renamed functions file, UI updates
* :zap: query parameters fixes, ui updates, refactoring
* :zap: fixes for credentials test, setup for error parsing
* :zap: rlc for schema and table, error handling tweaks
* :zap: delete operation, new options
* :zap: columns loader
* :zap: linter fixes
* :zap: where clauses setup
* :zap: logic for processing where clauses
* :zap: select operation
* :zap: refactoring
* :zap: data mode for insert and update, wip
* :zap: data mapping, insert update, skip on conflict option
* :zap: select columns with spaces fix
* :zap: update operation update, wip
* :zap: finished update operation
* :zap: upsert operation
* :zap: ui fixes
* Copy updates.
* Copy updates.
* :zap: option to convert empty strings to nulls, schema checks
* :zap: UI requested updates
* :zap: ssh setup WIP
* :zap: fixes, ssh WIP
* :zap: ssh fixes, credentials
* :zap: credentials testing update
* :zap: uncaught error fix
* :zap: clean up
* :zap: address in use fix
* :zap: improved error message
* :zap: tests setup
* :zap: unit tests wip
* :zap: config files clean up
* :zap: utils unit tests
* :zap: refactoring
* :zap: setup for testing operations, tests for deleteTable operation
* :zap: executeQuery and insert operations tests
* :zap: select, update, upsert operations tests
* :zap: runQueries tests setup
* :zap: hint to query
* Copy updates.
* :zap: ui fixes
* :zap: clean up
* :zap: error message update
* :zap: ui update
* Minor tweaks to query params decription.
* ✨ Updated Postgres node to use resource mapper component
* ✨ Implemented postgres <-> resource mapper type mapping
* ✨ Updated Postgres node execution to use resource mapper fields in v3
* 🔥 Removing unused import
---------
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
* feat(core): Resource editor componend P0 (#5970)
* ✨ Added inital value of mapping mode dropdown
* ✨ Finished mapping mode selector
* ✨ Finished implementing mapping mode selector
* ✨ Implemented 'Columns to match on' dropdown
* ✨ Implemented `loadOptionsDependOn` support in resource mapper
* ✨ Implemented initial version of mapping fields
* ✨ Implementing dependant fields watcher in new component setup
* ✨ Generating correct resource mapper field types. Added `supportAutoMap` to node specification and UI. Not showing fields with `display=false`. Pre-selecting matching columns if it's the only one
* ✨ Handling matching columns correctly in UI
* ✨ Saving and loading resourceMapper values in component
* ✨ Implemented proper data saving and loading
* ✨ ResourceMapper component refactor, fixing value save/load
* ✨ Refactoring MatchingColumnSelect component. Updating Sheets node to use single key match and Postgres to use multi key
* ✨ Updated Google Sheets node to work with the new UI
* ✨ Updating Postgres Node to work with new UI
* ✨ Additional loading indicator that shown if there is no mapping mode selector
* ✨ Removing hard-coded values, fixing matching columns ordering, refactoring
* ✨ Updating field names in nodes
* ✨ Fixing minor UI issues
* ✨ Implemented matching fields filter logic
* ✨ Moving loading label outside of fields list
* ✅ Added initial unit tests for resource mapper
* ✅ Finished default rendering test
* ✅ Test refactoring
* ✅ Finished unit tests
* 🔨 Updating the way i18n is used in resource mapper components
* ✔️ Fixing value to match on logic for postgres node
* ✨ Hiding mapping fields when auto-map mode is selected
* ✨ Syncing selected mapping mode between components
* ✨ Fixing dateTime input rendering and adding update check to Postgres node
* ✨ Properly handling database connections. Sending null for empty string values.
* 💄 Updated wording in the error message for non-existing rows
* ✨ Fixing issues with selected matching values
* ✔️ Updating unit tests after matching logic update
* ✨ Updating matching columns when new fields are loaded
* ✨ Defaulting to null for empty parameter values
* ✨ Allowing zero as valid value for number imputs
* ✨ Updated list of types that use datepicker as widger
* ✨ Using text inputs for time types
* ✨ Initial mapping field rework
* ✨ Added new component for mapping fields, moved bit of logic from root component to matching selector, fixing some lint errors
* ✨ Added tooltip for columns that cannot be deleted
* ✨ Saving deleted values in parameter value
* ✨ Implemented control to add/remove mapping fields
* ✨ Syncing field list with add field dropdown when changing dependent values
* ✨ Not showing removed fields in matching columns selector. Updating wording in matching columns selector description
* ✨ Implementing disabled states for add/remove all fields options
* ✨ Saving removed columns separately, updating copy
* ✨ Implemented resource mapper values validation
* ✨ Updated validation logic and error input styling
* ✨ Validating resource mapper fields when new nodes are added
* ✨ Using node field words in validation, refactoring resource mapper component
* ✨ Implemented schema syncing and add/remove all fields
* ✨ Implemented custom parameter actions
* ✨ Implemented loading indicator in parameter options
* 🔨 Removing unnecessary constants and vue props
* ✨ Handling default values properly
* ✨ Fixing validation logic
* 👕 Fixing lint errors
* ⚡ Fixing type issues
* ⚡ Not showing fields by default if `addAllFields` is set to `false`
* ✨ Implemented field type validation in resource mapper
* ✨ Updated casing in copy, removed all/remove all option from bottom menu
* ✨ Added auto mapping mode notice
* ✨ Added support for more types in validation
* ✨ Added support for enumerated values
* ✨ Fixing imports after merging
* ✨ Not showing removed fields in matching columns selector. Refactoring validation logic.
* 👕 Fixing imports
* ✔️ Updating unit tests
* ✅ Added resource mapper schema tests
* ⚡ Removing `match` from resource mapper field definition, fixing matching columns loading
* ⚡ Fixed schema merging
* :zap: update operation return data fix
* :zap: review
* 🐛 Added missing import
* 💄 Updating parameter actions icon based on the ui review
* 💄 Updating word capitalisation in tooltips
* 💄 Added empty state to mapping fields list
* 💄 Removing asterisk from fields, updating tooltips for matching fields
* ⚡ Preventing matching fields from being removed by 'Remove All option'
* ⚡ Not showing hidden fields in the `Add field` dropdown
* ⚡ Added support for custom matching columns labels
* :zap: query optimization
* :zap: fix
* ⚡ Optimizing Postgres node enumeration logic
* ⚡ Added empty state for matching columns
* ⚡ Only fully loading fields if there is no schema fetched
* ⚡ Hiding mapping fields if there is no matching columns available in the schema
* ✔️ Fixing minor issues
* ✨ Implemented runtime type validation
* 🔨 Refactoring validation logic
* ✨ Implemented required check, added more custom messages
* ✨ Skipping boolean type in required check
* Type check improvements
* ✨ Only reloading fields if dependent values actually change
* ✨ Adding item index to validation error title
* ✨ Updating Postgres fetching logic, using resource mapper mode to determine if a field can be deleted
* ✨ Resetting field values when adding them via the addAll option
* ⚡ Using minor version (2.2) for new Postgres node
* ⚡ Implemented proper date validation and type casting
* 👕 Consolidating typing
* ✅ Added unit tests for type validations
* 👌 Addressing front-end review comments
* ⚡ More refactoring to address review changes
* ⚡ Updating leftover props
* ⚡ Added fallback for ISO dates with invalid timezones
* Added timestamp to datetime test cases
* ⚡ Reseting matching columns if operation changes
* ⚡ Not forcing auto-increment fields to be filled in in Postgres node. Handling null values
* 💄 Added a custom message for invalid dates
* ⚡ Better handling of JSON values
* ⚡ Updating codemirror readonly stauts based on component property, handling objects in json validation
* Deleting leftover console.log
* ⚡ Better time validation
* ⚡ Fixing build error after merging
* 👕 Fixing lint error
* ⚡ Updating node configuration values
* ⚡ Handling postgres arrays better
* ⚡ Handling SQL array syntax
* ⚡ Updating time validation rules to include timezone
* ⚡ Sending expressions that resolve to `null` or `undefined` by the resource mapper to delete cell content in Google Sheets
* ⚡ Allowing removed fields to be selected for match
* ⚡ Updated the query for fetching unique columns and primary keys
* ⚡ Optimizing the unique query
* ⚡ Setting timezone to all parsed dates
* ⚡ Addressing PR review feedback
* ⚡ Configuring Sheets node for production, minor vue component update
* New cases added to the TypeValidation test.
* ✅ Tweaking validation rules for arrays/objects and updating test cases
---------
Co-authored-by: Michael Kret <michael.k@radency.com>
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
2023-05-31 02:56:09 -07:00
|
|
|
label: {
|
|
|
|
type: Object as PropType<IParameterLabel>,
|
|
|
|
default: () => ({
|
|
|
|
size: 'small',
|
|
|
|
}),
|
|
|
|
},
|
2023-06-20 03:00:53 -07:00
|
|
|
eventBus: {
|
|
|
|
type: Object as PropType<EventBus>,
|
|
|
|
default: () => createEventBus(),
|
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
},
|
2024-02-12 01:45:05 -08:00
|
|
|
setup() {
|
|
|
|
const router = useRouter();
|
2024-02-27 01:39:45 -08:00
|
|
|
const workflowHelpers = useWorkflowHelpers({ router });
|
2024-02-12 01:45:05 -08:00
|
|
|
|
|
|
|
return {
|
|
|
|
workflowHelpers,
|
|
|
|
};
|
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
computed: {
|
2023-08-25 01:33:46 -07:00
|
|
|
...mapStores(useNDVStore, useExternalSecretsStore, useEnvironmentsStore),
|
2022-10-12 05:06:28 -07:00
|
|
|
isValueExpression() {
|
2023-07-28 00:51:07 -07:00
|
|
|
return isValueExpression(this.parameter, this.modelValue);
|
2022-10-12 05:06:28 -07:00
|
|
|
},
|
|
|
|
activeNode(): INodeUi | null {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.ndvStore.activeNode;
|
2022-10-12 05:06:28 -07:00
|
|
|
},
|
|
|
|
selectedRLMode(): INodePropertyMode | undefined {
|
|
|
|
if (
|
2023-07-28 00:51:07 -07:00
|
|
|
typeof this.modelValue !== 'object' ||
|
2022-10-12 05:06:28 -07:00
|
|
|
this.parameter.type !== 'resourceLocator' ||
|
2023-07-28 00:51:07 -07:00
|
|
|
!isResourceLocatorValue(this.modelValue)
|
2022-10-12 05:06:28 -07:00
|
|
|
) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
|
2023-07-28 00:51:07 -07:00
|
|
|
const mode = this.modelValue.mode;
|
2022-10-12 05:06:28 -07:00
|
|
|
if (mode) {
|
|
|
|
return this.parameter.modes?.find((m: INodePropertyMode) => m.name === mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
return undefined;
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
parameterHint(): string | undefined {
|
|
|
|
if (this.isValueExpression) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
if (this.selectedRLMode?.hint) {
|
|
|
|
return this.selectedRLMode.hint;
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.hint;
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
targetItem(): TargetItem | null {
|
2022-11-04 06:04:31 -07:00
|
|
|
return this.ndvStore.hoveringItem;
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
2023-04-21 05:08:51 -07:00
|
|
|
isInputParentOfActiveNode(): boolean {
|
|
|
|
return this.ndvStore.isInputParentOfActiveNode;
|
|
|
|
},
|
2024-02-06 09:34:34 -08:00
|
|
|
evaluatedExpression(): Result<unknown, unknown> {
|
2023-07-28 00:51:07 -07:00
|
|
|
const value = isResourceLocatorValue(this.modelValue)
|
|
|
|
? this.modelValue.value
|
|
|
|
: this.modelValue;
|
2023-04-21 05:08:51 -07:00
|
|
|
if (!this.activeNode || !this.isValueExpression || typeof value !== 'string') {
|
2024-02-06 09:34:34 -08:00
|
|
|
return { ok: false, error: '' };
|
2022-12-14 01:04:10 -08:00
|
|
|
}
|
2022-10-12 05:06:28 -07:00
|
|
|
|
|
|
|
try {
|
2023-04-21 05:08:51 -07:00
|
|
|
let opts;
|
|
|
|
if (this.ndvStore.isInputParentOfActiveNode) {
|
|
|
|
opts = {
|
|
|
|
targetItem: this.targetItem ?? undefined,
|
|
|
|
inputNodeName: this.ndvStore.ndvInputNodeName,
|
|
|
|
inputRunIndex: this.ndvStore.ndvInputRunIndex,
|
|
|
|
inputBranchIndex: this.ndvStore.ndvInputBranchIndex,
|
2023-08-25 01:33:46 -07:00
|
|
|
additionalKeys: this.resolvedAdditionalExpressionData,
|
2023-04-21 05:08:51 -07:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2024-02-12 01:45:05 -08:00
|
|
|
return { ok: true, result: this.workflowHelpers.resolveExpression(value, undefined, opts) };
|
2024-02-06 09:34:34 -08:00
|
|
|
} catch (error) {
|
|
|
|
return { ok: false, error };
|
|
|
|
}
|
|
|
|
},
|
|
|
|
evaluatedExpressionValue(): unknown {
|
|
|
|
const evaluated = this.evaluatedExpression;
|
|
|
|
return evaluated.ok ? evaluated.result : null;
|
|
|
|
},
|
|
|
|
evaluatedExpressionString(): string | null {
|
|
|
|
const evaluated = this.evaluatedExpression;
|
2023-04-21 05:08:51 -07:00
|
|
|
|
2024-02-06 09:34:34 -08:00
|
|
|
if (!evaluated.ok) {
|
2024-02-27 01:29:16 -08:00
|
|
|
if (getResolvableState(evaluated.error) !== 'invalid') {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return `[${this.$locale.baseText('parameterInput.error')}: ${getExpressionErrorMessage(
|
|
|
|
evaluated.error as Error,
|
2024-02-06 09:34:34 -08:00
|
|
|
)}]`;
|
|
|
|
}
|
2022-10-12 05:06:28 -07:00
|
|
|
|
2024-02-06 09:34:34 -08:00
|
|
|
if (evaluated.result === null) {
|
|
|
|
return null;
|
2022-12-14 01:04:10 -08:00
|
|
|
}
|
2022-10-12 05:06:28 -07:00
|
|
|
|
2024-02-06 09:34:34 -08:00
|
|
|
if (typeof evaluated.result === 'string' && evaluated.result.length === 0) {
|
|
|
|
return this.$locale.baseText('parameterInput.emptyString');
|
|
|
|
}
|
|
|
|
return typeof evaluated.result === 'string'
|
|
|
|
? evaluated.result
|
|
|
|
: JSON.stringify(evaluated.result);
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
expressionOutput(): string | null {
|
2024-02-06 09:34:34 -08:00
|
|
|
if (this.isValueExpression && this.evaluatedExpressionString) {
|
|
|
|
return this.evaluatedExpressionString;
|
2022-12-14 01:04:10 -08:00
|
|
|
}
|
|
|
|
|
2022-10-12 05:06:28 -07:00
|
|
|
return null;
|
|
|
|
},
|
2023-08-25 01:33:46 -07:00
|
|
|
resolvedAdditionalExpressionData() {
|
|
|
|
return {
|
|
|
|
$vars: this.environmentsStore.variablesAsObject,
|
|
|
|
...(this.externalSecretsStore.isEnterpriseExternalSecretsEnabled && this.isForCredential
|
|
|
|
? { $secrets: this.externalSecretsStore.secretsAsObject }
|
|
|
|
: {}),
|
|
|
|
...this.additionalExpressionData,
|
|
|
|
};
|
|
|
|
},
|
2023-09-14 01:54:25 -07:00
|
|
|
parsedParameterName() {
|
|
|
|
return parseResourceMapperFieldName(this.parameter?.name ?? '');
|
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
methods: {
|
|
|
|
onFocus() {
|
|
|
|
this.$emit('focus');
|
|
|
|
},
|
|
|
|
onBlur() {
|
|
|
|
this.$emit('blur');
|
|
|
|
},
|
|
|
|
onDrop(data: string) {
|
|
|
|
this.$emit('drop', data);
|
|
|
|
},
|
|
|
|
onValueChanged(parameterData: IUpdateInformation) {
|
2023-07-28 00:51:07 -07:00
|
|
|
this.$emit('update', parameterData);
|
2022-10-12 05:06:28 -07:00
|
|
|
},
|
|
|
|
onTextInput(parameterData: IUpdateInformation) {
|
|
|
|
this.$emit('textInput', parameterData);
|
|
|
|
},
|
2022-12-14 01:04:10 -08:00
|
|
|
},
|
2022-10-12 05:06:28 -07:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
2023-12-13 05:45:22 -08:00
|
|
|
.parameterInput {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: var(--spacing-4xs);
|
2022-10-12 05:06:28 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.hovering {
|
|
|
|
color: var(--color-secondary);
|
|
|
|
}
|
|
|
|
</style>
|