Chore: Remove dead code related to billing (#935)

- remove subscription model
- remove billing-related code
This commit is contained in:
Sojan Jose
2020-06-07 20:31:48 +05:30
committed by GitHub
parent 051871a3cd
commit 52d28105e4
84 changed files with 27 additions and 1240 deletions

View File

@@ -1,20 +0,0 @@
/* global axios */
import endPoints from './endPoints';
export default {
getSubscription() {
const urlData = endPoints('subscriptions').get();
const fetchPromise = new Promise((resolve, reject) => {
axios
.get(urlData.url)
.then(response => {
resolve(response);
})
.catch(error => {
reject(error);
});
});
return fetchPromise;
},
};

View File

@@ -33,14 +33,6 @@ const endPoints = {
},
params: { omniauth_token: '' },
},
subscriptions: {
get() {
return {
url: '/api/v1/subscriptions',
};
},
},
};
export default page => {

View File

@@ -3,7 +3,6 @@
@import 'animations';
@import 'foundation-custom';
@import 'widgets/billing';
@import 'widgets/buttons';
@import 'widgets/conv-header';
@import 'widgets/conversation-card';

View File

@@ -1,75 +0,0 @@
.billing {
@include full-height;
.row {
@include full-height;
}
.billing__stats {
@include flex;
}
.billing__form {
@include thin-border($color-border-light);
@include margin($zero - $space-micro);
@include full-height;
background: $color-white;
iframe {
@include full-height;
border: 0;
width: 100%;
}
}
.account-row {
@include padding($space-normal);
@include flex;
flex-direction: column;
// @include thin-border($color-border-light);
// @include margin(-$space-micro $zero);
background: $color-white;
font-size: $font-size-small;
.title {
color: $color-heading;
font-weight: $font-weight-medium;
}
.value {
font-size: $font-size-mega;
font-weight: $font-weight-light;
text-transform: capitalize;
}
}
}
.account-locked {
@include background-gray;
@include margin(0);
}
.lock-message {
@include flex;
@include full-height;
flex-direction: column;
@include flex-align(center, middle);
div {
@include flex;
@include full-height;
flex-direction: column;
@include flex-align(center, middle);
img {
@include margin($space-normal);
width: 10rem;
}
span {
font-size: $font-size-small;
font-weight: $font-weight-medium;
text-align: center;
}
}
}

View File

@@ -21,18 +21,6 @@
</transition-group>
</div>
<!-- this block is only required in the hosted version with billing enabled -->
<transition name="fade" mode="out-in">
<woot-status-bar
v-if="shouldShowStatusBox"
:message="trialMessage"
:button-text="$t('APP_GLOBAL.TRAIL_BUTTON')"
:button-route="{ name: 'billing' }"
:type="statusBarClass"
:show-button="isAdmin"
/>
</transition>
<div class="bottom-nav">
<transition name="menu-slide">
<div
@@ -108,7 +96,6 @@ import { mixin as clickaway } from 'vue-clickaway';
import adminMixin from '../../mixins/isAdmin';
import Auth from '../../api/auth';
import SidebarItem from './SidebarItem';
import WootStatusBar from '../widgets/StatusBar';
import { frontendURL } from '../../helper/URLHelper';
import Thumbnail from '../widgets/Thumbnail';
import { getSidebarItems } from '../../i18n/default-sidebar';
@@ -116,7 +103,6 @@ import { getSidebarItems } from '../../i18n/default-sidebar';
export default {
components: {
SidebarItem,
WootStatusBar,
Thumbnail,
},
mixins: [clickaway, adminMixin],
@@ -138,7 +124,6 @@ export default {
daysLeft: 'getTrialLeft',
globalConfig: 'globalConfig/get',
inboxes: 'inboxes/getInboxes',
subscriptionData: 'getSubscription',
accountId: 'getCurrentAccountId',
currentRole: 'getCurrentRole',
}),
@@ -160,10 +145,6 @@ export default {
}
}
if (!window.chatwootConfig.billingEnabled) {
menuItems = this.filterBillingRoutes(menuItems);
}
return this.filterMenuItemsByRole(menuItems);
},
currentRoute() {
@@ -193,35 +174,11 @@ export default {
dashboardPath() {
return frontendURL(`accounts/${this.accountId}/dashboard`);
},
shouldShowStatusBox() {
return (
window.chatwootConfig.billingEnabled &&
(this.subscriptionData.state === 'trial' ||
this.subscriptionData.state === 'cancelled')
);
},
statusBarClass() {
if (this.subscriptionData.state === 'trial') {
return 'warning';
}
if (this.subscriptionData.state === 'cancelled') {
return 'danger';
}
return '';
},
trialMessage() {
return `${this.daysLeft} ${this.$t('APP_GLOBAL.TRIAL_MESSAGE')}`;
},
},
mounted() {
this.$store.dispatch('inboxes/get');
},
methods: {
filterBillingRoutes(menuItems) {
return menuItems.filter(
menuItem => !menuItem.toState.includes('billing')
);
},
filterMenuItemsByRole(menuItems) {
if (!this.currentRole) {
return [];

View File

@@ -1,24 +0,0 @@
<template>
<div class="status-bar" :class="type">
<p class="message">{{message}}</p>
<router-link
:to="buttonRoute"
class="button small warning nice"
v-if="showButton"
>
{{buttonText}}
</router-link>
</div>
</template>
<script>
export default {
props: {
message: String,
buttonRoute: Object,
buttonText: String,
showButton: Boolean,
type: String, // Danger, Info, Success, Warning
},
};
</script>

View File

@@ -1,15 +1,8 @@
/* eslint no-console: 0 */
import constants from '../constants';
import Auth from '../api/auth';
import router from '../routes';
const parseErrorCode = error => {
const errorStatus = error.response ? error.response.status : undefined;
// 901, 902 are used to identify billing related issues
if ([901, 902].includes(errorStatus)) {
const name = Auth.isAdmin() ? 'billing' : 'billing_deactivated';
router.push({ name });
}
return Promise.reject(error);
};

View File

@@ -8,7 +8,6 @@ export const getSidebarItems = accountId => ({
'inbox_conversation',
'conversation_through_inbox',
'settings_account_reports',
'billing_deactivated',
'profile_settings',
'profile_settings_index',
],
@@ -51,7 +50,6 @@ export const getSidebarItems = accountId => ({
'settings_inboxes_page_channel',
'settings_inboxes_add_agents',
'settings_inbox_finish',
'billing',
'settings_integrations',
'settings_integrations_webhook',
'general_settings',
@@ -88,13 +86,6 @@ export const getSidebarItems = accountId => ({
),
toStateName: 'canned_list',
},
billing: {
icon: 'ion-card',
label: 'BILLING',
hasSubMenu: false,
toState: frontendURL(`accounts/${accountId}/settings/billing`),
toStateName: 'billing',
},
settings_integrations: {
icon: 'ion-flash',
label: 'INTEGRATIONS',

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Facturació",
"LOADING": "S'estan obtenin les suscripcions",
"ACCOUNT_STATE": "Estat del compte",
"AGENT_COUNT": "Compte d'agent",
"PER_AGENT_COST": "Per cost d'agent",
"TOTAL_COST": "Cost total",
"BUTTON": {
"ADD": "Afegir mètode de pagament",
"EDIT": "EDITAR Mètode de pagament"
},
"TRIAL": {
"TITLE": "S'ha acabat el període de prova",
"MESSAGE": "Afegiu un mètode de pagament per continuar utilitzant Chatwoot."
},
"ACCOUNT_LOCKED": "El seu compte no està disponible de moment. <br>Poseu-vos en contacte amb l'administrador per reactivar-lo."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -87,7 +87,6 @@
"AGENTS": "Agents",
"INBOXES": "Safates d'entrada",
"CANNED_RESPONSES": "Respostes Predeterminades",
"BILLING": "Facturació",
"INTEGRATIONS": "Integracions",
"ACCOUNT_SETTINGS": "Configuració del compte"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Fakturace",
"LOADING": "Načítání předplatného",
"ACCOUNT_STATE": "Stav účtu",
"AGENT_COUNT": "Počet agentů",
"PER_AGENT_COST": "Náklady na jednoho agenta",
"TOTAL_COST": "Celkové náklady",
"BUTTON": {
"ADD": "Přidat způsob platby",
"EDIT": "Metoda platby EDIT"
},
"TRIAL": {
"TITLE": "Vaše zkušební období skončilo",
"MESSAGE": "Přidejte platební metodu a pokračujte v používání Chatwoot."
},
"ACCOUNT_LOCKED": "Váš účet není momentálně k dispozici. <br>Obraťte se na správce pro opětovné aktivaci."
}
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Abrechnung",
"LOADING": "Abonnements abrufen",
"ACCOUNT_STATE": "Kontostatus",
"AGENT_COUNT": "Anzahl der Agenten",
"PER_AGENT_COST": "Kosten pro Agent",
"TOTAL_COST": "Gesamtkosten",
"BUTTON": {
"ADD": "Zahlungsmethode hinzufügen",
"EDIT": "Zahlungsmethode BEARBEITEN"
},
"TRIAL": {
"TITLE": "Ihre Probezeit ist vorbei",
"MESSAGE": "Fügen Sie eine Zahlungsmethode hinzu, um Chatwoot weiterhin zu verwenden."
},
"ACCOUNT_LOCKED": "Ihr Konto ist derzeit nicht verfügbar. <br> Bitte wenden Sie sich zur Reaktivierung an Ihren Administrator."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -90,7 +90,6 @@
"AGENTS": "Agenten",
"INBOXES": "Posteingänge",
"CANNED_RESPONSES": "Vorgefertigte Antworten",
"BILLING": "Abrechnung",
"INTEGRATIONS": "Integrationen",
"ACCOUNT_SETTINGS": "Kontoeinstellungen"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Χρεώσεις",
"LOADING": "Λήψη Συνδρομών",
"ACCOUNT_STATE": "Κατάσταση Λογαριασμού",
"AGENT_COUNT": "Αριθμός Πρακτόρων",
"PER_AGENT_COST": "Κόστος ανά πράκτορα",
"TOTAL_COST": "Συνολικό κόστος",
"BUTTON": {
"ADD": "Προσθήκη μεθόδου πληρωμής",
"EDIT": "Επεξεργασία μεθόδου πληρωμής"
},
"TRIAL": {
"TITLE": "Η δοκιμαστική περίοδος ολοκληρώθηκε",
"MESSAGE": "Προσθέστε μια μέθοδο πληρωμής για να συνεχίσετε την χρήση του Chatwoot."
},
"ACCOUNT_LOCKED": "O Λογαριασμός σας δεν είναι ενεργός αυτήν τη στιγμή. <br>Παρακαλώ απευθυνθείτε στον διαχειριστή για ενεργοποίηση."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -102,7 +102,6 @@
"AGENTS": "Πράκτορες",
"INBOXES": "Κιβώτια Εισερχομένων",
"CANNED_RESPONSES": "Έτοιμες Απαντήσεις",
"BILLING": "Χρεώσεις",
"INTEGRATIONS": "Ενοποιήσεις",
"ACCOUNT_SETTINGS": "Ρυθμίσεις Λογαριασμού"
}

View File

@@ -3,7 +3,7 @@
"HEADER": "Agents",
"HEADER_BTN_TXT": "Add Agent",
"LOADING": "Fetching Agent List",
"SIDEBAR_TXT": "<p><b>Agents</b></p> <p> An <b>Agent</b> is a member of your Customer Support team. </p><p> Agents will be able to view and reply to messages from your users. The list shows all agents currently in your account. </p><p> Click on <b>Add Agent</b> to add a new agent. Agent you add will receive an email with a confirmation link to activate their account, after which they can access Chatwoot and respond to messages. </p><p> Access to Chatwoot's features are based on following roles. </p><p> <b>Agent</b> - Agents with this role can only access inboxes, reports and conversations. They can assign conversations to other agents or themselves and resolve conversations.</p><p> <b>Administrator</b> - Administrator will have access to all Chatwoot features enabled for your account, including settings and billing, along with all of a normal agents' privileges.</p>",
"SIDEBAR_TXT": "<p><b>Agents</b></p> <p> An <b>Agent</b> is a member of your Customer Support team. </p><p> Agents will be able to view and reply to messages from your users. The list shows all agents currently in your account. </p><p> Click on <b>Add Agent</b> to add a new agent. Agent you add will receive an email with a confirmation link to activate their account, after which they can access Chatwoot and respond to messages. </p><p> Access to Chatwoot's features are based on following roles. </p><p> <b>Agent</b> - Agents with this role can only access inboxes, reports and conversations. They can assign conversations to other agents or themselves and resolve conversations.</p><p> <b>Administrator</b> - Administrator will have access to all Chatwoot features enabled for your account, including settings, along with all of a normal agents' privileges.</p>",
"AGENT_TYPES": [
{
"name": "administrator",

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Billing",
"LOADING": "Fetching Subscriptions",
"ACCOUNT_STATE": "Account State",
"AGENT_COUNT": "Agent Count",
"PER_AGENT_COST": "Per Agent Cost",
"TOTAL_COST": "Total Cost",
"BUTTON": {
"ADD": "Add Payment Method",
"EDIT": "EDIT Payment Method"
},
"TRIAL": {
"TITLE": "Your Trial period is over",
"MESSAGE": "Add a payment method to continue using Chatwoot."
},
"ACCOUNT_LOCKED": "Your account is not available at the moment. <br>Please contact your administrator for reactivation."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -102,7 +102,6 @@
"AGENTS": "Agents",
"INBOXES": "Inboxes",
"CANNED_RESPONSES": "Canned Responses",
"BILLING": "Billing",
"INTEGRATIONS": "Integrations",
"ACCOUNT_SETTINGS": "Account Settings"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Facturación",
"LOADING": "Obteniendo suscripciones",
"ACCOUNT_STATE": "Estado de cuenta",
"AGENT_COUNT": "Contador de agentes",
"PER_AGENT_COST": "Coste por agente",
"TOTAL_COST": "Coste total",
"BUTTON": {
"ADD": "Añadir método de pago",
"EDIT": "Método de pago EDIT"
},
"TRIAL": {
"TITLE": "Su período de prueba ha terminado",
"MESSAGE": "Añadir un método de pago para seguir usando Chatwoot."
},
"ACCOUNT_LOCKED": "Su cuenta no está disponible en este momento. <br>Póngase en contacto con su administrador para reactivación."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -102,7 +102,6 @@
"AGENTS": "Agentes",
"INBOXES": "Entradas",
"CANNED_RESPONSES": "Respuestas predefinidas",
"BILLING": "Facturación",
"INTEGRATIONS": "Integraciones",
"ACCOUNT_SETTINGS": "Configuración de la cuenta"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Facturation",
"LOADING": "Récupération des abonnements",
"ACCOUNT_STATE": "État du compte",
"AGENT_COUNT": "Nombre d'agents",
"PER_AGENT_COST": "Coût par agent",
"TOTAL_COST": "Coût total",
"BUTTON": {
"ADD": "Ajouter une méthode de paiement",
"EDIT": "MODIFIER la méthode de paiement"
},
"TRIAL": {
"TITLE": "Votre période d'essai est terminée",
"MESSAGE": "Ajoutez une méthode de paiement pour continuer à utiliser Chatwoot."
},
"ACCOUNT_LOCKED": "Votre compte n'est pas disponible pour le moment. <br>Veuillez contacter votre administrateur pour la réactivation."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -102,7 +102,6 @@
"AGENTS": "Agents",
"INBOXES": "Boîtes de réception",
"CANNED_RESPONSES": "Réponses standardisées",
"BILLING": "Facturation",
"INTEGRATIONS": "Intégrations",
"ACCOUNT_SETTINGS": "Paramètres du compte"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Fatturazione",
"LOADING": "Recupero Iscrizioni",
"ACCOUNT_STATE": "Stato del conto",
"AGENT_COUNT": "Conteggio Agente",
"PER_AGENT_COST": "Costo per agente",
"TOTAL_COST": "Costo totale",
"BUTTON": {
"ADD": "Aggiungi metodo di pagamento",
"EDIT": "Metodo di pagamento EDIT"
},
"TRIAL": {
"TITLE": "Il tuo periodo di prova è finito",
"MESSAGE": "Aggiungi un metodo di pagamento per continuare a utilizzare Chatwoot."
},
"ACCOUNT_LOCKED": "Il tuo account non è al momento disponibile. <br>Si prega di contattare l'amministratore per la riattivazione."
}
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "ബില്ലിംഗ്",
"LOADING": "സബ്സ്ക്രിപ്ഷനുകൾ ലഭ്യമാക്കുന്നു",
"ACCOUNT_STATE": "അക്കൗണ്ടിന്റെ അവസ്ഥ",
"AGENT_COUNT": "ഏജന്റിന്റെ എണ്ണം ",
"PER_AGENT_COST": "ഓരോ ഏജന്റിന്റെ വില",
"TOTAL_COST": "ആകെ ചെലവ്",
"BUTTON": {
"ADD": "പേയ്‌മെന്റ് രീതി ചേർക്കുക",
"EDIT": "പേയ്‌മെന്റ് രീതി എഡിറ്റുചെയ്യുക"
},
"TRIAL": {
"TITLE": "നിങ്ങളുടെ ട്രയൽ കാലയളവ് അവസാനിച്ചു",
"MESSAGE": "ചാറ്റ് വൂട്ട് ഉപയോഗിക്കുന്നത് തുടരാൻ ഒരു പേയ്‌മെന്റ് രീതി ചേർക്കുക."
},
"ACCOUNT_LOCKED": "നിങ്ങളുടെ അക്കൗണ്ട് ഇപ്പോൾ ലഭ്യമല്ല. <br> വീണ്ടും സജീവമാക്കുന്നതിന് ദയവായി നിങ്ങളുടെ അഡ്മിനിസ്ട്രേറ്ററുമായി ബന്ധപ്പെടുക."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -90,7 +90,6 @@
"AGENTS": "ഏജന്റുമാർ",
"INBOXES": "ഇൻബോക്സുകൾ",
"CANNED_RESPONSES": "ക്യാൻഡ് പ്രതികരണങ്ങൾ",
"BILLING": "ബില്ലിംഗ്",
"INTEGRATIONS": "സംയോജനങ്ങൾ",
"ACCOUNT_SETTINGS": "അക്കൗണ്ട് ക്രമീകരണങ്ങൾ"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Facturatie",
"LOADING": "Ophalen Abonnementen",
"ACCOUNT_STATE": "Accountstatus",
"AGENT_COUNT": "Aantal Medewerkers",
"PER_AGENT_COST": "Kosten per medewerker",
"TOTAL_COST": "Totale kosten",
"BUTTON": {
"ADD": "Betaalmethode toevoegen",
"EDIT": "Betalingsmethode bewerken"
},
"TRIAL": {
"TITLE": "Uw proefperiode is voorbij",
"MESSAGE": "Voeg een betaalmethode toe om Chatwoot te blijven gebruiken."
},
"ACCOUNT_LOCKED": "Uw account is op dit moment niet beschikbaar. <br>Neem contact op met uw beheerder voor heractivatie."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -102,7 +102,6 @@
"AGENTS": "Medewerkers",
"INBOXES": "Inboxen",
"CANNED_RESPONSES": "Standaard antwoorden",
"BILLING": "Facturatie",
"INTEGRATIONS": "Integraties",
"ACCOUNT_SETTINGS": "Accountinstellingen"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Płatność",
"LOADING": "Pobieranie subskrypcji",
"ACCOUNT_STATE": "Stan konta",
"AGENT_COUNT": "Liczba agentów",
"PER_AGENT_COST": "Koszt za agenta",
"TOTAL_COST": "Całkowity koszt",
"BUTTON": {
"ADD": "Dodaj metodę płatności",
"EDIT": "Metoda płatności EDIT"
},
"TRIAL": {
"TITLE": "Twój okres próbny minął",
"MESSAGE": "Dodaj metodę płatności, aby kontynuować korzystanie z Chatwoot."
},
"ACCOUNT_LOCKED": "Twoje konto nie jest obecnie dostępne. <br>Skontaktuj się z administratorem, aby reaktywować."
}
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Faturamento",
"LOADING": "Buscando Assinaturas",
"ACCOUNT_STATE": "Estado do cliente",
"AGENT_COUNT": "Número de Representantes",
"PER_AGENT_COST": "Custo por agente",
"TOTAL_COST": "Custo Total",
"BUTTON": {
"ADD": "Adicionar método de pagamento",
"EDIT": "EDIT Método de Pagamento"
},
"TRIAL": {
"TITLE": "Seu período de avaliação terminou",
"MESSAGE": "Adicione um método de pagamento para continuar usando o Chatwoot."
},
"ACCOUNT_LOCKED": "Sua conta não está disponível no momento. <br>Por favor, entre em contato com o administrador para reativação."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -67,7 +67,6 @@
"AGENTS": "Agentes",
"INBOXES": "Caixas de entrada",
"CANNED_RESPONSES": "Respostas Enlatadas",
"BILLING": "Faturamento",
"INTEGRATIONS": "Integrações",
"ACCOUNT_SETTINGS": "Configurações da conta"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Faturamento",
"LOADING": "Buscando Assinaturas",
"ACCOUNT_STATE": "Estado do cliente",
"AGENT_COUNT": "Número de Agente",
"PER_AGENT_COST": "Custo por agente",
"TOTAL_COST": "Custo Total",
"BUTTON": {
"ADD": "Adicionar Forma de Pagamento",
"EDIT": "Editar Forma de Pagamento"
},
"TRIAL": {
"TITLE": "Seu período de avaliação terminou",
"MESSAGE": "Adicione um método de pagamento para continuar usando o Chatwoot."
},
"ACCOUNT_LOCKED": "Sua conta não está disponível no momento. <br>Por favor, entre em contato com o administrador para reativação."
}
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable */
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -17,7 +16,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -100,7 +100,6 @@
"AGENTS": "Agentes",
"INBOXES": "Caixas de Entrada",
"CANNED_RESPONSES": "Atalhos",
"BILLING": "Faturamento",
"INTEGRATIONS": "Integrações",
"ACCOUNT_SETTINGS": "Configurações da conta"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Facturare",
"LOADING": "Preluare abonamente",
"ACCOUNT_STATE": "Stare cont",
"AGENT_COUNT": "Număr de agenți",
"PER_AGENT_COST": "Cost per Agent",
"TOTAL_COST": "Cost total",
"BUTTON": {
"ADD": "Adaugă metodă de plată",
"EDIT": "Adaugă metodă de plată"
},
"TRIAL": {
"TITLE": "Perioada de evaluare s-a încheiat",
"MESSAGE": "Adaugă o metodă de plată pentru a continua să folosești Chatwoot."
},
"ACCOUNT_LOCKED": "Contul dvs. nu este disponibil momentan. <br>Vă rugăm să contactaţi administratorul pentru reactivare."
}
}

View File

@@ -1,5 +1,4 @@
import { default as _agentMgmt } from './agentMgmt.json';
import { default as _billing } from './billing.json';
import { default as _cannedMgmt } from './cannedMgmt.json';
import { default as _chatlist } from './chatlist.json';
import { default as _contact } from './contact.json';
@@ -16,7 +15,6 @@ import { default as _generalSettings } from './generalSettings.json';
export default {
..._agentMgmt,
..._billing,
..._cannedMgmt,
..._chatlist,
..._contact,

View File

@@ -102,7 +102,6 @@
"AGENTS": "Agenți",
"INBOXES": "Căsuțe",
"CANNED_RESPONSES": "Răspunsuri predefinite",
"BILLING": "Facturare",
"INTEGRATIONS": "Integrări",
"ACCOUNT_SETTINGS": "Setările contului"
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Fakturering",
"LOADING": "Hämtar prenumerationer",
"ACCOUNT_STATE": "Kontots status",
"AGENT_COUNT": "Agentkommando Antal",
"PER_AGENT_COST": "Per agent: kostnad",
"TOTAL_COST": "Total kostnad",
"BUTTON": {
"ADD": "Lägg till betalningsmetod",
"EDIT": "EDIT betalningsmetod"
},
"TRIAL": {
"TITLE": "Din provperiod är över",
"MESSAGE": "Lägg till en betalningsmetod för att fortsätta använda Chatwoot."
},
"ACCOUNT_LOCKED": "Ditt konto är inte tillgängligt just nu. <br>Kontakta administratören för återaktivering."
}
}

View File

@@ -1,19 +0,0 @@
{
"BILLING": {
"HEADER": "Оплата",
"LOADING": "Отримання підписок",
"ACCOUNT_STATE": "Стан облікового запису",
"AGENT_COUNT": "Кількість агентів",
"PER_AGENT_COST": "Вартість одного агента",
"TOTAL_COST": "Загальна вартість",
"BUTTON": {
"ADD": "Додати спосіб оплати",
"EDIT": "РЕДАГУВАТИ спосіб оплати"
},
"TRIAL": {
"TITLE": "Пробний період закінчився",
"MESSAGE": "Додайте спосіб оплати, щоб продовжити використовувати Chatwoot."
},
"ACCOUNT_LOCKED": "На даний момент ваш обліковий запис недоступний. <br>Зверніться до свого адміністратора для повторної активації."
}
}

View File

@@ -1,22 +0,0 @@
<template>
<div class="column content-box account-locked">
<div class="lock-message">
<!-- No inboxes attached -->
<div>
<img src="~dashboard/assets/images/lock.svg" alt="Lock" />
<span v-html="$t('BILLING.ACCOUNT_LOCKED')">
</span>
</div>
</div>
</div>
</template>
<script>
/* eslint no-console: 0 */
/* global bus */
export default {
props: ['state'],
};
</script>

View File

@@ -1,124 +0,0 @@
<template>
<div class="column content-box billing">
<woot-loading-state v-if="fetchStatus" :message="$t('BILLING.LOADING')" />
<div v-if="billingDetails" class="row">
<div class="small-12 columns billing__stats">
<div class="account-row column">
<span class="title">{{ $t('BILLING.ACCOUNT_STATE') }}</span>
<span class="value">{{ billingDetails.state }} </span>
</div>
<div class="account-row column">
<span class="title">{{ $t('BILLING.AGENT_COUNT') }}</span>
<span class="value">{{ billingDetails.agents_count }} </span>
</div>
<div class="account-row column">
<span class="title">{{ $t('BILLING.PER_AGENT_COST') }}</span>
<span class="value">${{ billingDetails.per_agent_cost }} </span>
</div>
<div class="account-row column">
<span class="title">{{ $t('BILLING.TOTAL_COST') }}</span>
<span class="value">${{ billingDetails.total_cost }} </span>
</div>
</div>
<div class="small-12 columns billing__form">
<iframe
v-if="iframeUrl && !isShowEmptyState"
:src="billingDetails.iframe_url"
></iframe>
<div v-if="isShowEmptyState">
<empty-state :title="emptyStateTitle" :message="emptyStateMessage">
<div class="medium-12 columns text-center">
<button class="button success nice" @click="billingButtonClick()">
{{ buttonText }}
</button>
</div>
</empty-state>
</div>
</div>
</div>
</div>
</template>
<script>
/* eslint no-console: 0 */
/* global bus */
import { mapGetters } from 'vuex';
import EmptyState from '../../../../components/widgets/EmptyState';
export default {
components: {
EmptyState,
},
props: ['state'],
data() {
return {
is_adding_source: false,
};
},
computed: {
...mapGetters({
billingDetails: 'getBillingDetails',
fetchStatus: 'billingFetchStatus',
daysLeft: 'getTrialLeft',
subscriptionData: 'getSubscription',
}),
redirectMessage() {
if (!this.state) {
return '';
}
if (this.state === 'succeeded') {
return this.$t('BILLING.STATUS.SUCCESS');
}
return this.$t('BILLING.STATUS.ERROR');
},
iframeUrl() {
return typeof this.billingDetails.iframe_url === 'string';
},
isShowEmptyState() {
if (this.billingDetails !== null) {
if (this.is_adding_source) {
return false;
}
}
return true;
},
buttonText() {
if (this.billingDetails !== null) {
return this.billingDetails.payment_source_added
? this.$t('BILLING.BUTTON.EDIT')
: this.$t('BILLING.BUTTON.ADD');
}
return this.$t('BILLING.BUTTON.ADD');
},
emptyStateTitle() {
if (this.daysLeft <= 0 || this.subscriptionData.state === 'cancelled') {
return this.$t('BILLING.TRIAL.TITLE');
}
return '';
},
emptyStateMessage() {
if (this.daysLeft <= 0 || this.subscriptionData.state === 'cancelled') {
return this.$t('BILLING.TRIAL.MESSAGE');
}
return '';
},
},
mounted() {
if (this.state) {
bus.$emit('newToastMessage', this.redirectMessage);
}
this.$store.dispatch('fetchSubscription');
},
methods: {
billingButtonClick() {
this.is_adding_source = true;
},
},
};
</script>

View File

@@ -1,32 +0,0 @@
import Index from './Index';
import SettingsContent from '../Wrapper';
import AccountLocked from './AccountLocked';
import { frontendURL } from '../../../../helper/URLHelper';
export default {
routes: [
{
path: frontendURL('accounts/:accountId/settings/billing'),
component: SettingsContent,
props: {
headerTitle: 'BILLING.HEADER',
icon: 'ion-card',
},
children: [
{
path: '',
name: 'billing',
component: Index,
roles: ['administrator'],
props: route => ({ state: route.query.state }),
},
],
},
{
path: '/deactivated',
name: 'billing_deactivated',
component: AccountLocked,
roles: ['agent'],
},
],
};

View File

@@ -1,6 +1,5 @@
import { frontendURL } from '../../../helper/URLHelper';
import agent from './agents/agent.routes';
import billing from './billing/billing.routes';
import canned from './canned/canned.routes';
import inbox from './inbox/inbox.routes';
import profile from './profile/profile.routes';
@@ -23,7 +22,6 @@ export default {
},
},
...agent.routes,
...billing.routes,
...canned.routes,
...inbox.routes,
...profile.routes,

View File

@@ -4,7 +4,6 @@ import Vuex from 'vuex';
import accounts from './modules/accounts';
import agents from './modules/agents';
import auth from './modules/auth';
import billing from './modules/billing';
import cannedResponse from './modules/cannedResponse';
import Channel from './modules/channels';
import contactConversations from './modules/contactConversations';
@@ -27,7 +26,6 @@ export default new Vuex.Store({
accounts,
agents,
auth,
billing,
cannedResponse,
Channel,
contactConversations,

View File

@@ -1,60 +0,0 @@
/* eslint no-console: 0 */
/* eslint no-param-reassign: 0 */
/* eslint no-shadow: 0 */
import * as types from '../mutation-types';
import Billing from '../../api/billing';
const state = {
fetchingStatus: false,
billingDetails: {},
status: null,
};
const getters = {
getBillingDetails(_state) {
return _state.billingDetails;
},
billingFetchStatus(_state) {
return _state.fetchingStatus;
},
};
const actions = {
fetchSubscription({ commit }) {
commit(types.default.TOGGLE_SUBSCRIPTION_LOADING, true);
Billing.getSubscription()
.then(billingDetails => {
commit(types.default.SET_SUBSCRIPTION, billingDetails.data);
commit(
types.default.TOGGLE_SUBSCRIPTION_LOADING,
false,
billingDetails.status
);
})
.catch(error => {
const { response } = error;
commit(
types.default.TOGGLE_SUBSCRIPTION_LOADING,
false,
response.status
);
});
},
};
const mutations = {
[types.default.SET_SUBSCRIPTION](_state, billingDetails) {
_state.billingDetails = billingDetails;
},
[types.default.TOGGLE_SUBSCRIPTION_LOADING](_state, flag, apiStatus) {
_state.fetchingStatus = flag;
_state.status = apiStatus;
},
};
export default {
state,
getters,
actions,
mutations,
};

View File

@@ -93,10 +93,6 @@ export default {
SET_ACCOUNT_SUMMARY: 'SET_ACCOUNT_SUMMARY',
TOGGLE_ACCOUNT_REPORT_LOADING: 'TOGGLE_ACCOUNT_REPORT_LOADING',
// Billings
SET_SUBSCRIPTION: 'SET_SUBSCRIPTION',
TOGGLE_SUBSCRIPTION_LOADING: 'TOGGLE_SUBSCRIPTION_LOADING',
// Conversation Metadata
SET_CONVERSATION_METADATA: 'SET_CONVERSATION_METADATA',