mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user