@raketa-cloud/admin 0.0.36 → 0.0.38

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": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "dev": "npx tailwindcss -i ./src/styles/application.css -o ../../apps/admin/static/application.css --watch",
@@ -7,6 +7,7 @@ import {
7
7
  DeleteArticleDocument,
8
8
  TranslateArticleDocument,
9
9
  ChangeArticleSlugDocument,
10
+ MinimalArticlesDocument,
10
11
  } from "./documents/articlesDocuments";
11
12
  import { toDateTimeInput, toUTCISO8601String } from "../utils";
12
13
 
@@ -41,6 +42,19 @@ export default class Articles extends RaketaClient {
41
42
  ];
42
43
  }
43
44
 
45
+ async minimal(query, locale, articleTypeSlug) {
46
+ const vars = this.buildListInput(query, locale);
47
+
48
+ const { articles: items } = await this.query(MinimalArticlesDocument, {
49
+ input: {
50
+ ...vars.input,
51
+ filters: { ...vars.input.filters, articleTypeSlug },
52
+ },
53
+ });
54
+
55
+ return items;
56
+ }
57
+
44
58
  async find(id, locale) {
45
59
  const { article: item } = await this.query(ArticleByIdDocument, {
46
60
  input: {
@@ -52,6 +66,19 @@ export default class Articles extends RaketaClient {
52
66
  return item;
53
67
  }
54
68
 
69
+ async minimal(query, locale, articleTypeSlug) {
70
+ const vars = this.buildListInput(query, locale);
71
+
72
+ const { articles: items } = await this.query(MinimalArticlesDocument, {
73
+ input: {
74
+ ...vars.input,
75
+ filters: { ...vars.input.filters, articleTypeSlug },
76
+ },
77
+ });
78
+
79
+ return items;
80
+ }
81
+
55
82
  async all(query, locale, articleTypeSlug) {
56
83
  const vars = this.buildAllInput(query, locale);
57
84
 
@@ -7,6 +7,7 @@ import {
7
7
  DeleteEventDocument,
8
8
  TranslateEventDocument,
9
9
  ChangeEventSlugDocument,
10
+ MinimalEventsDocument,
10
11
  } from "./documents/eventsDocuments";
11
12
  import { toDateTimeInput, toUTCISO8601String } from "../utils";
12
13
 
@@ -62,6 +63,19 @@ export default class Events extends RaketaClient {
62
63
  return item;
63
64
  }
64
65
 
66
+ async minimal(query, locale, eventTypeSlug) {
67
+ const vars = this.buildListInput(query, locale);
68
+
69
+ const { events: items } = await this.query(MinimalEventsDocument, {
70
+ input: {
71
+ ...vars.input,
72
+ filters: { ...vars.input.filters, eventTypeSlug },
73
+ },
74
+ });
75
+
76
+ return items;
77
+ }
78
+
65
79
  async all(query, locale, eventTypeSlug) {
66
80
  const vars = this.buildAllInput(query, locale);
67
81
 
@@ -7,6 +7,7 @@ import {
7
7
  DeletePageDocument,
8
8
  TranslatePageDocument,
9
9
  ChangePageSlugDocument,
10
+ MinimalPagesDocument,
10
11
  } from "./documents/pagesDocuments";
11
12
 
12
13
  export default class Pages extends RaketaClient {
@@ -42,6 +43,19 @@ export default class Pages extends RaketaClient {
42
43
  return item;
43
44
  }
44
45
 
46
+ async minimal(query, locale, pageTypeSlug) {
47
+ const vars = this.buildListInput(query, locale);
48
+
49
+ const { pages: items } = await this.query(MinimalPagesDocument, {
50
+ input: {
51
+ ...vars.input,
52
+ filters: { ...vars.input.filters, pageTypeSlug },
53
+ },
54
+ });
55
+
56
+ return items;
57
+ }
58
+
45
59
  async all(query, locale, pageTypeSlug) {
46
60
  const vars = this.buildAllInput(query, locale);
47
61
 
@@ -8,6 +8,16 @@ import {
8
8
  tagFragment,
9
9
  } from "./common";
10
10
 
11
+ function minimalArticleFragment() {
12
+ return gql`
13
+ {
14
+ id
15
+ slug
16
+ title
17
+ }
18
+ `;
19
+ }
20
+
11
21
  function articleFragment() {
12
22
  return gql`
13
23
  {
@@ -70,6 +80,15 @@ const ArticleChangesDocument = gql`
70
80
  }
71
81
  `;
72
82
 
83
+ const MinimalArticlesDocument = gql`
84
+ query Articles($input: ArticlesInput!) {
85
+ articles(input: $input) {
86
+ list ${minimalArticleFragment()}
87
+ pagination ${paginationFragment()}
88
+ }
89
+ }
90
+ `;
91
+
73
92
  const ArticlesDocument = gql`
74
93
  query Articles($input: ArticlesInput!) {
75
94
  articles(input: $input) {
@@ -229,6 +248,7 @@ const UnlockArticleRevisionDocument = gql`
229
248
  export {
230
249
  ArticleByIdDocument,
231
250
  ArticlesDocument,
251
+ MinimalArticlesDocument,
232
252
  CreateArticleDocument,
233
253
  UpdateArticleDocument,
234
254
  UpdateArticleWidgetsDocument,
@@ -8,6 +8,16 @@ import {
8
8
  tagFragment,
9
9
  } from "./common";
10
10
 
11
+ function minimalEventFragment() {
12
+ return gql`
13
+ {
14
+ id
15
+ slug
16
+ title
17
+ }
18
+ `;
19
+ }
20
+
11
21
  function eventFragment() {
12
22
  return gql`
13
23
  {
@@ -74,6 +84,15 @@ const EventChangesDocument = gql`
74
84
  }
75
85
  `;
76
86
 
87
+ const MinimalEventsDocument = gql`
88
+ query MinimalEvents($input: EventsInput!) {
89
+ events(input: $input) {
90
+ list ${minimalEventFragment()}
91
+ pagination ${paginationFragment()}
92
+ }
93
+ }
94
+ `;
95
+
77
96
  const EventsDocument = gql`
78
97
  query Events($input: EventsInput!) {
79
98
  events(input: $input) {
@@ -235,6 +254,7 @@ const UnlockEventRevisionDocument = gql`
235
254
  export {
236
255
  EventByIdDocument,
237
256
  EventsDocument,
257
+ MinimalEventsDocument,
238
258
  CreateEventDocument,
239
259
  UpdateEventDocument,
240
260
  UpdateEventWidgetsDocument,
@@ -8,6 +8,16 @@ import {
8
8
  tagFragment,
9
9
  } from "./common";
10
10
 
11
+ function minimalPageFragment() {
12
+ return gql`
13
+ {
14
+ id
15
+ slug
16
+ title
17
+ }
18
+ `;
19
+ }
20
+
11
21
  function pageFragment() {
12
22
  return gql`
13
23
  {
@@ -68,6 +78,15 @@ const PageChangesDocument = gql`
68
78
  }
69
79
  `;
70
80
 
81
+ const MinimalPagesDocument = gql`
82
+ query Pages($input: PagesInput!) {
83
+ pages(input: $input) {
84
+ list ${minimalPageFragment()}
85
+ pagination ${paginationFragment()}
86
+ }
87
+ }
88
+ `;
89
+
71
90
  const PagesDocument = gql`
72
91
  query Pages($input: PagesInput!) {
73
92
  pages(input: $input) {
@@ -226,6 +245,7 @@ const UnlockPageRevisionDocument = gql`
226
245
  export {
227
246
  PageByIdDocument,
228
247
  PagesDocument,
248
+ MinimalPagesDocument,
229
249
  CreatePageDocument,
230
250
  UpdatePageDocument,
231
251
  UpdatePageWidgetsDocument,
@@ -26,6 +26,7 @@ const update = async (ctx) => {
26
26
  }
27
27
 
28
28
  const params = ctx.resourceParams.resource;
29
+
29
30
  const resource = ctx.client.pageRevisions.deepMerge(revision, params);
30
31
 
31
32
  const { errors } = await ctx.client.pageRevisions.update(
@@ -253,7 +253,7 @@ export default class FormBuilder extends HTMLBuilder {
253
253
 
254
254
  const checkboxItem = this.tag("input", null, {
255
255
  type: "checkbox",
256
- value,
256
+ value: desiredValue,
257
257
  ...rest,
258
258
  ...selected,
259
259
  });
@@ -373,7 +373,8 @@ export default class FormBuilder extends HTMLBuilder {
373
373
  const error = this.__getError(name);
374
374
 
375
375
  if (as === "checkbox") {
376
- const { hint = "", cbOptsRest } = rest;
376
+ const { hint = "", ...cbOptsRest } = rest;
377
+
377
378
  return this.group(
378
379
  [
379
380
  this.tag(