fix: show billing setting page on click of banner button
This commit is contained in:
parent
f12ad4ba28
commit
83de0a6b4c
@ -2,21 +2,23 @@
|
|||||||
<Layout v-if="session().isLoggedIn">
|
<Layout v-if="session().isLoggedIn">
|
||||||
<router-view />
|
<router-view />
|
||||||
</Layout>
|
</Layout>
|
||||||
|
<SettingsModal />
|
||||||
<Dialogs />
|
<Dialogs />
|
||||||
<Toasts />
|
<Toasts />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import SettingsModal from '@/components/Settings/SettingsModal.vue'
|
||||||
import { Dialogs } from '@/utils/dialogs'
|
import { Dialogs } from '@/utils/dialogs'
|
||||||
import { sessionStore as session } from '@/stores/session'
|
import { sessionStore as session } from '@/stores/session'
|
||||||
import { Toasts } from 'frappe-ui'
|
import { Toasts } from 'frappe-ui'
|
||||||
import { computed, defineAsyncComponent } from 'vue'
|
import { computed, defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
const MobileLayout = defineAsyncComponent(() =>
|
const MobileLayout = defineAsyncComponent(
|
||||||
import('./components/Layouts/MobileLayout.vue')
|
() => import('./components/Layouts/MobileLayout.vue'),
|
||||||
)
|
)
|
||||||
const DesktopLayout = defineAsyncComponent(() =>
|
const DesktopLayout = defineAsyncComponent(
|
||||||
import('./components/Layouts/DesktopLayout.vue')
|
() => import('./components/Layouts/DesktopLayout.vue'),
|
||||||
)
|
)
|
||||||
const Layout = computed(() => {
|
const Layout = computed(() => {
|
||||||
if (window.innerWidth < 640) {
|
if (window.innerWidth < 640) {
|
||||||
|
|||||||
@ -74,7 +74,10 @@
|
|||||||
</Section>
|
</Section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TrialBanner :isSidebarCollapsed="isSidebarCollapsed" />
|
<TrialBanner
|
||||||
|
:isSidebarCollapsed="isSidebarCollapsed"
|
||||||
|
@upgradePlan="showBillingSettingPage"
|
||||||
|
/>
|
||||||
<div class="m-2 flex flex-col gap-1">
|
<div class="m-2 flex flex-col gap-1">
|
||||||
<SidebarLink
|
<SidebarLink
|
||||||
:label="isSidebarCollapsed ? __('Expand') : __('Collapse')"
|
:label="isSidebarCollapsed ? __('Expand') : __('Collapse')"
|
||||||
@ -114,6 +117,7 @@ import SidebarLink from '@/components/SidebarLink.vue'
|
|||||||
import Notifications from '@/components/Notifications.vue'
|
import Notifications from '@/components/Notifications.vue'
|
||||||
import { viewsStore } from '@/stores/views'
|
import { viewsStore } from '@/stores/views'
|
||||||
import { notificationsStore } from '@/stores/notifications'
|
import { notificationsStore } from '@/stores/notifications'
|
||||||
|
import { showSettingsModal, activeSettingsPage } from '@/composables/settings'
|
||||||
import { FeatherIcon, TrialBanner } from 'frappe-ui'
|
import { FeatherIcon, TrialBanner } from 'frappe-ui'
|
||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import { computed, h } from 'vue'
|
import { computed, h } from 'vue'
|
||||||
@ -227,4 +231,9 @@ function getIcon(routeName, icon) {
|
|||||||
return PinIcon
|
return PinIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showBillingSettingPage() {
|
||||||
|
showSettingsModal.value = true
|
||||||
|
activeSettingsPage.value = 'Billing'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog v-model="show" :options="{ size: '5xl' }">
|
<Dialog
|
||||||
|
v-model="showSettingsModal"
|
||||||
|
:options="{ size: '5xl' }"
|
||||||
|
@close="activeSettingsPage = ''"
|
||||||
|
>
|
||||||
<template #body>
|
<template #body>
|
||||||
<div class="flex h-[calc(100vh_-_8rem)]">
|
<div class="flex h-[calc(100vh_-_8rem)]">
|
||||||
<div class="flex w-52 shrink-0 flex-col bg-gray-50 p-2">
|
<div class="flex w-52 shrink-0 flex-col bg-gray-50 p-2">
|
||||||
@ -49,11 +53,13 @@ import WhatsAppSettings from '@/components/Settings/WhatsAppSettings.vue'
|
|||||||
import ERPNextSettings from '@/components/Settings/ERPNextSettings.vue'
|
import ERPNextSettings from '@/components/Settings/ERPNextSettings.vue'
|
||||||
import TwilioSettings from '@/components/Settings/TwilioSettings.vue'
|
import TwilioSettings from '@/components/Settings/TwilioSettings.vue'
|
||||||
import SidebarLink from '@/components/SidebarLink.vue'
|
import SidebarLink from '@/components/SidebarLink.vue'
|
||||||
import { isWhatsappInstalled } from '@/composables/settings'
|
import {
|
||||||
|
isWhatsappInstalled,
|
||||||
|
showSettingsModal,
|
||||||
|
activeSettingsPage,
|
||||||
|
} from '@/composables/settings'
|
||||||
import { Dialog, Plans, Billing } from 'frappe-ui'
|
import { Dialog, Plans, Billing } from 'frappe-ui'
|
||||||
import { ref, markRaw, computed } from 'vue'
|
import { ref, markRaw, computed, watch } from 'vue'
|
||||||
|
|
||||||
const show = defineModel()
|
|
||||||
|
|
||||||
const tabs = computed(() => {
|
const tabs = computed(() => {
|
||||||
let _tabs = [
|
let _tabs = [
|
||||||
@ -123,4 +129,16 @@ const tabs = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const activeTab = ref(tabs.value[0].items[0])
|
const activeTab = ref(tabs.value[0].items[0])
|
||||||
|
|
||||||
|
function setActiveTab(tabName) {
|
||||||
|
activeTab.value =
|
||||||
|
(tabName &&
|
||||||
|
tabs.value
|
||||||
|
.map((tab) => tab.items)
|
||||||
|
.flat()
|
||||||
|
.find((tab) => tab.label === tabName)) ||
|
||||||
|
tabs.value[0].items[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(activeSettingsPage, (activePage) => setActiveTab(activePage))
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -44,15 +44,14 @@
|
|||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
<SettingsModal v-if="showSettingsModal" v-model="showSettingsModal" />
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import SettingsModal from '@/components/Settings/SettingsModal.vue'
|
|
||||||
import CRMLogo from '@/components/Icons/CRMLogo.vue'
|
import CRMLogo from '@/components/Icons/CRMLogo.vue'
|
||||||
import Apps from '@/components/Apps.vue'
|
import Apps from '@/components/Apps.vue'
|
||||||
import { sessionStore } from '@/stores/session'
|
import { sessionStore } from '@/stores/session'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
|
import { showSettingsModal } from '@/composables/settings'
|
||||||
import { Dropdown } from 'frappe-ui'
|
import { Dropdown } from 'frappe-ui'
|
||||||
import { computed, ref, markRaw} from 'vue'
|
import { computed, ref, markRaw} from 'vue'
|
||||||
|
|
||||||
@ -68,8 +67,6 @@ const { getUser } = usersStore()
|
|||||||
|
|
||||||
const user = computed(() => getUser() || {})
|
const user = computed(() => getUser() || {})
|
||||||
|
|
||||||
const showSettingsModal = ref(false)
|
|
||||||
|
|
||||||
let dropdownOptions = ref([
|
let dropdownOptions = ref([
|
||||||
{
|
{
|
||||||
group: 'Manage',
|
group: 'Manage',
|
||||||
|
|||||||
@ -33,3 +33,6 @@ createResource({
|
|||||||
export const mobileSidebarOpened = ref(false)
|
export const mobileSidebarOpened = ref(false)
|
||||||
|
|
||||||
export const isMobileView = computed(() => window.innerWidth < 768)
|
export const isMobileView = computed(() => window.innerWidth < 768)
|
||||||
|
|
||||||
|
export const showSettingsModal = ref(false)
|
||||||
|
export const activeSettingsPage = ref('')
|
||||||
Loading…
x
Reference in New Issue
Block a user