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>
<div class="h-full w-full">
<div
v-if="item.type == 'number-card'"
v-if="item.type == 'number_card'"
class="rounded shadow overflow-hidden cursor-pointer"
>
<Tooltip :text="item.tooltip">
@ -9,20 +9,20 @@
</Tooltip>
</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="editing ? 'border border-dashed border-outline-gray-2' : ''"
>
{{ editing ? __('Blank card') : '' }}
</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"
>
<AxisChart v-if="item.data" :config="item.data" />
</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"
>
<DonutChart v-if="item.data" :config="item.data" />

View File

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