fix(editor): Issue showing Auth2 callback section when all properties are overriden (#8999)
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
/>
|
||||
|
||||
<CopyInput
|
||||
v-if="isOAuthType && credentialProperties.length"
|
||||
v-if="isOAuthType && !allOAuth2BasePropertiesOverridden"
|
||||
:label="$locale.baseText('credentialEdit.credentialConfig.oAuthRedirectUrl')"
|
||||
:value="oAuthCallbackUrl"
|
||||
:copy-button-text="$locale.baseText('credentialEdit.credentialConfig.clickToCopy')"
|
||||
@@ -204,6 +204,9 @@ export default defineComponent({
|
||||
isOAuthType: {
|
||||
type: Boolean,
|
||||
},
|
||||
allOAuth2BasePropertiesOverridden: {
|
||||
type: Boolean,
|
||||
},
|
||||
isOAuthConnected: {
|
||||
type: Boolean,
|
||||
},
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
:parent-types="parentTypes"
|
||||
:required-properties-filled="requiredPropertiesFilled"
|
||||
:credential-permissions="credentialPermissions"
|
||||
:all-o-auth2-base-properties-overridden="allOAuth2BasePropertiesOverridden"
|
||||
:mode="mode"
|
||||
:selected-credential="selectedCredential"
|
||||
:show-auth-type-selector="requiredCredentials"
|
||||
@@ -427,6 +428,15 @@ export default defineComponent({
|
||||
this.parentTypes.includes('oAuth1Api'))
|
||||
);
|
||||
},
|
||||
allOAuth2BasePropertiesOverridden() {
|
||||
if (this.credentialType?.__overwrittenProperties) {
|
||||
return (
|
||||
this.credentialType.__overwrittenProperties.includes('clientId') &&
|
||||
this.credentialType.__overwrittenProperties.includes('clientSecret')
|
||||
);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
isOAuthConnected(): boolean {
|
||||
return this.isOAuthType && !!this.credentialData.oauthTokenData;
|
||||
},
|
||||
@@ -435,7 +445,7 @@ export default defineComponent({
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.credentialType.properties.filter((propertyData: INodeProperties) => {
|
||||
const properties = this.credentialType.properties.filter((propertyData: INodeProperties) => {
|
||||
if (!this.displayCredentialParameter(propertyData)) {
|
||||
return false;
|
||||
}
|
||||
@@ -444,6 +454,17 @@ export default defineComponent({
|
||||
!this.credentialType!.__overwrittenProperties.includes(propertyData.name)
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* If after all credentials overrides are applied only "notice"
|
||||
* properties are left, do not return them. This will avoid
|
||||
* showing notices that refer to a property that was overridden.
|
||||
*/
|
||||
if (properties.every((p) => p.type === 'notice')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return properties;
|
||||
},
|
||||
requiredPropertiesFilled(): boolean {
|
||||
for (const property of this.credentialProperties) {
|
||||
|
||||
Reference in New Issue
Block a user