mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
⚡ Add parameter type "hidden"
This commit is contained in:
parent
928bf4dc68
commit
6bff3dc199
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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: '',
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Loading…
Reference in a new issue