mirror of
https://github.com/frappe/lms.git
synced 2026-05-01 21:19:31 +03:00
Merge pull request #2203 from frappe/mergify/bp/main-hotfix/pr-2202
feat: Frappe appointment booking for trial sites (backport #2202)
This commit is contained in:
@@ -182,10 +182,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip :text="__('Powered by Learning')">
|
<Tooltip
|
||||||
<Zap
|
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"
|
class="size-4 stroke-1.5 text-ink-gray-7 cursor-pointer"
|
||||||
@click="redirectToWebsite()"
|
@click="redirectToAppointmentScreen()"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip v-if="showOnboarding" :text="__('Help')">
|
<Tooltip v-if="showOnboarding" :text="__('Help')">
|
||||||
@@ -199,6 +202,12 @@
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
<Tooltip :text="__('Powered by Frappe Learning')">
|
||||||
|
<Zap
|
||||||
|
class="size-4 stroke-1.5 text-ink-gray-7 cursor-pointer"
|
||||||
|
@click="redirectToWebsite()"
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
:text="
|
:text="
|
||||||
@@ -267,10 +276,11 @@ import {
|
|||||||
CircleAlert,
|
CircleAlert,
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
ChevronsRight,
|
ChevronsRight,
|
||||||
Plus,
|
|
||||||
CircleHelp,
|
CircleHelp,
|
||||||
FolderTree,
|
FolderTree,
|
||||||
FileText,
|
FileText,
|
||||||
|
Phone,
|
||||||
|
Plus,
|
||||||
User,
|
User,
|
||||||
UserPlus,
|
UserPlus,
|
||||||
Users,
|
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(() => {
|
onUnmounted(() => {
|
||||||
socket.off('publish_lms_notifications')
|
socket.off('publish_lms_notifications')
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user