mirror of
https://github.com/frappe/lms.git
synced 2026-04-20 23:28:00 +03:00
feat: Frappe appointment booking for trial sites
(cherry picked from commit fde1c106c5)
This commit is contained in:
@@ -182,10 +182,13 @@
|
||||
</div>
|
||||
</template>
|
||||
</Tooltip>
|
||||
<Tooltip :text="__('Powered by Learning')">
|
||||
<Zap
|
||||
<Tooltip
|
||||
v-if="showAppointmentIcon"
|
||||
:text="__('Book a free onboarding session with the Frappe team')"
|
||||
>
|
||||
<Phone
|
||||
class="size-4 stroke-1.5 text-ink-gray-7 cursor-pointer"
|
||||
@click="redirectToWebsite()"
|
||||
@click="redirectToAppointmentScreen()"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip v-if="showOnboarding" :text="__('Help')">
|
||||
@@ -199,6 +202,12 @@
|
||||
"
|
||||
/>
|
||||
</Tooltip>
|
||||
<Tooltip :text="__('Powered by Frappe Learning')">
|
||||
<Zap
|
||||
class="size-4 stroke-1.5 text-ink-gray-7 cursor-pointer"
|
||||
@click="redirectToWebsite()"
|
||||
/>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<Tooltip
|
||||
:text="
|
||||
@@ -267,10 +276,11 @@ import {
|
||||
CircleAlert,
|
||||
ChevronRight,
|
||||
ChevronsRight,
|
||||
Plus,
|
||||
CircleHelp,
|
||||
FolderTree,
|
||||
FileText,
|
||||
Phone,
|
||||
Plus,
|
||||
User,
|
||||
UserPlus,
|
||||
Users,
|
||||
@@ -678,6 +688,36 @@ const profileIsComplete = computed(() => {
|
||||
)
|
||||
})
|
||||
|
||||
const showAppointmentIcon = computed(() => {
|
||||
let isTrialPlan = userResource.data?.site_info?.plan?.is_trial_plan
|
||||
let trialEndDate = calculateTrialEndDays(
|
||||
userResource.data?.site_info?.trial_end_date
|
||||
)
|
||||
return (
|
||||
userResource.data?.is_system_manager &&
|
||||
userResource.data?.is_fc_site &&
|
||||
isTrialPlan &&
|
||||
trialEndDate > 0
|
||||
)
|
||||
})
|
||||
|
||||
const calculateTrialEndDays = (trialEndDate) => {
|
||||
if (!trialEndDate) return 0
|
||||
|
||||
trialEndDate = new Date(trialEndDate)
|
||||
const today = new Date()
|
||||
const diffTime = trialEndDate - today
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
||||
return diffDays
|
||||
}
|
||||
|
||||
const redirectToAppointmentScreen = () => {
|
||||
window.open(
|
||||
'https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ0c7Z3XIpW1WgbeIuktSaoX6qudoYuSdRbIlJty5TW7p4IZaOk5viHQGwTNi6HpNVqzOZOTHcle',
|
||||
'_blank'
|
||||
)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
socket.off('publish_lms_notifications')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user