diff --git a/packages/frontend/editor-ui/src/app/components/layouts/EmptyStateLayout.vue b/packages/frontend/editor-ui/src/app/components/layouts/EmptyStateLayout.vue index 69c92cefb3c..c2bf856b463 100644 --- a/packages/frontend/editor-ui/src/app/components/layouts/EmptyStateLayout.vue +++ b/packages/frontend/editor-ui/src/app/components/layouts/EmptyStateLayout.vue @@ -10,6 +10,8 @@ import { getResourcePermissions } from '@n8n/permissions'; import { useProjectPages } from '@/features/collaboration/projects/composables/useProjectPages'; import { useToast } from '@/app/composables/useToast'; import { useReadyToRunStore } from '@/features/workflows/readyToRun/stores/readyToRun.store'; +import { useTemplatesDataQualityStore } from '@/experiments/templatesDataQuality/stores/templatesDataQuality.store'; +import TemplatesDataQualityInlineSection from '@/experiments/templatesDataQuality/components/TemplatesDataQualityInlineSection.vue'; import type { IUser } from 'n8n-workflow'; const emit = defineEmits<{ @@ -24,6 +26,7 @@ const projectsStore = useProjectsStore(); const sourceControlStore = useSourceControlStore(); const projectPages = useProjectPages(); const readyToRunStore = useReadyToRunStore(); +const templatesDataQualityStore = useTemplatesDataQualityStore(); const isLoadingReadyToRun = ref(false); @@ -54,6 +57,14 @@ const showReadyToRunCard = computed(() => { ); }); +const showTemplatesDataQualityInline = computed(() => { + return ( + templatesDataQualityStore.isFeatureEnabled() && + !readOnlyEnv.value && + projectPermissions.value.workflow.create + ); +}); + const handleReadyToRunClick = async () => { if (isLoadingReadyToRun.value) return; @@ -141,6 +152,7 @@ const addWorkflow = () => { + @@ -150,7 +162,8 @@ const addWorkflow = () => { display: flex; flex-direction: column; align-items: center; - justify-content: center; + justify-content: flex-start; + padding-top: var(--spacing--3xl); min-height: 100vh; } @@ -158,7 +171,7 @@ const addWorkflow = () => { display: flex; flex-direction: column; align-items: center; - max-width: 600px; + max-width: 900px; text-align: center; } diff --git a/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/NodeRecommendationModal.vue b/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/NodeRecommendationModal.vue index 7cf82147b51..57c3f3bd2c8 100644 --- a/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/NodeRecommendationModal.vue +++ b/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/NodeRecommendationModal.vue @@ -4,7 +4,6 @@ import { EXPERIMENT_TEMPLATES_DATA_QUALITY_KEY, TEMPLATES_URLS } from '@/app/con import { useUIStore } from '@/app/stores/ui.store'; import type { ITemplatesWorkflowFull } from '@n8n/rest-api-client'; import { onMounted, ref } from 'vue'; -import { useNodeTypesStore } from '@/app/stores/nodeTypes.store'; import { useTemplatesDataQualityStore } from '../stores/templatesDataQuality.store'; import TemplateCard from './TemplateCard.vue'; import { useI18n } from '@n8n/i18n'; @@ -20,28 +19,11 @@ const closeModal = () => { const templates = ref([]); const isLoadingTemplates = ref(false); -const nodeTypesStore = useNodeTypesStore(); - -const trackTemplatesShown = (templateIds: number[]) => { - templateIds.forEach((id, index) => { - templatesStore.trackTemplateShown(id, index + 1); - }); -}; onMounted(async () => { isLoadingTemplates.value = true; try { - await nodeTypesStore.loadNodeTypesIfNotLoaded(); - const ids = templatesStore.getRandomTemplateIds(); - const promises = ids.map(async (id) => await templatesStore.getTemplateData(id)); - const results = await Promise.allSettled(promises); - templates.value = results - .filter( - (r): r is PromiseFulfilledResult => - r.status === 'fulfilled' && r.value !== null, - ) - .map((r) => r.value); - trackTemplatesShown(ids); + templates.value = await templatesStore.loadExperimentTemplates(); } finally { isLoadingTemplates.value = false; } @@ -71,7 +53,12 @@ onMounted(async () => { }}
- +
diff --git a/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/TemplateCard.vue b/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/TemplateCard.vue index 67ae3d2e6b8..7da1a3ea6db 100644 --- a/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/TemplateCard.vue +++ b/packages/frontend/editor-ui/src/experiments/templatesDataQuality/components/TemplateCard.vue @@ -1,5 +1,5 @@