@knovator/pagecreator-admin 1.5.5 → 1.5.7
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/index.cjs +5 -7
- package/index.js +5 -7
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -3461,7 +3461,7 @@ const CustomReactSelect = ({
|
|
|
3461
3461
|
isLoading: isLoading,
|
|
3462
3462
|
loadOptions: loadOptions,
|
|
3463
3463
|
placeholder: placeholder,
|
|
3464
|
-
formatOptionLabel: formatOptionLabel && listCode !== 'pages' ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3464
|
+
formatOptionLabel: formatOptionLabel && listCode !== 'pages' && listCode !== 'blogs' ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3465
3465
|
styles: customStyles
|
|
3466
3466
|
}), error && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
3467
3467
|
className: "khb_input-error "
|
|
@@ -4029,6 +4029,7 @@ const DNDItemsList = ({
|
|
|
4029
4029
|
onFilterClick,
|
|
4030
4030
|
disableSettings: _disableSettings = false
|
|
4031
4031
|
}) => {
|
|
4032
|
+
console.log('listCode: ', listCode);
|
|
4032
4033
|
console.log('items: ', items);
|
|
4033
4034
|
return /*#__PURE__*/React__default["default"].createElement(DragDropContextWrapper, {
|
|
4034
4035
|
onDragEnd: onDragEnd
|
|
@@ -4045,7 +4046,7 @@ const DNDItemsList = ({
|
|
|
4045
4046
|
className: "khb_DND-item",
|
|
4046
4047
|
key: item.value,
|
|
4047
4048
|
ref: provided.innerRef
|
|
4048
|
-
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode && listCode !== 'pages' ? formatItem(listCode, item) : (/*#__PURE__*/React__default["default"].createElement("div", {
|
|
4049
|
+
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode && listCode !== 'pages' && listCode !== 'blogs' ? formatItem(listCode, item) : (/*#__PURE__*/React__default["default"].createElement("div", {
|
|
4049
4050
|
className: "khb_DND-item-content"
|
|
4050
4051
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4051
4052
|
className: "khb_DND-item-text"
|
|
@@ -7228,22 +7229,19 @@ const WidgetForm = ({
|
|
|
7228
7229
|
const collectionToUse = collectionName || (selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value);
|
|
7229
7230
|
callerRef.current = setTimeout(() => {
|
|
7230
7231
|
if (collectionToUse) getCollectionData(collectionToUse, str, options => {
|
|
7231
|
-
console.log('API options:', options); // Debug: see what comes from backend
|
|
7232
7232
|
if (typeof callback === 'function') callback(options.map(item => Object.assign({
|
|
7233
7233
|
value: item['_id'] || item['id'],
|
|
7234
|
-
label: item['name']
|
|
7234
|
+
label: item['name'] || item['title']
|
|
7235
7235
|
}, item)));
|
|
7236
7236
|
if (formState === 'UPDATE') {
|
|
7237
|
-
console.log('collectionItems (stored IDs):', collectionItems); // Debug
|
|
7238
7237
|
let selectedOptions = (collectionItems === null || collectionItems === void 0 ? void 0 : collectionItems.map(itemId => {
|
|
7239
7238
|
item = options.find(item => item._id === itemId || item.id === itemId);
|
|
7240
7239
|
return item ? Object.assign({
|
|
7241
|
-
label: item.name,
|
|
7240
|
+
label: item.name || item.title,
|
|
7242
7241
|
value: item._id || item.id
|
|
7243
7242
|
}, item) : {};
|
|
7244
7243
|
})) || [];
|
|
7245
7244
|
selectedOptions = selectedOptions.filter(obj => !!obj.value);
|
|
7246
|
-
console.log('selectedOptions (after mapping):', selectedOptions); // Debug
|
|
7247
7245
|
if (valueToSet) {
|
|
7248
7246
|
// only set tabcollection items, when they are not set
|
|
7249
7247
|
if (!tabCollectionItemsUpdated[activeTab]) {
|
package/index.js
CHANGED
|
@@ -3449,7 +3449,7 @@ const CustomReactSelect = ({
|
|
|
3449
3449
|
isLoading: isLoading,
|
|
3450
3450
|
loadOptions: loadOptions,
|
|
3451
3451
|
placeholder: placeholder,
|
|
3452
|
-
formatOptionLabel: formatOptionLabel && listCode !== 'pages' ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3452
|
+
formatOptionLabel: formatOptionLabel && listCode !== 'pages' && listCode !== 'blogs' ? option => formatOptionLabel(listCode, option) : undefined,
|
|
3453
3453
|
styles: customStyles
|
|
3454
3454
|
}), error && /*#__PURE__*/React.createElement("p", {
|
|
3455
3455
|
className: "khb_input-error "
|
|
@@ -4017,6 +4017,7 @@ const DNDItemsList = ({
|
|
|
4017
4017
|
onFilterClick,
|
|
4018
4018
|
disableSettings: _disableSettings = false
|
|
4019
4019
|
}) => {
|
|
4020
|
+
console.log('listCode: ', listCode);
|
|
4020
4021
|
console.log('items: ', items);
|
|
4021
4022
|
return /*#__PURE__*/React.createElement(DragDropContextWrapper, {
|
|
4022
4023
|
onDragEnd: onDragEnd
|
|
@@ -4033,7 +4034,7 @@ const DNDItemsList = ({
|
|
|
4033
4034
|
className: "khb_DND-item",
|
|
4034
4035
|
key: item.value,
|
|
4035
4036
|
ref: provided.innerRef
|
|
4036
|
-
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode && listCode !== 'pages' ? formatItem(listCode, item) : (/*#__PURE__*/React.createElement("div", {
|
|
4037
|
+
}, provided.draggableProps, provided.dragHandleProps), typeof formatItem === 'function' && listCode && listCode !== 'pages' && listCode !== 'blogs' ? formatItem(listCode, item) : (/*#__PURE__*/React.createElement("div", {
|
|
4037
4038
|
className: "khb_DND-item-content"
|
|
4038
4039
|
}, /*#__PURE__*/React.createElement("p", {
|
|
4039
4040
|
className: "khb_DND-item-text"
|
|
@@ -7216,22 +7217,19 @@ const WidgetForm = ({
|
|
|
7216
7217
|
const collectionToUse = collectionName || (selectedCollectionType === null || selectedCollectionType === void 0 ? void 0 : selectedCollectionType.value);
|
|
7217
7218
|
callerRef.current = setTimeout(() => {
|
|
7218
7219
|
if (collectionToUse) getCollectionData(collectionToUse, str, options => {
|
|
7219
|
-
console.log('API options:', options); // Debug: see what comes from backend
|
|
7220
7220
|
if (typeof callback === 'function') callback(options.map(item => Object.assign({
|
|
7221
7221
|
value: item['_id'] || item['id'],
|
|
7222
|
-
label: item['name']
|
|
7222
|
+
label: item['name'] || item['title']
|
|
7223
7223
|
}, item)));
|
|
7224
7224
|
if (formState === 'UPDATE') {
|
|
7225
|
-
console.log('collectionItems (stored IDs):', collectionItems); // Debug
|
|
7226
7225
|
let selectedOptions = (collectionItems === null || collectionItems === void 0 ? void 0 : collectionItems.map(itemId => {
|
|
7227
7226
|
item = options.find(item => item._id === itemId || item.id === itemId);
|
|
7228
7227
|
return item ? Object.assign({
|
|
7229
|
-
label: item.name,
|
|
7228
|
+
label: item.name || item.title,
|
|
7230
7229
|
value: item._id || item.id
|
|
7231
7230
|
}, item) : {};
|
|
7232
7231
|
})) || [];
|
|
7233
7232
|
selectedOptions = selectedOptions.filter(obj => !!obj.value);
|
|
7234
|
-
console.log('selectedOptions (after mapping):', selectedOptions); // Debug
|
|
7235
7233
|
if (valueToSet) {
|
|
7236
7234
|
// only set tabcollection items, when they are not set
|
|
7237
7235
|
if (!tabCollectionItemsUpdated[activeTab]) {
|