Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
77 lines
2.3 KiB
Vue
77 lines
2.3 KiB
Vue
<script setup>
|
|
import { computed, onMounted, watch } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import { useStore } from 'vuex';
|
|
import UpgradePage from '../components/UpgradePage.vue';
|
|
import { useUISettings } from 'dashboard/composables/useUISettings';
|
|
import { FEATURE_FLAGS } from 'dashboard/featureFlags';
|
|
|
|
const route = useRoute();
|
|
const store = useStore();
|
|
const { uiSettings, updateUISettings } = useUISettings();
|
|
|
|
const accountId = computed(() => store.getters.getCurrentAccountId);
|
|
const portals = computed(() => store.getters['portals/allPortals']);
|
|
const isFeatureEnabledonAccount = (id, flag) =>
|
|
store.getters['accounts/isFeatureEnabledonAccount'](id, flag);
|
|
|
|
const isHelpCenterEnabled = computed(() =>
|
|
isFeatureEnabledonAccount(accountId.value, FEATURE_FLAGS.HELP_CENTER)
|
|
);
|
|
|
|
const selectedPortal = computed(() => {
|
|
const slug =
|
|
route.params.portalSlug || uiSettings.value.last_active_portal_slug;
|
|
if (slug) return store.getters['portals/portalBySlug'](slug);
|
|
return portals.value[0];
|
|
});
|
|
|
|
const defaultPortalLocale = computed(() =>
|
|
selectedPortal.value ? selectedPortal.value.meta?.default_locale : ''
|
|
);
|
|
const selectedLocaleInPortal = computed(
|
|
() => route.params.locale || defaultPortalLocale.value
|
|
);
|
|
|
|
const selectedPortalSlug = computed(() =>
|
|
selectedPortal.value ? selectedPortal.value.slug : ''
|
|
);
|
|
|
|
const fetchPortalAndItsCategories = async () => {
|
|
await store.dispatch('portals/index');
|
|
const selectedPortalParam = {
|
|
portalSlug: selectedPortalSlug.value,
|
|
locale: selectedLocaleInPortal.value,
|
|
};
|
|
store.dispatch('portals/show', selectedPortalParam);
|
|
store.dispatch('categories/index', selectedPortalParam);
|
|
store.dispatch('agents/get');
|
|
};
|
|
|
|
onMounted(() => fetchPortalAndItsCategories());
|
|
|
|
watch(
|
|
() => route.params.portalSlug,
|
|
newSlug => {
|
|
if (newSlug && newSlug !== uiSettings.value.last_active_portal_slug) {
|
|
updateUISettings({
|
|
last_active_portal_slug: newSlug,
|
|
last_active_locale_code: selectedLocaleInPortal.value,
|
|
});
|
|
}
|
|
}
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex w-full h-full min-h-0">
|
|
<section
|
|
v-if="isHelpCenterEnabled"
|
|
class="flex flex-1 h-full px-0 overflow-hidden bg-n-background"
|
|
>
|
|
<router-view />
|
|
</section>
|
|
<UpgradePage v-else />
|
|
</div>
|
|
</template>
|