Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ebapp into feat/whatsapp-authentication-template
  • Loading branch information
paulobernardoaf committed Oct 30, 2023
2 parents 67f252c + 6cc15b0 commit 4646f6d
Show file tree
Hide file tree
Showing 79 changed files with 1,629 additions and 479 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
echo "COMMIT_SHA=$GITHUB_SHA" | tee -a "${GITHUB_ENV}"
echo "IMAGE_TAG=${{ secrets.ECR }}/integrations:webapp-$TAG" | tee -a "${GITHUB_ENV}"
echo "IMAGE_SOURCE_URL=https://github.com/weni-ai/weni-integrations-webapp" | tee -a "${GITHUB_ENV}"
echo "MANIFESTS_REPOSITORY=Ilhasoft/kubernetes-manifests-platform" | tee -a "${GITHUB_ENV}"
echo "MANIFESTS_REPOSITORY=weni-ai/kubernetes-manifests-platform" | tee -a "${GITHUB_ENV}"
echo "MANIFESTS_APPLICATION=integrations-webapp" | tee -a "${GITHUB_ENV}"
echo "MANIFESTS_PATCH_TARGET=deployment-webapp.json" | tee -a "${GITHUB_ENV}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@sentry/integrations": "^6.13.2",
"@sentry/vue": "^6.13.2",
"@weni/unnnic-system": "^1.16.51",
"@weni/unnnic-system": "^1.16.64",
"axios": "0.21.1",
"core-js": "^3.6.5",
"global": "^4.4.0",
Expand Down
24 changes: 24 additions & 0 deletions src/api/appType/whatsapp_cloud/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import qs from 'query-string';
import request from '@/api/request.js';

const resource = '/api/v1/apptypes/wpp-cloud/apps';
const catalogsResource = '/api/v1/apptypes/wpp-cloud';

export default {
getDebugToken(params) {
const queryString = qs.stringify(params);
Expand All @@ -14,4 +16,26 @@ export default {
configurePhoneNumber(data) {
return request.$http.post(`${resource}/`, data);
},
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}/`);
},
disableWhatsAppCloudCatalogs(appUuid, catalogUuid) {
return request.$http.post(`${catalogsResource}/${appUuid}/catalogs/${catalogUuid}/disable/`);
},
enableWhatsAppCloudCatalogs(appUuid, catalogUuid) {
return request.$http.post(`${catalogsResource}/${appUuid}/catalogs/${catalogUuid}/enable/`);
},
toggleCartVisibility(appUuid, data) {
return request.$http.post(`${catalogsResource}/${appUuid}/toggle-cart-visibility/`, data);
},
toggleCatalogVisibility(appUuid, data) {
return request.$http.post(`${catalogsResource}/${appUuid}/toggle-catalog-visibility/`, data);
},
getCommerceSettings(appUuid) {
return request.$http.get(`${catalogsResource}/${appUuid}/commerce-settings/`);
},
};
10 changes: 10 additions & 0 deletions src/assets/svgs/storefront.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/AddModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<unnnic-button
ref="unnnic-add-modal-close-button"
slot="options"
type="terciary"
type="tertiary"
@click.stop="toggleModal"
>{{ $t('general.Close') }}</unnnic-button
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
class="app-grid__content__item__dropdown"
slot="actions"
>
<unnnic-button slot="trigger" size="small" type="terciary" :iconCenter="cardIcon" />
<unnnic-button slot="trigger" size="small" type="tertiary" :iconCenter="cardIcon" />
<unnnic-dropdown-item
class="app-grid__content__item__button--action"
@click="openAppModal(app)"
Expand Down Expand Up @@ -99,7 +99,7 @@
<unnnic-button
ref="unnnic-remove-modal-close-button"
slot="options"
type="terciary"
type="tertiary"
@click="toggleRemoveModal"
>{{ $t('general.Cancel') }}</unnnic-button
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/OnboardModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>

<div v-if="currentApp" class="onboard__buttons">
<unnnic-button type="terciary" @click.stop="previousPage" :text="$t('general.back')" />
<unnnic-button type="tertiary" @click.stop="previousPage" :text="$t('general.back')" />
<unnnic-button
type="secondary"
@click="nextPage"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Survey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="survey__content__buttons">
<unnnic-button
class="survey__content__buttons__exit"
type="terciary"
type="tertiary"
size="small"
:text="$t('general.exit')"
@click="closeSurvey"
Expand Down
6 changes: 3 additions & 3 deletions src/components/app/AppDetailsComments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<unnnic-icon-svg slot="trigger" icon="navigation-menu-vertical-1" size="sm" />
<unnnic-dropdown-item>
<unnnic-button
type="terciary"
type="tertiary"
iconLeft="pencil-write-1"
:text="$t('apps.details.comments.edit_comment')"
size="small"
Expand All @@ -54,7 +54,7 @@
</unnnic-dropdown-item>
<unnnic-dropdown-item>
<unnnic-button
type="terciary"
type="tertiary"
iconLeft="delete-1"
:text="$t('apps.details.comments.delete_comment')"
size="small"
Expand All @@ -76,7 +76,7 @@
<unnnic-button
ref="unnnic-remove-modal-close-button"
slot="options"
type="terciary"
type="tertiary"
@click="toggleRemoveModal"
>{{ $t('general.Cancel') }}</unnnic-button
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/app/AppDetailsRecommended.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<div class="app-details-recommended__header__buttons">
<unnnic-button
class="app-details-recommended__header__buttons__prev"
type="terciary"
type="tertiary"
icon-center="arrow-left-1-1"
size="small"
@click="prevRecommendation"
/>
<unnnic-button
class="app-details-recommended__header__buttons__next"
type="terciary"
type="tertiary"
icon-center="arrow-right-1-1"
size="small"
@click="nextRecommendation"
Expand Down
2 changes: 1 addition & 1 deletion src/components/config/ConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<unnnic-button
ref="unnnic-remove-modal-close-button"
slot="options"
type="terciary"
type="tertiary"
@click="toggleConfirmationModal"
>
{{ $t('apps.config.confirmation.goBackToConfig') }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/config/bi_tools/power_bi/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<div class="app-config-power-bi__buttons">
<unnnic-button
class="app-config-power-bi__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('apps.config.cancel')"
@click="$emit('closeModal')"
Expand Down
4 changes: 2 additions & 2 deletions src/components/config/channels/WWC/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<div class="app-config-wwc__tabs__settings-content__buttons">
<unnnic-button
class="app-config-wwc__tabs__settings-content__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('general.Cancel')"
@click="closeConfig"
Expand Down Expand Up @@ -209,7 +209,7 @@
<div class="app-config-wwc__tabs__settings-content__buttons">
<unnnic-button
class="app-config-wwc__tabs__settings-content__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('general.Cancel')"
@click="closeConfig"
Expand Down
4 changes: 2 additions & 2 deletions src/components/config/channels/facebook/Setup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="facebook-setup__buttons">
<unnnic-button
class="facebook-setup__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('general.Cancel')"
@click="closePopUp"
Expand Down Expand Up @@ -70,7 +70,7 @@
<div class="page-selection__buttons" slot="options">
<unnnic-button
class="page-selection__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t(`${this.integrationName}.setup.connect_later`)"
@click="closePopUp"
Expand Down
2 changes: 1 addition & 1 deletion src/components/config/channels/generic/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<div class="app-config-generic__settings__buttons">
<unnnic-button
class="app-config-generic__settings__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('apps.config.cancel')"
@click="closeConfig"
Expand Down
6 changes: 1 addition & 5 deletions src/components/config/channels/telegram/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="app-config-telegram__settings__buttons">
<unnnic-button
class="app-config-telegram__settings__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('apps.config.cancel')"
@click="closeConfig"
Expand Down Expand Up @@ -224,10 +224,6 @@
&__input {
margin-top: $unnnic-spacing-stack-xs;
&__subtitle {
margin-top: $unnnic-spacing-stack-nano/2;
}
&__payload {
flex: 1;
margin-top: $unnnic-spacing-stack-xs;
Expand Down
2 changes: 1 addition & 1 deletion src/components/config/channels/whatsapp/Config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<unnnic-button
class="config-whatsapp__header__title__close"
type="terciary"
type="tertiary"
icon-center="close-1"
size="small"
@click="closeConfig"
Expand Down
9 changes: 5 additions & 4 deletions src/components/config/channels/whatsapp/Setup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="whatsapp-setup__buttons">
<unnnic-button
class="whatsapp-setup__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('general.Cancel')"
@click="closePopUp"
Expand Down Expand Up @@ -66,15 +66,15 @@
<div class="phone-number-selection__buttons" slot="options">
<unnnic-button
class="phone-number-selection__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('WhatsAppCloud.config.phone_numbers.connect_later')"
@click="closePopUp"
></unnnic-button>
<!-- eslint-disable -->
<LoadingButton
class="phone-number-selection__buttons__save"
type="terciary"
type="tertiary"
size="large"
:disabled="
loadingPhoneNumbers || loadingDebugToken || !!errorDebugToken || !!errorPhoneNumbers || loadingWhatsAppCloudConfigure
Expand Down Expand Up @@ -173,7 +173,8 @@
},
{
return_scopes: true,
scope: 'business_management,whatsapp_business_management,whatsapp_business_messaging',
scope:
'business_management,whatsapp_business_management,whatsapp_business_messaging,catalog_management',
extras: {
feature: 'whatsapp_embedded_signup',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,35 @@
<div class="account-tab__content">
<div class="account-tab__content__info">
<div class="account-tab__content__info__templates">
<div class="account-tab__content__info__templates__title">
{{ $t('WhatsApp.config.templates.title') }}
<div class="account-tab__content__info__templates__buttons">
<div class="account-tab__content__info__templates__buttons__title">
{{ $t('WhatsApp.config.templates.title') }}
</div>

<unnnic-button
class="account-tab__content__info__templates__buttons__button"
@click="navigateToTemplates"
type="alternative"
size="small"
scheme="feedback-green"
>
{{ $t('WhatsApp.config.templates.button') }}
</unnnic-button>
</div>
<div class="account-tab__content__info__templates__buttons">
<div class="account-tab__content__info__templates__buttons__title">
{{ $t('WhatsApp.config.catalog.title') }}
</div>

<unnnic-button
class="account-tab__content__info__templates__button"
@click="navigateToTemplates"
type="secondary"
size="small"
>
{{ $t('WhatsApp.config.templates.button') }}
</unnnic-button>
<unnnic-button
class="account-tab__content__info__templates__buttons__button"
@click="navigateToCatalogs"
type="primary"
size="small"
>
{{ $t('WhatsApp.config.catalog.button') }}
</unnnic-button>
</div>
</div>

<div class="account-tab__content__info__qr">
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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%;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="profile-content__buttons">
<unnnic-button
class="profile-content__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('WhatsApp.config.profile.configure_later')"
@click="() => this.$emit('close')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<div class="webhook-info__buttons">
<unnnic-button
class="webhook-info__buttons__cancel"
type="terciary"
type="tertiary"
size="large"
:text="$t('WhatsApp.config.contact_info.configure_later')"
@click="() => this.$emit('close')"
Expand Down
Loading

0 comments on commit 4646f6d

Please sign in to comment.