From 240d25926021c7cf55898c55682d9aa6c5ccf2b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20FIlipovi=C4=87?= Date: Mon, 11 Dec 2023 17:37:26 +0100 Subject: [PATCH] refactor(editor): Rename CollectionCard and CollectionCardCarousel (#7994) ## Summary As part of the plan to reuse current `CollectionCarousel` component, this PR makes it, and the cards it uses, more generic by renaming them and adds a new property to card component which can be used to hide the item count. #### How to test the change: Until the component that will use this is implmeneted, this can be tested manually: 1. Run n8n 2. Set `showItemCount` property for workflow collection cards to `false` 3. Check if workflow count is showing (it shouldn't) and if everything rendering correctly ## Issues fixed Fixes ADO-1567 ## Review / Merge checklist - [ ] PR title and summary are descriptive. **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** ([conventions](https://github.com/n8n-io/n8n/blob/master/.github/pull_request_title_conventions.md)) - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [ ] Tests included. > A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. > > *(internal)* You can use Slack commands to trigger [e2e tests](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#a39f9e5ba64a48b58a71d81c837e8227) or [deploy test instance](https://www.notion.so/n8n/How-to-use-Test-Instances-d65f49dfc51f441ea44367fb6f67eb0a?pvs=4#f6a177d32bde4b57ae2da0b8e454bfce) or [deploy early access version on Cloud](https://www.notion.so/n8n/Cloudbot-3dbe779836004972b7057bc989526998?pvs=4#fef2d36ab02247e1a0f65a74f6fb534e). --- ...llectionCard.vue => TemplatesInfoCard.vue} | 16 ++-- ...Carousel.vue => TemplatesInfoCarousel.vue} | 8 +- .../__tests__/TemplatesInfoCard.test.ts | 77 +++++++++++++++++++ .../src/views/TemplatesSearchView.vue | 6 +- 4 files changed, 95 insertions(+), 12 deletions(-) rename packages/editor-ui/src/components/{CollectionCard.vue => TemplatesInfoCard.vue} (69%) rename packages/editor-ui/src/components/{CollectionsCarousel.vue => TemplatesInfoCarousel.vue} (96%) create mode 100644 packages/editor-ui/src/components/__tests__/TemplatesInfoCard.test.ts diff --git a/packages/editor-ui/src/components/CollectionCard.vue b/packages/editor-ui/src/components/TemplatesInfoCard.vue similarity index 69% rename from packages/editor-ui/src/components/CollectionCard.vue rename to packages/editor-ui/src/components/TemplatesInfoCard.vue index 97fc3c450c..98300bdcfd 100644 --- a/packages/editor-ui/src/components/CollectionCard.vue +++ b/packages/editor-ui/src/components/TemplatesInfoCard.vue @@ -1,10 +1,12 @@