@knovator/pagecreator-admin 1.4.6 → 1.4.8

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.
Files changed (3) hide show
  1. package/index.cjs +11 -4
  2. package/index.js +11 -4
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -2956,7 +2956,11 @@ const usePage = ({
2956
2956
  if (selectedWidgets.length) {
2957
2957
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2958
2958
  // @ts-ignore
2959
- data.widgets = selectedWidgets.map(item => item.value);
2959
+ data.widgets = selectedWidgets.map(item => ({
2960
+ _id: item.value,
2961
+ widgetId: item.value,
2962
+ code: item.code
2963
+ }));
2960
2964
  }
2961
2965
  setLoading(true);
2962
2966
  const code = formState === 'ADD' ? CALLBACK_CODES.CREATE : CALLBACK_CODES.UPDATE;
@@ -3047,7 +3051,6 @@ const usePage = ({
3047
3051
  }
3048
3052
  };
3049
3053
  const onChangeWidgetSequence = (sourceIndex, destinationIndex) => {
3050
- console.log(sourceIndex, destinationIndex);
3051
3054
  setSelectedWidgets(listData => {
3052
3055
  const temporaryData = [...listData];
3053
3056
  const [selectedRow] = temporaryData.splice(sourceIndex, 1);
@@ -4154,7 +4157,11 @@ const PageForm = ({
4154
4157
  filterQuery
4155
4158
  }) : formData;
4156
4159
  const submitPayload = Array.isArray(selectedWidgets) && selectedWidgets.length > 0 ? Object.assign(Object.assign({}, dataToSubmit), {
4157
- widgets: selectedWidgets.map(item => item.value)
4160
+ widgets: selectedWidgets.map(item => ({
4161
+ _id: item.value,
4162
+ label: item.label,
4163
+ code: item.code
4164
+ }))
4158
4165
  }) : dataToSubmit;
4159
4166
  onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 ? void 0 : onPrimaryButtonClick(undefined, submitPayload);
4160
4167
  return onPageFormSubmit(dataToSubmit);
@@ -4375,7 +4382,7 @@ const PagePagination = () => {
4375
4382
  } = usePageState();
4376
4383
  return /*#__PURE__*/React__default["default"].createElement(Pagination, {
4377
4384
  ofText: commonTranslations.of,
4378
- pageText: commonTranslations.confirm,
4385
+ pageText: commonTranslations.page,
4379
4386
  showingText: commonTranslations.showing,
4380
4387
  nextContent: commonTranslations.next,
4381
4388
  previousContent: commonTranslations.previous,
package/index.js CHANGED
@@ -2944,7 +2944,11 @@ const usePage = ({
2944
2944
  if (selectedWidgets.length) {
2945
2945
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2946
2946
  // @ts-ignore
2947
- data.widgets = selectedWidgets.map(item => item.value);
2947
+ data.widgets = selectedWidgets.map(item => ({
2948
+ _id: item.value,
2949
+ widgetId: item.value,
2950
+ code: item.code
2951
+ }));
2948
2952
  }
2949
2953
  setLoading(true);
2950
2954
  const code = formState === 'ADD' ? CALLBACK_CODES.CREATE : CALLBACK_CODES.UPDATE;
@@ -3035,7 +3039,6 @@ const usePage = ({
3035
3039
  }
3036
3040
  };
3037
3041
  const onChangeWidgetSequence = (sourceIndex, destinationIndex) => {
3038
- console.log(sourceIndex, destinationIndex);
3039
3042
  setSelectedWidgets(listData => {
3040
3043
  const temporaryData = [...listData];
3041
3044
  const [selectedRow] = temporaryData.splice(sourceIndex, 1);
@@ -4142,7 +4145,11 @@ const PageForm = ({
4142
4145
  filterQuery
4143
4146
  }) : formData;
4144
4147
  const submitPayload = Array.isArray(selectedWidgets) && selectedWidgets.length > 0 ? Object.assign(Object.assign({}, dataToSubmit), {
4145
- widgets: selectedWidgets.map(item => item.value)
4148
+ widgets: selectedWidgets.map(item => ({
4149
+ _id: item.value,
4150
+ label: item.label,
4151
+ code: item.code
4152
+ }))
4146
4153
  }) : dataToSubmit;
4147
4154
  onPrimaryButtonClick === null || onPrimaryButtonClick === void 0 ? void 0 : onPrimaryButtonClick(undefined, submitPayload);
4148
4155
  return onPageFormSubmit(dataToSubmit);
@@ -4363,7 +4370,7 @@ const PagePagination = () => {
4363
4370
  } = usePageState();
4364
4371
  return /*#__PURE__*/React.createElement(Pagination, {
4365
4372
  ofText: commonTranslations.of,
4366
- pageText: commonTranslations.confirm,
4373
+ pageText: commonTranslations.page,
4367
4374
  showingText: commonTranslations.showing,
4368
4375
  nextContent: commonTranslations.next,
4369
4376
  previousContent: commonTranslations.previous,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knovator/pagecreator-admin",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "dependencies": {
5
5
  "classnames": "^2.3.1",
6
6
  "react-beautiful-dnd": "^13.1.0",