@@ -453,9 +456,13 @@ watch(
:is-category-articles="isCategoryArticles"
:is-searching="isSearching"
:selected-article-ids="selectedArticleIds"
+ :current-page="Number(meta.currentPage)"
+ :total-pages="totalPages"
class="relative z-0"
@translate-article="handleTranslateArticle"
@toggle-select="handleToggleSelect"
+ @navigate-page="handlePageChange"
+ @dragging="isArticleDragging = $event"
/>
{
a {
@apply p-4;
}
+
+ .ProseMirror a {
+ @apply p-0;
+ }
}
}
}
diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
index 95ef53491..a5dec806d 100644
--- a/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/ConversationCard.vue
@@ -57,7 +57,9 @@ const showMetaSection = computed(() => {
);
});
-const hasSlaPolicyId = computed(() => props.chat?.sla_policy_id);
+const hasSlaPolicyId = computed(
+ () => props.chat?.applied_sla?.id && !props.currentContact?.blocked
+);
const showLabelsSection = computed(() => {
return props.chat.labels?.length > 0 || hasSlaPolicyId.value;
diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue
index ccd1a8aae..b1e3bc603 100644
--- a/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/ConversationHeader.vue
@@ -93,7 +93,9 @@ const hasMultipleInboxes = computed(
() => store.getters['inboxes/getInboxes'].length > 1
);
-const hasSlaPolicyId = computed(() => props.chat?.sla_policy_id);
+const hasSlaPolicyId = computed(
+ () => props.chat?.applied_sla?.id && !currentContact.value?.blocked
+);
const copyConversationId = async () => {
try {
diff --git a/app/javascript/dashboard/components/widgets/conversation/components/SLACardLabel.vue b/app/javascript/dashboard/components/widgets/conversation/components/SLACardLabel.vue
index bb6ee48d2..f5e2d4522 100644
--- a/app/javascript/dashboard/components/widgets/conversation/components/SLACardLabel.vue
+++ b/app/javascript/dashboard/components/widgets/conversation/components/SLACardLabel.vue
@@ -1,7 +1,7 @@
diff --git a/app/javascript/dashboard/routes/dashboard/settings/billing/components/PurchaseCreditsModal.vue b/app/javascript/dashboard/routes/dashboard/settings/billing/components/PurchaseCreditsModal.vue
index 33f299b9b..ce59a8738 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/billing/components/PurchaseCreditsModal.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/billing/components/PurchaseCreditsModal.vue
@@ -4,20 +4,18 @@ import { useI18n } from 'vue-i18n';
import { useAlert } from 'dashboard/composables';
import Dialog from 'dashboard/components-next/dialog/Dialog.vue';
import Button from 'dashboard/components-next/button/Button.vue';
+import Spinner from 'dashboard/components-next/spinner/Spinner.vue';
import CreditPackageCard from './CreditPackageCard.vue';
import EnterpriseAccountAPI from 'dashboard/api/enterprise/account';
+import {
+ formatCurrencyAmount,
+ DEFAULT_BILLING_CURRENCY,
+} from 'dashboard/constants/billing';
-const emit = defineEmits(['close', 'success']);
+const emit = defineEmits(['success']);
const { t } = useI18n();
-const TOPUP_OPTIONS = [
- { credits: 1000, amount: 20.0, currency: 'usd' },
- { credits: 2500, amount: 50.0, currency: 'usd' },
- { credits: 6000, amount: 100.0, currency: 'usd' },
- { credits: 12000, amount: 200.0, currency: 'usd' },
-];
-
const POPULAR_CREDITS_AMOUNT = 6000;
const STEP_SELECT = 'select';
const STEP_CONFIRM = 'confirm';
@@ -27,16 +25,20 @@ const selectedCredits = ref(null);
const isLoading = ref(false);
const currentStep = ref(STEP_SELECT);
+// Topup packages come from the backend for the account's billing currency.
+const topupOptions = ref([]);
+const optionsCurrency = ref(DEFAULT_BILLING_CURRENCY);
+const isFetchingOptions = ref(false);
+const fetchError = ref(false);
+
const selectedOption = computed(() => {
- return TOPUP_OPTIONS.find(o => o.credits === selectedCredits.value);
+ return topupOptions.value.find(o => o.credits === selectedCredits.value);
});
const formattedAmount = computed(() => {
if (!selectedOption.value) return '';
- return new Intl.NumberFormat('en-US', {
- style: 'currency',
- currency: selectedOption.value.currency.toUpperCase(),
- }).format(selectedOption.value.amount);
+ const { amount, currency } = selectedOption.value;
+ return formatCurrencyAmount(amount, currency || optionsCurrency.value);
});
const formattedCredits = computed(() => {
@@ -64,24 +66,44 @@ const handlePackageSelect = credits => {
selectedCredits.value = credits;
};
-const open = () => {
- const popularOption = TOPUP_OPTIONS.find(
+const selectDefaultOption = () => {
+ const popularOption = topupOptions.value.find(
o => o.credits === POPULAR_CREDITS_AMOUNT
);
- selectedCredits.value = popularOption?.credits || TOPUP_OPTIONS[0]?.credits;
+ selectedCredits.value =
+ popularOption?.credits || topupOptions.value[0]?.credits || null;
+};
+
+const fetchOptions = async () => {
+ isFetchingOptions.value = true;
+ fetchError.value = false;
+ try {
+ const { data } = await EnterpriseAccountAPI.getTopupOptions();
+ topupOptions.value = data.options ?? [];
+ optionsCurrency.value = (
+ data.currency || DEFAULT_BILLING_CURRENCY
+ ).toLowerCase();
+ selectDefaultOption();
+ } catch {
+ fetchError.value = true;
+ topupOptions.value = [];
+ } finally {
+ isFetchingOptions.value = false;
+ }
+};
+
+const open = () => {
currentStep.value = STEP_SELECT;
isLoading.value = false;
+ selectedCredits.value = null;
dialogRef.value?.open();
+ fetchOptions();
};
const close = () => {
dialogRef.value?.close();
};
-const handleClose = () => {
- emit('close');
-};
-
const goToConfirmStep = () => {
if (!selectedOption.value) return;
currentStep.value = STEP_CONFIRM;
@@ -127,32 +149,58 @@ defineExpose({ open, close });
:width="dialogWidth"
:show-confirm-button="false"
:show-cancel-button="false"
- @close="handleClose"
>
-
-
-
+
+
+ {{
+ $t('BILLING_SETTINGS.TOPUP.LOADING')
+ }}
+
+
+
+
+ {{ $t('BILLING_SETTINGS.TOPUP.FETCH_ERROR') }}
+
+
-
-
- {{
- $t('BILLING_SETTINGS.TOPUP.NOTE_TITLE')
- }}
- {{ $t('BILLING_SETTINGS.TOPUP.NOTE_DESCRIPTION') }}
-
-
+
+
+
+
+
+
+
+ {{
+ $t('BILLING_SETTINGS.TOPUP.NOTE_TITLE')
+ }}
+ {{ $t('BILLING_SETTINGS.TOPUP.NOTE_DESCRIPTION') }}
+
+
+
@@ -178,7 +226,7 @@ defineExpose({ open, close });
diff --git a/app/javascript/dashboard/routes/dashboard/settings/canned/AddCanned.vue b/app/javascript/dashboard/routes/dashboard/settings/canned/AddCanned.vue
index 7fd23ebb1..b2d0dae69 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/canned/AddCanned.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/canned/AddCanned.vue
@@ -149,9 +149,5 @@ export default {
:deep(.ProseMirror-woot-style) {
@apply min-h-[12.5rem];
-
- p {
- @apply text-base;
- }
}
diff --git a/app/javascript/dashboard/routes/dashboard/settings/canned/EditCanned.vue b/app/javascript/dashboard/routes/dashboard/settings/canned/EditCanned.vue
index 7a570a300..9980db58b 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/canned/EditCanned.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/canned/EditCanned.vue
@@ -153,9 +153,5 @@ export default {
:deep(.ProseMirror-woot-style) {
@apply min-h-[12.5rem];
-
- p {
- @apply text-base;
- }
}
diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/BotReports.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/BotReports.vue
index 03b7290d6..2a1cd18c8 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/reports/BotReports.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/reports/BotReports.vue
@@ -101,6 +101,9 @@ export default {
summary-fetching-key="getBotSummaryFetchingStatus"
:group-by="groupBy"
:report-keys="reportKeys"
+ :from="from"
+ :to="to"
+ :business-hours="businessHours"
/>
diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue
index 9794d97e4..ea1e80e70 100644
--- a/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue
+++ b/app/javascript/dashboard/routes/dashboard/settings/reports/Index.vue
@@ -121,6 +121,11 @@ export default {
show-group-by
@filter-change="onFilterChange"
/>
-
+