@hed-hog/catalog 0.0.285 → 0.0.286

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.
@@ -14,6 +14,7 @@ import {
14
14
  CardHeader,
15
15
  CardTitle,
16
16
  } from '@/components/ui/card';
17
+ import { KpiCardsGrid } from '@/components/ui/kpi-cards-grid';
17
18
  import { Skeleton } from '@/components/ui/skeleton';
18
19
  import { useApp, useQuery } from '@hed-hog/next-app-provider';
19
20
  import {
@@ -126,7 +127,28 @@ export default function CatalogDashboardPage() {
126
127
  (item) => item.resource === resourceKey
127
128
  )!;
128
129
  const stats = statsMap.get(resourceKey);
129
- return { resource, total: stats?.total ?? 0, active: stats?.active };
130
+ const total = stats?.total ?? 0;
131
+ const active = stats?.active;
132
+
133
+ return {
134
+ key: resource.resource,
135
+ title: t(`resources.${resource.translationKey}.shortTitle`),
136
+ value: total,
137
+ description: (
138
+ <div className="flex items-center justify-between gap-3 text-sm text-muted-foreground">
139
+ <span>{t('dashboard.card.totalLabel')}</span>
140
+ <span>
141
+ {typeof active === 'number'
142
+ ? t('dashboard.card.activeLabel', { count: active })
143
+ : t('dashboard.card.noActiveLabel')}
144
+ </span>
145
+ </div>
146
+ ),
147
+ icon: resource.icon,
148
+ accentClassName: resource.colorClass,
149
+ iconContainerClassName: resource.glowClass,
150
+ loading: isLoading,
151
+ };
130
152
  });
131
153
 
132
154
  const volumeChartData = [...catalogResources]
@@ -253,45 +275,7 @@ export default function CatalogDashboardPage() {
253
275
  </CardContent>
254
276
  </Card>
255
277
 
256
- <div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
257
- {kpiCards.map(({ resource, total, active }) => {
258
- const Icon = resource.icon;
259
-
260
- return (
261
- <Card
262
- key={resource.resource}
263
- className="overflow-hidden border-border/70 py-0"
264
- >
265
- <div
266
- className={`h-1 w-full bg-gradient-to-r ${resource.colorClass}`}
267
- />
268
- <CardContent className="space-y-4 px-6 py-5">
269
- <div className="flex items-start justify-between gap-3">
270
- <div>
271
- <p className="text-xs uppercase tracking-[0.2em] text-muted-foreground">
272
- {t(`resources.${resource.translationKey}.shortTitle`)}
273
- </p>
274
- <p className="mt-2 text-3xl font-semibold tracking-tight">
275
- {isLoading ? '-' : total}
276
- </p>
277
- </div>
278
- <div className={`rounded-2xl p-3 ${resource.glowClass}`}>
279
- <Icon className="size-5" />
280
- </div>
281
- </div>
282
- <div className="flex items-center justify-between text-sm text-muted-foreground">
283
- <span>{t('dashboard.card.totalLabel')}</span>
284
- <span>
285
- {typeof active === 'number'
286
- ? t('dashboard.card.activeLabel', { count: active })
287
- : t('dashboard.card.noActiveLabel')}
288
- </span>
289
- </div>
290
- </CardContent>
291
- </Card>
292
- );
293
- })}
294
- </div>
278
+ <KpiCardsGrid items={kpiCards} />
295
279
 
296
280
  <div className="grid min-w-0 gap-6 xl:grid-cols-[minmax(0,1.3fr)_minmax(320px,0.9fr)]">
297
281
  <Card className="min-w-0">
@@ -34,13 +34,13 @@
34
34
  "secondaryAction": "View imports",
35
35
  "summary": {
36
36
  "totalRecords": "Total records",
37
- "activeRecords": "Active monitored",
37
+ "activeRecords": "Active/published monitored",
38
38
  "monitoredResources": "Resources with data"
39
39
  },
40
40
  "card": {
41
41
  "totalLabel": "Total",
42
- "activeLabel": "{count} active",
43
- "noActiveLabel": "No active metric"
42
+ "activeLabel": "{count} active/published",
43
+ "noActiveLabel": "No tracked status metric"
44
44
  },
45
45
  "charts": {
46
46
  "volume": {
@@ -48,8 +48,8 @@
48
48
  "description": "Comparison across the catalog resources with the largest record sets."
49
49
  },
50
50
  "status": {
51
- "title": "Active vs other records",
52
- "description": "Status view across the {count} resources that expose active metrics."
51
+ "title": "Tracked status vs other records",
52
+ "description": "Status view across the {count} resources that expose tracked status metrics."
53
53
  },
54
54
  "distribution": {
55
55
  "title": "Volume distribution",
@@ -59,7 +59,7 @@
59
59
  "ranking": {
60
60
  "title": "Resource ranking",
61
61
  "description": "The largest catalog areas right now.",
62
- "activeCount": "{count} active"
62
+ "activeCount": "{count} active/published"
63
63
  },
64
64
  "quickActions": {
65
65
  "itemHint": "Quick access"
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "kpis": {
93
93
  "total": "Resource total",
94
- "active": "Active",
94
+ "active": "Active/published",
95
95
  "visible": "Visible records",
96
96
  "activeInSlice": "Active in slice",
97
97
  "inStockInSlice": "In stock in slice",
@@ -111,7 +111,9 @@
111
111
  "active": "Active",
112
112
  "inactive": "Inactive",
113
113
  "draft": "Draft",
114
- "published": "Published"
114
+ "published": "Published",
115
+ "archived": "Archived",
116
+ "hidden": "Hidden"
115
117
  },
116
118
  "availability_status": {
117
119
  "inStock": "In stock",
@@ -175,13 +177,14 @@
175
177
  "active": "Active",
176
178
  "inactive": "Inactive",
177
179
  "draft": "Draft",
178
- "published": "Published"
180
+ "published": "Published",
181
+ "archived": "Archived",
182
+ "hidden": "Hidden"
179
183
  },
180
184
  "comparison_status": {
181
- "active": "Active",
182
- "inactive": "Inactive",
183
185
  "draft": "Draft",
184
- "published": "Published"
186
+ "ready": "Ready",
187
+ "disabled": "Disabled"
185
188
  },
186
189
  "availability_status": {
187
190
  "in_stock": "In stock",
@@ -34,13 +34,13 @@
34
34
  "secondaryAction": "Ver importacoes",
35
35
  "summary": {
36
36
  "totalRecords": "Registros totais",
37
- "activeRecords": "Ativos monitorados",
37
+ "activeRecords": "Ativos/publicados monitorados",
38
38
  "monitoredResources": "Recursos com dados"
39
39
  },
40
40
  "card": {
41
41
  "totalLabel": "Total",
42
- "activeLabel": "{count} ativos",
43
- "noActiveLabel": "Sem indicador de ativo"
42
+ "activeLabel": "{count} ativos/publicados",
43
+ "noActiveLabel": "Sem indicador de status monitorado"
44
44
  },
45
45
  "charts": {
46
46
  "volume": {
@@ -48,8 +48,8 @@
48
48
  "description": "Comparativo entre os recursos com mais registros no catalogo."
49
49
  },
50
50
  "status": {
51
- "title": "Ativos x demais registros",
52
- "description": "Leitura dos {count} recursos que expõem estatistica de status."
51
+ "title": "Status monitorado x demais registros",
52
+ "description": "Leitura dos {count} recursos que expoem metricas de status monitorado."
53
53
  },
54
54
  "distribution": {
55
55
  "title": "Distribuicao do volume",
@@ -59,7 +59,7 @@
59
59
  "ranking": {
60
60
  "title": "Ranking de recursos",
61
61
  "description": "Os modulos mais volumosos do catalogo neste momento.",
62
- "activeCount": "{count} ativos"
62
+ "activeCount": "{count} ativos/publicados"
63
63
  },
64
64
  "quickActions": {
65
65
  "itemHint": "Acesso rapido"
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "kpis": {
93
93
  "total": "Total do recurso",
94
- "active": "Ativos",
94
+ "active": "Ativos/publicados",
95
95
  "visible": "Registros exibidos",
96
96
  "activeInSlice": "Ativos no recorte",
97
97
  "inStockInSlice": "Em estoque no recorte",
@@ -111,7 +111,9 @@
111
111
  "active": "Ativo",
112
112
  "inactive": "Inativo",
113
113
  "draft": "Rascunho",
114
- "published": "Publicado"
114
+ "published": "Publicado",
115
+ "archived": "Arquivado",
116
+ "hidden": "Oculto"
115
117
  },
116
118
  "availability_status": {
117
119
  "inStock": "Em estoque",
@@ -175,13 +177,14 @@
175
177
  "active": "Ativo",
176
178
  "inactive": "Inativo",
177
179
  "draft": "Rascunho",
178
- "published": "Publicado"
180
+ "published": "Publicado",
181
+ "archived": "Arquivado",
182
+ "hidden": "Oculto"
179
183
  },
180
184
  "comparison_status": {
181
- "active": "Ativo",
182
- "inactive": "Inativo",
183
185
  "draft": "Rascunho",
184
- "published": "Publicado"
186
+ "ready": "Pronto",
187
+ "disabled": "Desabilitado"
185
188
  },
186
189
  "availability_status": {
187
190
  "in_stock": "Em estoque",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hed-hog/catalog",
3
- "version": "0.0.285",
3
+ "version": "0.0.286",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -9,14 +9,14 @@
9
9
  "@nestjs/core": "^11",
10
10
  "@nestjs/jwt": "^11",
11
11
  "@nestjs/mapped-types": "*",
12
- "@hed-hog/core": "0.0.285",
13
- "@hed-hog/api-prisma": "0.0.5",
14
12
  "@hed-hog/api-pagination": "0.0.6",
15
- "@hed-hog/api": "0.0.4",
16
- "@hed-hog/content": "0.0.285",
17
13
  "@hed-hog/api-locale": "0.0.13",
18
- "@hed-hog/category": "0.0.285",
19
- "@hed-hog/tag": "0.0.285"
14
+ "@hed-hog/api": "0.0.4",
15
+ "@hed-hog/category": "0.0.286",
16
+ "@hed-hog/core": "0.0.286",
17
+ "@hed-hog/api-prisma": "0.0.5",
18
+ "@hed-hog/content": "0.0.286",
19
+ "@hed-hog/tag": "0.0.286"
20
20
  },
21
21
  "exports": {
22
22
  ".": {