@lobb-js/lobb-ext-reports 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,10 @@
23
23
  filter: { id: reportId },
24
24
  });
25
25
  report = (await reportsRes.json()).data[0];
26
+ if (!report) {
27
+ if (showLoading) loading = false;
28
+ return;
29
+ }
26
30
 
27
31
  const chartsRes = await utils.lobb.findAll("reports_charts", {
28
32
  filter: { report_id: report.id },
@@ -70,13 +74,21 @@
70
74
  <div class="text-xs text-muted-foreground">Loading all the charts of the selected dashboard</div>
71
75
  </div>
72
76
  </div>
77
+ {:else if !report}
78
+ <div class="flex h-full w-full flex-col items-center justify-center gap-4" style="grid-row: 1 / -1">
79
+ <Icons.CircleSlash2 class="opacity-50" size="50" />
80
+ <div class="flex flex-col items-center justify-center">
81
+ <div class="text-muted-foreground">Report not found</div>
82
+ <div class="text-xs text-muted-foreground">The report you're looking for doesn't exist or couldn't be loaded</div>
83
+ </div>
84
+ </div>
73
85
  {:else}
74
86
  <div class="flex shrink-0 items-center justify-between gap-2 border-b bg-background p-2">
75
87
  <div class="flex gap-2">
76
88
  <div class="mt-1"><SidebarTrigger /></div>
77
89
  <div class="flex flex-col justify-center">
78
- <h2 class="font-medium text-primary">{report.name}</h2>
79
- <div class="text-xs text-muted-foreground">{report.description}</div>
90
+ <h2 class="font-medium text-primary">{report?.name}</h2>
91
+ <div class="text-xs text-muted-foreground">{report?.description}</div>
80
92
  </div>
81
93
  </div>
82
94
  <div class="flex items-center gap-2 self-end">
@@ -30,6 +30,7 @@
30
30
  for (let index = 0; index < allReports.length; index++) {
31
31
  const report = allReports[index];
32
32
  localSideBarData.push({
33
+ type: "element",
33
34
  name: report.name,
34
35
  icon: icons.FileChartColumn,
35
36
  onclick: () => {
@@ -12,6 +12,7 @@ export default function extension(): Extension {
12
12
  return {
13
13
  version: packageJson.version,
14
14
  name: "reports",
15
+ icon: "ChartNoAxesCombined",
15
16
  collectionRoutes: collectionRoutes,
16
17
  collections: collections,
17
18
  relations: relations,
@@ -23,6 +23,10 @@
23
23
  filter: { id: reportId },
24
24
  });
25
25
  report = (await reportsRes.json()).data[0];
26
+ if (!report) {
27
+ if (showLoading) loading = false;
28
+ return;
29
+ }
26
30
 
27
31
  const chartsRes = await utils.lobb.findAll("reports_charts", {
28
32
  filter: { report_id: report.id },
@@ -70,13 +74,21 @@
70
74
  <div class="text-xs text-muted-foreground">Loading all the charts of the selected dashboard</div>
71
75
  </div>
72
76
  </div>
77
+ {:else if !report}
78
+ <div class="flex h-full w-full flex-col items-center justify-center gap-4" style="grid-row: 1 / -1">
79
+ <Icons.CircleSlash2 class="opacity-50" size="50" />
80
+ <div class="flex flex-col items-center justify-center">
81
+ <div class="text-muted-foreground">Report not found</div>
82
+ <div class="text-xs text-muted-foreground">The report you're looking for doesn't exist or couldn't be loaded</div>
83
+ </div>
84
+ </div>
73
85
  {:else}
74
86
  <div class="flex shrink-0 items-center justify-between gap-2 border-b bg-background p-2">
75
87
  <div class="flex gap-2">
76
88
  <div class="mt-1"><SidebarTrigger /></div>
77
89
  <div class="flex flex-col justify-center">
78
- <h2 class="font-medium text-primary">{report.name}</h2>
79
- <div class="text-xs text-muted-foreground">{report.description}</div>
90
+ <h2 class="font-medium text-primary">{report?.name}</h2>
91
+ <div class="text-xs text-muted-foreground">{report?.description}</div>
80
92
  </div>
81
93
  </div>
82
94
  <div class="flex items-center gap-2 self-end">
@@ -30,6 +30,7 @@
30
30
  for (let index = 0; index < allReports.length; index++) {
31
31
  const report = allReports[index];
32
32
  localSideBarData.push({
33
+ type: "element",
33
34
  name: report.name,
34
35
  icon: icons.FileChartColumn,
35
36
  onclick: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobb-js/lobb-ext-reports",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -34,7 +34,7 @@
34
34
  "package": "svelte-package --input extensions/reports/studio"
35
35
  },
36
36
  "dependencies": {
37
- "@lobb-js/core": "^0.26.1",
37
+ "@lobb-js/core": "^0.29.0",
38
38
  "chart.js": "^4.4.8",
39
39
  "gridstack": "^12.6.0",
40
40
  "hono": "^4.7.0",
@@ -46,7 +46,7 @@
46
46
  "devDependencies": {
47
47
  "@faker-js/faker": "^9.6.0",
48
48
  "@playwright/test": "^1.58.2",
49
- "@lobb-js/studio": "^0.24.0",
49
+ "@lobb-js/studio": "^0.26.0",
50
50
  "@lucide/svelte": "^0.563.1",
51
51
  "@sveltejs/adapter-node": "^5.5.4",
52
52
  "@sveltejs/kit": "^2.55.0",