@hedhog/admin 0.46.35 → 0.46.39
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/README.md +960 -960
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +30 -4
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/consts/body.js +24 -24
- package/dist/emails/index.d.ts +3 -0
- package/dist/emails/index.d.ts.map +1 -0
- package/dist/emails/index.js +19 -0
- package/dist/emails/index.js.map +1 -0
- package/dist/emails/lib.d.ts +6 -0
- package/dist/emails/lib.d.ts.map +1 -0
- package/dist/emails/lib.js +43 -0
- package/dist/emails/lib.js.map +1 -0
- package/dist/emails/templates.d.ts +13 -0
- package/dist/emails/templates.d.ts.map +1 -0
- package/dist/emails/templates.js +63 -0
- package/dist/emails/templates.js.map +1 -0
- package/frontend/menu/components/create-panel.tsx.ejs +55 -55
- package/frontend/menu/components/update-panel.tsx.ejs +67 -67
- package/frontend/menu/locales/en/admin.menu.json +11 -11
- package/frontend/menu/locales/pt/admin.menu.json +11 -11
- package/frontend/menu/react-query/handlers.ts.ejs +28 -28
- package/frontend/menu/react-query/requests.ts.ejs +56 -56
- package/frontend/menu-locale/locales/en/admin.menu-locale.json +11 -11
- package/frontend/menu-locale/locales/pt/admin.menu-locale.json +11 -11
- package/frontend/menu-screen/locales/en/admin.menu-screen.json +11 -11
- package/frontend/menu-screen/locales/pt/admin.menu-screen.json +11 -11
- package/frontend/multifactor/components/create-panel.tsx.ejs +55 -55
- package/frontend/multifactor/components/update-panel.tsx.ejs +70 -70
- package/frontend/multifactor/locales/en/admin.multifactor.json +11 -11
- package/frontend/multifactor/locales/pt/admin.multifactor.json +11 -11
- package/frontend/multifactor/react-query/handlers.ts.ejs +28 -28
- package/frontend/multifactor/react-query/requests.ts.ejs +59 -59
- package/frontend/multifactor-locale/locales/en/admin.multifactor-locale.json +11 -11
- package/frontend/multifactor-locale/locales/pt/admin.multifactor-locale.json +11 -11
- package/frontend/screen/components/create-panel.tsx.ejs +55 -55
- package/frontend/screen/components/update-panel.tsx.ejs +67 -67
- package/frontend/screen/locales/en/admin.screen.json +11 -11
- package/frontend/screen/locales/pt/admin.screen.json +11 -11
- package/frontend/screen/react-query/handlers.ts.ejs +28 -28
- package/frontend/screen/react-query/requests.ts.ejs +56 -56
- package/frontend/screen-locale/locales/en/admin.screen-locale.json +11 -11
- package/frontend/screen-locale/locales/pt/admin.screen-locale.json +11 -11
- package/frontend/translation/components/create-panel.tsx.ejs +52 -52
- package/frontend/translation/components/update-panel.tsx.ejs +67 -67
- package/frontend/translation/locales/en/admin.translation.json +11 -11
- package/frontend/translation/locales/pt/admin.translation.json +11 -11
- package/frontend/translation/react-query/handlers.ts.ejs +28 -28
- package/frontend/translation/react-query/requests.ts.ejs +58 -58
- package/frontend/translation-namespace/components/create-panel.tsx.ejs +53 -53
- package/frontend/translation-namespace/components/update-panel.tsx.ejs +70 -70
- package/frontend/translation-namespace/locales/en/admin.translation-namespace.json +11 -11
- package/frontend/translation-namespace/locales/pt/admin.translation-namespace.json +11 -11
- package/frontend/translation-namespace/react-query/handlers.ts.ejs +28 -28
- package/frontend/translation-namespace/react-query/requests.ts.ejs +60 -60
- package/frontend/user/components/create-panel.tsx.ejs +52 -52
- package/frontend/user/components/update-panel.tsx.ejs +64 -64
- package/frontend/user/locales/en/admin.user.json +11 -11
- package/frontend/user/locales/pt/admin.user.json +11 -11
- package/frontend/user/react-query/handlers.ts.ejs +28 -28
- package/frontend/user/react-query/requests.ts.ejs +55 -55
- package/hedhog.yaml +783 -783
- package/package.json +45 -43
- package/src/admin.module.ts +39 -39
- package/src/auth/auth.controller.ts +88 -88
- package/src/auth/auth.module.ts +41 -41
- package/src/auth/auth.service.spec.ts +196 -196
- package/src/auth/auth.service.ts +349 -316
- package/src/auth/consts/body.ts +27 -27
- package/src/auth/dto/change.dto.ts +19 -19
- package/src/auth/dto/email.dto.ts +15 -15
- package/src/auth/dto/forget.dto.ts +6 -6
- package/src/auth/dto/login.dto.ts +21 -21
- package/src/auth/dto/otp.dto.ts +11 -11
- package/src/auth/dto/reset.dto.ts +14 -14
- package/src/auth/enums/multifactor-type.enum.ts +4 -4
- package/src/auth/guards/auth.guard.ts +54 -54
- package/src/auth/types/user.type.ts +8 -8
- package/src/dto/delete.dto.ts +8 -8
- package/src/dto/update-ids.dto.ts +9 -9
- package/src/emails/index.ts +2 -0
- package/src/emails/lib.ts +40 -0
- package/src/emails/templates.ts +60 -0
- package/src/index.ts +20 -20
- package/src/menu/dto/create.dto.ts +25 -25
- package/src/menu/dto/order.dto.ts +8 -8
- package/src/menu/dto/update.dto.ts +19 -19
- package/src/menu/menu.controller.ts +105 -105
- package/src/menu/menu.module.ts +18 -18
- package/src/menu/menu.service.spec.ts +247 -247
- package/src/menu/menu.service.ts +263 -263
- package/src/role/dto/create.dto.ts +7 -7
- package/src/role/dto/update.dto.ts +4 -4
- package/src/role/guards/role.guard.ts +121 -121
- package/src/role/role.controller.ts +126 -126
- package/src/role/role.module.ts +28 -28
- package/src/role/role.service.spec.ts +417 -417
- package/src/role/role.service.ts +289 -289
- package/src/route/dto/create.dto.ts +13 -13
- package/src/route/dto/update.dto.ts +15 -15
- package/src/route/route.controller.ts +91 -91
- package/src/route/route.module.ts +18 -18
- package/src/route/route.service.spec.ts +300 -300
- package/src/route/route.service.ts +164 -164
- package/src/screen/dto/create.dto.ts +11 -11
- package/src/screen/dto/update.dto.ts +19 -19
- package/src/screen/screen.controller.ts +93 -93
- package/src/screen/screen.module.ts +18 -18
- package/src/screen/screen.service.spec.ts +298 -298
- package/src/screen/screen.service.ts +179 -179
- package/src/types/http-method.ts +8 -8
- package/src/user/constants/user.constants.ts +1 -1
- package/src/user/dto/create.dto.ts +24 -24
- package/src/user/dto/update.dto.ts +41 -41
- package/src/user/user.controller.ts +75 -75
- package/src/user/user.module.ts +18 -18
- package/src/user/user.service.spec.ts +294 -294
- package/src/user/user.service.ts +129 -129
- package/tsconfig.lib.json +9 -9
- package/tsconfig.production.json +20 -20
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAS/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAS/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAI3C,qBACa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAEpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBANJ,aAAa,EAAE,aAAa,EAE5B,MAAM,EAAE,aAAa,EAErB,GAAG,EAAE,UAAU,EAEf,IAAI,EAAE,WAAW;IAG9B,WAAW,CAAC,KAAK,EAAE,MAAM;IAM/B,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAW5C,oBAAoB,IAAI,MAAM;IAMxB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;;;;;;;IAkDzD,QAAQ,CAAC,IAAI,KAAA;;;IAUb,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS;;;IA0C3B,cAAc,CAAC,EACnB,KAAK,EACL,eAAe,EACf,WAAW,EACX,kBAAkB,GACnB,EAAE,SAAS;;;IAkCN,WAAW,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,QAAQ;;;IAyD1D,aAAa,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,EAAE,QAAQ;;;IAkDjE,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM;;;IA0B3B,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ;;;;;;;;IAWnC,MAAM,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;CAKxB"}
|
@@ -19,8 +19,8 @@ const common_1 = require("@nestjs/common");
|
|
19
19
|
const config_1 = require("@nestjs/config");
|
20
20
|
const jwt_1 = require("@nestjs/jwt");
|
21
21
|
const bcrypt_1 = require("bcrypt");
|
22
|
-
const body_1 = require("./consts/body");
|
23
22
|
const multifactor_type_enum_1 = require("./enums/multifactor-type.enum");
|
23
|
+
const emails_1 = require("../emails");
|
24
24
|
let AuthService = class AuthService {
|
25
25
|
constructor(configService, prisma, jwt, mail) {
|
26
26
|
this.configService = configService;
|
@@ -53,8 +53,11 @@ let AuthService = class AuthService {
|
|
53
53
|
email,
|
54
54
|
},
|
55
55
|
});
|
56
|
+
if (!user) {
|
57
|
+
throw new common_1.BadRequestException('Acesso negado');
|
58
|
+
}
|
56
59
|
const isPasswordValid = await (0, bcrypt_1.compare)(password, user.password);
|
57
|
-
if (!
|
60
|
+
if (!isPasswordValid) {
|
58
61
|
throw new common_1.BadRequestException('Acesso negado');
|
59
62
|
}
|
60
63
|
if (!user.multifactor_id) {
|
@@ -120,7 +123,7 @@ let AuthService = class AuthService {
|
|
120
123
|
await this.mail.send({
|
121
124
|
to: email,
|
122
125
|
subject: `Recuperação de Senha`,
|
123
|
-
body: (0,
|
126
|
+
body: (0, emails_1.getForgetPasswordEmail)(`${appUrl}/login?mode=reset-password&code=${code}`),
|
124
127
|
});
|
125
128
|
}
|
126
129
|
return {
|
@@ -147,13 +150,21 @@ let AuthService = class AuthService {
|
|
147
150
|
password,
|
148
151
|
},
|
149
152
|
});
|
153
|
+
await this.mail.send({
|
154
|
+
to: email,
|
155
|
+
subject: `Senha alterada`,
|
156
|
+
body: (0, emails_1.getChangePasswordEmail)(),
|
157
|
+
});
|
150
158
|
return this.getToken(newUser);
|
151
159
|
}
|
152
160
|
async changeEmail({ currentEmail, password, newEmail }) {
|
153
161
|
const user = await this.prisma.user.findFirst({
|
154
162
|
where: { email: currentEmail },
|
155
163
|
});
|
156
|
-
if (!user
|
164
|
+
if (!user) {
|
165
|
+
throw new common_1.BadRequestException('Não foi possível atualizar o e-mail.');
|
166
|
+
}
|
167
|
+
if (!(await (0, bcrypt_1.compare)(password, user.password))) {
|
157
168
|
throw new common_1.BadRequestException('Não foi possível atualizar o e-mail.');
|
158
169
|
}
|
159
170
|
const existingUser = await this.prisma.user.findFirst({
|
@@ -183,6 +194,11 @@ let AuthService = class AuthService {
|
|
183
194
|
},
|
184
195
|
data: { value: newEmail },
|
185
196
|
});
|
197
|
+
await this.mail.send({
|
198
|
+
to: newEmail,
|
199
|
+
subject: `Email alterado`,
|
200
|
+
body: (0, emails_1.getChangeEmailEmail)(),
|
201
|
+
});
|
186
202
|
return this.getToken(newUser);
|
187
203
|
}
|
188
204
|
async resetPassword({ code, newPassword, confirmNewPassword }) {
|
@@ -212,6 +228,11 @@ let AuthService = class AuthService {
|
|
212
228
|
code: null,
|
213
229
|
},
|
214
230
|
});
|
231
|
+
await this.mail.send({
|
232
|
+
to: user.email,
|
233
|
+
subject: `Senha recuperada`,
|
234
|
+
body: (0, emails_1.getResetPasswordEmail)(),
|
235
|
+
});
|
215
236
|
return this.getToken(user);
|
216
237
|
}
|
217
238
|
return false;
|
@@ -242,6 +263,11 @@ let AuthService = class AuthService {
|
|
242
263
|
return this.getToken(user);
|
243
264
|
}
|
244
265
|
async login({ email, password }) {
|
266
|
+
await this.mail.send({
|
267
|
+
to: email,
|
268
|
+
subject: `Novo login no CoinBitClub`,
|
269
|
+
body: (0, emails_1.getUserLoginEmail)(),
|
270
|
+
});
|
245
271
|
return this.loginWithEmailAndPassword(email, password);
|
246
272
|
}
|
247
273
|
async verify(id) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,2CAA+C;AAC/C,2CAOwB;AACxB,2CAA+C;AAC/C,qCAAyC;AACzC,mCAAgD;
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../src/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2C;AAC3C,2CAA+C;AAC/C,2CAOwB;AACxB,2CAA+C;AAC/C,qCAAyC;AACzC,mCAAgD;AAQhD,yEAAgE;AAChE,sCAA0I;AAGnI,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,YACmB,aA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,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACnB,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,2BAA2B;YACpC,IAAI,EAAE,IAAA,0BAAiB,GAAE;SAC1B,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;YACjC,KAAK,EAAE,EAAE,EAAE,EAAE;SACd,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AApUY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sBAAa,CAAC,CAAC,CAAA;IAEvC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,gBAAU,CAAC,CAAC,CAAA;IAEpC,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,kBAAW,CAAC,CAAC,CAAA;qCALN,sBAAa;QAEpB,sBAAa;QAEhB,gBAAU;QAET,kBAAW;GARzB,WAAW,CAoUvB"}
|
package/dist/auth/consts/body.js
CHANGED
@@ -2,30 +2,30 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getBody = void 0;
|
4
4
|
const getBody = (url) => {
|
5
|
-
return `
|
6
|
-
<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
7
|
-
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
8
|
-
<div style="text-align: center; margin-bottom: 30px;">
|
9
|
-
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
10
|
-
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">Recuperação de Senha - CoinBitClub</h1>
|
11
|
-
</div>
|
12
|
-
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
13
|
-
<p>Olá,</p>
|
14
|
-
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
15
|
-
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
16
|
-
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
17
|
-
</div>
|
18
|
-
<div style="text-align: center; margin: 30px 0;">
|
19
|
-
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
20
|
-
</div>
|
21
|
-
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
22
|
-
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
23
|
-
<p>Agradecemos por escolher nossa plataforma!</p>
|
24
|
-
</div>
|
25
|
-
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
26
|
-
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
27
|
-
</div>
|
28
|
-
</div>
|
5
|
+
return `
|
6
|
+
<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
7
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
8
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
9
|
+
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
10
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">Recuperação de Senha - CoinBitClub</h1>
|
11
|
+
</div>
|
12
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
13
|
+
<p>Olá,</p>
|
14
|
+
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
15
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
16
|
+
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
17
|
+
</div>
|
18
|
+
<div style="text-align: center; margin: 30px 0;">
|
19
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
20
|
+
</div>
|
21
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
22
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
23
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
24
|
+
</div>
|
25
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
26
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
29
|
</body>`;
|
30
30
|
};
|
31
31
|
exports.getBody = getBody;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/emails/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,aAAa,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./lib"), exports);
|
18
|
+
__exportStar(require("./templates"), exports);
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/emails/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB;AACrB,8CAA2B"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export declare const getUserLoginEmail: () => string;
|
2
|
+
export declare const getForgetPasswordEmail: (url: string) => string;
|
3
|
+
export declare const getChangePasswordEmail: () => string;
|
4
|
+
export declare const getChangeEmailEmail: () => string;
|
5
|
+
export declare const getResetPasswordEmail: () => string;
|
6
|
+
//# sourceMappingURL=lib.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/emails/lib.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB,cAI7B,CAAA;AAGD,eAAO,MAAM,sBAAsB,QAAS,MAAM,WAIjD,CAAA;AAGD,eAAO,MAAM,sBAAsB,cAIlC,CAAA;AAGD,eAAO,MAAM,mBAAmB,cAI/B,CAAA;AAGD,eAAO,MAAM,qBAAqB,cAIjC,CAAA"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getResetPasswordEmail = exports.getChangeEmailEmail = exports.getChangePasswordEmail = exports.getForgetPasswordEmail = exports.getUserLoginEmail = void 0;
|
4
|
+
const templates_1 = require("./templates");
|
5
|
+
const getBodyWrapper = (content) => {
|
6
|
+
return templates_1.defaults.default_body(content);
|
7
|
+
};
|
8
|
+
// auth/login
|
9
|
+
const getUserLoginEmail = () => {
|
10
|
+
const body = templates_1.bodies['user_login'];
|
11
|
+
const content = [templates_1.defaults.header('Novo login no CoinBitClub'), body(), templates_1.defaults.footer()];
|
12
|
+
return getBodyWrapper(content);
|
13
|
+
};
|
14
|
+
exports.getUserLoginEmail = getUserLoginEmail;
|
15
|
+
// auth/forget
|
16
|
+
const getForgetPasswordEmail = (url) => {
|
17
|
+
const body = templates_1.bodies['user_forget_password'];
|
18
|
+
const content = [templates_1.defaults.header('Recuperação de senha'), body(url), templates_1.defaults.footer()];
|
19
|
+
return getBodyWrapper(content);
|
20
|
+
};
|
21
|
+
exports.getForgetPasswordEmail = getForgetPasswordEmail;
|
22
|
+
// auth/change-password
|
23
|
+
const getChangePasswordEmail = () => {
|
24
|
+
const body = templates_1.bodies['user_change_password'];
|
25
|
+
const content = [templates_1.defaults.header('Senha alterada'), body(), templates_1.defaults.footer()];
|
26
|
+
return getBodyWrapper(content);
|
27
|
+
};
|
28
|
+
exports.getChangePasswordEmail = getChangePasswordEmail;
|
29
|
+
// auth/change-email
|
30
|
+
const getChangeEmailEmail = () => {
|
31
|
+
const body = templates_1.bodies['user_change_email'];
|
32
|
+
const content = [templates_1.defaults.header('Email alterado'), body(), templates_1.defaults.footer()];
|
33
|
+
return getBodyWrapper(content);
|
34
|
+
};
|
35
|
+
exports.getChangeEmailEmail = getChangeEmailEmail;
|
36
|
+
// auth/reset
|
37
|
+
const getResetPasswordEmail = () => {
|
38
|
+
const body = templates_1.bodies['user_reset_password'];
|
39
|
+
const content = [templates_1.defaults.header('Senha recuperada'), body(), templates_1.defaults.footer()];
|
40
|
+
return getBodyWrapper(content);
|
41
|
+
};
|
42
|
+
exports.getResetPasswordEmail = getResetPasswordEmail;
|
43
|
+
//# sourceMappingURL=lib.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/emails/lib.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAE/C,MAAM,cAAc,GAAG,CAAC,OAAiB,EAAE,EAAE;IAC3C,OAAO,oBAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;AACvC,CAAC,CAAA;AAED,aAAa;AACN,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,IAAI,GAAG,kBAAM,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,CAAC,oBAAQ,CAAC,MAAM,CAAC,2BAA2B,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IACzF,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA;AAJY,QAAA,iBAAiB,qBAI7B;AAED,cAAc;AACP,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAE,EAAE;IACpD,MAAM,IAAI,GAAG,kBAAM,CAAC,sBAAsB,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAC,oBAAQ,CAAC,MAAM,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,oBAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IACvF,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA;AAJY,QAAA,sBAAsB,0BAIlC;AAED,uBAAuB;AAChB,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,MAAM,IAAI,GAAG,kBAAM,CAAC,sBAAsB,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAC,oBAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAC9E,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA;AAJY,QAAA,sBAAsB,0BAIlC;AAED,oBAAoB;AACb,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,IAAI,GAAG,kBAAM,CAAC,mBAAmB,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,CAAC,oBAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAC9E,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA;AAJY,QAAA,mBAAmB,uBAI/B;AAED,aAAa;AACN,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,IAAI,GAAG,kBAAM,CAAC,qBAAqB,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,CAAC,oBAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAChF,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC,CAAA;AAJY,QAAA,qBAAqB,yBAIjC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export declare const defaults: {
|
2
|
+
header: (title: string) => string;
|
3
|
+
default_body: (content: string[]) => string;
|
4
|
+
footer: () => string;
|
5
|
+
};
|
6
|
+
export declare const bodies: {
|
7
|
+
user_forget_password: (url: string) => string;
|
8
|
+
user_change_password: () => string;
|
9
|
+
user_change_email: () => string;
|
10
|
+
user_reset_password: () => string;
|
11
|
+
user_login: () => string;
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=templates.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/emails/templates.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;oBACH,MAAM;4BAME,MAAM,EAAE;;CAUjC,CAAA;AAED,eAAO,MAAM,MAAM;gCACW,MAAM;;;;;CAuCnC,CAAA"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.bodies = exports.defaults = void 0;
|
4
|
+
exports.defaults = {
|
5
|
+
header: (title) => `
|
6
|
+
<div style="text-align: center; margin-bottom: 30px;">
|
7
|
+
<img style="margin-bottom: 16px" src="https://coinbitclub.vip/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoinbitclub-logo.b29de722.png&w=640&q=75" alt="Coinbitclub Logo" />
|
8
|
+
<h1 style="color: #2c3e50; font-size: 26px; margin: 0;">${title}</h1>
|
9
|
+
</div>
|
10
|
+
`,
|
11
|
+
default_body: (content) => `<body style="font-family: Arial, sans-serif; background-color: #eef2f7; color: #333; margin: 0; padding: 0;">
|
12
|
+
<div style="max-width: 600px; margin: 40px auto; background-color: #ffffff; border: 1px solid #dcdfe6; border-radius: 10px; padding: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);">
|
13
|
+
${content.join("")}
|
14
|
+
</div>
|
15
|
+
</body>`,
|
16
|
+
footer: () => `
|
17
|
+
<div style="text-align: center; font-size: 13px; color: #95a5a6; margin-top: 40px; border-top: 1px solid #ecf0f1; padding-top: 20px;">
|
18
|
+
<p>Este email foi enviado automaticamente. Por favor, não responda.</p>
|
19
|
+
</div>
|
20
|
+
`
|
21
|
+
};
|
22
|
+
exports.bodies = {
|
23
|
+
user_forget_password: (url) => `
|
24
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
25
|
+
<p>Olá,</p>
|
26
|
+
<p>Recebemos uma solicitação para redefinir sua senha em nossa plataforma. Para garantir que você é o proprietário desta conta, criamos um link exclusivo para redefinir sua senha.</p>
|
27
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
28
|
+
<p>Para redefinir sua senha, clique no botão abaixo:</p>
|
29
|
+
</div>
|
30
|
+
<div style="text-align: center; margin: 30px 0;">
|
31
|
+
<a href="${url}" style="display: inline-block; padding: 15px 30px; background-color: #3498db; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: bold; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);">Redefinir Senha</a>
|
32
|
+
</div>
|
33
|
+
<div style="font-size: 14px; line-height: 1.7; color: #666;">
|
34
|
+
<p>Por razões de segurança, evite compartilhar suas informações de login ou clicar em links suspeitos.</p>
|
35
|
+
<p>Agradecemos por escolher nossa plataforma!</p>
|
36
|
+
</div>
|
37
|
+
`,
|
38
|
+
user_change_password: () => `
|
39
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
40
|
+
<p>Sua senha no CoinBitClub foi alterada recentemente.</p>
|
41
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
42
|
+
</div>
|
43
|
+
`,
|
44
|
+
user_change_email: () => `
|
45
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
46
|
+
<p>Seu endereço de e-mail foi alterado com sucesso. Se você realizou essa alteração, nenhuma ação adicional é necessária.</p>
|
47
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
48
|
+
</div>
|
49
|
+
`,
|
50
|
+
user_reset_password: () => `
|
51
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
52
|
+
<p>Sua senha foi redefinida com sucesso. Agora você já pode acessar sua conta normalmente utilizando a nova senha.</p>
|
53
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
54
|
+
</div>
|
55
|
+
`,
|
56
|
+
user_login: () => `
|
57
|
+
<div style="line-height: 1.8; font-size: 16px; color: #555; text-align: justify;">
|
58
|
+
<p>Um novo login foi realizado recentemente na sua conta do CoinBitClub.</p>
|
59
|
+
<p>Se você não fez essa solicitação, entre em contato conosco imediatamente para garantir a segurança de sua conta.</p>
|
60
|
+
</div>
|
61
|
+
`,
|
62
|
+
};
|
63
|
+
//# sourceMappingURL=templates.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/emails/templates.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC;;;gEAGmC,KAAK;;GAElE;IACD,YAAY,EAAE,CAAC,OAAiB,EAAE,EAAE,CAAC;;UAE7B,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;;YAEd;IACV,MAAM,EAAE,GAAG,EAAE,CAAC;;;;GAIb;CACF,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,oBAAoB,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC;;;;;;;;mBAQtB,GAAG;;;;;;GAMnB;IACD,oBAAoB,EAAE,GAAG,EAAE,CAAC;;;;;GAK3B;IACD,iBAAiB,EAAE,GAAG,EAAE,CAAC;;;;;GAKxB;IACD,mBAAmB,EAAE,GAAG,EAAE,CAAC;;;;;GAK1B;IACD,UAAU,EAAE,GAAG,EAAE,CAAC;;;;;GAKjB;CACF,CAAA"}
|
@@ -1,55 +1,55 @@
|
|
1
|
-
import FormPanel, {
|
2
|
-
FormPanelRef,
|
3
|
-
getFieldsLocale,
|
4
|
-
} from "@/components/panels/form-panel";
|
5
|
-
|
6
|
-
import { useMenuCreate } from "@/features/admin/menu";
|
7
|
-
import { Menu } from "@/types/models";
|
8
|
-
import { forwardRef, useImperativeHandle, useRef } from "react";
|
9
|
-
import { useTranslation } from "react-i18next";
|
10
|
-
|
11
|
-
export type MenuCreatePanelRef = {
|
12
|
-
submit: () => void;
|
13
|
-
};
|
14
|
-
|
15
|
-
export type MenuCreatePanelProps = {
|
16
|
-
onCreated?: (data: Menu) => void;
|
17
|
-
};
|
18
|
-
|
19
|
-
const MenuCreatePanel = forwardRef(
|
20
|
-
({ onCreated }: MenuCreatePanelProps, ref) => {
|
21
|
-
const formRef = useRef<FormPanelRef>(null);
|
22
|
-
const { t } = useTranslation(["actions", "fields", "translations"]);
|
23
|
-
const { mutateAsync: createMenu } = useMenuCreate();
|
24
|
-
|
25
|
-
useImperativeHandle(
|
26
|
-
ref,
|
27
|
-
() => ({
|
28
|
-
submit: () => {
|
29
|
-
formRef.current?.submit();
|
30
|
-
},
|
31
|
-
}),
|
32
|
-
[formRef],
|
33
|
-
);
|
34
|
-
|
35
|
-
return (
|
36
|
-
<FormPanel
|
37
|
-
ref={formRef}
|
38
|
-
fields={[...getFieldsLocale([{ name: "name" }])]}
|
39
|
-
button={{ text: t("create", { ns: "actions" }) }}
|
40
|
-
onSubmit={async (data) => {
|
41
|
-
const createdData = await createMenu({
|
42
|
-
data,
|
43
|
-
});
|
44
|
-
if (typeof onCreated === "function") {
|
45
|
-
onCreated(createdData as any);
|
46
|
-
}
|
47
|
-
}}
|
48
|
-
/>
|
49
|
-
);
|
50
|
-
},
|
51
|
-
);
|
52
|
-
|
53
|
-
MenuCreatePanel.displayName = "MenuCreatePanel";
|
54
|
-
|
55
|
-
export default MenuCreatePanel;
|
1
|
+
import FormPanel, {
|
2
|
+
FormPanelRef,
|
3
|
+
getFieldsLocale,
|
4
|
+
} from "@/components/panels/form-panel";
|
5
|
+
|
6
|
+
import { useMenuCreate } from "@/features/admin/menu";
|
7
|
+
import { Menu } from "@/types/models";
|
8
|
+
import { forwardRef, useImperativeHandle, useRef } from "react";
|
9
|
+
import { useTranslation } from "react-i18next";
|
10
|
+
|
11
|
+
export type MenuCreatePanelRef = {
|
12
|
+
submit: () => void;
|
13
|
+
};
|
14
|
+
|
15
|
+
export type MenuCreatePanelProps = {
|
16
|
+
onCreated?: (data: Menu) => void;
|
17
|
+
};
|
18
|
+
|
19
|
+
const MenuCreatePanel = forwardRef(
|
20
|
+
({ onCreated }: MenuCreatePanelProps, ref) => {
|
21
|
+
const formRef = useRef<FormPanelRef>(null);
|
22
|
+
const { t } = useTranslation(["actions", "fields", "translations"]);
|
23
|
+
const { mutateAsync: createMenu } = useMenuCreate();
|
24
|
+
|
25
|
+
useImperativeHandle(
|
26
|
+
ref,
|
27
|
+
() => ({
|
28
|
+
submit: () => {
|
29
|
+
formRef.current?.submit();
|
30
|
+
},
|
31
|
+
}),
|
32
|
+
[formRef],
|
33
|
+
);
|
34
|
+
|
35
|
+
return (
|
36
|
+
<FormPanel
|
37
|
+
ref={formRef}
|
38
|
+
fields={[...getFieldsLocale([{ name: "name" }])]}
|
39
|
+
button={{ text: t("create", { ns: "actions" }) }}
|
40
|
+
onSubmit={async (data) => {
|
41
|
+
const createdData = await createMenu({
|
42
|
+
data,
|
43
|
+
});
|
44
|
+
if (typeof onCreated === "function") {
|
45
|
+
onCreated(createdData as any);
|
46
|
+
}
|
47
|
+
}}
|
48
|
+
/>
|
49
|
+
);
|
50
|
+
},
|
51
|
+
);
|
52
|
+
|
53
|
+
MenuCreatePanel.displayName = "MenuCreatePanel";
|
54
|
+
|
55
|
+
export default MenuCreatePanel;
|
@@ -1,67 +1,67 @@
|
|
1
|
-
import FormPanel, {
|
2
|
-
FormPanelRef,
|
3
|
-
getFieldsLocale,
|
4
|
-
} from "@/components/panels/form-panel";
|
5
|
-
import { Overlay } from "@/components/custom/overlay";
|
6
|
-
import { TabPanel } from "@/components/panels/tab-panel";
|
7
|
-
import { useMenuGet, useMenuUpdate } from "@/features/admin/menu";
|
8
|
-
import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
|
9
|
-
import { Menu } from "@/types/models";
|
10
|
-
import { useState, forwardRef, useImperativeHandle, useRef } from "react";
|
11
|
-
import { useTranslation } from "react-i18next";
|
12
|
-
import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
|
13
|
-
|
14
|
-
export type MenuUpdatePanelProps = {
|
15
|
-
data: Menu;
|
16
|
-
onUpdated?: (data: Menu) => void;
|
17
|
-
};
|
18
|
-
|
19
|
-
const MenuUpdatePanel = forwardRef(
|
20
|
-
({ data, onUpdated }: MenuUpdatePanelProps, ref) => {
|
21
|
-
const { t } = useTranslation(["actions", "fields", "translations"]);
|
22
|
-
const { data: item, isLoading } = useMenuGet(data.id as number);
|
23
|
-
const { mutate: menuUpdate } = useMenuUpdate();
|
24
|
-
const formRef = useRef<FormPanelRef>(null);
|
25
|
-
|
26
|
-
useEffectAfterFirstUpdate(() => {
|
27
|
-
if (item && formRef.current) {
|
28
|
-
formRef.current.setValuesFromItem(item);
|
29
|
-
}
|
30
|
-
}, [item]);
|
31
|
-
|
32
|
-
useImperativeHandle(ref, () => ({}));
|
33
|
-
|
34
|
-
return (
|
35
|
-
<TabPanel
|
36
|
-
activeTabIndex={0}
|
37
|
-
tabs={[
|
38
|
-
{
|
39
|
-
title: t("details", { ns: "actions" }),
|
40
|
-
children: (
|
41
|
-
<Overlay loading={isLoading}>
|
42
|
-
<FormPanel
|
43
|
-
ref={formRef}
|
44
|
-
fields={[...getFieldsLocale([{ name: "name" }], item)]}
|
45
|
-
button={{ text: t("save", { ns: "actions" }) }}
|
46
|
-
onSubmit={(data) => {
|
47
|
-
menuUpdate({
|
48
|
-
id: data.id,
|
49
|
-
data,
|
50
|
-
});
|
51
|
-
if (typeof onUpdated === "function") {
|
52
|
-
onUpdated(data);
|
53
|
-
}
|
54
|
-
}}
|
55
|
-
/>
|
56
|
-
</Overlay>
|
57
|
-
),
|
58
|
-
},
|
59
|
-
]}
|
60
|
-
/>
|
61
|
-
);
|
62
|
-
},
|
63
|
-
);
|
64
|
-
|
65
|
-
MenuUpdatePanel.displayName = "MenuUpdatePanel";
|
66
|
-
|
67
|
-
export default MenuUpdatePanel;
|
1
|
+
import FormPanel, {
|
2
|
+
FormPanelRef,
|
3
|
+
getFieldsLocale,
|
4
|
+
} from "@/components/panels/form-panel";
|
5
|
+
import { Overlay } from "@/components/custom/overlay";
|
6
|
+
import { TabPanel } from "@/components/panels/tab-panel";
|
7
|
+
import { useMenuGet, useMenuUpdate } from "@/features/admin/menu";
|
8
|
+
import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
|
9
|
+
import { Menu } from "@/types/models";
|
10
|
+
import { useState, forwardRef, useImperativeHandle, useRef } from "react";
|
11
|
+
import { useTranslation } from "react-i18next";
|
12
|
+
import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
|
13
|
+
|
14
|
+
export type MenuUpdatePanelProps = {
|
15
|
+
data: Menu;
|
16
|
+
onUpdated?: (data: Menu) => void;
|
17
|
+
};
|
18
|
+
|
19
|
+
const MenuUpdatePanel = forwardRef(
|
20
|
+
({ data, onUpdated }: MenuUpdatePanelProps, ref) => {
|
21
|
+
const { t } = useTranslation(["actions", "fields", "translations"]);
|
22
|
+
const { data: item, isLoading } = useMenuGet(data.id as number);
|
23
|
+
const { mutate: menuUpdate } = useMenuUpdate();
|
24
|
+
const formRef = useRef<FormPanelRef>(null);
|
25
|
+
|
26
|
+
useEffectAfterFirstUpdate(() => {
|
27
|
+
if (item && formRef.current) {
|
28
|
+
formRef.current.setValuesFromItem(item);
|
29
|
+
}
|
30
|
+
}, [item]);
|
31
|
+
|
32
|
+
useImperativeHandle(ref, () => ({}));
|
33
|
+
|
34
|
+
return (
|
35
|
+
<TabPanel
|
36
|
+
activeTabIndex={0}
|
37
|
+
tabs={[
|
38
|
+
{
|
39
|
+
title: t("details", { ns: "actions" }),
|
40
|
+
children: (
|
41
|
+
<Overlay loading={isLoading}>
|
42
|
+
<FormPanel
|
43
|
+
ref={formRef}
|
44
|
+
fields={[...getFieldsLocale([{ name: "name" }], item)]}
|
45
|
+
button={{ text: t("save", { ns: "actions" }) }}
|
46
|
+
onSubmit={(data) => {
|
47
|
+
menuUpdate({
|
48
|
+
id: data.id,
|
49
|
+
data,
|
50
|
+
});
|
51
|
+
if (typeof onUpdated === "function") {
|
52
|
+
onUpdated(data);
|
53
|
+
}
|
54
|
+
}}
|
55
|
+
/>
|
56
|
+
</Overlay>
|
57
|
+
),
|
58
|
+
},
|
59
|
+
]}
|
60
|
+
/>
|
61
|
+
);
|
62
|
+
},
|
63
|
+
);
|
64
|
+
|
65
|
+
MenuUpdatePanel.displayName = "MenuUpdatePanel";
|
66
|
+
|
67
|
+
export default MenuUpdatePanel;
|