From be7aac32797a2e4b3ffcd696ed700e5479692cbd Mon Sep 17 00:00:00 2001 From: Alex Grozav Date: Tue, 18 Oct 2022 16:28:21 +0300 Subject: [PATCH] feat(editor): create new workflows page (#4267) * feat(editor): extract credentials view into reusable layout components for workflows view * feat(editor): add workflow card and start work on empty state * feat: add hoverable card and finish workflows empty state * fix: undo workflows response interface changes * chore: fix linting issues. * fix: remove enterprise sharing env schema * fix(editor): fix workflows resource view when sharing is enabled * fix: change owner tag design and order * feat: add personalization survey on workflows page * fix: update component snapshots * feat: refactored workflow card to use workflow-activator properly * fix: fix workflow activator and proptypes * fix: hide owner tag for workflow card until sharing is available * fix: fixed ownedBy and sharedWith appearing for workflows list * feat: update tags component design * refactor: change resource filter select to n8n-user-select * fix: made telemetry messages reusable * chore: remove unused import * refactor: fix component name casing * refactor: use Vue.set to make workflow property reactive * feat: add support for clicking on tags for filtering * chore: fix tags linting issues * fix: fix resources list layout when title words are very long * refactor: add active and inactive status text to workflow activator * fix: fix credentials and workflows sorting when name contains leading whitespace * fix: remove wrongfully added style tag * feat: add translations and storybook examples for truncated tags * fix: remove enterprise sharing env from schema * refactor: fix workflows module and workflows field store naming conflict * fix: fix workflow activator wrapping * feat: updated empty workflows list cards design * feat: update workflow activator margins and workflow card * feat: add duplicate workflow functionality and update tags * feat: fix duplicate workflow flow * fix: fix status color for workflow activator with could not be started status * fix: remove createdAt and updatedAt from workflow duplication --- .../src/components/N8nCard/Card.stories.ts | 19 + .../src/components/N8nCard/Card.vue | 30 +- .../__tests__/__snapshots__/Card.spec.ts.snap | 16 +- .../__snapshots__/InfoTip.spec.ts.snap | 4 +- .../src/components/N8nLink/Link.vue | 5 + .../src/components/N8nMenu/Menu.vue | 16 +- .../src/components/N8nTag/Tag.vue | 10 +- .../src/components/N8nTags/Tags.stories.js | 28 + .../src/components/N8nTags/Tags.vue | 74 ++- .../src/components/N8nText/Text.stories.js | 2 +- .../src/components/N8nText/Text.vue | 6 +- .../components/N8nUserSelect/UserSelect.vue | 9 +- .../design-system/src/css/common/var.scss | 2 +- packages/design-system/src/locale/lang/en.js | 1 + packages/editor-ui/src/Interface.ts | 9 +- packages/editor-ui/src/api/workflows.ts | 10 + .../src/components/CollectionCard.vue | 2 +- .../src/components/CollectionWorkflowCard.vue | 66 +++ .../src/components/CollectionsCarousel.vue | 2 +- .../src/components/CredentialCard.vue | 4 +- .../components/DuplicateWorkflowDialog.vue | 30 +- .../components/MainHeader/WorkflowDetails.vue | 29 +- .../editor-ui/src/components/MainSidebar.vue | 26 +- .../editor-ui/src/components/ModalRoot.vue | 4 + packages/editor-ui/src/components/Modals.vue | 11 +- .../editor-ui/src/components/TagsDropdown.vue | 17 + .../src/components/WorkflowActivator.vue | 26 +- .../editor-ui/src/components/WorkflowCard.vue | 254 +++++++-- .../editor-ui/src/components/WorkflowOpen.vue | 333 ----------- .../forms/ResourceFiltersDropdown.vue | 173 ++++++ .../forms/ResourceOwnershipSelect.ee.vue | 59 ++ .../layouts/ResourcesListLayout.vue | 408 ++++++++++++++ .../src/components/mixins/workflowActivate.ts | 1 - .../src/components/mixins/workflowHelpers.ts | 7 +- packages/editor-ui/src/constants.ts | 1 - packages/editor-ui/src/modules/ui.ts | 16 +- packages/editor-ui/src/modules/workflows.ts | 4 +- packages/editor-ui/src/permissions.ts | 21 +- .../src/plugins/i18n/locales/en.json | 48 +- packages/editor-ui/src/router.ts | 19 +- packages/editor-ui/src/store.ts | 53 +- .../editor-ui/src/views/CredentialsView.vue | 530 ++---------------- packages/editor-ui/src/views/NodeView.vue | 10 - .../editor-ui/src/views/WorkflowsView.vue | 187 ++++++ 44 files changed, 1612 insertions(+), 970 deletions(-) create mode 100644 packages/editor-ui/src/components/CollectionWorkflowCard.vue delete mode 100644 packages/editor-ui/src/components/WorkflowOpen.vue create mode 100644 packages/editor-ui/src/components/forms/ResourceFiltersDropdown.vue create mode 100644 packages/editor-ui/src/components/forms/ResourceOwnershipSelect.ee.vue create mode 100644 packages/editor-ui/src/components/layouts/ResourcesListLayout.vue create mode 100644 packages/editor-ui/src/views/WorkflowsView.vue diff --git a/packages/design-system/src/components/N8nCard/Card.stories.ts b/packages/design-system/src/components/N8nCard/Card.stories.ts index ff07c33e0c..4b83edf310 100644 --- a/packages/design-system/src/components/N8nCard/Card.stories.ts +++ b/packages/design-system/src/components/N8nCard/Card.stories.ts @@ -19,6 +19,25 @@ export const Default: StoryFn = (args, {argTypes}) => ({ template: `This is a card.`, }); +export const Hoverable: StoryFn = (args, {argTypes}) => ({ + props: Object.keys(argTypes), + components: { + N8nCard, + N8nIcon, + N8nText, + }, + template: `
+ + + Add + +
`, +}); + +Hoverable.args = { + hoverable: true, +}; + export const WithSlots: StoryFn = (args, {argTypes}) => ({ props: Object.keys(argTypes), diff --git a/packages/design-system/src/components/N8nCard/Card.vue b/packages/design-system/src/components/N8nCard/Card.vue index 6e72e2352d..ca1129f9d6 100644 --- a/packages/design-system/src/components/N8nCard/Card.vue +++ b/packages/design-system/src/components/N8nCard/Card.vue @@ -1,5 +1,5 @@