fix(editor): Fix new node credential creation via Resource Locator Component (#9896)

This commit is contained in:
Alex Grozav
2024-07-01 14:48:39 +03:00
committed by GitHub
parent 59c8bf1c44
commit 55cbc900a4
5 changed files with 84 additions and 24 deletions

View File

@@ -175,6 +175,7 @@ import ResourceLocatorDropdown from './ResourceLocatorDropdown.vue';
import { useDebounce } from '@/composables/useDebounce';
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
import { useRouter } from 'vue-router';
import { ndvEventBus } from '@/event-bus';
interface IResourceLocatorQuery {
results: INodeListSearchItems[];
@@ -566,12 +567,18 @@ export default defineComponent({
if (!nodeType) {
return;
}
const defaultCredentialType = nodeType.credentials?.[0].name ?? '';
const mainAuthType = getMainAuthField(nodeType);
const showAuthSelector =
const showAuthOptions =
mainAuthType !== null &&
Array.isArray(mainAuthType.options) &&
mainAuthType.options?.length > 0;
this.uiStore.openNewCredential('', showAuthSelector);
ndvEventBus.emit('credential.createNew', {
type: defaultCredentialType,
showAuthOptions,
});
},
findModeByName(name: string): INodePropertyMode | null {
if (this.parameter.modes) {