feat(editor): Add front-end for Data Store feature (#17590)

This commit is contained in:
Milorad FIlipović
2025-07-31 13:07:00 +02:00
committed by GitHub
parent b745cad72c
commit b89c254394
35 changed files with 1820 additions and 99 deletions

View File

@@ -2,7 +2,7 @@
import { computed, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useElementSize, useResizeObserver } from '@vueuse/core';
import type { UserAction } from '@n8n/design-system';
import type { TabOptions, UserAction } from '@n8n/design-system';
import { N8nButton, N8nTooltip } from '@n8n/design-system';
import { useI18n } from '@n8n/i18n';
import { ProjectTypes } from '@/types/projects.types';
@@ -19,6 +19,7 @@ import { truncateTextToFitWidth } from '@/utils/formatters/textFormatter';
import { type IconName } from '@n8n/design-system/components/N8nIcon/icons';
import type { IUser } from 'n8n-workflow';
import { type IconOrEmoji, isIconOrEmoji } from '@n8n/design-system/components/N8nIconPicker/types';
import { useUIStore } from '@/stores/ui.store';
const route = useRoute();
const router = useRouter();
@@ -26,6 +27,8 @@ const i18n = useI18n();
const projectsStore = useProjectsStore();
const sourceControlStore = useSourceControlStore();
const settingsStore = useSettingsStore();
const uiStore = useUIStore();
const projectPages = useProjectPages();
const emit = defineEmits<{
@@ -83,6 +86,23 @@ const showFolders = computed(() => {
);
});
const customProjectTabs = computed((): Array<TabOptions<string>> => {
// Determine the type of tab based on the current project page
let tabType: 'shared' | 'overview' | 'project';
if (projectPages.isSharedSubPage) {
tabType = 'shared';
} else if (projectPages.isOverviewSubPage) {
tabType = 'overview';
} else {
tabType = 'project';
}
// Only pick up tabs from active modules
const activeModules = Object.keys(uiStore.moduleTabs[tabType]).filter(
settingsStore.isModuleActive,
);
return activeModules.flatMap((module) => uiStore.moduleTabs[tabType][module]);
});
const ACTION_TYPES = {
WORKFLOW: 'workflow',
CREDENTIAL: 'credential',
@@ -278,6 +298,7 @@ const onSelect = (action: string) => {
:page-type="pageType"
:show-executions="!projectPages.isSharedSubPage"
:show-settings="showSettings"
:additional-tabs="customProjectTabs"
/>
</div>
</div>