@hedhog/admin 0.0.26 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/screen/screen.controller.d.ts +3 -3
- package/dist/screen/screen.controller.d.ts.map +1 -1
- package/dist/screen/screen.controller.js +13 -9
- package/dist/screen/screen.controller.js.map +1 -1
- package/dist/screen/screen.service.d.ts +3 -3
- package/dist/screen/screen.service.d.ts.map +1 -1
- package/dist/screen/screen.service.js +12 -3
- package/dist/screen/screen.service.js.map +1 -1
- package/package.json +1 -1
- package/src/migrations/migrate-01.ts +3 -2
- package/src/migrations/migrate-02.ts +172 -20
@@ -6,9 +6,9 @@ import { UpdateIdsDTO } from '../dto/update-ids.dto';
|
|
6
6
|
export declare class ScreenController {
|
7
7
|
private readonly screenService;
|
8
8
|
constructor(screenService: ScreenService);
|
9
|
-
getScreens(paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
10
|
-
listRoles(screenId: number, paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
11
|
-
listRoutes(screenId: number, paginationParams: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
9
|
+
getScreens(paginationParams: any, locale: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
10
|
+
listRoles(screenId: number, paginationParams: any, locale: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
11
|
+
listRoutes(screenId: number, paginationParams: any, locale: any): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
12
12
|
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<any>;
|
13
13
|
updateRoutes(screenId: number, data: UpdateIdsDTO): Promise<any>;
|
14
14
|
show(screenId: number): Promise<any>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.controller.d.ts","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"screen.controller.d.ts","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,qBAGa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAIzC,UAAU,CAAe,gBAAgB,KAAA,EAAY,MAAM,KAAA;IAK3D,SAAS,CACoB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA,EACpB,MAAM,KAAA;IAMZ,UAAU,CACmB,QAAQ,EAAE,MAAM,EACnC,gBAAgB,KAAA,EACpB,MAAM,KAAA;IAMZ,WAAW,CACkB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,YAAY,CACiB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,YAAY;IAMtB,IAAI,CAAkC,QAAQ,EAAE,MAAM;IAK5D,MAAM,CAAS,IAAI,EAAE,SAAS;IAKxB,MAAM,CACuB,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,SAAS;IASnB,MAAM,CAAS,IAAI,EAAE,SAAS;CAGrC"}
|
@@ -22,18 +22,19 @@ const screen_service_1 = require("./screen.service");
|
|
22
22
|
const auth_guard_1 = require("../auth/guards/auth.guard");
|
23
23
|
const role_decorator_1 = require("../role/decorators/role.decorator");
|
24
24
|
const update_ids_dto_1 = require("../dto/update-ids.dto");
|
25
|
+
const locale_1 = require("@hedhog/locale");
|
25
26
|
let ScreenController = class ScreenController {
|
26
27
|
constructor(screenService) {
|
27
28
|
this.screenService = screenService;
|
28
29
|
}
|
29
|
-
async getScreens(paginationParams) {
|
30
|
-
return this.screenService.getScreens(paginationParams);
|
30
|
+
async getScreens(paginationParams, locale) {
|
31
|
+
return this.screenService.getScreens(locale, paginationParams);
|
31
32
|
}
|
32
|
-
async listRoles(screenId, paginationParams) {
|
33
|
-
return this.screenService.listRoles(screenId, paginationParams);
|
33
|
+
async listRoles(screenId, paginationParams, locale) {
|
34
|
+
return this.screenService.listRoles(locale, screenId, paginationParams);
|
34
35
|
}
|
35
|
-
async listRoutes(screenId, paginationParams) {
|
36
|
-
return this.screenService.listRoutes(screenId, paginationParams);
|
36
|
+
async listRoutes(screenId, paginationParams, locale) {
|
37
|
+
return this.screenService.listRoutes(locale, screenId, paginationParams);
|
37
38
|
}
|
38
39
|
async updateRoles(screenId, data) {
|
39
40
|
return this.screenService.updateRoles(screenId, data);
|
@@ -61,24 +62,27 @@ exports.ScreenController = ScreenController;
|
|
61
62
|
__decorate([
|
62
63
|
(0, common_1.Get)(),
|
63
64
|
__param(0, (0, pagination_1.Pagination)()),
|
65
|
+
__param(1, (0, locale_1.Locale)()),
|
64
66
|
__metadata("design:type", Function),
|
65
|
-
__metadata("design:paramtypes", [Object]),
|
67
|
+
__metadata("design:paramtypes", [Object, Object]),
|
66
68
|
__metadata("design:returntype", Promise)
|
67
69
|
], ScreenController.prototype, "getScreens", null);
|
68
70
|
__decorate([
|
69
71
|
(0, common_1.Get)(':screenId/roles'),
|
70
72
|
__param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
|
71
73
|
__param(1, (0, pagination_1.Pagination)()),
|
74
|
+
__param(2, (0, locale_1.Locale)()),
|
72
75
|
__metadata("design:type", Function),
|
73
|
-
__metadata("design:paramtypes", [Number, Object]),
|
76
|
+
__metadata("design:paramtypes", [Number, Object, Object]),
|
74
77
|
__metadata("design:returntype", Promise)
|
75
78
|
], ScreenController.prototype, "listRoles", null);
|
76
79
|
__decorate([
|
77
80
|
(0, common_1.Get)(':screenId/routes'),
|
78
81
|
__param(0, (0, common_1.Param)('screenId', common_1.ParseIntPipe)),
|
79
82
|
__param(1, (0, pagination_1.Pagination)()),
|
83
|
+
__param(2, (0, locale_1.Locale)()),
|
80
84
|
__metadata("design:type", Function),
|
81
|
-
__metadata("design:paramtypes", [Number, Object]),
|
85
|
+
__metadata("design:paramtypes", [Number, Object, Object]),
|
82
86
|
__metadata("design:returntype", Promise)
|
83
87
|
], ScreenController.prototype, "listRoutes", null);
|
84
88
|
__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.controller.js","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,kDAA8C;AAC9C,iDAA6C;AAC7C,qDAAiD;AACjD,0DAAsD;AACtD,sEAAyD;AACzD,0DAAqD;
|
1
|
+
{"version":3,"file":"screen.controller.js","sourceRoot":"","sources":["../../src/screen/screen.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAgD;AAChD,2CAYwB;AACxB,iDAA6C;AAC7C,kDAA8C;AAC9C,iDAA6C;AAC7C,qDAAiD;AACjD,0DAAsD;AACtD,sEAAyD;AACzD,0DAAqD;AACrD,2CAAwC;AAKjC,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAGE,AAAN,KAAK,CAAC,UAAU,CAAe,gBAAgB,EAAY,MAAM;QAC/D,OAAO,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACjE,CAAC;IAGK,AAAN,KAAK,CAA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CAEnC;2BArEU,gBAAgB;IAH5B,IAAA,qBAAI,GAAE;IACN,IAAA,kBAAS,EAAC,sBAAS,CAAC;IACpB,IAAA,mBAAU,EAAC,SAAS,CAAC;IAGjB,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,8BAAa,CAAC,CAAC,CAAA;qCACR,8BAAa;GAHpC,gBAAgB,CAsE5B"}
|
@@ -10,9 +10,9 @@ export declare class ScreenService {
|
|
10
10
|
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
11
11
|
updateRoles(screenId: number, data: UpdateIdsDTO): Promise<any>;
|
12
12
|
updateRoutes(screenId: number, { ids }: UpdateIdsDTO): Promise<any>;
|
13
|
-
listRoutes(screenId: number, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
14
|
-
listRoles(screenId: number, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
15
|
-
getScreens(paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
13
|
+
listRoutes(locale: string, screenId: number, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
14
|
+
listRoles(locale: string, screenId: number, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
15
|
+
getScreens(locale: string, paginationParams: PaginationDTO): Promise<import("@hedhog/pagination").PaginatedResult<unknown>>;
|
16
16
|
get(screenId: number): Promise<any>;
|
17
17
|
create({ name, slug, description, icon }: CreateDTO): Promise<any>;
|
18
18
|
update({ id, data }: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.service.d.ts","sourceRoot":"","sources":["../../src/screen/screen.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO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EACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,aAAa;IAqB3B,SAAS,CACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,aAAa;IAqB3B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa;IA2B1D,GAAG,CAAC,QAAQ,EAAE,MAAM;IAIpB,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,SAAS;IAWnD,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE;IAOpD,MAAM,CAAC,EAAE,GAAG,EAAE,EAAE,SAAS;CAehC"}
|
@@ -59,7 +59,7 @@ let ScreenService = class ScreenService {
|
|
59
59
|
skipDuplicates: true,
|
60
60
|
});
|
61
61
|
}
|
62
|
-
async listRoutes(screenId, paginationParams) {
|
62
|
+
async listRoutes(locale, screenId, paginationParams) {
|
63
63
|
return this.paginationService.paginate(this.prismaService.routes, paginationParams, {
|
64
64
|
include: {
|
65
65
|
route_screens: {
|
@@ -74,7 +74,7 @@ let ScreenService = class ScreenService {
|
|
74
74
|
},
|
75
75
|
});
|
76
76
|
}
|
77
|
-
async listRoles(screenId, paginationParams) {
|
77
|
+
async listRoles(locale, screenId, paginationParams) {
|
78
78
|
return this.paginationService.paginate(this.prismaService.roles, paginationParams, {
|
79
79
|
include: {
|
80
80
|
role_screens: {
|
@@ -89,13 +89,22 @@ let ScreenService = class ScreenService {
|
|
89
89
|
},
|
90
90
|
});
|
91
91
|
}
|
92
|
-
async getScreens(paginationParams) {
|
92
|
+
async getScreens(locale, paginationParams) {
|
93
93
|
const fields = ['name', 'slug', 'description', 'icon'];
|
94
94
|
const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
|
95
95
|
return this.paginationService.paginate(this.prismaService.screens, paginationParams, {
|
96
96
|
where: {
|
97
97
|
OR,
|
98
98
|
},
|
99
|
+
include: {
|
100
|
+
screen_translations: {
|
101
|
+
where: {
|
102
|
+
locale: {
|
103
|
+
code: locale,
|
104
|
+
},
|
105
|
+
},
|
106
|
+
},
|
107
|
+
},
|
99
108
|
});
|
100
109
|
}
|
101
110
|
async get(screenId) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"screen.service.js","sourceRoot":"","sources":["../../src/screen/screen.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAsE;AACtE,2CAA+C;AAC/C,2CAKwB;AAOjB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,aAA4B,EAE5B,iBAAoC;QAFpC,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;IACpD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,IAAkB;QACpD,MAAM,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC;YAC/C,KAAK,EAAE;gBACL,SAAS,EAAE,QAAQ;aACpB;SACF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC;YAChD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAC9B,SAAS,EAAE,QAAQ;gBACnB,OAAO,EAAE,MAAM;aAChB,CAAC,CAAC;YACH,cAAc,EAAE,IAAI;SACrB,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,QAAgB,EAAE,EAAE,GAAG,EAAgB;QACxD,GAAG,GAAG,CACJ,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC;YACvC,KAAK,EAAE;gBACL,EAAE,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;aACF;YACD,MAAM,EAAE;gBACN,EAAE,EAAE,I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AC,EAAE,EAAE,EAAE,IAAI,EAAmC;QACxD,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;YACvC,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,GAAG,EAAa;QAC7B,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACpC,MAAM,IAAI,4BAAmB,CAC3B,gDAAgD,CACjD,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC;YAC3C,KAAK,EAAE;gBACL,EAAE,EAAE;oBACF,EAAE,EAAE,GAAG;iBACR;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAnKY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGR,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,8BAAiB,CAAC,CAAC,CAAA;qCADZ,sBAAa;QAET,8BAAiB;GAL5C,aAAa,CAmKzB"}
|
package/package.json
CHANGED
@@ -21,16 +21,17 @@ export class Migrate implements MigrationInterface {
|
|
21
21
|
new Table({
|
22
22
|
name: 'multifactor_translations',
|
23
23
|
columns: [
|
24
|
-
idColumn(),
|
25
24
|
{
|
26
25
|
name: 'multifactor_id',
|
27
26
|
type: 'int',
|
28
27
|
unsigned: true,
|
28
|
+
isPrimary: true,
|
29
29
|
},
|
30
30
|
{
|
31
31
|
name: 'locale_id',
|
32
32
|
type: 'int',
|
33
33
|
unsigned: true,
|
34
|
+
isPrimary: true,
|
34
35
|
},
|
35
36
|
{
|
36
37
|
name: 'name',
|
@@ -93,7 +94,7 @@ export class Migrate implements MigrationInterface {
|
|
93
94
|
},
|
94
95
|
{
|
95
96
|
multifactor_id: 2,
|
96
|
-
locale_id:
|
97
|
+
locale_id: 2,
|
97
98
|
name: 'Aplicativo',
|
98
99
|
},
|
99
100
|
])
|
@@ -1,6 +1,11 @@
|
|
1
1
|
import { idColumn, timestampColumn } from '@hedhog/utils';
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
MigrationInterface,
|
5
|
+
QueryRunner,
|
6
|
+
Table,
|
7
|
+
TableForeignKey,
|
8
|
+
} from 'typeorm';
|
4
9
|
|
5
10
|
export class Migrate implements MigrationInterface {
|
6
11
|
async up(queryRunner: QueryRunner) {
|
@@ -10,72 +15,219 @@ export class Migrate implements MigrationInterface {
|
|
10
15
|
columns: [
|
11
16
|
idColumn(),
|
12
17
|
{
|
13
|
-
name: '
|
18
|
+
name: 'slug',
|
14
19
|
type: 'varchar',
|
20
|
+
isUnique: true,
|
15
21
|
},
|
16
22
|
{
|
17
|
-
name: '
|
23
|
+
name: 'icon',
|
18
24
|
type: 'varchar',
|
19
|
-
|
25
|
+
isNullable: true,
|
26
|
+
},
|
27
|
+
timestampColumn(),
|
28
|
+
timestampColumn('updated_at'),
|
29
|
+
],
|
30
|
+
}),
|
31
|
+
);
|
32
|
+
|
33
|
+
await queryRunner.createTable(
|
34
|
+
new Table({
|
35
|
+
name: 'screen_translations',
|
36
|
+
columns: [
|
37
|
+
{
|
38
|
+
name: 'screen_id',
|
39
|
+
type: 'int',
|
40
|
+
unsigned: true,
|
41
|
+
isPrimary: true,
|
20
42
|
},
|
21
43
|
{
|
22
|
-
name: '
|
44
|
+
name: 'locale_id',
|
45
|
+
type: 'int',
|
46
|
+
unsigned: true,
|
47
|
+
isPrimary: true,
|
48
|
+
},
|
49
|
+
{
|
50
|
+
name: 'name',
|
23
51
|
type: 'varchar',
|
24
52
|
},
|
25
53
|
{
|
26
|
-
name: '
|
54
|
+
name: 'description',
|
27
55
|
type: 'varchar',
|
28
|
-
isNullable: true,
|
29
56
|
},
|
30
57
|
timestampColumn(),
|
31
58
|
timestampColumn('updated_at'),
|
32
59
|
],
|
60
|
+
foreignKeys: [
|
61
|
+
new TableForeignKey({
|
62
|
+
columnNames: ['screen_id'],
|
63
|
+
referencedTableName: 'screens',
|
64
|
+
referencedColumnNames: ['id'],
|
65
|
+
onDelete: 'CASCADE',
|
66
|
+
}),
|
67
|
+
new TableForeignKey({
|
68
|
+
columnNames: ['locale_id'],
|
69
|
+
referencedTableName: 'locales',
|
70
|
+
referencedColumnNames: ['id'],
|
71
|
+
onDelete: 'CASCADE',
|
72
|
+
}),
|
73
|
+
],
|
33
74
|
}),
|
34
75
|
);
|
35
76
|
|
36
77
|
await queryRunner.manager
|
37
78
|
.createQueryBuilder()
|
38
79
|
.insert()
|
39
|
-
.into('screens', ['
|
80
|
+
.into('screens', ['slug', 'icon'])
|
40
81
|
.values([
|
41
82
|
{
|
42
|
-
name: 'Users',
|
43
83
|
slug: '/management/users',
|
44
|
-
description: 'Check all users registered in the system.',
|
45
84
|
icon: 'users',
|
46
85
|
},
|
47
86
|
{
|
48
|
-
name: 'Roles',
|
49
87
|
slug: '/management/roles',
|
50
|
-
description: 'Check all roles registered in the system.',
|
51
88
|
icon: 'circles',
|
52
89
|
},
|
53
90
|
{
|
54
|
-
name: 'Screens',
|
55
91
|
slug: '/management/screens',
|
56
|
-
description: 'Check all screens registered in the system.',
|
57
92
|
icon: 'monitor',
|
58
93
|
},
|
59
94
|
{
|
60
|
-
name: 'Menus',
|
61
95
|
slug: '/management/menus',
|
62
|
-
description: 'Check all menus registered in the system.',
|
63
96
|
icon: 'menu',
|
64
97
|
},
|
65
98
|
{
|
66
|
-
name: 'Routes',
|
67
99
|
slug: '/management/routes',
|
68
|
-
description: 'Check all routes registered in the system.',
|
69
100
|
icon: 'route',
|
70
101
|
},
|
71
102
|
{
|
72
|
-
name: 'Settings',
|
73
103
|
slug: '/management/settings',
|
74
|
-
description: 'Check all settings registered in the system.',
|
75
104
|
icon: 'settings',
|
76
105
|
},
|
77
106
|
])
|
78
107
|
.execute();
|
108
|
+
|
109
|
+
const screenUsers = await queryRunner.manager
|
110
|
+
.createQueryBuilder()
|
111
|
+
.select('id')
|
112
|
+
.from('screens', 's')
|
113
|
+
.where('s.slug = :slug', { slug: '/management/users' })
|
114
|
+
.execute();
|
115
|
+
const screenRoles = await queryRunner.manager
|
116
|
+
.createQueryBuilder()
|
117
|
+
.select('id')
|
118
|
+
.from('screens', 's')
|
119
|
+
.where('s.slug = :slug', { slug: '/management/roles' })
|
120
|
+
.execute();
|
121
|
+
const screenScreens = await queryRunner.manager
|
122
|
+
.createQueryBuilder()
|
123
|
+
.select('id')
|
124
|
+
.from('screens', 's')
|
125
|
+
.where('s.slug = :slug', { slug: '/management/screens' })
|
126
|
+
.execute();
|
127
|
+
const screenMenus = await queryRunner.manager
|
128
|
+
.createQueryBuilder()
|
129
|
+
.select('id')
|
130
|
+
.from('screens', 's')
|
131
|
+
.where('s.slug = :slug', { slug: '/management/menus' })
|
132
|
+
.execute();
|
133
|
+
const screenRoutes = await queryRunner.manager
|
134
|
+
.createQueryBuilder()
|
135
|
+
.select('id')
|
136
|
+
.from('screens', 's')
|
137
|
+
.where('s.slug = :slug', { slug: '/management/routes' })
|
138
|
+
.execute();
|
139
|
+
const screenSettings = await queryRunner.manager
|
140
|
+
.createQueryBuilder()
|
141
|
+
.select('id')
|
142
|
+
.from('screens', 's')
|
143
|
+
.where('s.slug = :slug', { slug: '/management/settings' })
|
144
|
+
.execute();
|
145
|
+
|
146
|
+
await queryRunner.manager
|
147
|
+
.createQueryBuilder()
|
148
|
+
.insert()
|
149
|
+
.into('screen_translations', [
|
150
|
+
'screen_id',
|
151
|
+
'locale_id',
|
152
|
+
'name',
|
153
|
+
'description',
|
154
|
+
])
|
155
|
+
.values([
|
156
|
+
{
|
157
|
+
screen_id: screenUsers[0].id,
|
158
|
+
locale_id: 1,
|
159
|
+
name: 'Users',
|
160
|
+
description: 'Check all users registered in the system.',
|
161
|
+
},
|
162
|
+
{
|
163
|
+
screen_id: screenUsers[0].id,
|
164
|
+
locale_id: 2,
|
165
|
+
name: 'Usuários',
|
166
|
+
description: 'Verifique todos os usuários registrados no sistema.',
|
167
|
+
},
|
168
|
+
{
|
169
|
+
screen_id: screenRoles[0].id,
|
170
|
+
locale_id: 1,
|
171
|
+
name: 'Roles',
|
172
|
+
description: 'Check all roles registered in the system.',
|
173
|
+
},
|
174
|
+
{
|
175
|
+
screen_id: screenRoles[0].id,
|
176
|
+
locale_id: 2,
|
177
|
+
name: 'Funções',
|
178
|
+
description: 'Verifique todas as funções registradas no sistema.',
|
179
|
+
},
|
180
|
+
{
|
181
|
+
screen_id: screenScreens[0].id,
|
182
|
+
locale_id: 1,
|
183
|
+
name: 'Screens',
|
184
|
+
description: 'Check all screens registered in the system.',
|
185
|
+
},
|
186
|
+
{
|
187
|
+
screen_id: screenScreens[0].id,
|
188
|
+
locale_id: 2,
|
189
|
+
name: 'Telas',
|
190
|
+
description: 'Verifique todas as telas registradas no sistema.',
|
191
|
+
},
|
192
|
+
{
|
193
|
+
screen_id: screenMenus[0].id,
|
194
|
+
locale_id: 1,
|
195
|
+
name: 'Menus',
|
196
|
+
description: 'Check all menus registered in the system.',
|
197
|
+
},
|
198
|
+
{
|
199
|
+
screen_id: screenMenus[0].id,
|
200
|
+
locale_id: 2,
|
201
|
+
name: 'Menus',
|
202
|
+
description: 'Verifique todos os menus registrados no sistema.',
|
203
|
+
},
|
204
|
+
{
|
205
|
+
screen_id: screenRoutes[0].id,
|
206
|
+
locale_id: 1,
|
207
|
+
name: 'Routes',
|
208
|
+
description: 'Check all routes registered in the system.',
|
209
|
+
},
|
210
|
+
{
|
211
|
+
screen_id: screenRoutes[0].id,
|
212
|
+
locale_id: 2,
|
213
|
+
name: 'Rotas',
|
214
|
+
description: 'Verifique todas as rotas registradas no sistema.',
|
215
|
+
},
|
216
|
+
{
|
217
|
+
screen_id: screenSettings[0].id,
|
218
|
+
locale_id: 1,
|
219
|
+
name: 'Settings',
|
220
|
+
description: 'Check all settings registered in the system.',
|
221
|
+
},
|
222
|
+
{
|
223
|
+
screen_id: screenSettings[0].id,
|
224
|
+
locale_id: 2,
|
225
|
+
name: 'Configurações',
|
226
|
+
description:
|
227
|
+
'Verifique todas as configurações registradas no sistema.',
|
228
|
+
},
|
229
|
+
])
|
230
|
+
.execute();
|
79
231
|
}
|
80
232
|
|
81
233
|
async down(queryRunner: QueryRunner) {
|