@uxf/cms 11.58.1 → 11.59.0
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.
@@ -24,7 +24,7 @@ const visibilityLevelOptions = [
|
|
24
24
|
{ id: "PUBLIC", label: "Veřejný" },
|
25
25
|
];
|
26
26
|
function ContentBuilderBasicForm(props) {
|
27
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
28
28
|
const seoName = props.formApi.watch("seo.name");
|
29
29
|
const onBlurName = (event) => {
|
30
30
|
if ((0, is_nil_1.isNil)(seoName) || (0, is_empty_1.isEmpty)(seoName)) {
|
@@ -36,11 +36,12 @@ function ContentBuilderBasicForm(props) {
|
|
36
36
|
react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, isRequired: true, label: "Nadpis", name: "name", onBlur: onBlurName, type: "text" }),
|
37
37
|
!((_d = (_c = props.fields) === null || _c === void 0 ? void 0 : _c.publishedAt) === null || _d === void 0 ? void 0 : _d.isHidden) && (react_1.default.createElement(datetime_picker_input_1.DatetimePickerInput, { control: props.formApi.control, isRequired: true, label: "Datum publikace", name: "publishedAt" })),
|
38
38
|
!((_f = (_e = props.fields) === null || _e === void 0 ? void 0 : _e.perex) === null || _f === void 0 ? void 0 : _f.isHidden) && (react_1.default.createElement(textarea_1.Textarea, { control: props.formApi.control, label: "Perex", name: "perex", rows: 3 })),
|
39
|
-
|
40
|
-
!((
|
41
|
-
!((
|
42
|
-
!((_v = (_u = props.fields) === null || _u === void 0 ? void 0 : _u.
|
43
|
-
!((_x = (_w = props.fields) === null || _w === void 0 ? void 0 : _w.
|
44
|
-
!((_z = (_y = props.fields) === null || _y === void 0 ? void 0 : _y.
|
45
|
-
(
|
39
|
+
((_h = (_g = props.fields) === null || _g === void 0 ? void 0 : _g.authorText) === null || _h === void 0 ? void 0 : _h.isHidden) === false && (react_1.default.createElement(text_input_1.TextInput, { control: props.formApi.control, label: "Autor", name: "authorText" })),
|
40
|
+
!((_k = (_j = props.fields) === null || _j === void 0 ? void 0 : _j.author) === null || _k === void 0 ? void 0 : _k.isHidden) && ((_m = (_l = props.fields) === null || _l === void 0 ? void 0 : _l.author) === null || _m === void 0 ? void 0 : _m.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Autor", loadOptions: props.fields.author.autocomplete, name: "author" })),
|
41
|
+
!((_p = (_o = props.fields) === null || _o === void 0 ? void 0 : _o.category) === null || _p === void 0 ? void 0 : _p.isHidden) && ((_r = (_q = props.fields) === null || _q === void 0 ? void 0 : _q.category) === null || _r === void 0 ? void 0 : _r.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Kategorie", loadOptions: props.fields.category.autocomplete, name: "category" })),
|
42
|
+
!((_t = (_s = props.fields) === null || _s === void 0 ? void 0 : _s.tags) === null || _t === void 0 ? void 0 : _t.isHidden) && ((_v = (_u = props.fields) === null || _u === void 0 ? void 0 : _u.tags) === null || _v === void 0 ? void 0 : _v.autocomplete) && (react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.formApi.control, label: "Tagy", loadOptions: props.fields.tags.autocomplete, name: "tags" })),
|
43
|
+
!((_x = (_w = props.fields) === null || _w === void 0 ? void 0 : _w.image) === null || _x === void 0 ? void 0 : _x.isHidden) && (react_1.default.createElement(file_input_1.FileInput, { control: props.formApi.control, id: "image", label: "Hlavn\u00ED obr\u00E1zek", name: "image", onUploadFile: (file) => (0, api_1.uploadFile)(file, props.uploadNamespace) })),
|
44
|
+
!((_z = (_y = props.fields) === null || _y === void 0 ? void 0 : _y.isActive) === null || _z === void 0 ? void 0 : _z.isHidden) && (react_1.default.createElement(checkbox_input_1.CheckboxInput, { control: props.formApi.control, label: "Aktivn\u00ED", name: "isActive" })),
|
45
|
+
!((_1 = (_0 = props.fields) === null || _0 === void 0 ? void 0 : _0.visibilityLevel) === null || _1 === void 0 ? void 0 : _1.isHidden) && (react_1.default.createElement(select_1.Select, { control: props.formApi.control, isRequired: true, label: "Viditelnost", name: "visibilityLevel", options: visibilityLevelOptions })),
|
46
|
+
(0, is_not_nil_1.isNotNil)((_3 = (_2 = props.fields) === null || _2 === void 0 ? void 0 : _2.parent) === null || _3 === void 0 ? void 0 : _3.autocomplete) && (react_1.default.createElement(combobox_1.Combobox, { control: props.formApi.control, label: "Nad\u0159azen\u00FD \u010Dl\u00E1nek", loadOptions: props.fields.parent.autocomplete, name: "parent" }))));
|
46
47
|
}
|
@@ -1,38 +1,44 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.mapContentResponseToFormData = mapContentResponseToFormData;
|
4
|
+
const is_not_empty_1 = require("@uxf/core/utils/is-not-empty");
|
5
|
+
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
4
6
|
function mapContentResponseToFormData(content) {
|
5
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
7
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
6
8
|
return {
|
7
9
|
name: (_a = content === null || content === void 0 ? void 0 : content.name) !== null && _a !== void 0 ? _a : "",
|
8
10
|
visibilityLevel: (_b = content === null || content === void 0 ? void 0 : content.visibilityLevel) !== null && _b !== void 0 ? _b : null,
|
11
|
+
authorText: [(_c = content === null || content === void 0 ? void 0 : content.author) === null || _c === void 0 ? void 0 : _c.firstName, (_d = content === null || content === void 0 ? void 0 : content.author) === null || _d === void 0 ? void 0 : _d.surname]
|
12
|
+
.filter(is_not_nil_1.isNotNil)
|
13
|
+
.filter(is_not_empty_1.isNotEmpty)
|
14
|
+
.join(" "),
|
9
15
|
author: (content === null || content === void 0 ? void 0 : content.author)
|
10
16
|
? {
|
11
17
|
id: content.author.id,
|
12
18
|
label: `${content.author.firstName} ${content.author.surname}`,
|
13
19
|
}
|
14
20
|
: null,
|
15
|
-
image: (
|
16
|
-
publishedAt: (
|
17
|
-
type: (
|
21
|
+
image: (_e = content === null || content === void 0 ? void 0 : content.image) !== null && _e !== void 0 ? _e : null,
|
22
|
+
publishedAt: (_f = content === null || content === void 0 ? void 0 : content.publishedAt) !== null && _f !== void 0 ? _f : null,
|
23
|
+
type: (_g = content === null || content === void 0 ? void 0 : content.type) !== null && _g !== void 0 ? _g : null,
|
18
24
|
category: (content === null || content === void 0 ? void 0 : content.category)
|
19
25
|
? {
|
20
26
|
id: content.category.id,
|
21
27
|
label: content.category.name,
|
22
28
|
}
|
23
29
|
: null,
|
24
|
-
parent: (
|
30
|
+
parent: (_h = content === null || content === void 0 ? void 0 : content.parent) !== null && _h !== void 0 ? _h : null,
|
25
31
|
isActive: !(content === null || content === void 0 ? void 0 : content.hidden),
|
26
|
-
perex: (
|
27
|
-
tags: (
|
32
|
+
perex: (_j = content === null || content === void 0 ? void 0 : content.perex) !== null && _j !== void 0 ? _j : null,
|
33
|
+
tags: (_k = content === null || content === void 0 ? void 0 : content.tags) !== null && _k !== void 0 ? _k : [],
|
28
34
|
seo: {
|
29
|
-
name: (
|
30
|
-
title: (
|
31
|
-
description: (
|
32
|
-
ogTitle: (
|
33
|
-
ogDescription: (
|
34
|
-
ogImage: (
|
35
|
+
name: (_l = content === null || content === void 0 ? void 0 : content.seo.name) !== null && _l !== void 0 ? _l : "",
|
36
|
+
title: (_m = content === null || content === void 0 ? void 0 : content.seo.title) !== null && _m !== void 0 ? _m : "",
|
37
|
+
description: (_o = content === null || content === void 0 ? void 0 : content.seo.description) !== null && _o !== void 0 ? _o : "",
|
38
|
+
ogTitle: (_p = content === null || content === void 0 ? void 0 : content.seo.ogTitle) !== null && _p !== void 0 ? _p : "",
|
39
|
+
ogDescription: (_q = content === null || content === void 0 ? void 0 : content.seo.ogDescription) !== null && _q !== void 0 ? _q : "",
|
40
|
+
ogImage: (_r = content === null || content === void 0 ? void 0 : content.seo.ogImage) !== null && _r !== void 0 ? _r : null,
|
35
41
|
},
|
36
|
-
content: { data: (
|
42
|
+
content: { data: (_s = content === null || content === void 0 ? void 0 : content.content) !== null && _s !== void 0 ? _s : [], search: "" },
|
37
43
|
};
|
38
44
|
}
|
@@ -8,6 +8,7 @@ import { TextInputValue } from "@uxf/form/text-input";
|
|
8
8
|
import { TextareaValue } from "@uxf/form/textarea";
|
9
9
|
import { SelectOption } from "@uxf/ui/select";
|
10
10
|
export type ContentBuilderFormData = {
|
11
|
+
authorText: TextInputValue;
|
11
12
|
author: ComboboxValue<number>;
|
12
13
|
category: ComboboxValue<number>;
|
13
14
|
content: {
|
@@ -46,6 +47,9 @@ export type FieldsConfiguration = {
|
|
46
47
|
perex?: {
|
47
48
|
isHidden?: boolean;
|
48
49
|
};
|
50
|
+
authorText?: {
|
51
|
+
isHidden?: boolean;
|
52
|
+
};
|
49
53
|
author?: {
|
50
54
|
autocomplete?: Autocomplete;
|
51
55
|
isHidden?: boolean;
|