@raketa-cloud/admin 1.8.0 → 1.8.3

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.0",
3
+ "version": "1.8.3",
4
4
  "main": "src/index.js",
5
5
  "files": [
6
6
  "src/",
@@ -1,4 +1,4 @@
1
- import { dateToUTCISO8601String, toUTCISO8601String, toDateInput } from "../utils";
1
+ import { dateToUTCISO8601String, toDateInput } from "../utils";
2
2
  import RaketaClient from "./RaketaClient";
3
3
  import {
4
4
  ArticleByIdDocument,
@@ -58,6 +58,8 @@ export default class Articles extends RaketaClient {
58
58
  async listAll(query, locale, articleTypeSlug) {
59
59
  const vars = this.buildAllInput(query, locale);
60
60
 
61
+ vars.input.filters = this.formatDateFilters(vars.input.filters);
62
+
61
63
  const { miniArticles: items } = await this.query(MiniArticlesDocument, {
62
64
  input: {
63
65
  ...vars.input,
@@ -71,12 +73,7 @@ export default class Articles extends RaketaClient {
71
73
  async list(query, locale, articleTypeSlug) {
72
74
  const vars = this.buildListInput(query, locale);
73
75
 
74
- if (vars.input.filters.last_updated_from) {
75
- vars.input.filters.last_updated_from = toUTCISO8601String(vars.input.filters.last_updated_from);
76
- }
77
- if (vars.input.filters.last_updated_to) {
78
- vars.input.filters.last_updated_to = toUTCISO8601String(vars.input.filters.last_updated_to);
79
- }
76
+ vars.input.filters = this.formatDateFilters(vars.input.filters);
80
77
 
81
78
  const { articles: items } = await this.query(ArticlesDocument, {
82
79
  input: {
@@ -73,6 +73,8 @@ export default class Events extends RaketaClient {
73
73
  async listAll(query, locale, eventTypeSlug) {
74
74
  const vars = this.buildAllInput(query, locale);
75
75
 
76
+ vars.input.filters = this.formatDateFilters(vars.input.filters);
77
+
76
78
  const { miniEvents: items } = await this.query(MiniEventsDocument, {
77
79
  input: {
78
80
  ...vars.input,
@@ -86,12 +88,7 @@ export default class Events extends RaketaClient {
86
88
  async list(query, locale, eventTypeSlug) {
87
89
  const vars = this.buildListInput(query, locale);
88
90
 
89
- if (vars.input.filters.last_updated_from) {
90
- vars.input.filters.last_updated_from = toUTCISO8601String(vars.input.filters.last_updated_from);
91
- }
92
- if (vars.input.filters.last_updated_to) {
93
- vars.input.filters.last_updated_to = toUTCISO8601String(vars.input.filters.last_updated_to);
94
- }
91
+ vars.input.filters = this.formatDateFilters(vars.input.filters);
95
92
 
96
93
  const { events: items } = await this.query(EventsDocument, {
97
94
  input: {
@@ -1,4 +1,3 @@
1
- import { toUTCISO8601String } from "../utils";
2
1
  import RaketaClient from "./RaketaClient";
3
2
  import {
4
3
  ChangePageSlugDocument,
@@ -49,6 +48,8 @@ export default class Pages extends RaketaClient {
49
48
  async listAll(query, locale, pageTypeSlug) {
50
49
  const vars = this.buildAllInput(query, locale);
51
50
 
51
+ vars.input.filters = this.formatDateFilters(vars.input.filters);
52
+
52
53
  const { miniPages: items } = await this.query(MiniPagesDocument, {
53
54
  input: {
54
55
  ...vars.input,
@@ -62,16 +63,7 @@ export default class Pages extends RaketaClient {
62
63
  async list(query, locale, pageTypeSlug) {
63
64
  const vars = this.buildListInput(query, locale);
64
65
 
65
- if (vars.input.filters.last_updated_from) {
66
- vars.input.filters.last_updated_from = toUTCISO8601String(
67
- vars.input.filters.last_updated_from,
68
- );
69
- }
70
- if (vars.input.filters.last_updated_to) {
71
- vars.input.filters.last_updated_to = toUTCISO8601String(
72
- vars.input.filters.last_updated_to,
73
- );
74
- }
66
+ vars.input.filters = this.formatDateFilters(vars.input.filters);
75
67
 
76
68
  const { pages: items } = await this.query(PagesDocument, {
77
69
  input: {
@@ -1,4 +1,5 @@
1
1
  import { request } from "graphql-request";
2
+ import { toUTCISO8601String } from "../utils";
2
3
 
3
4
  function isObjectEmpty(obj) {
4
5
  for (const key in obj) {
@@ -217,6 +218,16 @@ export default class RaketaClient {
217
218
  return variables;
218
219
  }
219
220
 
221
+ formatDateFilters(filters) {
222
+ if (filters.last_updated_from) {
223
+ filters.last_updated_from = toUTCISO8601String(filters.last_updated_from);
224
+ }
225
+ if (filters.last_updated_to) {
226
+ filters.last_updated_to = toUTCISO8601String(filters.last_updated_to);
227
+ }
228
+ return filters;
229
+ }
230
+
220
231
  deepMerge(target, source) {
221
232
  return parseJsonFields(deepMerge(structuredClone(target), source));
222
233
  }
@@ -18,7 +18,7 @@ const exportCSV = async (ctx) => {
18
18
  const csv = CSVExportHelper.formatDataAsCSV(
19
19
  pages.list,
20
20
  headers,
21
- fieldMapping
21
+ fieldMapping,
22
22
  );
23
23
 
24
24
  return {
File without changes
@@ -208,6 +208,8 @@
208
208
  </div>
209
209
  <% } %>
210
210
 
211
+ <%- render_partial('./_shared/_addons.ejs') %>
212
+
211
213
  <div class="mb-4">
212
214
  <h4 class="pb-4 heading-3 items-center gap-2 flex">
213
215
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-4 text-raketa-primary">
File without changes
@@ -208,6 +208,8 @@
208
208
  </div>
209
209
  <% } %>
210
210
 
211
+ <%- render_partial('./_shared/_addons.ejs') %>
212
+
211
213
  <div class="mb-4">
212
214
  <h4 class="pb-4 heading-3 items-center gap-2 flex">
213
215
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-4 text-raketa-primary">
File without changes
@@ -6,12 +6,11 @@
6
6
 
7
7
  <div class="flex flex-wrap items-center gap-1 mb-6 -mt-4">
8
8
  <%
9
- const availableLocales = Object.keys(_context.locales);
10
- const totalPossibleTranslations = availableLocales.length - 1;
11
- const existingTranslationsCount = Object.keys(resource.translations).length;
12
- const canBeTranslated = existingTranslationsCount < totalPossibleTranslations;
13
- %>
14
-
9
+ const availableLocales = Object.keys(_context.locales);
10
+ const totalPossibleTranslations = availableLocales.length - 1;
11
+ const existingTranslationsCount = Object.keys(resource.translations).length;
12
+ const canBeTranslated = existingTranslationsCount < totalPossibleTranslations;
13
+ %>
15
14
 
16
15
  <% Object.keys(_context.locales).forEach(key => { %>
17
16
  <% const { name, _code, flag} = _context.locales[key] %>
@@ -209,6 +208,8 @@
209
208
  </div>
210
209
  <% } %>
211
210
 
211
+ <%- render_partial('./_shared/_addons.ejs') %>
212
+
212
213
  <div class="mb-4">
213
214
  <h4 class="flex items-center gap-2 pb-4 heading-3">
214
215
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="size-4 text-raketa-primary">