fix: load dashboard layout from CRM Dashboard doctype and render

(cherry picked from commit fd38f0ac985360eae2e370e86b3e8dd5a8baa587)
This commit is contained in:
Shariq Ansari 2025-07-14 14:16:10 +05:30 committed by Mergify
parent 8defe6285f
commit 1be736cb6f
3 changed files with 504 additions and 508 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="h-full w-full"> <div class="h-full w-full">
<div <div
v-if="item.type == 'number-card'" v-if="item.type == 'number_card'"
class="rounded shadow overflow-hidden cursor-pointer" class="rounded shadow overflow-hidden cursor-pointer"
> >
<Tooltip :text="item.tooltip"> <Tooltip :text="item.tooltip">
@ -9,20 +9,20 @@
</Tooltip> </Tooltip>
</div> </div>
<div <div
v-else-if="item.type == 'blank-card'" v-else-if="item.type == 'blank_card'"
class="rounded bg-surface-white h-full overflow-hidden text-ink-gray-5 flex items-center justify-center" class="rounded bg-surface-white h-full overflow-hidden text-ink-gray-5 flex items-center justify-center"
:class="editing ? 'border border-dashed border-outline-gray-2' : ''" :class="editing ? 'border border-dashed border-outline-gray-2' : ''"
> >
{{ editing ? __('Blank card') : '' }} {{ editing ? __('Blank card') : '' }}
</div> </div>
<div <div
v-else-if="item.type == 'axis-card'" v-else-if="item.type == 'axis_card'"
class="h-full w-full rounded-md bg-surface-white shadow" class="h-full w-full rounded-md bg-surface-white shadow"
> >
<AxisChart v-if="item.data" :config="item.data" /> <AxisChart v-if="item.data" :config="item.data" />
</div> </div>
<div <div
v-else-if="item.type == 'donut-card'" v-else-if="item.type == 'donut_card'"
class="h-full w-full rounded-md bg-surface-white shadow overflow-hidden" class="h-full w-full rounded-md bg-surface-white shadow overflow-hidden"
> >
<DonutChart v-if="item.data" :config="item.data" /> <DonutChart v-if="item.data" :config="item.data" />

View File

@ -19,7 +19,6 @@
<LucidePenLine class="size-4" /> <LucidePenLine class="size-4" />
</template> </template>
</Button> </Button>
<Button v-if="editing" :label="__('Cancel')" @click="cancel" />
<Button <Button
v-if="editing" v-if="editing"
variant="solid" variant="solid"
@ -215,8 +214,8 @@ const options = computed(() => [
]) ])
const dashboardItems = createResource({ const dashboardItems = createResource({
url: 'crm.api.dashboard.get_dashboard_items', url: 'crm.api.dashboard.get_dashboard',
cache: ['Analytics', 'DashboardItems'], cache: ['Analytics', 'ManagerDashboard'],
makeParams() { makeParams() {
return { return {
from_date: fromDate.value, from_date: fromDate.value,