@@ -93,6 +110,10 @@
const { code, uuid } = this.appInfo;
this.$router.push({ path: `/apps/my/${code}/${uuid}/templates` });
},
+ navigateToCatalogs() {
+ const { code, uuid } = this.appInfo;
+ this.$router.push({ path: `/apps/my/${code}/${uuid}/catalogs` });
+ },
},
computed: {
QRCodeUrl() {
@@ -222,20 +243,23 @@
gap: $unnnic-spacing-stack-lg;
&__templates {
- flex: 1;
display: flex;
- flex-direction: column;
+ justify-content: space-between;
gap: $unnnic-spacing-stack-sm;
- &__title {
- font-weight: $unnnic-font-weight-black;
- font-size: $unnnic-font-size-body-lg;
- line-height: $unnnic-font-size-body-lg + $unnnic-line-height-md;
- color: $unnnic-color-neutral-darkest;
- }
+ &__buttons {
+ width: 100%;
- &__button {
- max-width: 160px;
+ &__title {
+ font-weight: $unnnic-font-weight-bold;
+ font-size: $unnnic-font-size-body-lg;
+ line-height: $unnnic-font-size-body-lg + $unnnic-line-height-md;
+ color: $unnnic-color-neutral-darkest;
+ margin-bottom: $unnnic-spacing-sm;
+ }
+ &__button {
+ width: 100%;
+ }
}
}
diff --git a/src/components/whatsAppCatalogs/Card.vue b/src/components/whatsAppCatalogs/Card.vue
new file mode 100644
index 00000000..e89ec9a2
--- /dev/null
+++ b/src/components/whatsAppCatalogs/Card.vue
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+
diff --git a/src/components/whatsAppCatalogs/List.vue b/src/components/whatsAppCatalogs/List.vue
new file mode 100644
index 00000000..be989bf0
--- /dev/null
+++ b/src/components/whatsAppCatalogs/List.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+ {{ $t('WhatsApp.catalog.list.disable_modal.description') }}
+
+
+
+
+
+
+
+
diff --git a/src/locales/en.json b/src/locales/en.json
index 660bfe39..5f01465c 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -457,6 +457,37 @@
"templates": {
"button": "See my templates",
"title": "Templates"
+ },
+ "catalog": {
+ "button": "View list of catalogs",
+ "title": "Catalog"
+ }
+ },
+ "catalog": {
+ "list": {
+ "title": "List of catalogs",
+ "description": "Add all the items you want to advertise or sell",
+ "advanced_settings": "Advanced Settings",
+ "identification": "Identification",
+ "actions": {
+ "enabled_cart": "Cart enabled",
+ "disabled_cart": "Cart disabled",
+ "enabled_catalog": "Catalog enabled",
+ "disabled_catalog": "Disabled"
+ },
+ "disable_modal": {
+ "title": "Are you really going to disable the catalogue?",
+ "description": "To continue sending your products on Whatsapp you need an active catalogue.",
+ "label": "Type “disable catalog” to confirm",
+ "placeholder": "disable catalog",
+ "confirm": "Disable"
+ },
+ "advanced_configurations_modal": {
+ "title": "Advanced Settings",
+ "description": "Configure the level of accuracy for automatic shipping of your products",
+ "recomendation": "Recommended configuration: 1.55",
+ "confirm": "To save"
+ }
}
},
"templates": {
diff --git a/src/locales/es_es.json b/src/locales/es_es.json
index fb139b18..764321a6 100644
--- a/src/locales/es_es.json
+++ b/src/locales/es_es.json
@@ -457,6 +457,40 @@
"templates": {
"button": "Ver mis plantillas",
"title": "Plantillas"
+ },
+ "catalog": {
+ "button": "Ver lista de catálogos",
+ "title": "Catalogar"
+ }
+ },
+ "catalog": {
+ "list": {
+ "title": "Lista de catálogos",
+ "description": "Añade todos los artículos que quieras anunciar o vender",
+ "advanced_settings": "Configuraciones avanzadas",
+ "identification": "Identificación",
+ "actions": {
+ "enabled_cart": "Carrito habilitado",
+ "disabled_cart": "Carrito inhabilitado",
+ "enabled_catalog": "Catálogo habilitado",
+ "disabled_catalog": "Desactivado"
+ },
+ "disable_modal": {
+ "title": "¿De verdad vas a desactivar el catálogo?",
+ "description": "Para seguir enviando tus productos por Whatsapp necesitas un catálogo activo.",
+ "label": "Escriba “deshabilitar catálogo” para confirmar",
+ "placeholder": "desactivar catálogo",
+ "confirm": "Desactivar"
+ },
+ "advanced_configurations_modal": {
+ "title": "Configuraciones avanzadas",
+ "description": "Configura el nivel de precisión para el envío automático de tus productos",
+ "recomendation": "Configuración recomendada: 1,55",
+ "confirm": "Ahorrar"
+ }
+ },
+ "error": {
+ "toggle_cart_visibility": ""
}
},
"templates": {
diff --git a/src/locales/pt_br.json b/src/locales/pt_br.json
index d9579fd7..cb65f493 100644
--- a/src/locales/pt_br.json
+++ b/src/locales/pt_br.json
@@ -457,6 +457,43 @@
"templates": {
"button": "Ver meus templates",
"title": "Templates"
+ },
+ "catalog": {
+ "button": "Ver lista de catálogos",
+ "title": "Catálogo"
+ }
+ },
+ "catalog": {
+ "error": {
+ "fetch_catalogs": "Não foi possível carregar a lista de catálogos. Por favor tente novamente mais tarde",
+ "disable_catalog": "Não foi possível desabilitar o catálogo no momento. Por favor tente novamente mais tarde",
+ "enable_catalog": "Não foi possível habilitar o catálogo no momento. Por favor tente novamente mais tarde",
+ "toggle_cart_visibility": ""
+ },
+ "list": {
+ "title": "Lista de catálogos",
+ "description": "Adicione todos os itens que você quer anunciar ou vender",
+ "advanced_settings": "Configurações avançadas",
+ "identification": "Identificação",
+ "actions": {
+ "enabled_cart": "Carrinho habilitado",
+ "disabled_cart": "Carrinho desabilitado",
+ "enabled_catalog": "Catálogo habilitado",
+ "disabled_catalog": "Desabilitado"
+ },
+ "disable_modal": {
+ "title": "Vai mesmo desabilitar o catálogo?",
+ "description": "Para continuar enviando seus produtos no Whatsapp você precisa de um catálogo ativo.",
+ "label": "Digite “{name}” para confirmar",
+ "placeholder": "desabilitar catálogo",
+ "confirm": "Desabilitar"
+ },
+ "advanced_configurations_modal": {
+ "title": "Configurações avançadas",
+ "description": "Configure o nível de precisão do envio automático dos seus produtos",
+ "recomendation": "Configuração recomendada: 1.55",
+ "confirm": "Salvar"
+ }
}
},
"templates": {
diff --git a/src/router.js b/src/router.js
index 6a0096e5..2e9313e0 100644
--- a/src/router.js
+++ b/src/router.js
@@ -64,6 +64,20 @@ const routes = [
},
],
},
+ {
+ path: '/apps/my/:appCode/:appUuid/catalogs',
+ component: () => import('@/views/whatsAppCatalogs/Base.vue'),
+ children: [
+ {
+ name: 'WhatsApp Catalogs List',
+ path: '',
+ component: () => import('@/views/whatsAppCatalogs/List.vue'),
+ meta: {
+ crumb_title: 'WhatsApp.catalog.list.title',
+ },
+ },
+ ],
+ },
{
path: '/loginexternal/:token/:project/:flowOrg',
name: 'externalLogin',
diff --git a/src/store/appType/channels/whatsapp_cloud/actions.js b/src/store/appType/channels/whatsapp_cloud/actions.js
index a599978f..d0f4b71f 100644
--- a/src/store/appType/channels/whatsapp_cloud/actions.js
+++ b/src/store/appType/channels/whatsapp_cloud/actions.js
@@ -35,4 +35,75 @@ export default {
setSelectedPhoneNumber({ commit }, { data }) {
commit('SET_SELECTED_PHONE_NUMBER', data);
},
+ async getWhatsAppCloudCatalogs({ commit }, { appUuid }) {
+ commit('GET_WHATSAPP_CATALOGS_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.getWhatsAppCloudCatalogs(appUuid);
+ commit('GET_WHATSAPP_CATALOGS_SUCCESS', data);
+ } catch (err) {
+ captureSentryException(err);
+ commit('GET_WHATSAPP_CATALOGS_ERROR', err);
+ }
+ },
+ async fetchCatalogData({ commit }, { appUuid, catalogUuid }) {
+ commit('FETCH_WHATSAPP_CATALOG_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.fetchCatalogData(appUuid, catalogUuid);
+ commit('FETCH_WHATSAPP_CATALOG_SUCCESS', data);
+ } catch (err) {
+ captureSentryException(err);
+ commit('FETCH_WHATSAPP_CATALOG_ERROR', err);
+ }
+ },
+ async disableWhatsAppCloudCatalogs({ commit }, { appUuid, catalogUuid }) {
+ commit('DISABLE_WHATSAPP_CATALOG_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.disableWhatsAppCloudCatalogs(appUuid, catalogUuid);
+ commit('DISABLE_WHATSAPP_CATALOG_SUCCESS', data);
+ } catch (err) {
+ captureSentryException(err);
+ commit('DISABLE_WHATSAPP_CATALOG_ERROR', err);
+ }
+ },
+ async enableWhatsAppCloudCatalogs({ commit }, { appUuid, catalogUuid }) {
+ commit('ENABLE_WHATSAPP_CATALOG_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.enableWhatsAppCloudCatalogs(appUuid, catalogUuid);
+ commit('ENABLE_WHATSAPP_CATALOG_SUCCESS', data);
+ } catch (err) {
+ captureSentryException(err);
+ commit('ENABLE_WHATSAPP_CATALOG_ERROR', err);
+ }
+ },
+ async toggleCartVisibility({ commit }, { appUuid, payload }) {
+ commit('TOGGLE_CART_VISIBILITY_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.toggleCartVisibility(appUuid, payload);
+ commit('TOGGLE_CART_VISIBILITY_SUCCESS', data);
+ } catch (err) {
+ captureSentryException(err);
+ commit('TOGGLE_CART_VISIBILITY_ERROR', err);
+ }
+ },
+ async toggleCatalogVisibility({ commit }, { appUuid, payload }) {
+ commit('TOGGLE_CATALOG_VISIBILITY_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.toggleCatalogVisibility(appUuid, payload);
+ commit('TOGGLE_CATALOG_VISIBILITY_SUCCESS', data);
+ } catch (err) {
+ captureSentryException(err);
+ commit('TOGGLE_CATALOG_VISIBILITY_ERROR', err);
+ }
+ },
+ async getCommerceSettings({ commit }, { appUuid }) {
+ commit('GET_COMMERCE_SETTINGS_REQUEST');
+ try {
+ const { data } = await whatsAppCloud.getCommerceSettings(appUuid);
+ const settings = data.data[0];
+ commit('GET_COMMERCE_SETTINGS_SUCCESS', settings);
+ } catch (err) {
+ captureSentryException(err);
+ commit('GET_COMMERCE_SETTINGS_ERROR', err);
+ }
+ },
};
diff --git a/src/store/appType/channels/whatsapp_cloud/mutations.js b/src/store/appType/channels/whatsapp_cloud/mutations.js
index b4665fef..0951bb66 100644
--- a/src/store/appType/channels/whatsapp_cloud/mutations.js
+++ b/src/store/appType/channels/whatsapp_cloud/mutations.js
@@ -44,4 +44,96 @@ export default {
SET_SELECTED_PHONE_NUMBER(state, data) {
state.selectedPhoneNumber = data;
},
+ GET_WHATSAPP_CATALOGS_REQUEST(state) {
+ state.loadingWhatsAppCloudCatalogs = true;
+ state.errorWhatsAppCloudCatalogs = null;
+ },
+ GET_WHATSAPP_CATALOGS_SUCCESS(state, data) {
+ state.whatsAppCloudCatalogs = data;
+ state.loadingWhatsAppCloudCatalogs = false;
+ },
+ GET_WHATSAPP_CATALOGS_ERROR(state, data) {
+ state.errorWhatsAppCloudCatalogs = data;
+ state.loadingWhatsAppCloudCatalogs = false;
+ },
+ FETCH_WHATSAPP_CATALOG_REQUEST(state) {
+ state.loadingFetchWhatsAppCloudCatalog = true;
+ state.errorFetchWhatsAppCloudCatalog = null;
+ },
+ FETCH_WHATSAPP_CATALOG_SUCCESS(state, data) {
+ state.whatsAppCloudCatalog = data;
+ state.loadingFetchWhatsAppCloudCatalog = false;
+ },
+ FETCH_WHATSAPP_CATALOG_ERROR(state, data) {
+ state.errorFetchWhatsAppCloudCatalog = data;
+ state.loadingFetchWhatsAppCloudCatalog = false;
+ },
+ DISABLE_WHATSAPP_CATALOG_REQUEST(state) {
+ state.loadingDisableCatalog = true;
+ state.disabledCatalog = null;
+ state.errorDisableCatalog = null;
+ },
+ DISABLE_WHATSAPP_CATALOG_SUCCESS(state, data) {
+ state.disabledCatalog = data;
+ state.loadingDisableCatalog = false;
+ },
+ DISABLE_WHATSAPP_CATALOG_ERROR(state, data) {
+ state.errorDisableCatalog = data;
+ state.loadingDisableCatalog = false;
+ },
+
+ ENABLE_WHATSAPP_CATALOG_REQUEST(state) {
+ state.loadingEnableCatalog = true;
+ state.enabledCatalog = null;
+ state.errorEnableCatalog = null;
+ },
+ ENABLE_WHATSAPP_CATALOG_SUCCESS(state, data) {
+ state.enabledCatalog = data;
+ state.loadingEnableCatalog = false;
+ },
+ ENABLE_WHATSAPP_CATALOG_ERROR(state, data) {
+ state.errorEnableCatalog = data;
+ state.loadingEnableCatalog = false;
+ },
+
+ TOGGLE_CART_VISIBILITY_REQUEST(state) {
+ state.loadingToggleCartVisibility = true;
+ state.toggledCartVisibility = null;
+ state.errorToggleCartVisibility = null;
+ },
+ TOGGLE_CART_VISIBILITY_SUCCESS(state, data) {
+ state.toggledCartVisibility = data;
+ state.loadingToggleCartVisibility = false;
+ },
+ TOGGLE_CART_VISIBILITY_ERROR(state, data) {
+ state.errorToggleCartVisibility = data;
+ state.loadingToggleCartVisibility = false;
+ },
+
+ TOGGLE_CATALOG_VISIBILITY_REQUEST(state) {
+ state.loadingToggleCatalogVisibility = true;
+ state.toggledCatalogVisibility = null;
+ state.errorToggleCatalogVisibility = null;
+ },
+ TOGGLE_CATALOG_VISIBILITY_SUCCESS(state, data) {
+ state.toggledCatalogVisibility = data;
+ state.loadingToggleCatalogVisibility = false;
+ },
+ TOGGLE_CATALOG_VISIBILITY_ERROR(state, data) {
+ state.errorToggleCatalogVisibility = data;
+ state.loadingToggleCatalogVisibility = false;
+ },
+
+ GET_COMMERCE_SETTINGS_REQUEST(state) {
+ state.loadingCommerceSettings = true;
+ state.errorCommerceSettings = null;
+ },
+ GET_COMMERCE_SETTINGS_SUCCESS(state, data) {
+ state.commerceSettings = data;
+ state.loadingCommerceSettings = false;
+ },
+ GET_COMMERCE_SETTINGS_ERROR(state, data) {
+ state.errorCommerceSettings = data;
+ state.loadingCommerceSettings = false;
+ },
};
diff --git a/src/store/appType/channels/whatsapp_cloud/state.js b/src/store/appType/channels/whatsapp_cloud/state.js
index 7524d4c8..bc44d41f 100644
--- a/src/store/appType/channels/whatsapp_cloud/state.js
+++ b/src/store/appType/channels/whatsapp_cloud/state.js
@@ -12,4 +12,32 @@ export default {
loadingWhatsAppCloudConfigure: false,
errorCloudConfigure: false,
+
+ whatsAppCloudCatalogs: null,
+ loadingWhatsAppCloudCatalogs: false,
+ errorWhatsAppCloudCatalogs: false,
+
+ whatsAppCloudCatalog: null,
+ loadingFetchWhatsAppCloudCatalog: false,
+ errorFetchWhatsAppCloudCatalog: false,
+
+ disabledCatalog: null,
+ loadingDisableCatalog: false,
+ errorDisableCatalog: false,
+
+ enabledCatalog: null,
+ loadingEnableCatalog: false,
+ errorEnableCatalog: false,
+
+ toggledCartVisibility: null,
+ loadingToggleCartVisibility: false,
+ errorToggleCartVisibility: false,
+
+ toggledCatalogVisibility: null,
+ loadingToggleCatalogVisibility: false,
+ errorToggleCatalogVisibility: false,
+
+ commerceSettings: null,
+ loadingCommerceSettings: false,
+ errorCommerceSettings: false,
};
diff --git a/src/views/whatsAppCatalogs/Base.vue b/src/views/whatsAppCatalogs/Base.vue
new file mode 100644
index 00000000..c7ffdeba
--- /dev/null
+++ b/src/views/whatsAppCatalogs/Base.vue
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/whatsAppCatalogs/List.vue b/src/views/whatsAppCatalogs/List.vue
new file mode 100644
index 00000000..1bfb0929
--- /dev/null
+++ b/src/views/whatsAppCatalogs/List.vue
@@ -0,0 +1,19 @@
+
+
+
+
+