@hed-hog/core 0.0.279 → 0.0.285
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.
- package/dist/auth/auth.controller.d.ts +3 -3
- package/dist/auth/auth.service.d.ts +8 -8
- package/dist/file/file.controller.d.ts +2 -2
- package/dist/file/file.service.d.ts +4 -4
- package/dist/role/guards/role.guard.d.ts.map +1 -1
- package/dist/role/guards/role.guard.js +1 -1
- package/dist/role/guards/role.guard.js.map +1 -1
- package/dist/session/session.controller.d.ts +1 -1
- package/dist/session/session.service.d.ts +3 -3
- package/dist/user/user.controller.d.ts +2 -2
- package/dist/user/user.service.d.ts +6 -6
- package/hedhog/frontend/app/ai_agent/page.tsx.ejs +72 -65
- package/hedhog/frontend/app/mail/log/page.tsx.ejs +37 -42
- package/hedhog/frontend/app/mail/template/page.tsx.ejs +176 -126
- package/hedhog/frontend/app/menu/page.tsx.ejs +45 -39
- package/hedhog/frontend/app/roles/page.tsx.ejs +45 -46
- package/hedhog/frontend/app/users/page.tsx.ejs +61 -64
- package/hedhog/frontend/messages/en.json +5 -0
- package/hedhog/frontend/messages/pt.json +5 -0
- package/package.json +3 -3
- package/src/role/guards/role.guard.ts +9 -8
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
EmptyState,
|
|
5
|
+
Page,
|
|
4
6
|
PageHeader,
|
|
5
7
|
PaginationFooter,
|
|
6
8
|
SearchBar,
|
|
@@ -25,13 +27,6 @@ import {
|
|
|
25
27
|
CardHeader,
|
|
26
28
|
CardTitle,
|
|
27
29
|
} from '@/components/ui/card';
|
|
28
|
-
import {
|
|
29
|
-
Dialog,
|
|
30
|
-
DialogContent,
|
|
31
|
-
DialogDescription,
|
|
32
|
-
DialogHeader,
|
|
33
|
-
DialogTitle,
|
|
34
|
-
} from '@/components/ui/dialog';
|
|
35
30
|
import {
|
|
36
31
|
Form,
|
|
37
32
|
FormControl,
|
|
@@ -422,7 +417,7 @@ export default function UserPage() {
|
|
|
422
417
|
];
|
|
423
418
|
|
|
424
419
|
return (
|
|
425
|
-
<
|
|
420
|
+
<Page>
|
|
426
421
|
<PageHeader
|
|
427
422
|
breadcrumbs={[{ label: 'Home', href: '/' }, { label: t('users') }]}
|
|
428
423
|
actions={[
|
|
@@ -487,10 +482,9 @@ export default function UserPage() {
|
|
|
487
482
|
{ label: t('filterOptionBlocked'), value: 'blocked' },
|
|
488
483
|
],
|
|
489
484
|
}}
|
|
490
|
-
className="mt-4"
|
|
491
485
|
/>
|
|
492
486
|
|
|
493
|
-
<div className="flex-1
|
|
487
|
+
<div className="flex-1 ">
|
|
494
488
|
{isLoading && (
|
|
495
489
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
496
490
|
{Array.from({ length: 3 }).map((_, i) => (
|
|
@@ -522,7 +516,13 @@ export default function UserPage() {
|
|
|
522
516
|
)}
|
|
523
517
|
|
|
524
518
|
{(paginate?.data?.length || 0) === 0 ? (
|
|
525
|
-
<
|
|
519
|
+
<EmptyState
|
|
520
|
+
icon={<Users className="h-12 w-12" />}
|
|
521
|
+
title={t('noUsersFound')}
|
|
522
|
+
description={t('description')}
|
|
523
|
+
actionLabel={t('buttonAddUser')}
|
|
524
|
+
onAction={() => setIsDialogOpen(true)}
|
|
525
|
+
/>
|
|
526
526
|
) : (
|
|
527
527
|
<div className="grid gap-4 grid-cols-1 lg:grid-cols-2 xl:grid-cols-3">
|
|
528
528
|
{paginate?.data?.map((user: User) => (
|
|
@@ -1157,36 +1157,29 @@ export default function UserPage() {
|
|
|
1157
1157
|
</Button>
|
|
1158
1158
|
</div>
|
|
1159
1159
|
|
|
1160
|
-
<
|
|
1160
|
+
<AlertDialog
|
|
1161
1161
|
open={openDeleteModal}
|
|
1162
1162
|
onOpenChange={setOpenDeleteModal}
|
|
1163
1163
|
>
|
|
1164
|
-
<
|
|
1165
|
-
<
|
|
1166
|
-
<
|
|
1167
|
-
|
|
1164
|
+
<AlertDialogContent>
|
|
1165
|
+
<AlertDialogHeader>
|
|
1166
|
+
<AlertDialogTitle>
|
|
1167
|
+
{t('dialogDeleteUserTitle')}
|
|
1168
|
+
</AlertDialogTitle>
|
|
1169
|
+
<AlertDialogDescription>
|
|
1168
1170
|
{t('dialogDeleteUserDescription')}
|
|
1169
|
-
</
|
|
1170
|
-
</
|
|
1171
|
-
<
|
|
1172
|
-
|
|
1173
|
-
<Button
|
|
1174
|
-
type="button"
|
|
1175
|
-
className="px-4 w-28 h-12 py-2 bg-gray-300 text-black hover:bg-gray-300 hover:text-black rounded-sm mr-2 text-md"
|
|
1176
|
-
onClick={() => setOpenDeleteModal(false)}
|
|
1177
|
-
>
|
|
1171
|
+
</AlertDialogDescription>
|
|
1172
|
+
</AlertDialogHeader>
|
|
1173
|
+
<AlertDialogFooter>
|
|
1174
|
+
<AlertDialogCancel>
|
|
1178
1175
|
{t('deleteUserCancel')}
|
|
1179
|
-
</
|
|
1180
|
-
<
|
|
1181
|
-
onClick={onDelete}
|
|
1182
|
-
variant="destructive"
|
|
1183
|
-
className="px-4 w-32 h-12 py-2 text-white hover:text-white rounded-sm text-md cursor-pointer"
|
|
1184
|
-
>
|
|
1176
|
+
</AlertDialogCancel>
|
|
1177
|
+
<AlertDialogAction onClick={onDelete}>
|
|
1185
1178
|
{t('deleteUserConfirm')}
|
|
1186
|
-
</
|
|
1187
|
-
</
|
|
1188
|
-
</
|
|
1189
|
-
</
|
|
1179
|
+
</AlertDialogAction>
|
|
1180
|
+
</AlertDialogFooter>
|
|
1181
|
+
</AlertDialogContent>
|
|
1182
|
+
</AlertDialog>
|
|
1190
1183
|
</TabsContent>
|
|
1191
1184
|
|
|
1192
1185
|
<TabsContent value="edit" className="space-y-4 mt-4 p-4 pt-0">
|
|
@@ -1232,27 +1225,29 @@ export default function UserPage() {
|
|
|
1232
1225
|
value="credentials"
|
|
1233
1226
|
className="space-y-4 mt-4 p-4 pt-0"
|
|
1234
1227
|
>
|
|
1235
|
-
<
|
|
1236
|
-
<
|
|
1237
|
-
<
|
|
1228
|
+
<div className="space-y-3 rounded-lg border p-4">
|
|
1229
|
+
<div>
|
|
1230
|
+
<h4 className="text-sm font-semibold">
|
|
1238
1231
|
{t('passwordResetTitle')}
|
|
1239
|
-
</
|
|
1240
|
-
<
|
|
1232
|
+
</h4>
|
|
1233
|
+
<p className="text-xs text-muted-foreground mt-1">
|
|
1241
1234
|
{t('passwordResetDescription')}
|
|
1242
|
-
</
|
|
1243
|
-
</
|
|
1244
|
-
<
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
<
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1235
|
+
</p>
|
|
1236
|
+
</div>
|
|
1237
|
+
<p className="text-xs text-muted-foreground">
|
|
1238
|
+
{t('passwordResetNotice')}
|
|
1239
|
+
</p>
|
|
1240
|
+
<div className="flex flex-col gap-2">
|
|
1241
|
+
<Button
|
|
1242
|
+
type="button"
|
|
1243
|
+
onClick={openResetPasswordDialog}
|
|
1244
|
+
className="w-full sm:w-fit"
|
|
1245
|
+
>
|
|
1246
|
+
<RefreshCcw className="h-4 w-4 mr-2" />
|
|
1247
|
+
{t('buttonResetPassword')}
|
|
1248
|
+
</Button>
|
|
1249
|
+
</div>
|
|
1250
|
+
</div>
|
|
1256
1251
|
|
|
1257
1252
|
<div className="space-y-3">
|
|
1258
1253
|
<h4 className="text-sm font-medium">
|
|
@@ -1422,7 +1417,7 @@ export default function UserPage() {
|
|
|
1422
1417
|
</AlertDialogContent>
|
|
1423
1418
|
</AlertDialog>
|
|
1424
1419
|
|
|
1425
|
-
<
|
|
1420
|
+
<AlertDialog
|
|
1426
1421
|
open={isResetResultDialogOpen}
|
|
1427
1422
|
onOpenChange={(open) => {
|
|
1428
1423
|
setIsResetResultDialogOpen(open);
|
|
@@ -1432,13 +1427,15 @@ export default function UserPage() {
|
|
|
1432
1427
|
}
|
|
1433
1428
|
}}
|
|
1434
1429
|
>
|
|
1435
|
-
<
|
|
1436
|
-
<
|
|
1437
|
-
<
|
|
1438
|
-
|
|
1430
|
+
<AlertDialogContent>
|
|
1431
|
+
<AlertDialogHeader>
|
|
1432
|
+
<AlertDialogTitle>
|
|
1433
|
+
{t('passwordResultTitle')}
|
|
1434
|
+
</AlertDialogTitle>
|
|
1435
|
+
<AlertDialogDescription>
|
|
1439
1436
|
{t('passwordResultDescription')}
|
|
1440
|
-
</
|
|
1441
|
-
</
|
|
1437
|
+
</AlertDialogDescription>
|
|
1438
|
+
</AlertDialogHeader>
|
|
1442
1439
|
|
|
1443
1440
|
<div className="space-y-3">
|
|
1444
1441
|
<div className="relative">
|
|
@@ -1484,8 +1481,8 @@ export default function UserPage() {
|
|
|
1484
1481
|
</Button>
|
|
1485
1482
|
</div>
|
|
1486
1483
|
</div>
|
|
1487
|
-
</
|
|
1488
|
-
</
|
|
1484
|
+
</AlertDialogContent>
|
|
1485
|
+
</AlertDialog>
|
|
1489
1486
|
</TabsContent>
|
|
1490
1487
|
|
|
1491
1488
|
<TabsContent
|
|
@@ -1573,6 +1570,6 @@ export default function UserPage() {
|
|
|
1573
1570
|
</Sheet>
|
|
1574
1571
|
)}
|
|
1575
1572
|
</div>
|
|
1576
|
-
</
|
|
1573
|
+
</Page>
|
|
1577
1574
|
);
|
|
1578
1575
|
}
|
|
@@ -329,6 +329,9 @@
|
|
|
329
329
|
"newTemplate": "New Template",
|
|
330
330
|
"title": "Email Templates",
|
|
331
331
|
"description": "Manage your email templates",
|
|
332
|
+
"searchPlaceholder": "Search templates by slug or subject...",
|
|
333
|
+
"noTemplatesFound": "No templates found",
|
|
334
|
+
"noTemplatesHint": "Create your first template to start sending emails.",
|
|
332
335
|
"tableSlug": "Slug",
|
|
333
336
|
"tableSubject": "Subject",
|
|
334
337
|
"tableVariables": "Variables",
|
|
@@ -849,6 +852,8 @@
|
|
|
849
852
|
"noLogsFound": "No email logs found",
|
|
850
853
|
"adjustSearch": "Try adjusting your search terms",
|
|
851
854
|
"noEmailsSent": "No emails have been sent yet",
|
|
855
|
+
"clearSearch": "Clear search",
|
|
856
|
+
"refreshList": "Refresh list",
|
|
852
857
|
"viewDetails": "View Details",
|
|
853
858
|
"emailDetails": "Email Details",
|
|
854
859
|
"detailsDescription": "Complete information about the sent email",
|
|
@@ -329,6 +329,9 @@
|
|
|
329
329
|
"newTemplate": "Novo Template",
|
|
330
330
|
"title": "Templates de E-mail",
|
|
331
331
|
"description": "Gerencie seus templates de e-mail",
|
|
332
|
+
"searchPlaceholder": "Buscar templates por slug ou assunto...",
|
|
333
|
+
"noTemplatesFound": "Nenhum template encontrado",
|
|
334
|
+
"noTemplatesHint": "Crie o primeiro template para começar a enviar e-mails.",
|
|
332
335
|
"tableSlug": "Slug",
|
|
333
336
|
"tableSubject": "Assunto",
|
|
334
337
|
"tableVariables": "Variáveis",
|
|
@@ -852,6 +855,8 @@
|
|
|
852
855
|
"noLogsFound": "Nenhum log de e-mail encontrado",
|
|
853
856
|
"adjustSearch": "Tente ajustar seus termos de busca",
|
|
854
857
|
"noEmailsSent": "Nenhum e-mail foi enviado ainda",
|
|
858
|
+
"clearSearch": "Limpar busca",
|
|
859
|
+
"refreshList": "Atualizar lista",
|
|
855
860
|
"viewDetails": "Ver Detalhes",
|
|
856
861
|
"emailDetails": "Detalhes do E-mail",
|
|
857
862
|
"detailsDescription": "Informações completas sobre o e-mail enviado",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.285",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
33
|
"@hed-hog/api-pagination": "0.0.6",
|
|
34
34
|
"@hed-hog/api-types": "0.0.1",
|
|
35
|
-
"@hed-hog/api
|
|
35
|
+
"@hed-hog/api": "0.0.4",
|
|
36
36
|
"@hed-hog/api-mail": "0.0.8",
|
|
37
37
|
"@hed-hog/api-prisma": "0.0.5",
|
|
38
|
-
"@hed-hog/api": "0.0.
|
|
38
|
+
"@hed-hog/api-locale": "0.0.13"
|
|
39
39
|
},
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|
|
@@ -2,13 +2,14 @@ import { IS_PUBLIC_KEY, WITH_ROLE } from '@hed-hog/api';
|
|
|
2
2
|
import { getLocaleText } from '@hed-hog/api-locale';
|
|
3
3
|
import { PrismaService } from '@hed-hog/api-prisma';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
CanActivate,
|
|
6
|
+
ExecutionContext,
|
|
7
|
+
ForbiddenException,
|
|
8
|
+
forwardRef,
|
|
9
|
+
Inject,
|
|
10
|
+
Injectable,
|
|
11
|
+
RequestMethod,
|
|
12
|
+
UnauthorizedException,
|
|
12
13
|
} from '@nestjs/common';
|
|
13
14
|
import { METHOD_METADATA } from '@nestjs/common/constants';
|
|
14
15
|
import { Reflector } from '@nestjs/core';
|
|
@@ -130,7 +131,7 @@ export class RoleGuard implements CanActivate {
|
|
|
130
131
|
.replace('{{method}}', httpMethod)
|
|
131
132
|
.replace('{{path}}', fullPath);
|
|
132
133
|
|
|
133
|
-
throw new
|
|
134
|
+
throw new ForbiddenException(message);
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
const hasPendingPasswordReset = await this.prisma.user_credential.findFirst({
|