@hedhog/admin 0.48.6 → 0.48.7

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.
Files changed (170) hide show
  1. package/dist/admin.module.d.ts.map +1 -1
  2. package/dist/admin.module.js +2 -0
  3. package/dist/admin.module.js.map +1 -1
  4. package/dist/auth/consts/body.d.ts.map +1 -1
  5. package/dist/dashboard/dashboard/dashboard.controller.d.ts +22 -0
  6. package/dist/dashboard/dashboard/dashboard.controller.d.ts.map +1 -0
  7. package/dist/dashboard/dashboard/dashboard.controller.js +88 -0
  8. package/dist/dashboard/dashboard/dashboard.controller.js.map +1 -0
  9. package/dist/dashboard/dashboard/dashboard.module.d.ts +3 -0
  10. package/dist/dashboard/dashboard/dashboard.module.d.ts.map +1 -0
  11. package/dist/dashboard/dashboard/dashboard.module.js +26 -0
  12. package/dist/dashboard/dashboard/dashboard.module.js.map +1 -0
  13. package/dist/dashboard/dashboard/dashboard.service.d.ts +30 -0
  14. package/dist/dashboard/dashboard/dashboard.service.d.ts.map +1 -0
  15. package/dist/dashboard/dashboard/dashboard.service.js +61 -0
  16. package/dist/dashboard/dashboard/dashboard.service.js.map +1 -0
  17. package/dist/dashboard/dashboard/dto/create.dto.d.ts +5 -0
  18. package/dist/dashboard/dashboard/dto/create.dto.d.ts.map +1 -0
  19. package/dist/dashboard/dashboard/dto/create.dto.js +23 -0
  20. package/dist/dashboard/dashboard/dto/create.dto.js.map +1 -0
  21. package/dist/dashboard/dashboard/dto/update.dto.d.ts +6 -0
  22. package/dist/dashboard/dashboard/dto/update.dto.d.ts.map +1 -0
  23. package/dist/dashboard/dashboard/dto/update.dto.js +9 -0
  24. package/dist/dashboard/dashboard/dto/update.dto.js.map +1 -0
  25. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +22 -0
  26. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts.map +1 -0
  27. package/dist/dashboard/dashboard-component/dashboard-component.controller.js +90 -0
  28. package/dist/dashboard/dashboard-component/dashboard-component.controller.js.map +1 -0
  29. package/dist/dashboard/dashboard-component/dashboard-component.module.d.ts +3 -0
  30. package/dist/dashboard/dashboard-component/dashboard-component.module.d.ts.map +1 -0
  31. package/dist/dashboard/dashboard-component/dashboard-component.module.js +26 -0
  32. package/dist/dashboard/dashboard-component/dashboard-component.module.js.map +1 -0
  33. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +30 -0
  34. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts.map +1 -0
  35. package/dist/dashboard/dashboard-component/dashboard-component.service.js +59 -0
  36. package/dist/dashboard/dashboard-component/dashboard-component.service.js.map +1 -0
  37. package/dist/dashboard/dashboard-component/dto/create.dto.d.ts +13 -0
  38. package/dist/dashboard/dashboard-component/dto/create.dto.d.ts.map +1 -0
  39. package/dist/dashboard/dashboard-component/dto/create.dto.js +59 -0
  40. package/dist/dashboard/dashboard-component/dto/create.dto.js.map +1 -0
  41. package/dist/dashboard/dashboard-component/dto/update.dto.d.ts +6 -0
  42. package/dist/dashboard/dashboard-component/dto/update.dto.d.ts.map +1 -0
  43. package/dist/dashboard/dashboard-component/dto/update.dto.js +9 -0
  44. package/dist/dashboard/dashboard-component/dto/update.dto.js.map +1 -0
  45. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +52 -0
  46. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts.map +1 -0
  47. package/dist/dashboard/dashboard-item/dashboard-item.controller.js +88 -0
  48. package/dist/dashboard/dashboard-item/dashboard-item.controller.js.map +1 -0
  49. package/dist/dashboard/dashboard-item/dashboard-item.module.d.ts +3 -0
  50. package/dist/dashboard/dashboard-item/dashboard-item.module.d.ts.map +1 -0
  51. package/dist/dashboard/dashboard-item/dashboard-item.module.js +26 -0
  52. package/dist/dashboard/dashboard-item/dashboard-item.module.js.map +1 -0
  53. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +57 -0
  54. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts.map +1 -0
  55. package/dist/dashboard/dashboard-item/dashboard-item.service.js +77 -0
  56. package/dist/dashboard/dashboard-item/dashboard-item.service.js.map +1 -0
  57. package/dist/dashboard/dashboard-item/dto/create.dto.d.ts +9 -0
  58. package/dist/dashboard/dashboard-item/dto/create.dto.d.ts.map +1 -0
  59. package/dist/dashboard/dashboard-item/dto/create.dto.js +41 -0
  60. package/dist/dashboard/dashboard-item/dto/create.dto.js.map +1 -0
  61. package/dist/dashboard/dashboard-item/dto/update.dto.d.ts +6 -0
  62. package/dist/dashboard/dashboard-item/dto/update.dto.d.ts.map +1 -0
  63. package/dist/dashboard/dashboard-item/dto/update.dto.js +9 -0
  64. package/dist/dashboard/dashboard-item/dto/update.dto.js.map +1 -0
  65. package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts +52 -0
  66. package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts.map +1 -0
  67. package/dist/dashboard/dashboard-user/dashboard-user.controller.js +88 -0
  68. package/dist/dashboard/dashboard-user/dashboard-user.controller.js.map +1 -0
  69. package/dist/dashboard/dashboard-user/dashboard-user.module.d.ts +3 -0
  70. package/dist/dashboard/dashboard-user/dashboard-user.module.d.ts.map +1 -0
  71. package/dist/dashboard/dashboard-user/dashboard-user.module.js +26 -0
  72. package/dist/dashboard/dashboard-user/dashboard-user.module.js.map +1 -0
  73. package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts +59 -0
  74. package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts.map +1 -0
  75. package/dist/dashboard/dashboard-user/dashboard-user.service.js +83 -0
  76. package/dist/dashboard/dashboard-user/dashboard-user.service.js.map +1 -0
  77. package/dist/dashboard/dashboard-user/dto/create.dto.d.ts +10 -0
  78. package/dist/dashboard/dashboard-user/dto/create.dto.d.ts.map +1 -0
  79. package/dist/dashboard/dashboard-user/dto/create.dto.js +42 -0
  80. package/dist/dashboard/dashboard-user/dto/create.dto.js.map +1 -0
  81. package/dist/dashboard/dashboard-user/dto/update.dto.d.ts +6 -0
  82. package/dist/dashboard/dashboard-user/dto/update.dto.d.ts.map +1 -0
  83. package/dist/dashboard/dashboard-user/dto/update.dto.js +9 -0
  84. package/dist/dashboard/dashboard-user/dto/update.dto.js.map +1 -0
  85. package/dist/dashboard/dashboard.module.d.ts +3 -0
  86. package/dist/dashboard/dashboard.module.d.ts.map +1 -0
  87. package/dist/dashboard/dashboard.module.js +35 -0
  88. package/dist/dashboard/dashboard.module.js.map +1 -0
  89. package/dist/dashboard/index.d.ts +2 -0
  90. package/dist/dashboard/index.d.ts.map +1 -0
  91. package/dist/dashboard/index.js +18 -0
  92. package/dist/dashboard/index.js.map +1 -0
  93. package/dist/emails/lib.d.ts.map +1 -1
  94. package/frontend/dashboard/components/create-panel.tsx.ejs +63 -0
  95. package/frontend/dashboard/components/dashboard.screen.tsx.ejs +116 -0
  96. package/frontend/dashboard/components/update-panel.tsx.ejs +80 -0
  97. package/frontend/dashboard/locales/en/dashboard.dashboard.json +11 -0
  98. package/frontend/dashboard/locales/pt/dashboard.dashboard.json +11 -0
  99. package/frontend/dashboard/react-query/handlers.ts.ejs +28 -0
  100. package/frontend/dashboard/react-query/requests.ts.ejs +56 -0
  101. package/frontend/dashboard-component/components/create-panel.tsx.ejs +130 -0
  102. package/frontend/dashboard-component/components/dashboard-component.screen.tsx.ejs +135 -0
  103. package/frontend/dashboard-component/components/update-panel.tsx.ejs +164 -0
  104. package/frontend/dashboard-component/locales/en/dashboard.dashboard-component.json +11 -0
  105. package/frontend/dashboard-component/locales/pt/dashboard.dashboard-component.json +11 -0
  106. package/frontend/dashboard-component/react-query/handlers.ts.ejs +28 -0
  107. package/frontend/dashboard-component/react-query/requests.ts.ejs +61 -0
  108. package/frontend/dashboard-item/components/create-panel.tsx.ejs +108 -0
  109. package/frontend/dashboard-item/components/dashboard-item.screen.tsx.ejs +133 -0
  110. package/frontend/dashboard-item/components/update-panel.tsx.ejs +141 -0
  111. package/frontend/dashboard-item/locales/en/dashboard.dashboard-item.json +11 -0
  112. package/frontend/dashboard-item/locales/pt/dashboard.dashboard-item.json +11 -0
  113. package/frontend/dashboard-item/react-query/handlers.ts.ejs +28 -0
  114. package/frontend/dashboard-item/react-query/requests.ts.ejs +58 -0
  115. package/frontend/dashboard-user/components/create-panel.tsx.ejs +108 -0
  116. package/frontend/dashboard-user/components/dashboard-user.screen.tsx.ejs +131 -0
  117. package/frontend/dashboard-user/components/update-panel.tsx.ejs +138 -0
  118. package/frontend/dashboard-user/locales/en/dashboard.dashboard-user.json +11 -0
  119. package/frontend/dashboard-user/locales/pt/dashboard.dashboard-user.json +11 -0
  120. package/frontend/dashboard-user/react-query/handlers.ts.ejs +28 -0
  121. package/frontend/dashboard-user/react-query/requests.ts.ejs +58 -0
  122. package/frontend/translation/fields/en.json +23 -1
  123. package/frontend/translation/fields/pt.json +27 -1
  124. package/frontend/translation/modules/en.json +6 -1
  125. package/frontend/translation/modules/pt.json +6 -1
  126. package/hedhog.yaml +439 -0
  127. package/package.json +2 -2
  128. package/src/admin.module.ts +2 -0
  129. package/src/dashboard/dashboard/dashboard.controller.ts +49 -0
  130. package/src/dashboard/dashboard/dashboard.module.ts +13 -0
  131. package/src/dashboard/dashboard/dashboard.service.ts +71 -0
  132. package/src/dashboard/dashboard/dto/create.dto.ts +8 -0
  133. package/src/dashboard/dashboard/dto/update.dto.ts +4 -0
  134. package/src/dashboard/dashboard-component/dashboard-component.controller.ts +55 -0
  135. package/src/dashboard/dashboard-component/dashboard-component.module.ts +14 -0
  136. package/src/dashboard/dashboard-component/dashboard-component.service.ts +70 -0
  137. package/src/dashboard/dashboard-component/dto/create.dto.ts +36 -0
  138. package/src/dashboard/dashboard-component/dto/update.dto.ts +4 -0
  139. package/src/dashboard/dashboard-item/dashboard-item.controller.ts +55 -0
  140. package/src/dashboard/dashboard-item/dashboard-item.module.ts +13 -0
  141. package/src/dashboard/dashboard-item/dashboard-item.service.ts +82 -0
  142. package/src/dashboard/dashboard-item/dto/create.dto.ts +22 -0
  143. package/src/dashboard/dashboard-item/dto/update.dto.ts +4 -0
  144. package/src/dashboard/dashboard-user/dashboard-user.controller.ts +55 -0
  145. package/src/dashboard/dashboard-user/dashboard-user.module.ts +13 -0
  146. package/src/dashboard/dashboard-user/dashboard-user.service.ts +89 -0
  147. package/src/dashboard/dashboard-user/dto/create.dto.ts +22 -0
  148. package/src/dashboard/dashboard-user/dto/update.dto.ts +4 -0
  149. package/src/dashboard/dashboard.module.ts +22 -0
  150. package/src/dashboard/index.ts +1 -0
  151. package/frontend/menu-locale/locales/en/admin.menu-locale.json +0 -11
  152. package/frontend/menu-locale/locales/pt/admin.menu-locale.json +0 -11
  153. package/frontend/menu-screen/locales/en/admin.menu-screen.json +0 -11
  154. package/frontend/menu-screen/locales/pt/admin.menu-screen.json +0 -11
  155. package/frontend/multifactor-locale/locales/en/admin.multifactor-locale.json +0 -11
  156. package/frontend/multifactor-locale/locales/pt/admin.multifactor-locale.json +0 -11
  157. package/frontend/screen-locale/locales/en/admin.screen-locale.json +0 -11
  158. package/frontend/screen-locale/locales/pt/admin.screen-locale.json +0 -11
  159. package/frontend/translation/components/create-panel.tsx.ejs +0 -52
  160. package/frontend/translation/components/update-panel.tsx.ejs +0 -67
  161. package/frontend/translation/locales/en/admin.translation.json +0 -11
  162. package/frontend/translation/locales/pt/admin.translation.json +0 -11
  163. package/frontend/translation/react-query/handlers.ts.ejs +0 -28
  164. package/frontend/translation/react-query/requests.ts.ejs +0 -58
  165. package/frontend/translation-namespace/components/create-panel.tsx.ejs +0 -53
  166. package/frontend/translation-namespace/components/update-panel.tsx.ejs +0 -70
  167. package/frontend/translation-namespace/locales/en/admin.translation-namespace.json +0 -11
  168. package/frontend/translation-namespace/locales/pt/admin.translation-namespace.json +0 -11
  169. package/frontend/translation-namespace/react-query/handlers.ts.ejs +0 -28
  170. package/frontend/translation-namespace/react-query/requests.ts.ejs +0 -60
package/hedhog.yaml CHANGED
@@ -223,6 +223,126 @@ data:
223
223
  - url: /menu-screen
224
224
  method: DELETE
225
225
  relations: *a7
226
+ - url: /dashboard
227
+ method: GET
228
+ relations:
229
+ role:
230
+ - where:
231
+ slug: admin
232
+ - url: /dashboard
233
+ method: POST
234
+ relations:
235
+ role:
236
+ - where:
237
+ slug: admin
238
+ - url: /dashboard/:id
239
+ method: GET
240
+ relations:
241
+ role:
242
+ - where:
243
+ slug: admin
244
+ - url: /dashboard/:id
245
+ method: PATCH
246
+ relations:
247
+ role:
248
+ - where:
249
+ slug: admin
250
+ - url: /dashboard
251
+ method: DELETE
252
+ relations:
253
+ role:
254
+ - where:
255
+ slug: admin
256
+ - url: /dashboard-component
257
+ method: GET
258
+ relations:
259
+ role:
260
+ - where:
261
+ slug: admin
262
+ - url: /dashboard-component
263
+ method: POST
264
+ relations:
265
+ role:
266
+ - where:
267
+ slug: admin
268
+ - url: /dashboard-component/:id
269
+ method: GET
270
+ relations:
271
+ role:
272
+ - where:
273
+ slug: admin
274
+ - url: /dashboard-component/:id
275
+ method: PATCH
276
+ relations:
277
+ role:
278
+ - where:
279
+ slug: admin
280
+ - url: /dashboard-component
281
+ method: DELETE
282
+ relations:
283
+ role:
284
+ - where:
285
+ slug: admin
286
+ - url: /dashboard-item
287
+ method: GET
288
+ relations:
289
+ role:
290
+ - where:
291
+ slug: admin
292
+ - url: /dashboard-item
293
+ method: POST
294
+ relations:
295
+ role:
296
+ - where:
297
+ slug: admin
298
+ - url: /dashboard-item/:id
299
+ method: GET
300
+ relations:
301
+ role:
302
+ - where:
303
+ slug: admin
304
+ - url: /dashboard-item/:id
305
+ method: PATCH
306
+ relations:
307
+ role:
308
+ - where:
309
+ slug: admin
310
+ - url: /dashboard-item
311
+ method: DELETE
312
+ relations:
313
+ role:
314
+ - where:
315
+ slug: admin
316
+ - url: /dashboard-user
317
+ method: GET
318
+ relations:
319
+ role:
320
+ - where:
321
+ slug: admin
322
+ - url: /dashboard-user
323
+ method: POST
324
+ relations:
325
+ role:
326
+ - where:
327
+ slug: admin
328
+ - url: /dashboard-user/:id
329
+ method: GET
330
+ relations:
331
+ role:
332
+ - where:
333
+ slug: admin
334
+ - url: /dashboard-user/:id
335
+ method: PATCH
336
+ relations:
337
+ role:
338
+ - where:
339
+ slug: admin
340
+ - url: /dashboard-user
341
+ method: DELETE
342
+ relations:
343
+ role:
344
+ - where:
345
+ slug: admin
226
346
  menu:
227
347
  - url: /
228
348
  icon: dashboard
@@ -281,6 +401,58 @@ data:
281
401
  en: Route
282
402
  pt: Rotas
283
403
  slug: /management/route
404
+ - name:
405
+ en: Dashboard
406
+ pt: Dashboard
407
+ icon: dashboard
408
+ url: /management/dashboard
409
+ slug: /management/dashboard
410
+ menu_id:
411
+ where:
412
+ slug: /management
413
+ relations:
414
+ role:
415
+ - where:
416
+ slug: admin
417
+ - name:
418
+ en: Dashboard Component
419
+ pt: Componente do Dashboard
420
+ icon: dashboard
421
+ url: /management/dashboard-component
422
+ slug: /management/dashboard-component
423
+ menu_id:
424
+ where:
425
+ slug: /management
426
+ relations:
427
+ role:
428
+ - where:
429
+ slug: admin
430
+ - name:
431
+ en: Dashboard Item
432
+ pt: Item do Dashboard
433
+ icon: dashboard
434
+ url: /management/dashboard-item
435
+ slug: /management/dashboard-item
436
+ menu_id:
437
+ where:
438
+ slug: /management
439
+ relations:
440
+ role:
441
+ - where:
442
+ slug: admin
443
+ - name:
444
+ en: Dashboard User
445
+ pt: Usuário do Dashboard
446
+ icon: dashboard
447
+ url: /management/dashboard-user
448
+ slug: /management/dashboard-user
449
+ menu_id:
450
+ where:
451
+ slug: /management
452
+ relations:
453
+ role:
454
+ - where:
455
+ slug: admin
284
456
  screen:
285
457
  - slug: /management/user
286
458
  icon: user
@@ -347,6 +519,38 @@ data:
347
519
  - where:
348
520
  url:
349
521
  like: /route%
522
+ - name:
523
+ en: Dashboard
524
+ pt: Dashboard
525
+ slug: dashboard
526
+ description:
527
+ en: Screen to manage dashboard
528
+ pt: Tela para gerenciar dashboard
529
+ icon: dashboard
530
+ - name:
531
+ en: Dashboard Component
532
+ pt: Componente de Dashboard
533
+ slug: dashboard-component
534
+ description:
535
+ en: Screen to manage dashboard component
536
+ pt: Tela para gerenciar componentes de dashboard
537
+ icon: dashboard
538
+ - name:
539
+ en: Dashboard User
540
+ pt: Componente de Dashboard
541
+ slug: dashboard-user
542
+ description:
543
+ en: Screen to manage dashboard user
544
+ pt: Tela para gerenciar usuários de dashboard
545
+ icon: dashboard
546
+ - name:
547
+ en: Dashboard Item
548
+ pt: Item de Dashboard
549
+ slug: dashboard-item
550
+ description:
551
+ en: Screen to manage dashboard item
552
+ pt: Tela para gerenciar itens de dashboard
553
+ icon: dashboard
350
554
  multifactor:
351
555
  - name:
352
556
  en: Email
@@ -796,3 +1000,238 @@ tables:
796
1000
  - type: created_at
797
1001
  - type: updated_at
798
1002
  ifNotExists: true
1003
+ dashboard:
1004
+ columns:
1005
+ - type: pk
1006
+ - type: slug
1007
+ locale:
1008
+ en: Slug
1009
+ pt: Slug
1010
+ - type: created_at
1011
+ - type: updated_at
1012
+ ifNotExists: true
1013
+ dashboard_component:
1014
+ columns:
1015
+ - type: pk
1016
+ - type: slug
1017
+ locale:
1018
+ en: Slug
1019
+ pt: Slug
1020
+ - name: path
1021
+ type: varchar
1022
+ length: 500
1023
+ locale:
1024
+ en: Path
1025
+ pt: Caminho
1026
+ - name: min_width
1027
+ type: int
1028
+ default: 1
1029
+ - name: max_width
1030
+ type: int
1031
+ isNullable: true
1032
+ - name: min_height
1033
+ type: int
1034
+ default: 1
1035
+ - name: max_height
1036
+ type: int
1037
+ isNullable: true
1038
+ - name: width
1039
+ type: int
1040
+ - name: height
1041
+ type: int
1042
+ - name: is_resizable
1043
+ type: boolean
1044
+ default: true
1045
+ - type: created_at
1046
+ - type: updated_at
1047
+ ifNotExists: true
1048
+ dashboard_component_locale:
1049
+ columns:
1050
+ - name: component_id
1051
+ type: fk
1052
+ isPrimary: true
1053
+ references:
1054
+ table: dashboard_component
1055
+ column: id
1056
+ onDelete: CASCADE
1057
+ - name: locale_id
1058
+ type: fk
1059
+ isPrimary: true
1060
+ references:
1061
+ table: locale
1062
+ column: id
1063
+ onDelete: CASCADE
1064
+ - name: name
1065
+ type: varchar
1066
+ length: 255
1067
+ locale:
1068
+ en: Name
1069
+ pt: Nome
1070
+ - type: created_at
1071
+ - type: updated_at
1072
+ ifNotExists: true
1073
+ dashboard_locale:
1074
+ columns:
1075
+ - name: dashboard_id
1076
+ type: fk
1077
+ isPrimary: true
1078
+ references:
1079
+ table: dashboard
1080
+ column: id
1081
+ onDelete: CASCADE
1082
+ - name: locale_id
1083
+ type: fk
1084
+ isPrimary: true
1085
+ references:
1086
+ table: locale
1087
+ column: id
1088
+ onDelete: CASCADE
1089
+ - name: name
1090
+ type: varchar
1091
+ length: 255
1092
+ locale:
1093
+ en: Name
1094
+ pt: Nome
1095
+ - type: created_at
1096
+ - type: updated_at
1097
+ ifNotExists: true
1098
+ dashboard_item:
1099
+ columns:
1100
+ - type: pk
1101
+ - name: component_id
1102
+ type: fk
1103
+ references:
1104
+ table: dashboard_component
1105
+ column: id
1106
+ onDelete: CASCADE
1107
+ - name: dashboard_id
1108
+ type: fk
1109
+ references:
1110
+ table: dashboard
1111
+ column: id
1112
+ onDelete: CASCADE
1113
+ - name: width
1114
+ type: int
1115
+ - name: height
1116
+ type: int
1117
+ - name: x_axis
1118
+ type: int
1119
+ - name: y_axis
1120
+ type: int
1121
+ - type: created_at
1122
+ - type: updated_at
1123
+ ifNotExists: true
1124
+ dashboard_user:
1125
+ columns:
1126
+ - type: pk
1127
+ - name: item_id
1128
+ type: fk
1129
+ references:
1130
+ table: dashboard_item
1131
+ column: id
1132
+ onDelete: CASCADE
1133
+ - name: user_id
1134
+ type: fk
1135
+ references:
1136
+ table: user
1137
+ column: id
1138
+ onDelete: CASCADE
1139
+ - name: width
1140
+ type: int
1141
+ - name: height
1142
+ type: int
1143
+ - name: x_axis
1144
+ type: int
1145
+ - name: y_axis
1146
+ type: int
1147
+ - type: created_at
1148
+ - type: updated_at
1149
+ ifNotExists: true
1150
+ screens:
1151
+ dashboard:
1152
+ title:
1153
+ en: Dashboard
1154
+ pt: Dashboard
1155
+ menu:
1156
+ menu_id:
1157
+ where:
1158
+ slug: /management
1159
+ url: /management/dashboard
1160
+ icon: adjustments
1161
+ name:
1162
+ en: Dashboard
1163
+ pt: Dashboard
1164
+ slug: /management/dashboard
1165
+ relations:
1166
+ role:
1167
+ - where:
1168
+ slug: admin
1169
+ dashboard_component:
1170
+ title:
1171
+ en: Dashboard Component
1172
+ pt: Componente do Dashboard
1173
+ menu:
1174
+ menu_id:
1175
+ where:
1176
+ slug: /management
1177
+ url: /management/dashboard-component
1178
+ icon: adjustments
1179
+ name:
1180
+ en: Dashboard Component
1181
+ pt: Componente do Dashboard
1182
+ slug: /management/dashboard-component
1183
+ relations:
1184
+ role:
1185
+ - where:
1186
+ slug: admin
1187
+ dashboard_user:
1188
+ title:
1189
+ en: Dashboard User
1190
+ pt: Usuário de Dashboard
1191
+ menu:
1192
+ menu_id:
1193
+ where:
1194
+ slug: /management
1195
+ url: /management/dashboard-user
1196
+ icon: adjustments
1197
+ name:
1198
+ en: Dashboard User
1199
+ pt: Usuário de Dashboard
1200
+ slug: /management/dashboard-user
1201
+ relations:
1202
+ role:
1203
+ - where:
1204
+ slug: admin
1205
+ dashboard_item:
1206
+ title:
1207
+ en: Dashboard Item
1208
+ pt: Item de Dashboard
1209
+ menu:
1210
+ menu_id:
1211
+ where:
1212
+ slug: /management
1213
+ url: /management/dashboard-item
1214
+ icon: adjustments
1215
+ name:
1216
+ en: Dashboard Item
1217
+ pt: Item de Dashboard
1218
+ slug: /management/dashboard-item
1219
+ relations:
1220
+ role:
1221
+ - where:
1222
+ slug: admin
1223
+ routes:
1224
+ - path: management
1225
+ children:
1226
+ - path: dashboard
1227
+ lazy:
1228
+ component: ./pages/management/dashboard/dashboard/index.tsx
1229
+ - path: dashboard-component
1230
+ lazy:
1231
+ component: ./pages/management/dashboard/dashboard-component/index.tsx
1232
+ - path: dashboard-item
1233
+ lazy:
1234
+ component: ./pages/management/dashboard/dashboard-item/index.tsx
1235
+ - path: dashboard-user
1236
+ lazy:
1237
+ component: ./pages/management/dashboard/dashboard-user/index.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.48.6",
3
+ "version": "0.48.7",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -25,7 +25,7 @@
25
25
  "license": "MIT",
26
26
  "description": "",
27
27
  "devDependencies": {
28
- "@hedhog/locale": "^0.46.2",
28
+ "@hedhog/locale": "^0.48.2",
29
29
  "@hedhog/mail": "^0.48.1",
30
30
  "@hedhog/pagination": "^0.46.1",
31
31
  "@hedhog/prisma": "^0.46.1",
@@ -5,6 +5,7 @@ import { PrismaModule } from '@hedhog/prisma';
5
5
  import { forwardRef, Module } from '@nestjs/common';
6
6
  import { ConfigModule } from '@nestjs/config';
7
7
  import { AuthModule } from './auth/auth.module';
8
+ import { DashboardModule } from './dashboard/dashboard.module';
8
9
  import { CoreModule } from './core/core.module';
9
10
  import { MenuModule } from './menu/menu.module';
10
11
  import { RoleModule } from './role/role.module';
@@ -16,6 +17,7 @@ import { UserModule } from './user/user.module';
16
17
  imports: [
17
18
  ConfigModule.forRoot(),
18
19
  forwardRef(() => AuthModule),
20
+ forwardRef(() => DashboardModule),
19
21
  forwardRef(() => MailModule),
20
22
  forwardRef(() => MenuModule),
21
23
  forwardRef(() => PaginationModule),
@@ -0,0 +1,49 @@
1
+ import {
2
+ Body,
3
+ Controller,
4
+ Delete,
5
+ Get,
6
+ Param,
7
+ ParseIntPipe,
8
+ Patch,
9
+ Post,
10
+ } from '@nestjs/common';
11
+ import { DashboardService } from './dashboard.service';
12
+ import { Locale } from '@hedhog/locale';
13
+ import { Pagination } from '@hedhog/pagination';
14
+ import { CreateDTO } from './dto/create.dto';
15
+ import { UpdateDTO } from './dto/update.dto';
16
+ import { DeleteDTO } from '@hedhog/core';
17
+
18
+ @Controller('/dashboard')
19
+ export class DashboardController {
20
+ constructor(private readonly dashboardService: DashboardService) {}
21
+
22
+ @Get()
23
+ async list(@Locale() locale, @Pagination() paginationParams) {
24
+ return this.dashboardService.list(locale, paginationParams);
25
+ }
26
+
27
+ @Get(':id')
28
+ async get(@Param('id', ParseIntPipe) id: number) {
29
+ return this.dashboardService.get(id);
30
+ }
31
+
32
+ @Post()
33
+ async create(@Body() data: CreateDTO) {
34
+ return this.dashboardService.create(data);
35
+ }
36
+
37
+ @Patch(':id')
38
+ async update(@Param('id', ParseIntPipe) id: number, @Body() data: UpdateDTO) {
39
+ return this.dashboardService.update({
40
+ id,
41
+ data,
42
+ });
43
+ }
44
+
45
+ @Delete()
46
+ async delete(@Body() data: DeleteDTO) {
47
+ return this.dashboardService.delete(data);
48
+ }
49
+ }
@@ -0,0 +1,13 @@
1
+ import { LocaleModule } from '@hedhog/locale';
2
+ import { PrismaModule } from '@hedhog/prisma';
3
+ import { forwardRef, Module } from '@nestjs/common';
4
+ import { DashboardController } from './dashboard.controller';
5
+ import { DashboardService } from './dashboard.service';
6
+
7
+ @Module({
8
+ imports: [forwardRef(() => LocaleModule), forwardRef(() => PrismaModule)],
9
+ controllers: [DashboardController],
10
+ providers: [DashboardService],
11
+ exports: [forwardRef(() => DashboardService)],
12
+ })
13
+ export class DashboardModule2 {}
@@ -0,0 +1,71 @@
1
+ import { DeleteDTO } from '@hedhog/core';
2
+ import { LocaleService } from '@hedhog/locale';
3
+ import { PaginationDTO } from '@hedhog/pagination';
4
+ import { PrismaService } from '@hedhog/prisma';
5
+ import { Injectable } from '@nestjs/common';
6
+ import { BadRequestException } from '@nestjs/common/exceptions';
7
+ import { CreateDTO } from './dto/create.dto';
8
+ import { UpdateDTO } from './dto/update.dto';
9
+
10
+ @Injectable()
11
+ export class DashboardService {
12
+ constructor(
13
+ private readonly localeService: LocaleService,
14
+ private readonly prismaService: PrismaService,
15
+ ) {}
16
+ private readonly modelName = 'dashboard';
17
+ private readonly foreignKey = 'dashboard_id';
18
+
19
+ async list(locale: string, paginationParams: PaginationDTO) {
20
+ return this.localeService.listModelWithLocale(
21
+ locale,
22
+ 'dashboard',
23
+ paginationParams,
24
+ {},
25
+ {
26
+ dashboard_item: {
27
+ include: {
28
+ dashboard_component: true,
29
+ },
30
+ },
31
+ },
32
+ );
33
+ }
34
+
35
+ async get(id: number) {
36
+ return this.localeService.getModelWithLocale(this.modelName, id);
37
+ }
38
+
39
+ async create(data: CreateDTO) {
40
+ return this.localeService.createModelWithLocale(
41
+ this.modelName,
42
+ this.foreignKey,
43
+ data,
44
+ );
45
+ }
46
+
47
+ async update({ id, data }: { id: number; data: UpdateDTO }) {
48
+ return this.localeService.updateModelWithLocale(
49
+ this.modelName,
50
+ this.foreignKey,
51
+ id,
52
+ data,
53
+ );
54
+ }
55
+
56
+ async delete({ ids }: DeleteDTO) {
57
+ if (ids == undefined || ids == null) {
58
+ throw new BadRequestException(
59
+ 'You must select at least one item to delete.',
60
+ );
61
+ }
62
+
63
+ return this.prismaService.dashboard.deleteMany({
64
+ where: {
65
+ id: {
66
+ in: ids,
67
+ },
68
+ },
69
+ });
70
+ }
71
+ }
@@ -0,0 +1,8 @@
1
+ import { WithLocaleDTO } from '@hedhog/locale';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ export class CreateDTO extends WithLocaleDTO {
5
+ @IsString()
6
+ @IsNotEmpty()
7
+ slug: string;
8
+ }
@@ -0,0 +1,4 @@
1
+ import { PartialType } from '@nestjs/mapped-types';
2
+ import { CreateDTO } from './create.dto';
3
+
4
+ export class UpdateDTO extends PartialType(CreateDTO) {}
@@ -0,0 +1,55 @@
1
+ import { Pagination } from '@hedhog/pagination';
2
+ import { Locale } from '@hedhog/locale';
3
+ import {
4
+ Body,
5
+ Controller,
6
+ Delete,
7
+ Get,
8
+ Inject,
9
+ Param,
10
+ ParseIntPipe,
11
+ Patch,
12
+ Post,
13
+ forwardRef
14
+ } from '@nestjs/common';
15
+ import { CreateDTO } from './dto/create.dto';
16
+ import { UpdateDTO } from './dto/update.dto';
17
+ import { DashboardComponentService } from './dashboard-component.service';
18
+ import { Role, DeleteDTO } from '@hedhog/core';
19
+
20
+ @Role()
21
+ @Controller('dashboard-component')
22
+ export class DashboardComponentController {
23
+ constructor(
24
+ @Inject(forwardRef(() => DashboardComponentService))
25
+ private readonly dashboardComponentService: DashboardComponentService
26
+ ) {}
27
+
28
+ @Get()
29
+ async list(@Locale() locale, @Pagination() paginationParams) {
30
+ return this.dashboardComponentService.list(locale, paginationParams);
31
+ }
32
+
33
+ @Get(':id')
34
+ async get(@Param('id', ParseIntPipe) id: number) {
35
+ return this.dashboardComponentService.get(id);
36
+ }
37
+
38
+ @Post()
39
+ async create(@Body() data: CreateDTO) {
40
+ return this.dashboardComponentService.create(data);
41
+ }
42
+
43
+ @Patch(':id')
44
+ async update(@Param('id', ParseIntPipe) id: number, @Body() data: UpdateDTO) {
45
+ return this.dashboardComponentService.update({
46
+ id,
47
+ data
48
+ });
49
+ }
50
+
51
+ @Delete()
52
+ async delete(@Body() data: DeleteDTO) {
53
+ return this.dashboardComponentService.delete(data);
54
+ }
55
+ }
@@ -0,0 +1,14 @@
1
+ import { PaginationModule } from '@hedhog/pagination';
2
+ import { PrismaModule } from '@hedhog/prisma';
3
+ import { LocaleModule } from '@hedhog/locale';
4
+ import { forwardRef, Module } from '@nestjs/common';
5
+ import { DashboardComponentService } from './dashboard-component.service';
6
+ import { DashboardComponentController } from './dashboard-component.controller';
7
+
8
+ @Module({
9
+ imports: [forwardRef(() => LocaleModule), forwardRef(() => PrismaModule)],
10
+ controllers: [DashboardComponentController],
11
+ providers: [DashboardComponentService],
12
+ exports: [DashboardComponentService],
13
+ })
14
+ export class DashboardComponentModule {}