mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
fix(editor): Show used credentials names as links in a tooltip and send IDs with the request
This commit is contained in:
parent
32c6768271
commit
3eeea284f9
|
@ -19,8 +19,10 @@ export async function moveWorkflowToProject(
|
|||
context: IRestApiContext,
|
||||
id: string,
|
||||
destinationProjectId: string,
|
||||
shareCredentials?: string[],
|
||||
): Promise<void> {
|
||||
return await makeRestApiRequest(context, 'PUT', `/workflows/${id}/transfer`, {
|
||||
destinationProjectId,
|
||||
shareCredentials,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ const moveResource = async () => {
|
|||
props.data.resourceType,
|
||||
props.data.resource.id,
|
||||
selectedProject.value.id,
|
||||
shareUsedCredentials.value ? usedCredentials.value.map((c) => c.id) : undefined,
|
||||
);
|
||||
closeModal();
|
||||
telemetry.track(`User successfully moved ${props.data.resourceType}`, {
|
||||
|
@ -221,7 +222,7 @@ onMounted(async () => {
|
|||
}}
|
||||
</span>
|
||||
<template #content>
|
||||
<ul>
|
||||
<ul :class="$style.credentialsList">
|
||||
<li v-for="credential in usedCredentials" :key="credential.id">
|
||||
<router-link
|
||||
target="_blank"
|
||||
|
@ -276,4 +277,18 @@ onMounted(async () => {
|
|||
display: block;
|
||||
margin-top: var(--spacing-s);
|
||||
}
|
||||
|
||||
.credentialsList {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
li {
|
||||
padding: 0 0 var(--spacing-3xs);
|
||||
|
||||
&:last-child {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -162,9 +162,15 @@ export const useProjectsStore = defineStore(STORES.PROJECTS, () => {
|
|||
resourceType: 'workflow' | 'credential',
|
||||
resourceId: string,
|
||||
projectId: string,
|
||||
shareCredentials?: string[],
|
||||
) => {
|
||||
if (resourceType === 'workflow') {
|
||||
await workflowsEEApi.moveWorkflowToProject(rootStore.restApiContext, resourceId, projectId);
|
||||
await workflowsEEApi.moveWorkflowToProject(
|
||||
rootStore.restApiContext,
|
||||
resourceId,
|
||||
projectId,
|
||||
shareCredentials,
|
||||
);
|
||||
await workflowsStore.fetchAllWorkflows(currentProjectId.value);
|
||||
} else {
|
||||
await credentialsEEApi.moveCredentialToProject(
|
||||
|
|
Loading…
Reference in a new issue