feat(editor): Combine 'Move to Folder' and 'Change owner' modals (#15756)

This new modal also allows transferring entire folders to other projects and users.
This commit is contained in:
Jaakko Husso
2025-05-28 23:41:07 +03:00
committed by GitHub
parent ba70cab9d5
commit e860dd6d2e
27 changed files with 1989 additions and 292 deletions

View File

@@ -2,7 +2,12 @@
import type { AllRolesMap } from '@n8n/permissions';
import { computed, ref, watch } from 'vue';
import { useI18n } from '@/composables/useI18n';
import type { ProjectListItem, ProjectSharingData } from '@/types/projects.types';
import {
ProjectTypes,
type ProjectIcon as ProjectIconItem,
type ProjectListItem,
type ProjectSharingData,
} from '@/types/projects.types';
import ProjectSharingInfo from '@/components/Projects/ProjectSharingInfo.vue';
import { sortByProperty } from '@n8n/utils/sort/sortByProperty';
@@ -46,6 +51,19 @@ const filteredProjects = computed(() =>
),
);
const projectIcon = computed<ProjectIconItem>(() => {
const defaultIcon: ProjectIconItem = { type: 'icon', value: 'layer-group' };
const project = props.projects.find((p) => p.id === selectedProject.value);
if (project?.type === ProjectTypes.Personal) {
return { type: 'icon', value: 'user' };
} else if (project?.type === ProjectTypes.Team) {
return project.icon ?? defaultIcon;
}
return defaultIcon;
});
const setFilter = (query: string) => {
filter.value = query;
};
@@ -109,7 +127,10 @@ watch(
@update:model-value="onProjectSelected"
>
<template #prefix>
<n8n-icon icon="search" />
<N8nIcon v-if="projectIcon.type === 'icon'" :icon="projectIcon.value" color="text-dark" />
<N8nText v-else-if="projectIcon.type === 'emoji'" color="text-light" :class="$style.emoji">
{{ projectIcon.value }}
</N8nText>
</template>
<N8nOption
v-for="project in filteredProjects"
@@ -187,4 +208,8 @@ watch(
.projectRoleSelect {
width: auto;
}
.emoji {
font-size: var(--font-size-s);
}
</style>