fix: added TrialBanner in sidebar
This commit is contained in:
parent
37e535a28e
commit
65abf1131b
@ -73,6 +73,7 @@
|
||||
</div>
|
||||
<div class="m-2 flex flex-col gap-1">
|
||||
<SignupBanner :isSidebarCollapsed="isSidebarCollapsed" />
|
||||
<TrialBanner v-if="isFCSite" />
|
||||
<SidebarLink
|
||||
:label="isSidebarCollapsed ? __('Expand') : __('Collapse')"
|
||||
:isCollapsed="isSidebarCollapsed"
|
||||
@ -117,15 +118,17 @@ import {
|
||||
unreadNotificationsCount,
|
||||
notificationsStore,
|
||||
} from '@/stores/notifications'
|
||||
import { FeatherIcon } from 'frappe-ui'
|
||||
import { FeatherIcon, TrialBanner } from 'frappe-ui'
|
||||
import { useStorage } from '@vueuse/core'
|
||||
import { computed, h } from 'vue'
|
||||
import { ref, computed, h } from 'vue'
|
||||
|
||||
const { getPinnedViews, getPublicViews } = viewsStore()
|
||||
const { toggle: toggleNotificationPanel } = notificationsStore()
|
||||
|
||||
const isSidebarCollapsed = useStorage('isSidebarCollapsed', false)
|
||||
|
||||
const isFCSite = ref(window.is_fc_site)
|
||||
|
||||
const links = [
|
||||
{
|
||||
label: 'Leads',
|
||||
|
||||
@ -1,10 +1,23 @@
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { call } from 'frappe-ui'
|
||||
import { createResource } from 'frappe-ui'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const frappeCloudBaseEndpoint = 'https://frappecloud.com'
|
||||
const isPaymentModeAdded = ref(false)
|
||||
|
||||
export const currentSiteInfo = createResource({
|
||||
url: 'frappe.integrations.frappe_providers.frappecloud_billing.current_site_info',
|
||||
cache: 'currentSiteInfo',
|
||||
onSuccess: (data) => {
|
||||
isPaymentModeAdded.value = data.is_payment_method_added
|
||||
},
|
||||
})
|
||||
|
||||
export const confirmLoginToFrappeCloud = () => {
|
||||
currentSiteInfo.fetch()
|
||||
|
||||
const { $dialog } = globalStore()
|
||||
|
||||
$dialog({
|
||||
title: __('Login to Frappe Cloud?'),
|
||||
message: __(
|
||||
@ -24,19 +37,13 @@ export const confirmLoginToFrappeCloud = () => {
|
||||
}
|
||||
|
||||
const loginToFrappeCloud = () => {
|
||||
call(
|
||||
'frappe.integrations.frappe_providers.frappecloud_billing.current_site_info',
|
||||
).then((response) => {
|
||||
if (!response) return
|
||||
let redirectRoute = ''
|
||||
|
||||
let redirectRoute = ''
|
||||
if (isPaymentModeAdded.value) {
|
||||
redirectRoute = '/dashboard'
|
||||
} else {
|
||||
redirectRoute = '/dashboard/welcome'
|
||||
}
|
||||
|
||||
if (response.is_payment_method_added) {
|
||||
redirectRoute = '/dashboard'
|
||||
} else {
|
||||
redirectRoute = '/dashboard/welcome'
|
||||
}
|
||||
|
||||
window.open(`${frappeCloudBaseEndpoint}${redirectRoute}`, '_blank')
|
||||
})
|
||||
window.open(`${frappeCloudBaseEndpoint}${redirectRoute}`, '_blank')
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user