Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N8 n 4179 resource locator list mode #3933

Merged
merged 201 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
0510e17
✨ Implemented initial version of list mode dropdown
MiloradFilipovic Aug 11, 2022
fe58554
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 15, 2022
e9c60d6
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 15, 2022
d08e874
✨ Handling mode switching and expression support in list mode
MiloradFilipovic Aug 15, 2022
547e229
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 17, 2022
f1b9dfa
🔨 Removing `sortedModes` references
MiloradFilipovic Aug 17, 2022
3eadaf2
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 18, 2022
ce98df2
⚡ Fixing list mode UI after latest mege
MiloradFilipovic Aug 18, 2022
ff428f4
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 18, 2022
79310fd
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 18, 2022
c2c6939
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 19, 2022
0574ade
Merge branch 'feature-resource-locator' into N8N-4179-resource-locato…
MiloradFilipovic Aug 19, 2022
65cf95e
💄 Updating padding-right for input fields with suffix slots
MiloradFilipovic Aug 19, 2022
5254248
✨ Minor fixes to validation, mode switching logic and styling
MiloradFilipovic Aug 19, 2022
28cdddd
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Aug 24, 2022
31c3be1
update error
mutdmour Aug 24, 2022
f10202e
2 or more regex
mutdmour Aug 24, 2022
91e0758
update regex to be more strict
mutdmour Aug 24, 2022
f9a7c8c
remove expr colors
mutdmour Aug 24, 2022
ee1a580
merge in master
mutdmour Aug 24, 2022
143e7b7
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Aug 24, 2022
6dd96f7
update hint
mutdmour Aug 24, 2022
9361323
:construction: super basic version of the search endpoint
valya Aug 24, 2022
402e036
:construction: fixed up type errors and return urls
valya Aug 25, 2022
a45d1eb
begin list impl
mutdmour Aug 25, 2022
2f34c90
:sparkles: add v3 of Google Drive node with RLC
valya Aug 25, 2022
fdb55b4
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Aug 29, 2022
b2ba979
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Aug 29, 2022
249e563
fix ts issue
mutdmour Aug 29, 2022
362586f
introduce dropdown
mutdmour Aug 29, 2022
2271f15
add more behavior
mutdmour Aug 29, 2022
cad2747
update design
mutdmour Aug 29, 2022
0138725
show search
mutdmour Aug 29, 2022
1d4ab8e
add filtering
mutdmour Aug 29, 2022
28b753f
push up selected
mutdmour Aug 29, 2022
7c7c491
add keyboard nav
mutdmour Aug 29, 2022
06b837c
add loading
mutdmour Aug 29, 2022
9b0b541
add caching
mutdmour Aug 29, 2022
d048a50
remove console
mutdmour Aug 29, 2022
cbaa6ae
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Aug 29, 2022
ccaa184
fix build issues
mutdmour Aug 29, 2022
87f6743
add debounce
mutdmour Aug 29, 2022
b3bfe36
fix click
mutdmour Aug 29, 2022
ee5e4e2
keep event on focus
mutdmour Aug 29, 2022
98e80b0
fix input size bug
mutdmour Aug 29, 2022
a31679e
add resource locator type
mutdmour Aug 29, 2022
507cc95
update type
mutdmour Aug 29, 2022
bae794f
update interface
mutdmour Aug 29, 2022
00b04b9
Merge remote-tracking branch 'origin/n8n-4387-resource-loader' into n…
valya Aug 30, 2022
f49d0a1
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Aug 30, 2022
f7fc11f
update resource locator types
mutdmour Aug 30, 2022
0c45aa3
:sparkles: add search to Trello boards
valya Aug 30, 2022
cbb8781
:sparkles: add RLC to Google Drive Shared Drive operations
valya Aug 30, 2022
1874990
update
mutdmour Aug 30, 2022
c29607d
Merge branch 'n8n-4370-implement-search-endpoints-be' into n8n-4453-i…
valya Aug 30, 2022
9063bc1
update name
mutdmour Aug 30, 2022
380786e
add package
mutdmour Aug 31, 2022
c74fcd5
use stringify pckg
mutdmour Aug 31, 2022
046e706
handle long vals
mutdmour Aug 31, 2022
bdc8f5e
fix bug in url id modes
mutdmour Aug 31, 2022
dcd2c25
remove console log
mutdmour Aug 31, 2022
5bb4bc7
add lazy loading
mutdmour Aug 31, 2022
1eec3f8
add lazy loading on filtering
mutdmour Aug 31, 2022
02b1a53
clean up
mutdmour Aug 31, 2022
02a9f4a
make search clearable
mutdmour Aug 31, 2022
2ed0a67
add error state
mutdmour Aug 31, 2022
3b55043
:sparkles: add RLC to Trello cards
valya Aug 31, 2022
848ff00
Merge remote-tracking branch 'origin/n8n-4387-resource-loader' into n…
valya Aug 31, 2022
e508c86
:recycle: address some small changes requested in review
valya Aug 31, 2022
501f1bd
Merge branch 'n8n-4370-implement-search-endpoints-be' into n8n-4453-i…
valya Aug 31, 2022
c88bb23
:recycle: use new versioning system for Trello v2
valya Aug 31, 2022
fa58cd6
refactor a bit
mutdmour Sep 1, 2022
39e414c
fix how loading happens
mutdmour Sep 1, 2022
f6890e4
clear after blur
mutdmour Sep 1, 2022
bdde870
merge in
mutdmour Sep 1, 2022
f930ebc
update api
mutdmour Sep 1, 2022
69bc4b5
comment out test code
mutdmour Sep 1, 2022
bbceab7
update api
mutdmour Sep 1, 2022
0e7b32f
relaod in case of error
mutdmour Sep 1, 2022
7933cf8
update endpoint
mutdmour Sep 1, 2022
9cf35af
:bug: move list search out of /nodes/ and add check for required param
valya Sep 1, 2022
922f325
:bug: move list search out of /nodes/ and add check for required param
valya Sep 1, 2022
f0606fc
Merge branch 'n8n-4370-implement-search-endpoints-be' into n8n-4453-i…
valya Sep 1, 2022
3c9d526
update req handling
mutdmour Sep 1, 2022
7d5f011
Merge branch 'n8n-4453-implement-search-endpoints-be-33' of github.co…
mutdmour Sep 1, 2022
0eb7045
update endpoint
mutdmour Sep 1, 2022
34604e5
:sparkles: re-add trello search methods
valya Sep 1, 2022
7862360
Merge branch 'n8n-4453-implement-search-endpoints-be-33' of github.co…
mutdmour Sep 1, 2022
200ec40
:goal_net: throw error if RLC search isn't sent a method name
valya Sep 1, 2022
6c37d5e
Merge branch 'n8n-4453-implement-search-endpoints-be-33' of github.co…
mutdmour Sep 1, 2022
0b9b817
get api to work
mutdmour Sep 1, 2022
e8a7d0f
update scroll handling
mutdmour Sep 1, 2022
aa4bdef
:sparkles: google drive folder search
valya Sep 1, 2022
8baf27c
Merge branch 'n8n-4370-implement-search-endpoints-be' into n8n-4453-i…
valya Sep 1, 2022
b880dbe
:sparkles: add requires filter field to RLC search
valya Sep 1, 2022
33cabf6
:sparkles: google drive search sort by name
valya Sep 1, 2022
1160d11
Merge branch 'n8n-4370-implement-search-endpoints-be' into n8n-4453-i…
valya Sep 1, 2022
b91d90a
Merge branch 'n8n-4453-implement-search-endpoints-be-33' of github.co…
mutdmour Sep 1, 2022
a6d2952
remove console
mutdmour Sep 1, 2022
b2ba457
:sparkles: add searchable flag for RLC
valya Sep 1, 2022
ebdf203
Merge branch 'n8n-4370-implement-search-endpoints-be' into n8n-4453-i…
valya Sep 1, 2022
c14ac23
:sparkles: add searchable flag to Trello searches
valya Sep 1, 2022
8bebc55
update searchable
mutdmour Sep 1, 2022
0b30361
Merge branch 'n8n-4453-implement-search-endpoints-be-33' of github.co…
mutdmour Sep 1, 2022
13c57c0
:sparkles: add RLC for cardId and boardId on all operations
valya Sep 1, 2022
5c94628
:sparkles: add ID and URL RLC to Airtable
valya Sep 1, 2022
19f22d9
Merge branch 'n8n-4453-implement-search-endpoints-be-33' of github.co…
mutdmour Sep 2, 2022
159c378
fix up search
mutdmour Sep 2, 2022
aa57d76
remove extra padding
mutdmour Sep 2, 2022
afc06a0
add link button
mutdmour Sep 2, 2022
4d16e78
update popper pos
mutdmour Sep 2, 2022
0afef91
format
mutdmour Sep 2, 2022
fb53493
fix formating
mutdmour Sep 2, 2022
8fc6b7a
update mode change
mutdmour Sep 2, 2022
ab0c995
add name urls
mutdmour Sep 2, 2022
8194e88
update regex and errors
mutdmour Sep 4, 2022
3cd0948
upate error
mutdmour Sep 4, 2022
59cc082
update errors
mutdmour Sep 4, 2022
2db293c
update airtable regex
mutdmour Sep 4, 2022
dc6f6dc
Merge branch 'master' of github.com:n8n-io/n8n into n8n-4179-rl-trello
mutdmour Sep 4, 2022
f68f3c2
update trello regex rules
mutdmour Sep 4, 2022
5d421cf
udpate param name
mutdmour Sep 4, 2022
1ddb7b4
update
mutdmour Sep 4, 2022
44114a6
update param
mutdmour Sep 4, 2022
f8ebd94
update param
mutdmour Sep 4, 2022
b02c1ab
update drive node
mutdmour Sep 4, 2022
c70efc1
update params
mutdmour Sep 4, 2022
1aeef10
add keyboard nav
mutdmour Sep 5, 2022
24ae7de
fix bug
mutdmour Sep 5, 2022
c18640b
update airtable default mode
mutdmour Sep 5, 2022
bedb900
fix default value issue
mutdmour Sep 5, 2022
fc3798b
hide long selected value
mutdmour Sep 5, 2022
ed19774
update duplicate reqs
mutdmour Sep 5, 2022
6c2025f
update node
mutdmour Sep 5, 2022
1d405eb
clean up impl
mutdmour Sep 5, 2022
1090cc4
dedupe resources
mutdmour Sep 5, 2022
9917aaa
fix up nv
mutdmour Sep 5, 2022
e8a26ba
resort params
mutdmour Sep 5, 2022
0572e86
update icon
mutdmour Sep 5, 2022
3f490ad
set placeholders
mutdmour Sep 5, 2022
d413e09
default to id mode
mutdmour Sep 5, 2022
3c08494
add telemetry
mutdmour Sep 5, 2022
d1b2a59
add refresh opt
mutdmour Sep 5, 2022
12c4bae
clean up tmp val
mutdmour Sep 5, 2022
853ef19
Merge branch 'master' of github.com:n8n-io/n8n into N8N-4179-resource…
mutdmour Sep 5, 2022
2f5b09e
merge in
mutdmour Sep 5, 2022
507b6a5
revert test change
mutdmour Sep 5, 2022
abd4a21
make placeholder optional
mutdmour Sep 6, 2022
ef083e8
Merge branch 'n8n-4387-resource-loader' of github.com:n8n-io/n8n into…
mutdmour Sep 6, 2022
7b427f9
update validation
mutdmour Sep 6, 2022
8bcc534
remove description as param hint
mutdmour Sep 7, 2022
55dd826
support more general values
mutdmour Sep 7, 2022
45e1148
fix links on long names
mutdmour Sep 7, 2022
2b89030
update resource item styles
mutdmour Sep 7, 2022
30e197d
update pos
mutdmour Sep 7, 2022
953f0e2
update icon color
mutdmour Sep 7, 2022
f20cab0
update link alt
mutdmour Sep 7, 2022
3d88620
check if required
mutdmour Sep 7, 2022
5e03d7d
move validation to workflow
mutdmour Sep 7, 2022
d4b5709
update naming
mutdmour Sep 8, 2022
3527d60
only show warning at param level
mutdmour Sep 8, 2022
90607fa
show right border on focus
mutdmour Sep 8, 2022
85efa94
fix hover on all item
mutdmour Sep 8, 2022
6fa60a5
fix long names bug
mutdmour Sep 8, 2022
38af388
fix expr bug
mutdmour Sep 14, 2022
dfade2f
add expr
mutdmour Sep 14, 2022
c17fc32
update legacy mode
mutdmour Sep 14, 2022
827949b
fix up impl
mutdmour Sep 14, 2022
55bcfe5
clean up node types
mutdmour Sep 15, 2022
f12b294
clean up types
mutdmour Sep 15, 2022
11b0180
remove unnessary type
mutdmour Sep 15, 2022
53bb950
clean up types
mutdmour Sep 15, 2022
7feff2f
clean up types
mutdmour Sep 15, 2022
b92c13a
clean up types
mutdmour Sep 15, 2022
6cb08c4
clea n up localizaiton
mutdmour Sep 15, 2022
ca097e6
remove unused key
mutdmour Sep 15, 2022
9df2b60
clean up helpers
mutdmour Sep 15, 2022
3cd89e0
clean up paraminput
mutdmour Sep 15, 2022
2d17df1
clean up paraminputfull
mutdmour Sep 15, 2022
a41bbfe
refactor into one loop
mutdmour Sep 15, 2022
1cc4cd9
update component
mutdmour Sep 15, 2022
eb63bf1
update class names
mutdmour Sep 15, 2022
ebd822f
update prop types
mutdmour Sep 15, 2022
14aed4c
update name cases
mutdmour Sep 15, 2022
f727cb4
update casing
mutdmour Sep 15, 2022
0a4c05e
clean up classes
mutdmour Sep 15, 2022
c6edcb2
clean up resource locator
mutdmour Sep 15, 2022
53546e0
update drop handling
mutdmour Sep 15, 2022
258290c
update mode
mutdmour Sep 15, 2022
0661d3d
add url for link mode
mutdmour Sep 19, 2022
2ddbfaf
clear value by default
mutdmour Sep 19, 2022
27576c3
add placeholder
mutdmour Sep 19, 2022
5496a2c
remove legacy hint
mutdmour Sep 19, 2022
3dd5f23
handle expr in legacy
mutdmour Sep 19, 2022
d1010a4
fix typos
mutdmour Sep 19, 2022
0b24297
revert padding change
mutdmour Sep 19, 2022
0c875f8
fix up spacing
mutdmour Sep 19, 2022
543b67e
update to link component
mutdmour Sep 19, 2022
5e80b7d
support urls for id
mutdmour Sep 19, 2022
ae42b0c
fix replacement
mutdmour Sep 19, 2022
b368fcc
build
mutdmour Sep 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/design-system/src/components/N8nButton/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ $loading-overlay-background-color: rgba(255, 255, 255, 0);
--button-hover-color: var(--color-success);
}

&.tertiary {
--button-hover-color: var(--color-primary);
}

&.warning {
--button-color: var(--color-warning);
--button-active-color: var(--color-warning);
Expand Down
3 changes: 3 additions & 0 deletions packages/design-system/src/components/N8nInput/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export default Vue.extend({
disabled: {
type: Boolean,
},
readonly: {
type: Boolean,
},
clearable: {
type: Boolean,
},
Expand Down
4 changes: 4 additions & 0 deletions packages/design-system/src/components/N8nLink/Link.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export default Vue.extend({
.text {
color: var(--color-text-base);

&:hover {
color: var(--color-primary);
}

&:active {
color: saturation(--color-primary-h, --color-primary-s, --color-primary-l, -(30%));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/theme/src/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
@include mixins.e(suffix) {
position: absolute;
height: 100%;
right: 10px;
right: var(--spacing-2xs);
top: 0;
text-align: center;
color: var(--color-text-light);
Expand Down
1 change: 1 addition & 0 deletions packages/editor-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"vue-template-compiler": "~2.6.11",
"vue-typed-mixins": "^0.2.0",
"vue2-touch-events": "^3.2.1",
"fast-json-stable-stringify": "^2.1.0",
"vuex": "^3.1.1"
}
}
16 changes: 16 additions & 0 deletions packages/editor-ui/src/Interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
IWorkflowSettings as IWorkflowSettingsWorkflow,
WorkflowExecuteMode,
PublicInstalledPackage,
INodeListSearchItems,
} from 'n8n-workflow';
import { FAKE_DOOR_FEATURES } from './constants';

Expand Down Expand Up @@ -1072,3 +1073,18 @@ export interface ITab {
align?: 'right';
tooltip?: string;
}

export interface IResourceLocatorReqParams {
nodeTypeAndVersion: INodeTypeNameVersion;
path: string;
methodName?: string;
searchList?: ILoadOptions;
currentNodeParameters: INodeParameters;
credentials?: INodeCredentials;
filter?: string;
paginationToken?: unknown;
}

export interface IResourceLocatorResultExpanded extends INodeListSearchItems {
linkAlt?: string;
}
11 changes: 11 additions & 0 deletions packages/editor-ui/src/api/nodeTypes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { makeRestApiRequest } from './helpers';
import type {
INodeTranslationHeaders,
IResourceLocatorReqParams,
IRestApiContext,
} from '@/Interface';
import type {
IDataObject,
ILoadOptions,
INodeCredentials,
INodeListSearchResult,
INodeParameters,
INodePropertyOptions,
INodeTypeDescription,
Expand Down Expand Up @@ -45,3 +48,11 @@ export async function getNodeParameterOptions(
): Promise<INodePropertyOptions[]> {
return makeRestApiRequest(context, 'GET', '/node-parameter-options', sendData);
}

export async function getResourceLocatorResults(
context: IRestApiContext,
sendData: IResourceLocatorReqParams,
): Promise<INodeListSearchResult> {
return makeRestApiRequest(context, 'GET', '/nodes-list-search', sendData as unknown as IDataObject);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can IResourceLocatorReqParams be made to extend IDataObject so we can avoid ugly type conversions like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cool idea.. I tried but IDataObject does not support unknown.. changing that might break too many things

}

5 changes: 3 additions & 2 deletions packages/editor-ui/src/components/BreakpointsObserver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import {

import mixins from "vue-typed-mixins";
import { genericHelpers } from "@/components/mixins/genericHelpers";
import { debounceHelper } from "./mixins/debounce";

export default mixins(genericHelpers).extend({
export default mixins(genericHelpers, debounceHelper).extend({
name: "BreakpointsObserver",
props: [
"valueXS",
Expand Down Expand Up @@ -98,4 +99,4 @@ export default mixins(genericHelpers).extend({
},
},
});
</script>
</script>
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/CredentialsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default mixins(
},

editCredential (credential: ICredentialsResponse) {
this.$store.dispatch('ui/openExisitngCredential', { id: credential.id});
this.$store.dispatch('ui/openExistingCredential', { id: credential.id});
this.$telemetry.track('User opened Credential modal', { credential_type: credential.type, source: 'primary_menu', new_credential: false, workflow_id: this.$store.getters.workflowId });
},

Expand Down
2 changes: 2 additions & 0 deletions packages/editor-ui/src/components/ExpressionEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ import { genericHelpers } from '@/components/mixins/genericHelpers';

import mixins from 'vue-typed-mixins';
import { hasExpressionMapping } from './helpers';
import { debounceHelper } from './mixins/debounce';

export default mixins(
externalHooks,
genericHelpers,
debounceHelper,
).extend({
name: 'ExpressionEdit',
props: [
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/components/NodeCredentials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export default mixins(

editCredential(credentialType: string): void {
const { id } = this.node.credentials[credentialType];
this.$store.dispatch('ui/openExisitngCredential', { id });
this.$store.dispatch('ui/openExistingCredential', { id });

this.$telemetry.track('User opened Credential modal', { credential_type: credentialType, source: 'node', new_credential: false, workflow_id: this.$store.getters.workflowId });

Expand Down
49 changes: 30 additions & 19 deletions packages/editor-ui/src/components/ParameterInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div @keydown.stop :class="parameterInputClasses">
<expression-edit
:dialogVisible="expressionEditDialogVisible"
:value="isResourceLocatorParameter ? value.value || '' : value"
:value="isResourceLocatorParameter ? (value ? value.value : '') : value"
:parameter="parameter"
:path="path"
:eventSource="eventSource || 'ndv'"
Expand All @@ -18,22 +18,20 @@
v-if="isResourceLocatorParameter"
ref="resourceLocator"
:parameter="parameter"
:value="typeof value === 'string' ? value : value.value"
:mode="value.mode || ''"
:displayValue="displayValue"
:value="value"
:displayTitle="displayTitle"
:parameterInputClasses="parameterInputClasses"
:expressionDisplayValue="expressionDisplayValue"
:isValueExpression="isValueExpression"
:isReadOnly="isReadOnly"
:parameterIssues="getIssues"
:droppable="droppable"
@valueChanged="valueChanged"
@modeChanged="valueChanged"
:node="node"
:path="path"
@input="valueChanged"
@focus="setFocus"
@blur="onBlur"
@drop="onDrop"
></resource-locator>
@drop="onResourceLocatorDrop"
/>
<n8n-input
v-else-if="isValueExpression || droppable || forceShowExpression"
:size="inputSize"
Expand Down Expand Up @@ -98,7 +96,7 @@
<div slot="suffix" class="expand-input-icon-container">
<font-awesome-icon
v-if="!isReadOnly"
icon="external-link-alt"
icon="expand-alt"
class="edit-window-button clickable"
:title="$locale.baseText('parameterInput.openEditWindow')"
@click="displayEditDialog()"
Expand Down Expand Up @@ -278,7 +276,7 @@
/>
</div>

<parameter-issues v-if="parameter.type !== 'credentialsSelect'" :issues="getIssues" />
<parameter-issues v-if="parameter.type !== 'credentialsSelect' && !isResourceLocatorParameter" :issues="getIssues" />
</div>
</template>

Expand Down Expand Up @@ -317,7 +315,8 @@ import { workflowHelpers } from '@/components/mixins/workflowHelpers';
import mixins from 'vue-typed-mixins';
import { CUSTOM_API_CALL_KEY } from '@/constants';
import { mapGetters } from 'vuex';
import { hasExpressionMapping } from './helpers';
import { hasExpressionMapping, isValueExpression } from './helpers';
import { isResourceLocatorValue } from '@/typeGuards';

export default mixins(
externalHooks,
Expand All @@ -326,7 +325,7 @@ export default mixins(
workflowHelpers,
)
.extend({
name: 'ParameterInput',
name: 'parameter-input',
components: {
CodeEdit,
ExpressionEdit,
Expand All @@ -353,7 +352,6 @@ export default mixins(
'activeDrop',
'droppable',
'forceShowExpression',
'isValueExpression',
],
data () {
return {
Expand Down Expand Up @@ -415,6 +413,9 @@ export default mixins(
},
computed: {
...mapGetters('credentials', ['allCredentialTypes']),
isValueExpression(): boolean {
return isValueExpression(this.parameter, this.value);
},
areExpressionsDisabled(): boolean {
return this.$store.getters['ui/areExpressionsDisabled'];
},
Expand Down Expand Up @@ -479,7 +480,7 @@ export default mixins(

let returnValue;
if (this.isValueExpression === false) {
returnValue = this.isResourceLocatorParameter ? this.value.value : this.value;
returnValue = this.isResourceLocatorParameter ? (this.value ? this.value.value: '') : this.value;
} else {
returnValue = this.expressionValueComputed;
}
Expand Down Expand Up @@ -670,7 +671,7 @@ export default mixins(
const styles = {
width: '100%',
};
if (this.parameter.type === 'credentialsSelect') {
if (this.parameter.type === 'credentialsSelect' || this.isResourceLocatorParameter) {
return styles;
}
if (this.getIssues.length) {
Expand Down Expand Up @@ -744,9 +745,9 @@ export default mixins(
this.remoteParameterOptions.length = 0;

// Get the resolved parameter values of the current node
const currentNodeParameters = this.$store.getters.activeNode.parameters;

try {
const currentNodeParameters = (this.$store.getters.activeNode as INodeUi).parameters;
const resolvedNodeParameters = this.resolveParameter(currentNodeParameters) as INodeParameters;
const loadOptionsMethod = this.getArgument('loadOptionsMethod') as string | undefined;
const loadOptions = this.getArgument('loadOptions') as ILoadOptions | undefined;
Expand Down Expand Up @@ -834,7 +835,7 @@ export default mixins(
onBlur () {
this.$emit('blur');
},
onDrop(data: string) {
onResourceLocatorDrop(data: string) {
this.$emit('drop', data);
},
setFocus () {
Expand Down Expand Up @@ -936,7 +937,11 @@ export default mixins(
if (this.parameter.type === 'number' || this.parameter.type === 'boolean') {
this.valueChanged({ value: `={{${this.value}}}`, mode: this.value.mode });
} else if (this.isResourceLocatorParameter) {
this.valueChanged({ value: `=${this.value.value}`, mode: this.value.mode });
if (isResourceLocatorValue(this.value)) {
this.valueChanged({ value: `=${this.value.value}`, mode: this.value.mode });
} else {
this.valueChanged({ value: `=${this.value}`, mode: '' });
}
} else {
this.valueChanged(`=${this.value}`);
}
Expand All @@ -959,6 +964,12 @@ export default mixins(
this.valueChanged(typeof value !== 'undefined' ? value : null);
}
} else if (command === 'refreshOptions') {
if (this.isResourceLocatorParameter) {
const resourceLocator = this.$refs.resourceLocator;
if (resourceLocator) {
(resourceLocator as Vue).$emit('refreshList');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be triggered in some nicer way instead of emitting child component event (which is handled inside that same component, if i see it correctly)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure.. one approach I could think of is creating an event bus and passing it down but that's not much better.. or moving data to a store.. but not sure if a store makes sense here... since we don't reuse the data and only needed when directly using a parameter..

}
}
this.loadRemoteParameterOptions();
}

Expand Down
Loading