From c9015fe5e1f79b99f155b2327754b1810cf9d795 Mon Sep 17 00:00:00 2001 From: Sthefani Date: Mon, 16 Oct 2023 09:41:07 -0300 Subject: [PATCH 1/2] added design review --- src/api/appType/whatsapp_cloud/index.js | 5 +- src/assets/svgs/storefront.svg | 10 + src/components/whatsAppCatalogs/Card.vue | 25 +- src/components/whatsAppCatalogs/List.vue | 151 +++++-- src/locales/en.json | 11 +- src/locales/es_es.json | 14 +- src/locales/pt_br.json | 5 +- .../channels/whatsapp_cloud/actions.js | 3 +- .../components/tabs/AccountTab.spec.js | 13 + .../__snapshots__/AccountTab.spec.js.snap | 20 +- .../components/whatsAppCatalogs/List.spec.js | 404 ++++++++++++++++++ .../__snapshots__/List.spec.js.snap | 42 ++ .../appType/whatsapp_cloud/actions.spec.js | 46 ++ .../specs/views/whatsAppCatalogs/Base.spec.js | 77 ++++ .../specs/views/whatsAppCatalogs/List.spec.js | 29 ++ .../__snapshots__/Base.spec.js.snap | 8 + .../__snapshots__/List.spec.js.snap | 9 + 17 files changed, 796 insertions(+), 76 deletions(-) create mode 100644 src/assets/svgs/storefront.svg create mode 100644 tests/unit/specs/components/whatsAppCatalogs/List.spec.js create mode 100644 tests/unit/specs/components/whatsAppCatalogs/__snapshots__/List.spec.js.snap create mode 100644 tests/unit/specs/views/whatsAppCatalogs/Base.spec.js create mode 100644 tests/unit/specs/views/whatsAppCatalogs/List.spec.js create mode 100644 tests/unit/specs/views/whatsAppCatalogs/__snapshots__/Base.spec.js.snap create mode 100644 tests/unit/specs/views/whatsAppCatalogs/__snapshots__/List.spec.js.snap diff --git a/src/api/appType/whatsapp_cloud/index.js b/src/api/appType/whatsapp_cloud/index.js index 4fa57673..4d7b98d2 100644 --- a/src/api/appType/whatsapp_cloud/index.js +++ b/src/api/appType/whatsapp_cloud/index.js @@ -16,8 +16,9 @@ export default { configurePhoneNumber(data) { return request.$http.post(`${resource}/`, data); }, - getWhatsAppCloudCatalogs(appUuid) { - return request.$http.get(`${catalogsResource}/${appUuid}/catalogs/`); + getWhatsAppCloudCatalogs(appUuid, params) { + const queryString = qs.stringify(params); + return request.$http.get(`${catalogsResource}/${appUuid}/catalogs/?${queryString}`); }, fetchCatalogData(appUuid, catalogUuid) { return request.$http.get(`${catalogsResource}/${appUuid}/catalogs/${catalogUuid}/`); diff --git a/src/assets/svgs/storefront.svg b/src/assets/svgs/storefront.svg new file mode 100644 index 00000000..0d4b8320 --- /dev/null +++ b/src/assets/svgs/storefront.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/components/whatsAppCatalogs/Card.vue b/src/components/whatsAppCatalogs/Card.vue index e89ec9a2..3ca8cd2d 100644 --- a/src/components/whatsAppCatalogs/Card.vue +++ b/src/components/whatsAppCatalogs/Card.vue @@ -11,7 +11,7 @@ {{ $t('WhatsApp.catalog.list.identification') }} - + {{ catalog.facebook_catalog_id }} @@ -65,29 +65,6 @@ currentDisable: null, catalogStatus: this.catalog.is_connected, cartStatus: this.enabledCart, - listCatalog: [ - { - uuid: '3081a268-fff5-4366-bf44-ee387c8ddcdc', - name: 'Teste_localizacao', - facebook_catalog_id: '312538484461506', - category: 'commerce', - is_connected: false, - }, - { - uuid: 'eaf96431-9be8-4cbd-8541-f4ae08af0d1e', - name: 'catalogo marketing token', - facebook_catalog_id: '339959911815729', - category: 'commerce', - is_connected: true, - }, - { - uuid: 'e7974bfa-14d8-470a-8b1b-669718bc1036', - name: 'catalogo criado em dev', - facebook_catalog_id: '664025605666699', - category: 'commerce', - is_connected: false, - }, - ], }; }, computed: { diff --git a/src/components/whatsAppCatalogs/List.vue b/src/components/whatsAppCatalogs/List.vue index be989bf0..94d1c0f9 100644 --- a/src/components/whatsAppCatalogs/List.vue +++ b/src/components/whatsAppCatalogs/List.vue @@ -1,24 +1,24 @@