diff --git a/cypress/e2e/36-suggested-templates.cy.ts b/cypress/e2e/36-suggested-templates.cy.ts deleted file mode 100644 index b788796e45..0000000000 --- a/cypress/e2e/36-suggested-templates.cy.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { WorkflowsPage as WorkflowsPageClass } from '../pages/workflows'; -import { WorkflowPage as WorkflowPageClass } from '../pages/workflow'; - -type SuggestedTemplatesStub = { - sections: SuggestedTemplatesSectionStub[]; -} - -type SuggestedTemplatesSectionStub = { - name: string; - title: string; - description: string; - workflows: Array; -}; - -const WorkflowsListPage = new WorkflowsPageClass(); -const WorkflowPage = new WorkflowPageClass(); - -let fixtureSections: SuggestedTemplatesStub = { sections: [] };; - -describe('Suggested templates - Should render', () => { - - before(() => { - cy.fixture('Suggested_Templates.json').then((data) => { - fixtureSections = data; - }); - }); - - beforeEach(() => { - localStorage.removeItem('SHOW_N8N_SUGGESTED_TEMPLATES'); - cy.intercept('GET', '/rest/settings', (req) => { - req.on('response', (res) => { - res.send({ - data: { ...res.body.data, deployment: { type: 'cloud' } }, - }); - }); - }).as('loadSettings'); - cy.intercept('GET', '/rest/cloud/proxy/templates', { - fixture: 'Suggested_Templates.json', - }); - cy.visit(WorkflowsListPage.url); - cy.wait('@loadSettings'); - }); - - it('should render suggested templates page in empty workflow list', () => { - WorkflowsListPage.getters.suggestedTemplatesPageContainer().should('exist'); - WorkflowsListPage.getters.suggestedTemplatesCards().should('have.length', fixtureSections.sections[0].workflows.length); - WorkflowsListPage.getters.suggestedTemplatesSectionDescription().should('contain', fixtureSections.sections[0].description); - }); - - it('should render suggested templates when there are workflows in the list', () => { - WorkflowsListPage.getters.suggestedTemplatesNewWorkflowButton().click(); - cy.createFixtureWorkflow('Test_workflow_1.json', 'Test workflow'); - cy.visit(WorkflowsListPage.url); - WorkflowsListPage.getters.suggestedTemplatesSectionContainer().should('exist'); - cy.contains(`Explore ${fixtureSections.sections[0].name.toLocaleLowerCase()} workflow templates`).should('exist'); - WorkflowsListPage.getters.suggestedTemplatesCards().should('have.length', fixtureSections.sections[0].workflows.length); - }); - - it('should enable users to signup for suggested templates templates', () => { - // Test the whole flow - WorkflowsListPage.getters.suggestedTemplatesCards().first().click(); - WorkflowsListPage.getters.suggestedTemplatesPreviewModal().should('exist'); - WorkflowsListPage.getters.suggestedTemplatesUseTemplateButton().click(); - cy.url().should('include', '/workflow/new'); - WorkflowPage.getters.infoToast().should('contain', 'Template coming soon!'); - WorkflowPage.getters.infoToast().contains('Notify me when it\'s available').click(); - WorkflowPage.getters.successToast().should('contain', 'We will contact you via email once this template is released.'); - cy.visit(WorkflowsListPage.url); - // Once users have signed up for a template, suggestions should not be shown again - WorkflowsListPage.getters.suggestedTemplatesSectionContainer().should('not.exist'); - }); - -}); - -describe('Suggested templates - Should not render', () => { - beforeEach(() => { - localStorage.removeItem('SHOW_N8N_SUGGESTED_TEMPLATES'); - cy.visit(WorkflowsListPage.url); - }); - - it('should not render suggested templates templates if not in cloud deployment', () => { - cy.intercept('GET', '/rest/settings', (req) => { - req.on('response', (res) => { - res.send({ - data: { ...res.body.data, deployment: { type: 'notCloud' } }, - }); - }); - }); - WorkflowsListPage.getters.suggestedTemplatesPageContainer().should('not.exist'); - WorkflowsListPage.getters.suggestedTemplatesSectionContainer().should('not.exist'); - }); - - it('should not render suggested templates templates if endpoint throws error', () => { - cy.intercept('GET', '/rest/settings', (req) => { - req.on('response', (res) => { - res.send({ - data: { ...res.body.data, deployment: { type: 'cloud' } }, - }); - }); - }); - cy.intercept('GET', '/rest/cloud/proxy/templates', { statusCode: 500 }).as('loadTemplates'); - WorkflowsListPage.getters.suggestedTemplatesPageContainer().should('not.exist'); - WorkflowsListPage.getters.suggestedTemplatesSectionContainer().should('not.exist'); - }); - - it('should not render suggested templates templates if endpoint returns empty list', () => { - cy.intercept('GET', '/rest/settings', (req) => { - req.on('response', (res) => { - res.send({ - data: { ...res.body.data, deployment: { type: 'cloud' } }, - }); - }); - }); - cy.intercept('GET', '/rest/cloud/proxy/templates', (req) => { - req.on('response', (res) => { - res.send({ - data: { collections: [] }, - }); - }); - }); - WorkflowsListPage.getters.suggestedTemplatesPageContainer().should('not.exist'); - WorkflowsListPage.getters.suggestedTemplatesSectionContainer().should('not.exist'); - }); - - it('should not render suggested templates templates if endpoint returns invalid response', () => { - cy.intercept('GET', '/rest/settings', (req) => { - req.on('response', (res) => { - res.send({ - data: { ...res.body.data, deployment: { type: 'cloud' } }, - }); - }); - }); - cy.intercept('GET', '/rest/cloud/proxy/templates', (req) => { - req.on('response', (res) => { - res.send({ - data: { somethingElse: [] }, - }); - }); - }); - WorkflowsListPage.getters.suggestedTemplatesPageContainer().should('not.exist'); - WorkflowsListPage.getters.suggestedTemplatesSectionContainer().should('not.exist'); - }); -}); diff --git a/cypress/fixtures/Suggested_Templates.json b/cypress/fixtures/Suggested_Templates.json deleted file mode 100644 index 308806c6c6..0000000000 --- a/cypress/fixtures/Suggested_Templates.json +++ /dev/null @@ -1,655 +0,0 @@ -{ - "sections": [ - { - "name": "Lead enrichment", - "description": "Explore curated lead enrichment workflows or start fresh with a blank canvas", - "workflows": [ - { - "title": "Score new leads with AI from Facebook Lead Ads with AI and get notifications for high scores on Slack", - "description": "This workflow will help you save tons of time and will notify you fully automatically about the most important incoming leads from Facebook Lead Ads. The workflow will automatically fire for every submission. It will then take the name, company, and email information, enrich the submitter via AI, and score it based on metrics that you can easily set.", - "preview": { - "nodes": [ - { - "parameters": { - "operation": "create", - "base": { - "__rl": true, - "mode": "list", - "value": "" - }, - "table": { - "__rl": true, - "mode": "list", - "value": "" - }, - "columns": { - "mappingMode": "defineBelow", - "value": {}, - "matchingColumns": [], - "schema": [] - }, - "options": {} - }, - "id": "b09d4f4d-19fa-43de-8148-2d430a04956f", - "name": "Airtable", - "type": "n8n-nodes-base.airtable", - "typeVersion": 2, - "position": [ - 1800, - 740 - ] - }, - { - "parameters": {}, - "id": "551313bb-1e01-4133-9956-e6f09968f2ce", - "name": "When clicking ‘Test workflow’", - "type": "n8n-nodes-base.manualTrigger", - "typeVersion": 1, - "position": [ - 920, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "b4c089ee-2adb-435e-8d48-47012c981a11", - "name": "Get image", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.1, - "position": [ - 1140, - 740 - ] - }, - { - "parameters": { - "operation": "extractHtmlContent", - "options": {} - }, - "id": "04ca2f61-b930-4fbc-b467-3470c0d93d64", - "name": "Extract Information", - "type": "n8n-nodes-base.html", - "typeVersion": 1, - "position": [ - 1360, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "d1a77493-c579-4ac4-b6a7-708eea2bf8ce", - "name": "Set Information", - "type": "n8n-nodes-base.set", - "typeVersion": 3.2, - "position": [ - 1580, - 740 - ] - } - ], - "connections": { - "When clicking ‘Test workflow’": { - "main": [ - [ - { - "node": "Get image", - "type": "main", - "index": 0 - } - ] - ] - }, - "Get image": { - "main": [ - [ - { - "node": "Extract Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Extract Information": { - "main": [ - [ - { - "node": "Set Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set Information": { - "main": [ - [ - { - "node": "Airtable", - "type": "main", - "index": 0 - } - ] - ] - } - } - }, - "nodes": [ - { - "id": 24, - "icon": "fa:code-branch", - "defaults": { - "color": "#00bbcc" - }, - "iconData": { - "icon": "code-branch", - "type": "icon" - }, - "displayName": "Merge" - } - ] - }, - { - "title": "Verify the email address every time a contact is created in HubSpot", - "description": "This workflow will help you save tons of time and will notify you fully automatically about the most important incoming leads from Facebook Lead Ads. The workflow will automatically fire for every submission. It will then take the name, company, and email information, enrich the submitter via AI, and score it based on metrics that you can easily set.", - "preview": { - "nodes": [ - { - "parameters": { - "operation": "create", - "base": { - "__rl": true, - "mode": "list", - "value": "" - }, - "table": { - "__rl": true, - "mode": "list", - "value": "" - }, - "columns": { - "mappingMode": "defineBelow", - "value": {}, - "matchingColumns": [], - "schema": [] - }, - "options": {} - }, - "id": "b09d4f4d-19fa-43de-8148-2d430a04956f", - "name": "Airtable", - "type": "n8n-nodes-base.airtable", - "typeVersion": 2, - "position": [ - 1800, - 740 - ] - }, - { - "parameters": {}, - "id": "551313bb-1e01-4133-9956-e6f09968f2ce", - "name": "When clicking ‘Test workflow’", - "type": "n8n-nodes-base.manualTrigger", - "typeVersion": 1, - "position": [ - 920, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "b4c089ee-2adb-435e-8d48-47012c981a11", - "name": "Get image", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.1, - "position": [ - 1140, - 740 - ] - }, - { - "parameters": { - "operation": "extractHtmlContent", - "options": {} - }, - "id": "04ca2f61-b930-4fbc-b467-3470c0d93d64", - "name": "Extract Information", - "type": "n8n-nodes-base.html", - "typeVersion": 1, - "position": [ - 1360, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "d1a77493-c579-4ac4-b6a7-708eea2bf8ce", - "name": "Set Information", - "type": "n8n-nodes-base.set", - "typeVersion": 3.2, - "position": [ - 1580, - 740 - ] - } - ], - "connections": { - "When clicking ‘Test workflow’": { - "main": [ - [ - { - "node": "Get image", - "type": "main", - "index": 0 - } - ] - ] - }, - "Get image": { - "main": [ - [ - { - "node": "Extract Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Extract Information": { - "main": [ - [ - { - "node": "Set Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set Information": { - "main": [ - [ - { - "node": "Airtable", - "type": "main", - "index": 0 - } - ] - ] - } - } - }, - "nodes": [ - { - "id": 14, - "icon": "fa:code", - "name": "n8n-nodes-base.function", - "defaults": { - "name": "Function", - "color": "#FF9922" - }, - "iconData": { - "icon": "code", - "type": "icon" - }, - "categories": [ - { - "id": 5, - "name": "Development" - }, - { - "id": 9, - "name": "Core Nodes" - } - ], - "displayName": "Function", - "typeVersion": 1 - }, - { - "id": 24, - "icon": "fa:code-branch", - "name": "n8n-nodes-base.merge", - "defaults": { - "name": "Merge", - "color": "#00bbcc" - }, - "iconData": { - "icon": "code-branch", - "type": "icon" - }, - "categories": [ - { - "id": 9, - "name": "Core Nodes" - } - ], - "displayName": "Merge", - "typeVersion": 2 - } - ] - }, - { - "title": "Enrich leads from HubSpot with company information via OpenAi", - "description": "This workflow will help you save tons of time and will notify you fully automatically about the most important incoming leads from Facebook Lead Ads. The workflow will automatically fire for every submission. It will then take the name, company, and email information, enrich the submitter via AI, and score it based on metrics that you can easily set.", - "preview": { - "nodes": [ - { - "parameters": { - "operation": "create", - "base": { - "__rl": true, - "mode": "list", - "value": "" - }, - "table": { - "__rl": true, - "mode": "list", - "value": "" - }, - "columns": { - "mappingMode": "defineBelow", - "value": {}, - "matchingColumns": [], - "schema": [] - }, - "options": {} - }, - "id": "b09d4f4d-19fa-43de-8148-2d430a04956f", - "name": "Airtable", - "type": "n8n-nodes-base.airtable", - "typeVersion": 2, - "position": [ - 1800, - 740 - ] - }, - { - "parameters": {}, - "id": "551313bb-1e01-4133-9956-e6f09968f2ce", - "name": "When clicking ‘Test workflow’", - "type": "n8n-nodes-base.manualTrigger", - "typeVersion": 1, - "position": [ - 920, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "b4c089ee-2adb-435e-8d48-47012c981a11", - "name": "Get image", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.1, - "position": [ - 1140, - 740 - ] - }, - { - "parameters": { - "operation": "extractHtmlContent", - "options": {} - }, - "id": "04ca2f61-b930-4fbc-b467-3470c0d93d64", - "name": "Extract Information", - "type": "n8n-nodes-base.html", - "typeVersion": 1, - "position": [ - 1360, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "d1a77493-c579-4ac4-b6a7-708eea2bf8ce", - "name": "Set Information", - "type": "n8n-nodes-base.set", - "typeVersion": 3.2, - "position": [ - 1580, - 740 - ] - } - ], - "connections": { - "When clicking ‘Test workflow’": { - "main": [ - [ - { - "node": "Get image", - "type": "main", - "index": 0 - } - ] - ] - }, - "Get image": { - "main": [ - [ - { - "node": "Extract Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Extract Information": { - "main": [ - [ - { - "node": "Set Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set Information": { - "main": [ - [ - { - "node": "Airtable", - "type": "main", - "index": 0 - } - ] - ] - } - } - }, - "nodes": [ - { - "id": 14, - "icon": "fa:code", - "defaults": { - "name": "Function", - "color": "#FF9922" - }, - "iconData": { - "icon": "code", - "type": "icon" - }, - "displayName": "Function" - } - ] - }, - { - "title": "Score new lead submissions from Facebook Lead Ads with AI and notify me on Slack when it is a high score lead", - "description": "This workflow will help you save tons of time and will notify you fully automatically about the most important incoming leads from Facebook Lead Ads. The workflow will automatically fire for every submission. It will then take the name, company, and email information, enrich the submitter via AI, and score it based on metrics that you can easily set.", - "preview": { - "nodes": [ - { - "parameters": { - "operation": "create", - "base": { - "__rl": true, - "mode": "list", - "value": "" - }, - "table": { - "__rl": true, - "mode": "list", - "value": "" - }, - "columns": { - "mappingMode": "defineBelow", - "value": {}, - "matchingColumns": [], - "schema": [] - }, - "options": {} - }, - "id": "b09d4f4d-19fa-43de-8148-2d430a04956f", - "name": "Airtable", - "type": "n8n-nodes-base.airtable", - "typeVersion": 2, - "position": [ - 1800, - 740 - ] - }, - { - "parameters": {}, - "id": "551313bb-1e01-4133-9956-e6f09968f2ce", - "name": "When clicking ‘Test workflow’", - "type": "n8n-nodes-base.manualTrigger", - "typeVersion": 1, - "position": [ - 920, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "b4c089ee-2adb-435e-8d48-47012c981a11", - "name": "Get image", - "type": "n8n-nodes-base.httpRequest", - "typeVersion": 4.1, - "position": [ - 1140, - 740 - ] - }, - { - "parameters": { - "operation": "extractHtmlContent", - "options": {} - }, - "id": "04ca2f61-b930-4fbc-b467-3470c0d93d64", - "name": "Extract Information", - "type": "n8n-nodes-base.html", - "typeVersion": 1, - "position": [ - 1360, - 740 - ] - }, - { - "parameters": { - "options": {} - }, - "id": "d1a77493-c579-4ac4-b6a7-708eea2bf8ce", - "name": "Set Information", - "type": "n8n-nodes-base.set", - "typeVersion": 3.2, - "position": [ - 1580, - 740 - ] - } - ], - "connections": { - "When clicking ‘Test workflow’": { - "main": [ - [ - { - "node": "Get image", - "type": "main", - "index": 0 - } - ] - ] - }, - "Get image": { - "main": [ - [ - { - "node": "Extract Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Extract Information": { - "main": [ - [ - { - "node": "Set Information", - "type": "main", - "index": 0 - } - ] - ] - }, - "Set Information": { - "main": [ - [ - { - "node": "Airtable", - "type": "main", - "index": 0 - } - ] - ] - } - } - }, - "nodes": [ - { - "id": 14, - "icon": "fa:code", - "defaults": { - "name": "Function", - "color": "#FF9922" - }, - "iconData": { - "icon": "code", - "type": "icon" - }, - "displayName": "Function" - }, - { - "id": 24, - "icon": "fa:code-branch", - "defaults": { - "name": "Merge", - "color": "#00bbcc" - }, - "iconData": { - "icon": "code-branch", - "type": "icon" - }, - "displayName": "Merge" - } - ] - } - ] - } - ] -} diff --git a/cypress/pages/workflows.ts b/cypress/pages/workflows.ts index fd65a426a4..370a2ae0e3 100644 --- a/cypress/pages/workflows.ts +++ b/cypress/pages/workflows.ts @@ -34,13 +34,6 @@ export class WorkflowsPage extends BasePage { // Not yet implemented // myWorkflows: () => cy.getByTestId('my-workflows'), // allWorkflows: () => cy.getByTestId('all-workflows'), - suggestedTemplatesPageContainer: () => cy.getByTestId('suggested-templates-page-container'), - suggestedTemplatesCards: () => cy.get('.agile__slides--regular [data-test-id=templates-info-card]'), - suggestedTemplatesNewWorkflowButton: () => cy.getByTestId('suggested-templates-new-workflow-button'), - suggestedTemplatesSectionContainer: () => cy.getByTestId('suggested-templates-section-container'), - suggestedTemplatesPreviewModal: () => cy.getByTestId('suggested-templates-preview-modal'), - suggestedTemplatesUseTemplateButton: () => cy.getByTestId('use-template-button'), - suggestedTemplatesSectionDescription: () => cy.getByTestId('suggested-template-section-description'), }; actions = { diff --git a/packages/design-system/src/components/N8nRecycleScroller/RecycleScroller.vue b/packages/design-system/src/components/N8nRecycleScroller/RecycleScroller.vue index 810d5a7da9..3a5d798ad9 100644 --- a/packages/design-system/src/components/N8nRecycleScroller/RecycleScroller.vue +++ b/packages/design-system/src/components/N8nRecycleScroller/RecycleScroller.vue @@ -193,9 +193,6 @@ function onScroll() { -
- -
@@ -223,7 +220,4 @@ function onScroll() { position: relative; width: 100%; } -.post-list-container { - margin-top: var(--spacing-3xl); -} diff --git a/packages/design-system/src/components/N8nRecycleScroller/__tests__/__snapshots__/RecycleScroller.spec.ts.snap b/packages/design-system/src/components/N8nRecycleScroller/__tests__/__snapshots__/RecycleScroller.spec.ts.snap index 661ee68ca6..8fc70f9f20 100644 --- a/packages/design-system/src/components/N8nRecycleScroller/__tests__/__snapshots__/RecycleScroller.spec.ts.snap +++ b/packages/design-system/src/components/N8nRecycleScroller/__tests__/__snapshots__/RecycleScroller.spec.ts.snap @@ -9,6 +9,5 @@ exports[`components > N8nRecycleScroller > should render correctly 1`] = `
-
" `; diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index f0608dfa6f..e7e54e7416 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -1325,7 +1325,6 @@ export interface UIState { bannersHeight: number; bannerStack: BannerName[]; theme: ThemeOption; - suggestedTemplates?: SuggestedTemplates; pendingNotificationsForViews: { [key in VIEWS]?: NotificationOptions[]; }; @@ -1917,24 +1916,6 @@ export type ToggleNodeCreatorOptions = { export type AppliedThemeOption = 'light' | 'dark'; export type ThemeOption = AppliedThemeOption | 'system'; -export type SuggestedTemplates = { - sections: SuggestedTemplatesSection[]; -}; - -export type SuggestedTemplatesSection = { - name: string; - title: string; - description: string; - workflows: SuggestedTemplatesWorkflowPreview[]; -}; - -export type SuggestedTemplatesWorkflowPreview = { - title: string; - description: string; - preview: IWorkflowData; - nodes: Array>; -}; - export type NewConnectionInfo = { sourceId: string; index: number; diff --git a/packages/editor-ui/src/api/cloudPlans.ts b/packages/editor-ui/src/api/cloudPlans.ts index c6acad2c54..f7daa4b0a1 100644 --- a/packages/editor-ui/src/api/cloudPlans.ts +++ b/packages/editor-ui/src/api/cloudPlans.ts @@ -1,4 +1,4 @@ -import type { Cloud, IRestApiContext, InstanceUsage, LeadEnrichmentTemplates } from '@/Interface'; +import type { Cloud, IRestApiContext, InstanceUsage } from '@/Interface'; import { get, post } from '@/utils/apiUtils'; export async function getCurrentPlan(context: IRestApiContext): Promise { @@ -20,9 +20,3 @@ export async function confirmEmail(context: IRestApiContext): Promise { return await get(context.baseUrl, '/cloud/proxy/login/code'); } - -export async function fetchSuggestedTemplates( - context: IRestApiContext, -): Promise { - return await get(context.baseUrl, '/cloud/proxy/templates'); -} diff --git a/packages/editor-ui/src/components/Modals.vue b/packages/editor-ui/src/components/Modals.vue index 191ccb79af..14eed1b446 100644 --- a/packages/editor-ui/src/components/Modals.vue +++ b/packages/editor-ui/src/components/Modals.vue @@ -157,15 +157,6 @@ /> - - - -