# Pull Request Template ## Description This PR fixes the layout overflow scroll issue and removes unused CSS. It also optimizes the display of the Sidebar, Copilot Panel, and Conversation Panel in the mobile view. Additionally, it resolves a runtime console warning. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Screencast https://github.com/user-attachments/assets/7e8885fa-6174-4740-80f1-bb1cec6517fc ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.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>
|