diff --git a/packages/editor-ui/src/components/CredentialsEdit.vue b/packages/editor-ui/src/components/CredentialsEdit.vue index cd3b6c1f74..782e615a33 100644 --- a/packages/editor-ui/src/components/CredentialsEdit.vue +++ b/packages/editor-ui/src/components/CredentialsEdit.vue @@ -34,6 +34,7 @@ import CredentialsInput from '@/components/CredentialsInput.vue'; import { ICredentialsCreatedEvent, ICredentialsDecryptedResponse, + INodeProperties, } from '@/Interface'; import { @@ -181,9 +182,21 @@ export default mixins( // Credentials extends another one. So get the properties of the one it // extends and add them. credentialData = JSON.parse(JSON.stringify(credentialData)); + let existingIndex: number; for (const credentialTypeName of credentialData.extends) { const data = this.$store.getters.credentialType(credentialTypeName); - credentialData.properties.push.apply(credentialData.properties, data.properties); + + for (const property of data.properties) { + existingIndex = credentialData.properties.findIndex(element => element.name === property.name); + + if (existingIndex === -1) { + // Property does not exist yet, so add + credentialData.properties.push(property); + } else { + // Property exists already, so overwrite + credentialData.properties[existingIndex] = property; + } + } } return credentialData; diff --git a/packages/editor-ui/src/components/ParameterInputList.vue b/packages/editor-ui/src/components/ParameterInputList.vue index 4bad3a3417..939452e3a0 100644 --- a/packages/editor-ui/src/components/ParameterInputList.vue +++ b/packages/editor-ui/src/components/ParameterInputList.vue @@ -149,6 +149,10 @@ export default mixins( this.$emit('valueChanged', parameterData); }, displayNodeParameter (parameter: INodeProperties): boolean { + if (parameter.type === 'hidden') { + return false; + } + if (parameter.displayOptions === undefined) { // If it is not defined no need to do a proper check return true; diff --git a/packages/nodes-base/credentials/GithubOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GithubOAuth2Api.credentials.ts index 74df45d8a6..0bf12444f2 100644 --- a/packages/nodes-base/credentials/GithubOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/GithubOAuth2Api.credentials.ts @@ -1,15 +1,21 @@ import { ICredentialType, + NodePropertyTypes, } from 'n8n-workflow'; export class GithubOAuth2Api implements ICredentialType { name = 'githubOAuth2Api'; - // name = 'oAuth2Api/githubOAuth2Api'; extends = [ 'oAuth2Api', ]; displayName = 'Github OAuth2 API'; properties = [ + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, ]; } diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 6b8f98fe04..7052dd2431 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -364,7 +364,7 @@ export interface INodeParameters { } -export type NodePropertyTypes = 'boolean' | 'collection' | 'color' | 'dateTime' | 'fixedCollection' | 'json' | 'multiOptions' | 'number' | 'options' | 'string'; +export type NodePropertyTypes = 'boolean' | 'collection' | 'color' | 'dateTime' | 'fixedCollection' | 'hidden' | 'json' | 'multiOptions' | 'number' | 'options' | 'string'; export type EditorTypes = 'code';