Skip to content

Commit

Permalink
fix(editor): Show used credentials names as links in a tooltip and se…
Browse files Browse the repository at this point in the history
…nd IDs with the request
  • Loading branch information
cstuncsik committed Jan 9, 2025
1 parent 32c6768 commit 3eeea28
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/editor-ui/src/api/workflows.ee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}`, {
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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>
8 changes: 7 additions & 1 deletion packages/editor-ui/src/stores/projects.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3eeea28

Please sign in to comment.