@dracul/audit-frontend 1.35.7 → 1.35.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dracul/audit-frontend",
3
- "version": "1.35.7",
3
+ "version": "1.35.9",
4
4
  "description": "Audit frontend",
5
5
  "author": "Cristian Incarnato <cristian.cdi@gmail.com>",
6
6
  "publishConfig": {
@@ -38,5 +38,5 @@
38
38
  "type": "git",
39
39
  "url": "git+https://github.com/draculjs/modular-framework.git"
40
40
  },
41
- "gitHead": "b9c5be39959452b94d59742d37b0a391ccef62b5"
41
+ "gitHead": "6dcc8ee328f065deb431834da3142fdbec432ccd"
42
42
  }
@@ -34,11 +34,11 @@ const i18nMessages = {
34
34
  delete: 'Delete',
35
35
  restart: 'Reiniciar',
36
36
  detailMessages: {
37
- create: 'A resource with ID "{resourceID}" was created',
38
- read: 'A resource with ID "{resourceID}" was visualized',
39
- update: 'A resource with ID "{resourceID}" was updated',
40
- delete: 'A resource with ID "{resourceID}" was deleted',
41
- restart: 'Se ha reiniciado un recurso con ID "{resourceID}',
37
+ create: 'The resource “{resourceID}” has been created',
38
+ read: 'The resource “{resourceID}” has been readed',
39
+ update: 'The resource “{resourceID}” has been updated',
40
+ delete: 'The resource “{resourceID}” has been deleted',
41
+ restart: 'The resource “{resourceID}” has been restarted',
42
42
  },
43
43
 
44
44
  changes: {
@@ -101,11 +101,11 @@ const i18nMessages = {
101
101
  delete: 'Eliminar',
102
102
  restart: 'Reiniciar',
103
103
  detailMessages: {
104
- create: 'Se ha creado un recurso con ID "{resourceID}"',
105
- read: 'Se ha visualizado un recurso con ID "{resourceID}"',
106
- update: 'Se ha modificado un recurso con ID "{resourceID}"',
107
- delete: 'Se ha eliminado un recurso con ID "{resourceID}"',
108
- restart: 'Se ha reiniciado un recurso con ID "{resourceID}',
104
+ create: 'Se ha creado el recurso "{resourceID}"',
105
+ read: 'Se ha visualizado el recurso "{resourceID}"',
106
+ update: 'Se ha modificado el recurso "{resourceID}"',
107
+ delete: 'Se ha eliminado el recurso "{resourceID}"',
108
+ restart: 'Se ha reiniciado el recurso "{resourceID}',
109
109
  },
110
110
 
111
111
  changes: {
@@ -168,11 +168,11 @@ const i18nMessages = {
168
168
  delete: 'Eliminar',
169
169
  restart: 'Reiniciar',
170
170
  detailMessages: {
171
- create: 'Se ha creado un recurso con ID "{resourceID}"',
172
- read: 'Se ha visualizado un recurso con ID "{resourceID}"',
173
- update: 'Se ha modificado un recurso con ID "{resourceID}"',
174
- delete: 'Se ha eliminado un recurso con ID "{resourceID}"',
175
- restart: 'Se ha reiniciado un recurso con ID "{resourceID}',
171
+ create: 'Se ha creado el recurso "{resourceID}"',
172
+ read: 'Se ha visualizado el recurso "{resourceID}"',
173
+ update: 'Se ha modificado el recurso "{resourceID}"',
174
+ delete: 'Se ha eliminado el recurso "{resourceID}"',
175
+ restart: 'Se ha reiniciado el recurso "{resourceID}',
176
176
  },
177
177
 
178
178
  changes: {
@@ -175,7 +175,7 @@
175
175
 
176
176
 
177
177
  <template v-slot:[`item.details`]="{ item }">
178
- {{ $t(`audit.actions.detailMessages.${item.action.toLowerCase()}`, {resourceID: item.details}) }}
178
+ {{ $t(`audit.actions.detailMessages.${item.action.toLowerCase()}`, {resourceID: getDetailsText(item)}) }}
179
179
  </template>
180
180
 
181
181
  <template slot="no-data">
@@ -279,6 +279,9 @@ export default {
279
279
 
280
280
  return actionColors[action]
281
281
  },
282
+ getDetailsText(item){
283
+ return item.resourceData.Spec.Name ? item.resourceData.Spec.Name : item.details
284
+ },
282
285
  performSearch() {
283
286
  this.pageNumber = 1
284
287
  this.fetch()
@@ -321,7 +324,7 @@ export default {
321
324
  this.fetch()
322
325
  },
323
326
  getAuditDataChanges(audit) {
324
- if (audit && typeof audit.resourceData === 'string') {
327
+ if (audit && audit.resourceData && audit.resourceData !== '' && typeof audit.resourceData === 'string' && audit.resourceData !== null && audit.resourceData !== undefined) {
325
328
  try {
326
329
  audit.resourceData = JSON.parse(audit.resourceData)
327
330
  } catch {
@@ -333,6 +336,7 @@ export default {
333
336
  if (!audit || typeof audit.resourceData !== 'object') return []
334
337
 
335
338
  const buildTree = (data) => {
339
+ if (!data) return [];
336
340
  return Object.entries(data).map(([key, value]) => {
337
341
  if (typeof value === 'object' && value !== null) {
338
342
  return {