@raketa-cloud/admin 1.8.13 → 1.8.14

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": "@raketa-cloud/admin",
3
- "version": "1.8.13",
3
+ "version": "1.8.14",
4
4
  "main": "src/index.js",
5
5
  "files": [
6
6
  "src/",
@@ -21,6 +21,7 @@ function minimalResourceFragment() {
21
21
  insertedAt
22
22
  updatedAt
23
23
  translations
24
+ tags ${tagFragment()}
24
25
  }
25
26
  `;
26
27
  }
@@ -75,6 +75,10 @@ function formatTranslations(item) {
75
75
  .join(";");
76
76
  }
77
77
 
78
+ function formatTags(item) {
79
+ return (item?.tags || []).map((tag) => tag.name).join(";");
80
+ }
81
+
78
82
  const standardFieldMapping = (remoteConfig, locale, type) => ({
79
83
  id: "id",
80
84
  type: (item) => extractResourceType(item, type),
@@ -85,6 +89,7 @@ const standardFieldMapping = (remoteConfig, locale, type) => ({
85
89
  created_at: "insertedAt",
86
90
  updated_at: "updatedAt",
87
91
  translations: formatTranslations,
92
+ tags: formatTags,
88
93
  });
89
94
 
90
95
  const standardHeaders = [
@@ -97,6 +102,7 @@ const standardHeaders = [
97
102
  "created_at",
98
103
  "updated_at",
99
104
  "translations",
105
+ "tags",
100
106
  ];
101
107
 
102
108
  export default {
@@ -144,7 +144,7 @@ describe("Resources ExportsHandler", () => {
144
144
  const result = await ExportsHandler.index(ctx);
145
145
 
146
146
  expect(result.text).toBe(
147
- "id,type,locale,title,URL,visibility,created_at,updated_at,translations",
147
+ "id,type,locale,title,URL,visibility,created_at,updated_at,translations,tags",
148
148
  );
149
149
  });
150
150
 
@@ -210,6 +210,7 @@ describe("CSVExportHelper", () => {
210
210
  es: {},
211
211
  de: {},
212
212
  },
213
+ tags: [{ name: "Finance" }, { name: "Product" }],
213
214
  },
214
215
  ];
215
216
  const headers = [...CSVExportHelper.standardHeaders];
@@ -226,8 +227,8 @@ describe("CSVExportHelper", () => {
226
227
  );
227
228
 
228
229
  expect(result).toBe(
229
- "id,type,locale,title,URL,visibility,created_at,updated_at,translations\r\n" +
230
- "1,article,en,Test Article,/en/article/1,public,2024-01-01,2024-01-02,es;de",
230
+ "id,type,locale,title,URL,visibility,created_at,updated_at,translations,tags\r\n" +
231
+ "1,article,en,Test Article,/en/article/1,public,2024-01-01,2024-01-02,es;de,Finance;Product",
231
232
  );
232
233
  });
233
234
  });
@@ -302,6 +303,7 @@ describe("CSVExportHelper", () => {
302
303
  created_at: "insertedAt",
303
304
  updated_at: "updatedAt",
304
305
  translations: expect.any(Function),
306
+ tags: expect.any(Function),
305
307
  });
306
308
  });
307
309
 
@@ -364,6 +366,7 @@ describe("CSVExportHelper", () => {
364
366
  "created_at",
365
367
  "updated_at",
366
368
  "translations",
369
+ "tags",
367
370
  ]);
368
371
  });
369
372
  });