@hedhog/admin 0.0.27 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/admin",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -77,41 +77,72 @@ export class Migrate implements MigrationInterface {
77
77
  await queryRunner.manager
78
78
  .createQueryBuilder()
79
79
  .insert()
80
- .into('screens', ['id', 'slug', 'icon'])
80
+ .into('screens', ['slug', 'icon'])
81
81
  .values([
82
82
  {
83
- id: 1,
84
83
  slug: '/management/users',
85
84
  icon: 'users',
86
85
  },
87
86
  {
88
- id: 2,
89
87
  slug: '/management/roles',
90
88
  icon: 'circles',
91
89
  },
92
90
  {
93
- id: 3,
94
91
  slug: '/management/screens',
95
92
  icon: 'monitor',
96
93
  },
97
94
  {
98
- id: 4,
99
95
  slug: '/management/menus',
100
96
  icon: 'menu',
101
97
  },
102
98
  {
103
- id: 5,
104
99
  slug: '/management/routes',
105
100
  icon: 'route',
106
101
  },
107
102
  {
108
- id: 6,
109
103
  slug: '/management/settings',
110
104
  icon: 'settings',
111
105
  },
112
106
  ])
113
107
  .execute();
114
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
+
115
146
  await queryRunner.manager
116
147
  .createQueryBuilder()
117
148
  .insert()
@@ -123,73 +154,73 @@ export class Migrate implements MigrationInterface {
123
154
  ])
124
155
  .values([
125
156
  {
126
- screen_id: 1,
157
+ screen_id: screenUsers[0].id,
127
158
  locale_id: 1,
128
159
  name: 'Users',
129
160
  description: 'Check all users registered in the system.',
130
161
  },
131
162
  {
132
- screen_id: 1,
163
+ screen_id: screenUsers[0].id,
133
164
  locale_id: 2,
134
165
  name: 'Usuários',
135
166
  description: 'Verifique todos os usuários registrados no sistema.',
136
167
  },
137
168
  {
138
- screen_id: 2,
169
+ screen_id: screenRoles[0].id,
139
170
  locale_id: 1,
140
171
  name: 'Roles',
141
172
  description: 'Check all roles registered in the system.',
142
173
  },
143
174
  {
144
- screen_id: 2,
175
+ screen_id: screenRoles[0].id,
145
176
  locale_id: 2,
146
177
  name: 'Funções',
147
178
  description: 'Verifique todas as funções registradas no sistema.',
148
179
  },
149
180
  {
150
- screen_id: 3,
181
+ screen_id: screenScreens[0].id,
151
182
  locale_id: 1,
152
183
  name: 'Screens',
153
184
  description: 'Check all screens registered in the system.',
154
185
  },
155
186
  {
156
- screen_id: 3,
187
+ screen_id: screenScreens[0].id,
157
188
  locale_id: 2,
158
189
  name: 'Telas',
159
190
  description: 'Verifique todas as telas registradas no sistema.',
160
191
  },
161
192
  {
162
- screen_id: 4,
193
+ screen_id: screenMenus[0].id,
163
194
  locale_id: 1,
164
195
  name: 'Menus',
165
196
  description: 'Check all menus registered in the system.',
166
197
  },
167
198
  {
168
- screen_id: 4,
199
+ screen_id: screenMenus[0].id,
169
200
  locale_id: 2,
170
201
  name: 'Menus',
171
202
  description: 'Verifique todos os menus registrados no sistema.',
172
203
  },
173
204
  {
174
- screen_id: 5,
205
+ screen_id: screenRoutes[0].id,
175
206
  locale_id: 1,
176
207
  name: 'Routes',
177
208
  description: 'Check all routes registered in the system.',
178
209
  },
179
210
  {
180
- screen_id: 5,
211
+ screen_id: screenRoutes[0].id,
181
212
  locale_id: 2,
182
213
  name: 'Rotas',
183
214
  description: 'Verifique todas as rotas registradas no sistema.',
184
215
  },
185
216
  {
186
- screen_id: 6,
217
+ screen_id: screenSettings[0].id,
187
218
  locale_id: 1,
188
219
  name: 'Settings',
189
220
  description: 'Check all settings registered in the system.',
190
221
  },
191
222
  {
192
- screen_id: 6,
223
+ screen_id: screenSettings[0].id,
193
224
  locale_id: 2,
194
225
  name: 'Configurações',
195
226
  description: