@crystaldesign/diva-backoffice 24.12.0-beta.1 → 24.12.0-beta.16
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/build/esm/index.js +352 -343
- package/build/types/backoffice/src/Configuration.d.ts +1 -0
- package/build/types/backoffice/src/Configuration.d.ts.map +1 -1
- package/build/types/backoffice/src/layout/Navigation/types.d.ts +1 -0
- package/build/types/backoffice/src/layout/Navigation/types.d.ts.map +1 -1
- package/build/types/backoffice/src/layout/Toolbar/Tools/WYSIWYG_Configurator/ArticleSelection/index.d.ts.map +1 -1
- package/build/types/backoffice/src/layout/Toolbar/index.d.ts.map +1 -1
- package/build/types/backoffice/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssetMananger/MediaItem.d.ts +1 -0
- package/build/types/backoffice/src/ui/AssetMananger/MediaItem.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/AssetMananger/Upload/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/elements.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/types.d.ts +1 -0
- package/build/types/backoffice/src/ui/Form/types.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Form/useFormData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/IDMEnricherEditor/useModule.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/RichTextEditor/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/BaseTable/cellRenderer/MediaItemViewerCell/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/BaseTable/cellRenderer/MediaViewerCell/index.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/CatalogTable/useTableData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/StandardTable/useTableData.d.ts.map +1 -1
- package/build/types/backoffice/src/ui/Table/types.d.ts +2 -0
- package/build/types/backoffice/src/ui/Table/types.d.ts.map +1 -1
- package/package.json +4 -4
package/build/esm/index.js
CHANGED
|
@@ -73,7 +73,7 @@ import 'jsoneditor/dist/jsoneditor.css';
|
|
|
73
73
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
74
74
|
import { MinusCircleOutlined, PlusOutlined, DownloadOutlined as DownloadOutlined$1, PlusSquareOutlined, DeleteOutlined as DeleteOutlined$1, FullscreenOutlined, FileUnknownOutlined, CloseOutlined as CloseOutlined$1, PlusCircleOutlined as PlusCircleOutlined$1, HomeOutlined as HomeOutlined$1, InboxOutlined, PushpinOutlined, PushpinFilled, ReloadOutlined as ReloadOutlined$1 } from '@ant-design/icons';
|
|
75
75
|
import classnames from 'classnames';
|
|
76
|
-
import
|
|
76
|
+
import RTFEditor from '@crystaldesign/rtf-editor';
|
|
77
77
|
import debounce from 'lodash/debounce';
|
|
78
78
|
import Button$1 from 'antd/es/button';
|
|
79
79
|
import Upload$1 from 'antd/es/upload';
|
|
@@ -3144,17 +3144,6 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
3144
3144
|
}]
|
|
3145
3145
|
}
|
|
3146
3146
|
},
|
|
3147
|
-
GroupContentItems: {
|
|
3148
|
-
type: 'Group',
|
|
3149
|
-
items: [{
|
|
3150
|
-
id: 'ContentItems',
|
|
3151
|
-
type: 'Table'
|
|
3152
|
-
}, {
|
|
3153
|
-
id: 'ContentItemsTemplate',
|
|
3154
|
-
type: 'Table'
|
|
3155
|
-
}],
|
|
3156
|
-
setSelectedOrganization: true
|
|
3157
|
-
},
|
|
3158
3147
|
ContentItems: {
|
|
3159
3148
|
title: t('backoffice.table.contentitems.title'),
|
|
3160
3149
|
type: 'Table',
|
|
@@ -3162,18 +3151,33 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
3162
3151
|
pagination: {
|
|
3163
3152
|
pageSize: 50
|
|
3164
3153
|
},
|
|
3154
|
+
filter: {
|
|
3155
|
+
toggle: {
|
|
3156
|
+
fields: ['onlyTemplates'],
|
|
3157
|
+
label: t('backoffice.table.contentitemstemplate.title'),
|
|
3158
|
+
labelOff: t('backoffice.table.contentitems.toggleOff'),
|
|
3159
|
+
inQuery: true
|
|
3160
|
+
}
|
|
3161
|
+
},
|
|
3165
3162
|
copyAction: {
|
|
3166
3163
|
actionType: 'Detail',
|
|
3167
3164
|
type: 'Form',
|
|
3168
3165
|
id: 'FormEditContentItem',
|
|
3166
|
+
disableOnMultiselect: true,
|
|
3167
|
+
resetToggleAfter: true,
|
|
3169
3168
|
title: t('backoffice.table.contentItem.copyAction.title'),
|
|
3170
3169
|
label: t('backoffice.table.services.copyAction.label'),
|
|
3171
|
-
disableOnMultiselect: true,
|
|
3172
3170
|
mapping: {
|
|
3173
3171
|
type: 'body',
|
|
3174
3172
|
map: [{
|
|
3175
3173
|
targetField: 'content',
|
|
3176
3174
|
sourceField: 'content'
|
|
3175
|
+
}, {
|
|
3176
|
+
targetField: 'catalogName',
|
|
3177
|
+
sourceField: 'catalogName'
|
|
3178
|
+
}, {
|
|
3179
|
+
targetField: 'supplierName',
|
|
3180
|
+
sourceField: 'supplierName'
|
|
3177
3181
|
}, {
|
|
3178
3182
|
targetField: 'description',
|
|
3179
3183
|
sourceField: 'description'
|
|
@@ -3183,10 +3187,18 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
3183
3187
|
}]
|
|
3184
3188
|
}
|
|
3185
3189
|
},
|
|
3190
|
+
createAction: {
|
|
3191
|
+
actionType: 'Detail',
|
|
3192
|
+
type: 'JsonEditor',
|
|
3193
|
+
id: 'JsonEditorCreateContentItem',
|
|
3194
|
+
title: t('backoffice.table.contentItem.label.create'),
|
|
3195
|
+
label: t('backoffice.table.contentItem.label.create'),
|
|
3196
|
+
permission: 'backoffice_create_contentitem_template'
|
|
3197
|
+
},
|
|
3186
3198
|
deleteAction: {
|
|
3187
3199
|
disabled: function disabled(datas) {
|
|
3188
3200
|
return (datas === null || datas === void 0 ? void 0 : datas.find(function (d) {
|
|
3189
|
-
return !d.organizationId;
|
|
3201
|
+
return !(d !== null && d !== void 0 && d.organizationId);
|
|
3190
3202
|
})) && !root.actions.userHasPermission('backoffice_delete_contentitem_template');
|
|
3191
3203
|
}
|
|
3192
3204
|
},
|
|
@@ -3217,6 +3229,7 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
3217
3229
|
}, {
|
|
3218
3230
|
title: t('backoffice.table.views.lastUpdated'),
|
|
3219
3231
|
field: 'lastUpdated',
|
|
3232
|
+
defaultSortOrder: 'descend',
|
|
3220
3233
|
type: 'unixTimeStamp',
|
|
3221
3234
|
sorter: 1,
|
|
3222
3235
|
filter: 'advanced',
|
|
@@ -3238,106 +3251,6 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
3238
3251
|
filter: 'advanced',
|
|
3239
3252
|
width: 150
|
|
3240
3253
|
}],
|
|
3241
|
-
rowAction: [{
|
|
3242
|
-
actionType: 'Detail',
|
|
3243
|
-
disabled: function disabled(data) {
|
|
3244
|
-
return !(data !== null && data !== void 0 && data.organizationId) && !root.actions.userHasPermission('backoffice_edit_contentitem_template');
|
|
3245
|
-
},
|
|
3246
|
-
disableOnMultiselect: true,
|
|
3247
|
-
type: 'Form',
|
|
3248
|
-
id: 'FormEditContentItem',
|
|
3249
|
-
title: t('backoffice.table.contentItem.edit'),
|
|
3250
|
-
label: t('backoffice.edit')
|
|
3251
|
-
}, {
|
|
3252
|
-
disableOnMultiselect: true,
|
|
3253
|
-
actionType: 'Detail',
|
|
3254
|
-
permission: 'backoffice_edit_contentitem_template',
|
|
3255
|
-
type: 'JsonEditor',
|
|
3256
|
-
label: t('backoffice.table.contentItem.editjson'),
|
|
3257
|
-
id: 'JsonEditorEditContentItem',
|
|
3258
|
-
title: t('backoffice.table.contentItem.edit')
|
|
3259
|
-
}],
|
|
3260
|
-
apiInterface: {
|
|
3261
|
-
read: {
|
|
3262
|
-
list: '${catalogService}/contentItems',
|
|
3263
|
-
filterServerSide: true
|
|
3264
|
-
},
|
|
3265
|
-
"delete": '${catalogService}/contentItems/${id}'
|
|
3266
|
-
}
|
|
3267
|
-
},
|
|
3268
|
-
ContentItemsTemplate: {
|
|
3269
|
-
title: t('backoffice.table.contentitemstemplate.title'),
|
|
3270
|
-
type: 'Table',
|
|
3271
|
-
canRefresh: true,
|
|
3272
|
-
pagination: {
|
|
3273
|
-
pageSize: 50
|
|
3274
|
-
},
|
|
3275
|
-
copyAction: {
|
|
3276
|
-
actionType: 'Detail',
|
|
3277
|
-
type: 'Form',
|
|
3278
|
-
id: 'FormEditContentItem',
|
|
3279
|
-
disableOnMultiselect: true,
|
|
3280
|
-
title: t('backoffice.table.contentItem.copyAction.title'),
|
|
3281
|
-
label: t('backoffice.table.services.copyAction.label'),
|
|
3282
|
-
mapping: {
|
|
3283
|
-
type: 'body',
|
|
3284
|
-
map: [{
|
|
3285
|
-
targetField: 'content',
|
|
3286
|
-
sourceField: 'content'
|
|
3287
|
-
}, {
|
|
3288
|
-
targetField: 'description',
|
|
3289
|
-
sourceField: 'description'
|
|
3290
|
-
}, {
|
|
3291
|
-
targetField: 'organizationId',
|
|
3292
|
-
globalValue: 'organizationId'
|
|
3293
|
-
}]
|
|
3294
|
-
}
|
|
3295
|
-
},
|
|
3296
|
-
createAction: {
|
|
3297
|
-
actionType: 'Detail',
|
|
3298
|
-
type: 'JsonEditor',
|
|
3299
|
-
id: 'JsonEditorCreateContentItem',
|
|
3300
|
-
title: t('backoffice.table.contentItem.label.create'),
|
|
3301
|
-
label: t('backoffice.table.contentItem.label.create'),
|
|
3302
|
-
permission: 'backoffice_create_contentitem_template'
|
|
3303
|
-
},
|
|
3304
|
-
deleteAction: {
|
|
3305
|
-
disabled: function disabled(datas) {
|
|
3306
|
-
return (datas === null || datas === void 0 ? void 0 : datas.find(function (d) {
|
|
3307
|
-
return !d.organizationId;
|
|
3308
|
-
})) && !root.actions.userHasPermission('backoffice_delete_contentitem_template');
|
|
3309
|
-
}
|
|
3310
|
-
},
|
|
3311
|
-
columns: [{
|
|
3312
|
-
title: t('backoffice.table.roles.columns.description'),
|
|
3313
|
-
field: 'description',
|
|
3314
|
-
sorter: 1,
|
|
3315
|
-
filter: 'advanced',
|
|
3316
|
-
width: 500
|
|
3317
|
-
}, {
|
|
3318
|
-
title: t('backoffice.table.views.lastUpdatedBy'),
|
|
3319
|
-
field: 'lastUpdatedBy_displayText',
|
|
3320
|
-
sorter: 1,
|
|
3321
|
-
filter: 'advanced',
|
|
3322
|
-
width: 150
|
|
3323
|
-
}, {
|
|
3324
|
-
title: t('backoffice.table.views.lastUpdated'),
|
|
3325
|
-
field: 'lastUpdated',
|
|
3326
|
-
type: 'unixTimeStamp',
|
|
3327
|
-
sorter: 1,
|
|
3328
|
-
filter: 'advanced',
|
|
3329
|
-
width: 200
|
|
3330
|
-
}, {
|
|
3331
|
-
title: 'backoffice.content',
|
|
3332
|
-
field: 'content',
|
|
3333
|
-
hidden: true
|
|
3334
|
-
}, {
|
|
3335
|
-
title: t('backoffice._id'),
|
|
3336
|
-
field: '_id',
|
|
3337
|
-
sorter: 1,
|
|
3338
|
-
filter: 'advanced',
|
|
3339
|
-
width: 100
|
|
3340
|
-
}],
|
|
3341
3254
|
rowAction: [{
|
|
3342
3255
|
actionType: 'Detail',
|
|
3343
3256
|
disabled: function disabled(data) {
|
|
@@ -3369,7 +3282,7 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
3369
3282
|
}],
|
|
3370
3283
|
apiInterface: {
|
|
3371
3284
|
read: {
|
|
3372
|
-
list: '${catalogService}/contentItems
|
|
3285
|
+
list: '${catalogService}/contentItems',
|
|
3373
3286
|
filterServerSide: true
|
|
3374
3287
|
},
|
|
3375
3288
|
"delete": '${catalogService}/contentItems/${id}'
|
|
@@ -7624,6 +7537,7 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
7624
7537
|
}, {
|
|
7625
7538
|
name: 'mediaItemImage',
|
|
7626
7539
|
type: 'media',
|
|
7540
|
+
hideTrash: true,
|
|
7627
7541
|
allowedTypes: ['image/*'],
|
|
7628
7542
|
mediaItemRefField: 'mediaItemRefImage',
|
|
7629
7543
|
urlField: 'image',
|
|
@@ -7644,6 +7558,7 @@ function loadConfiguration(t, root, config, lang) {
|
|
|
7644
7558
|
}, {
|
|
7645
7559
|
name: 'mediaItemVideo',
|
|
7646
7560
|
type: 'media',
|
|
7561
|
+
hideTrash: true,
|
|
7647
7562
|
allowedTypes: ['video/*'],
|
|
7648
7563
|
mediaItemRefField: 'mediaItemRefVideo',
|
|
7649
7564
|
urlField: 'video',
|
|
@@ -12250,16 +12165,10 @@ var menu = [{
|
|
|
12250
12165
|
}
|
|
12251
12166
|
}]
|
|
12252
12167
|
}, {
|
|
12253
|
-
id: '
|
|
12168
|
+
id: 'ContentItems',
|
|
12254
12169
|
path: 'contentitems',
|
|
12255
12170
|
label: 'backoffice.menu.items.label.ContentItems',
|
|
12256
|
-
icon: 'OrderedListOutlined'
|
|
12257
|
-
rules: [{
|
|
12258
|
-
match: {
|
|
12259
|
-
value: ['RETAILER', 'ASSOCIATION'],
|
|
12260
|
-
globalValue: 'organization.parentType'
|
|
12261
|
-
}
|
|
12262
|
-
}]
|
|
12171
|
+
icon: 'OrderedListOutlined'
|
|
12263
12172
|
}, {
|
|
12264
12173
|
id: 'idmTables',
|
|
12265
12174
|
path: 'idm',
|
|
@@ -13879,6 +13788,7 @@ function useFormData (_ref) {
|
|
|
13879
13788
|
removedMedias = _useState12[0],
|
|
13880
13789
|
setRemovedMedias = _useState12[1];
|
|
13881
13790
|
var _useMemo = useMemo(function () {
|
|
13791
|
+
setCanSave === null || setCanSave === void 0 || setCanSave(true);
|
|
13882
13792
|
var c = {
|
|
13883
13793
|
apiHandler: root.getApiHandler(id, apiInterface),
|
|
13884
13794
|
configuration: root.configurationStore.getConfiguration(id, 'Form')
|
|
@@ -13894,7 +13804,7 @@ function useFormData (_ref) {
|
|
|
13894
13804
|
if (configuration.disableSave) setCanSave === null || setCanSave === void 0 || setCanSave(false);
|
|
13895
13805
|
}, [configuration]);
|
|
13896
13806
|
var _onLoadFields = function onLoadFields(data) {
|
|
13897
|
-
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.items;
|
|
13807
|
+
var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.itemSelector && Array.isArray(configuration.items[0])) ? configuration.items[0] : configuration.items;
|
|
13898
13808
|
var _iterator = _createForOfIteratorHelper$j(items),
|
|
13899
13809
|
_step;
|
|
13900
13810
|
try {
|
|
@@ -14015,21 +13925,25 @@ function useFormData (_ref) {
|
|
|
14015
13925
|
_context.next = 17;
|
|
14016
13926
|
break;
|
|
14017
13927
|
}
|
|
13928
|
+
if (configuration.showProgressBar) setProgressBarPercentage(i > 0 ? Math.floor(i / multipleEditingData.length * 100) : 1);
|
|
14018
13929
|
original = multipleEditingData[i];
|
|
14019
13930
|
_newData = setNewData(newData, JSON.parse(JSON.stringify(original)));
|
|
14020
13931
|
_context.t0 = response;
|
|
14021
|
-
_context.next =
|
|
13932
|
+
_context.next = 12;
|
|
14022
13933
|
return apiHandler.update(_newData, original, configuration.mapping);
|
|
14023
|
-
case
|
|
13934
|
+
case 12:
|
|
14024
13935
|
_context.t1 = _context.sent;
|
|
14025
13936
|
_context.t0.push.call(_context.t0, _context.t1);
|
|
14026
|
-
if (configuration.showProgressBar) setProgressBarPercentage(Math.abs((i + 1 / multipleEditingData.length) * 100));
|
|
14027
13937
|
case 14:
|
|
14028
13938
|
i++;
|
|
14029
13939
|
_context.next = 5;
|
|
14030
13940
|
break;
|
|
14031
13941
|
case 17:
|
|
14032
|
-
if (configuration.showProgressBar)
|
|
13942
|
+
if (configuration.showProgressBar) {
|
|
13943
|
+
if (configuration.showProgressBar) setProgressBarPercentage(100);
|
|
13944
|
+
setProgressBarOpen(false);
|
|
13945
|
+
setProgressBarPercentage(0);
|
|
13946
|
+
}
|
|
14033
13947
|
_context.next = 23;
|
|
14034
13948
|
break;
|
|
14035
13949
|
case 20:
|
|
@@ -14091,27 +14005,37 @@ function useFormData (_ref) {
|
|
|
14091
14005
|
}
|
|
14092
14006
|
return _context2.abrupt("return", newData);
|
|
14093
14007
|
case 3:
|
|
14094
|
-
|
|
14008
|
+
root.actions.toggleLoading('saving_form');
|
|
14009
|
+
_context2.prev = 4;
|
|
14010
|
+
_context2.next = 7;
|
|
14095
14011
|
return setDynamicFields(_objectSpread$I({}, state.data), newData);
|
|
14096
|
-
case
|
|
14012
|
+
case 7:
|
|
14097
14013
|
newData = _context2.sent;
|
|
14098
|
-
_context2.next =
|
|
14014
|
+
_context2.next = 10;
|
|
14099
14015
|
return preSaveProcess(newData, selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.items);
|
|
14100
|
-
case
|
|
14016
|
+
case 10:
|
|
14101
14017
|
newData = removeEmpty(newData);
|
|
14018
|
+
_context2.next = 17;
|
|
14019
|
+
break;
|
|
14020
|
+
case 13:
|
|
14021
|
+
_context2.prev = 13;
|
|
14022
|
+
_context2.t0 = _context2["catch"](4);
|
|
14023
|
+
root.actions.toggleLoading('saving_form');
|
|
14024
|
+
throw _context2.t0;
|
|
14025
|
+
case 17:
|
|
14102
14026
|
setState(_objectSpread$I(_objectSpread$I({}, state), {}, {
|
|
14103
14027
|
loading: true
|
|
14104
14028
|
}));
|
|
14105
14029
|
finalData = state.data;
|
|
14106
|
-
_context2.prev =
|
|
14107
|
-
_context2.next =
|
|
14030
|
+
_context2.prev = 19;
|
|
14031
|
+
_context2.next = 22;
|
|
14108
14032
|
return apiCall(newData);
|
|
14109
|
-
case
|
|
14033
|
+
case 22:
|
|
14110
14034
|
response = _context2.sent;
|
|
14111
14035
|
i = 0;
|
|
14112
|
-
case
|
|
14036
|
+
case 24:
|
|
14113
14037
|
if (!(i < (((_configuration$additi = configuration.additionals) === null || _configuration$additi === void 0 ? void 0 : _configuration$additi.length) || 0))) {
|
|
14114
|
-
_context2.next =
|
|
14038
|
+
_context2.next = 34;
|
|
14115
14039
|
break;
|
|
14116
14040
|
}
|
|
14117
14041
|
// perform additional server actions before returning the data
|
|
@@ -14123,47 +14047,52 @@ function useFormData (_ref) {
|
|
|
14123
14047
|
if (additional.addBaseUrl) {
|
|
14124
14048
|
data[additional.addBaseUrl] = window.location.origin;
|
|
14125
14049
|
}
|
|
14126
|
-
_context2.next =
|
|
14050
|
+
_context2.next = 31;
|
|
14127
14051
|
return additionalApi.create(data, additional.mapping, response);
|
|
14128
|
-
case
|
|
14052
|
+
case 31:
|
|
14129
14053
|
i++;
|
|
14130
|
-
_context2.next =
|
|
14054
|
+
_context2.next = 24;
|
|
14131
14055
|
break;
|
|
14132
|
-
case
|
|
14056
|
+
case 34:
|
|
14133
14057
|
finalData = response;
|
|
14134
14058
|
return _context2.abrupt("return", response);
|
|
14135
|
-
case
|
|
14136
|
-
_context2.prev =
|
|
14137
|
-
_context2.
|
|
14138
|
-
if (
|
|
14139
|
-
|
|
14059
|
+
case 38:
|
|
14060
|
+
_context2.prev = 38;
|
|
14061
|
+
_context2.t1 = _context2["catch"](19);
|
|
14062
|
+
if (configuration.showProgressBar) {
|
|
14063
|
+
setProgressBarOpen(false);
|
|
14064
|
+
setProgressBarPercentage(0);
|
|
14065
|
+
}
|
|
14066
|
+
if (!(_context2.t1 instanceof DivaError && _context2.t1.name)) {
|
|
14067
|
+
_context2.next = 47;
|
|
14140
14068
|
break;
|
|
14141
14069
|
}
|
|
14142
|
-
errorCode = _context2.
|
|
14070
|
+
errorCode = _context2.t1.name;
|
|
14143
14071
|
item = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.find(function (item) {
|
|
14144
14072
|
var _item$onError;
|
|
14145
14073
|
return (_item$onError = item.onError) === null || _item$onError === void 0 ? void 0 : _item$onError[errorCode];
|
|
14146
14074
|
});
|
|
14147
14075
|
if (!item) {
|
|
14148
|
-
_context2.next =
|
|
14076
|
+
_context2.next = 47;
|
|
14149
14077
|
break;
|
|
14150
14078
|
}
|
|
14151
14079
|
setFieldErrors(_objectSpread$I(_objectSpread$I({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
|
|
14152
14080
|
return _context2.abrupt("return", undefined);
|
|
14153
|
-
case
|
|
14154
|
-
throw _context2.
|
|
14155
|
-
case
|
|
14156
|
-
_context2.prev =
|
|
14081
|
+
case 47:
|
|
14082
|
+
throw _context2.t1;
|
|
14083
|
+
case 48:
|
|
14084
|
+
_context2.prev = 48;
|
|
14085
|
+
root.actions.toggleLoading('saving_form');
|
|
14157
14086
|
setState(_objectSpread$I(_objectSpread$I({}, state), {}, {
|
|
14158
14087
|
data: finalData,
|
|
14159
14088
|
loading: false
|
|
14160
14089
|
}));
|
|
14161
|
-
return _context2.finish(
|
|
14162
|
-
case
|
|
14090
|
+
return _context2.finish(48);
|
|
14091
|
+
case 52:
|
|
14163
14092
|
case "end":
|
|
14164
14093
|
return _context2.stop();
|
|
14165
14094
|
}
|
|
14166
|
-
}, _callee2, null, [[
|
|
14095
|
+
}, _callee2, null, [[4, 13], [19, 38, 48, 52]]);
|
|
14167
14096
|
}));
|
|
14168
14097
|
return function onSave(_x2) {
|
|
14169
14098
|
return _ref3.apply(this, arguments);
|
|
@@ -15360,26 +15289,13 @@ var RichTextEditor = function RichTextEditor(_ref) {
|
|
|
15360
15289
|
var initValue = _ref.initValue,
|
|
15361
15290
|
onChange = _ref.onChange,
|
|
15362
15291
|
name = _ref.name;
|
|
15363
|
-
var _useDivaCore = useDivaCore(),
|
|
15364
|
-
tinyMceApiKey = _useDivaCore.state.tinyMceApiKey;
|
|
15365
15292
|
var val = useRef(initValue);
|
|
15366
|
-
|
|
15367
|
-
|
|
15368
|
-
|
|
15369
|
-
|
|
15370
|
-
},
|
|
15293
|
+
function handleChange(val) {
|
|
15294
|
+
onChange(name, val);
|
|
15295
|
+
}
|
|
15296
|
+
return /*#__PURE__*/jsx(RTFEditor, {
|
|
15371
15297
|
initialValue: val.current,
|
|
15372
|
-
|
|
15373
|
-
init: {
|
|
15374
|
-
height: 500,
|
|
15375
|
-
menubar: false,
|
|
15376
|
-
plugins: ['advlist autolink lists link table paste'],
|
|
15377
|
-
contextmenu: '',
|
|
15378
|
-
resize: false,
|
|
15379
|
-
statusbar: false,
|
|
15380
|
-
toolbar: 'undo redo | formatselect | ' + 'bold italic backcolor | alignleft aligncenter ' + 'alignright alignjustify | bullist numlist outdent indent | table ',
|
|
15381
|
-
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
|
|
15382
|
-
}
|
|
15298
|
+
onChange: handleChange
|
|
15383
15299
|
});
|
|
15384
15300
|
};
|
|
15385
15301
|
|
|
@@ -17277,6 +17193,9 @@ function Upload (_ref) {
|
|
|
17277
17193
|
beforeUpload: beforeUpload,
|
|
17278
17194
|
onRemove: onRemoveMedia,
|
|
17279
17195
|
accept: allowedTypes === null || allowedTypes === void 0 ? void 0 : allowedTypes.join(','),
|
|
17196
|
+
showUploadList: {
|
|
17197
|
+
showRemoveIcon: !config.hideTrash
|
|
17198
|
+
},
|
|
17280
17199
|
children: /*#__PURE__*/jsxs(Space$1, {
|
|
17281
17200
|
direction: "horizontal",
|
|
17282
17201
|
children: [/*#__PURE__*/jsx(Button$1, {
|
|
@@ -17339,7 +17258,8 @@ function Media (_ref) {
|
|
|
17339
17258
|
onError: onError,
|
|
17340
17259
|
config: {
|
|
17341
17260
|
baseUrl: state.root.configurationStore.apiConfig.mediaService,
|
|
17342
|
-
jwt: state.root.dataStore.jwt
|
|
17261
|
+
jwt: state.root.dataStore.jwt,
|
|
17262
|
+
hideTrash: item.hideTrash
|
|
17343
17263
|
}
|
|
17344
17264
|
});
|
|
17345
17265
|
}
|
|
@@ -17569,6 +17489,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
|
|
|
17569
17489
|
});
|
|
17570
17490
|
case 'radio':
|
|
17571
17491
|
return /*#__PURE__*/jsx(Radio.Group, {
|
|
17492
|
+
defaultValue: item.defaultValue,
|
|
17572
17493
|
value: item.value,
|
|
17573
17494
|
options: item.options.map(function (o) {
|
|
17574
17495
|
var _o$disabled;
|
|
@@ -22405,7 +22326,7 @@ var useMediaUpload = function useMediaUpload(_ref) {
|
|
|
22405
22326
|
var small = "small-NY1-k";
|
|
22406
22327
|
var medium = "medium---QcO";
|
|
22407
22328
|
var big = "big--E39S";
|
|
22408
|
-
var css_248z$d = ".diva-component-DIVA_BACKOFFICE_NEW .ant-upload-wrapper {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-table-wrapper, .diva-component-DIVA_BACKOFFICE_NEW .ant-table {\n height: inherit;\n overflow: auto;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-container {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-spin-container {\n display: flex;\n flex-direction: column;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-space-item .andt-table .ant-spin-container {\n height: calc(60vh - 90px);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-table-container {\n height: calc(100% - 80px);\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list-item-container {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-select {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .small-NY1-k {\n width: 104px;\n height: 104px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .medium---QcO {\n width: 200px;\n height: 200px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .big--E39S {\n width: 400px;\n height: 400px;\n}\n";
|
|
22329
|
+
var css_248z$d = ".diva-component-DIVA_BACKOFFICE_NEW .ant-upload-wrapper {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-table-wrapper, .diva-component-DIVA_BACKOFFICE_NEW .ant-table {\n height: inherit;\n overflow: auto;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-drawer-body .ant-spin-nested-loading {\n width: 100%;\n height: 80%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-container {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-spin-container {\n display: flex;\n flex-direction: column;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-space-item .andt-table .ant-spin-container {\n height: calc(60vh - 90px);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-table-container {\n height: calc(100% - 80px);\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list-item-container {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-select {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .small-NY1-k {\n width: 104px;\n height: 104px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .medium---QcO {\n width: 200px;\n height: 200px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .big--E39S {\n width: 400px;\n height: 400px;\n}\n";
|
|
22409
22330
|
styleInject(css_248z$d);
|
|
22410
22331
|
|
|
22411
22332
|
var MediaUpload = observer(function (_ref) {
|
|
@@ -22804,6 +22725,8 @@ if (!window.customElements.get('model-viewer')) {
|
|
|
22804
22725
|
function MediaViewerCell (_ref) {
|
|
22805
22726
|
var children = _ref.children,
|
|
22806
22727
|
column = _ref.column;
|
|
22728
|
+
var _useDivaCore = useDivaCore(),
|
|
22729
|
+
isFirefox = _useDivaCore.state.isFirefox;
|
|
22807
22730
|
if (!(children !== null && children !== void 0 && children[1])) {
|
|
22808
22731
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
22809
22732
|
}
|
|
@@ -22849,7 +22772,7 @@ function MediaViewerCell (_ref) {
|
|
|
22849
22772
|
src: children[1],
|
|
22850
22773
|
ar: true,
|
|
22851
22774
|
"ar-scale": 'fixed',
|
|
22852
|
-
"ar-modes": 'webxr quick-look',
|
|
22775
|
+
"ar-modes": !isFirefox ? 'webxr quick-look' : '',
|
|
22853
22776
|
"shadow-intensity": "1",
|
|
22854
22777
|
"camera-controls": true,
|
|
22855
22778
|
"touch-action": "pan-y",
|
|
@@ -22989,6 +22912,8 @@ function MediaItemViewerCell (_ref) {
|
|
|
22989
22912
|
timeStamp = _useState4[0],
|
|
22990
22913
|
setTimeStamp = _useState4[1];
|
|
22991
22914
|
var id;
|
|
22915
|
+
var _useDivaCore = useDivaCore(),
|
|
22916
|
+
isFirefox = _useDivaCore.state.isFirefox;
|
|
22992
22917
|
|
|
22993
22918
|
//! for renderjob table mediaItems because can't filter mediaItems.0
|
|
22994
22919
|
if (Array.isArray(children[1])) {
|
|
@@ -23020,9 +22945,9 @@ function MediaItemViewerCell (_ref) {
|
|
|
23020
22945
|
});
|
|
23021
22946
|
}, [timeStamp, id]);
|
|
23022
22947
|
if (!id) return /*#__PURE__*/jsx(FileUnknownOutlined, {});
|
|
23023
|
-
var
|
|
23024
|
-
handler =
|
|
23025
|
-
actions =
|
|
22948
|
+
var _useDivaCore2 = useDivaCore(),
|
|
22949
|
+
handler = _useDivaCore2.handler,
|
|
22950
|
+
actions = _useDivaCore2.actions;
|
|
23026
22951
|
var openModelViewer = function openModelViewer() {
|
|
23027
22952
|
actions.openFullscreen({
|
|
23028
22953
|
content: /*#__PURE__*/jsx("model-viewer", {
|
|
@@ -23030,7 +22955,7 @@ function MediaItemViewerCell (_ref) {
|
|
|
23030
22955
|
src: children[1],
|
|
23031
22956
|
ar: true,
|
|
23032
22957
|
"ar-scale": 'fixed',
|
|
23033
|
-
"ar-modes": 'webxr quick-look',
|
|
22958
|
+
"ar-modes": !isFirefox ? 'webxr quick-look' : '',
|
|
23034
22959
|
"shadow-intensity": "1",
|
|
23035
22960
|
"camera-controls": true,
|
|
23036
22961
|
"touch-action": "pan-y",
|
|
@@ -23587,7 +23512,7 @@ dayjs.extend(weekYear);
|
|
|
23587
23512
|
Select$1.Option;
|
|
23588
23513
|
var LOG$3 = getLogger('Backoffice', 'BaseTable');
|
|
23589
23514
|
var TableWrapper = function TableWrapper(_ref) {
|
|
23590
|
-
var _state$configuration$,
|
|
23515
|
+
var _state$configuration$, _toggleConfig$label, _toggleConfig$labelOf, _state$globalFilter, _state$configuration$2, _state$configuration$3, _state$globalFilter2, _state$globalFilter3, _state$globalFilter4, _state$globalFilter5, _state$configuration$4, _state$configuration$5, _state$globalFilter$s, _state$configuration$6, _state$configuration$7, _state$configuration$8, _state$selected2, _state$configuration$9, _state$configuration$10, _state$configuration$11, _state$configuration$14, _state$configuration$15, _state$configuration$16;
|
|
23591
23516
|
var state = _ref.state;
|
|
23592
23517
|
var root = useStore();
|
|
23593
23518
|
var _useState = useState(0),
|
|
@@ -23681,6 +23606,7 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
23681
23606
|
if (!permission) return true;
|
|
23682
23607
|
return root.actions.userHasPermission(permission);
|
|
23683
23608
|
}
|
|
23609
|
+
var toggleConfig = (_state$configuration$ = state.configuration.filter) === null || _state$configuration$ === void 0 ? void 0 : _state$configuration$.toggle;
|
|
23684
23610
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
23685
23611
|
children: [(state.canDelete || state.configuration.createAction || state.title || state.configuration.canRefresh || state.configuration.clientRelations) && /*#__PURE__*/jsx(Fragment, {
|
|
23686
23612
|
children: /*#__PURE__*/jsx(Descriptions, {
|
|
@@ -23739,16 +23665,17 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
23739
23665
|
state.triggerRefresh();
|
|
23740
23666
|
},
|
|
23741
23667
|
children: /*#__PURE__*/jsx(ReloadOutlined, {})
|
|
23742
|
-
}),
|
|
23668
|
+
}), toggleConfig && (!toggleConfig.permission || root.actions.userHasPermission(toggleConfig.permission)) && /*#__PURE__*/jsx("div", {
|
|
23743
23669
|
children: /*#__PURE__*/jsx(Switch, {
|
|
23744
|
-
defaultChecked:
|
|
23745
|
-
checkedChildren: (
|
|
23746
|
-
unCheckedChildren: (
|
|
23670
|
+
defaultChecked: toggleConfig.defaultChecked,
|
|
23671
|
+
checkedChildren: (_toggleConfig$label = toggleConfig.label) !== null && _toggleConfig$label !== void 0 ? _toggleConfig$label : 'unfiltered',
|
|
23672
|
+
unCheckedChildren: (_toggleConfig$labelOf = toggleConfig.labelOff) !== null && _toggleConfig$labelOf !== void 0 ? _toggleConfig$labelOf : 'filtered',
|
|
23747
23673
|
onChange: function onChange() {
|
|
23748
23674
|
return state.onGlobalFilterToggle();
|
|
23749
|
-
}
|
|
23675
|
+
},
|
|
23676
|
+
checked: !!((_state$globalFilter = state.globalFilter) !== null && _state$globalFilter !== void 0 && _state$globalFilter.toggle) != !!toggleConfig.inverted
|
|
23750
23677
|
})
|
|
23751
|
-
}), ((_state$configuration$
|
|
23678
|
+
}), ((_state$configuration$2 = state.configuration.filter) === null || _state$configuration$2 === void 0 ? void 0 : _state$configuration$2.search) && /*#__PURE__*/jsx(Input.Search, {
|
|
23752
23679
|
placeholder: t('filter.global'),
|
|
23753
23680
|
onSearch: function onSearch(v) {
|
|
23754
23681
|
return state.onGlobalFilterSearch(v);
|
|
@@ -23757,17 +23684,17 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
23757
23684
|
style: {
|
|
23758
23685
|
width: 200
|
|
23759
23686
|
}
|
|
23760
|
-
}), ((_state$configuration$
|
|
23687
|
+
}), ((_state$configuration$3 = state.configuration.filter) === null || _state$configuration$3 === void 0 ? void 0 : _state$configuration$3.period) && /*#__PURE__*/jsx(DatePicker.RangePicker, {
|
|
23761
23688
|
onCalendarChange: function onCalendarChange(values) {
|
|
23762
23689
|
if (values && values[0] && values[1]) {
|
|
23763
23690
|
state.onGlobalFilterPeriod(values[0].valueOf(), values[1].valueOf());
|
|
23764
23691
|
}
|
|
23765
23692
|
},
|
|
23766
|
-
value: [(_state$
|
|
23693
|
+
value: [(_state$globalFilter2 = state.globalFilter) !== null && _state$globalFilter2 !== void 0 && (_state$globalFilter2 = _state$globalFilter2.timeStamp) !== null && _state$globalFilter2 !== void 0 && (_state$globalFilter2 = _state$globalFilter2['fromTimeStamp']) !== null && _state$globalFilter2 !== void 0 && _state$globalFilter2[0] ? dayjs((_state$globalFilter3 = state.globalFilter) === null || _state$globalFilter3 === void 0 || (_state$globalFilter3 = _state$globalFilter3.timeStamp) === null || _state$globalFilter3 === void 0 || (_state$globalFilter3 = _state$globalFilter3['fromTimeStamp']) === null || _state$globalFilter3 === void 0 ? void 0 : _state$globalFilter3[0]) : dayjs(new Date(Date.now() - 30 * 24 * 60 * 60 * 1000)),
|
|
23767
23694
|
// Convert to Dayjs
|
|
23768
|
-
(_state$
|
|
23695
|
+
(_state$globalFilter4 = state.globalFilter) !== null && _state$globalFilter4 !== void 0 && (_state$globalFilter4 = _state$globalFilter4.timeStamp) !== null && _state$globalFilter4 !== void 0 && (_state$globalFilter4 = _state$globalFilter4['toTimeStamp']) !== null && _state$globalFilter4 !== void 0 && _state$globalFilter4[0] ? dayjs((_state$globalFilter5 = state.globalFilter) === null || _state$globalFilter5 === void 0 || (_state$globalFilter5 = _state$globalFilter5.timeStamp) === null || _state$globalFilter5 === void 0 || (_state$globalFilter5 = _state$globalFilter5['toTimeStamp']) === null || _state$globalFilter5 === void 0 ? void 0 : _state$globalFilter5[0]) : dayjs(new Date()) // Convert to Dayjs
|
|
23769
23696
|
]
|
|
23770
|
-
}), ((_state$configuration$
|
|
23697
|
+
}), ((_state$configuration$4 = state.configuration.filter) === null || _state$configuration$4 === void 0 ? void 0 : _state$configuration$4.select) && /*#__PURE__*/jsx(SimpleSelect, _objectSpread$l(_objectSpread$l({}, (_state$configuration$5 = state.configuration.filter) === null || _state$configuration$5 === void 0 ? void 0 : _state$configuration$5.select.settings), {}, {
|
|
23771
23698
|
style: {
|
|
23772
23699
|
minWidth: '200px'
|
|
23773
23700
|
},
|
|
@@ -23780,17 +23707,17 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
23780
23707
|
}), state.canDelete && /*#__PURE__*/jsx(DeleteButton, {
|
|
23781
23708
|
selected: state.selected,
|
|
23782
23709
|
total: state.pagination.total,
|
|
23783
|
-
min: (_state$configuration$
|
|
23710
|
+
min: (_state$configuration$6 = state.configuration.rules) === null || _state$configuration$6 === void 0 ? void 0 : _state$configuration$6.min,
|
|
23784
23711
|
deleting: state.deleting,
|
|
23785
23712
|
onDelete: state.onDelete,
|
|
23786
|
-
disabled: !!((_state$configuration$
|
|
23713
|
+
disabled: !!((_state$configuration$7 = state.configuration.deleteAction) !== null && _state$configuration$7 !== void 0 && (_state$configuration$8 = _state$configuration$7.disabled) !== null && _state$configuration$8 !== void 0 && _state$configuration$8.call(_state$configuration$7, ((_state$selected2 = state.selected) !== null && _state$selected2 !== void 0 ? _state$selected2 : []).map(function (id) {
|
|
23787
23714
|
return state.data.find(function (d) {
|
|
23788
23715
|
return d._id == id;
|
|
23789
23716
|
});
|
|
23790
23717
|
})))
|
|
23791
23718
|
}), state.configuration.copyAction !== undefined && /*#__PURE__*/jsx(CopyButton, {
|
|
23792
23719
|
state: state
|
|
23793
|
-
}), (_state$configuration$
|
|
23720
|
+
}), (_state$configuration$9 = state.configuration.bulkActions) === null || _state$configuration$9 === void 0 ? void 0 : _state$configuration$9.map(function (action) {
|
|
23794
23721
|
return /*#__PURE__*/jsx(BulkAction, {
|
|
23795
23722
|
action: action,
|
|
23796
23723
|
state: state,
|
|
@@ -23801,18 +23728,18 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
23801
23728
|
setProgressBarPercentage: setProgressBarPercentage
|
|
23802
23729
|
} : undefined
|
|
23803
23730
|
}, action.id);
|
|
23804
|
-
}), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && !((_state$configuration$
|
|
23731
|
+
}), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && !((_state$configuration$10 = (_state$configuration$11 = state.configuration.createAction).hidden) !== null && _state$configuration$10 !== void 0 && _state$configuration$10.call(_state$configuration$11, data)) && /*#__PURE__*/jsx(ActionButton, {
|
|
23805
23732
|
action: state.configuration.createAction,
|
|
23806
23733
|
callback: function callback(data) {
|
|
23807
|
-
var _state$onUpdate, _state$configuration$
|
|
23734
|
+
var _state$onUpdate, _state$configuration$12, _state$configuration$13;
|
|
23808
23735
|
(_state$onUpdate = state.onUpdate) === null || _state$onUpdate === void 0 || _state$onUpdate.call(state, data);
|
|
23809
|
-
(_state$configuration$
|
|
23736
|
+
(_state$configuration$12 = state.configuration.createAction) === null || _state$configuration$12 === void 0 || (_state$configuration$13 = _state$configuration$12.callback) === null || _state$configuration$13 === void 0 || _state$configuration$13.call(_state$configuration$12, data);
|
|
23810
23737
|
},
|
|
23811
23738
|
type: "Button",
|
|
23812
23739
|
id: 'create',
|
|
23813
23740
|
defaultLabel: t('backoffice.table.emailtemplates.createAction.title'),
|
|
23814
23741
|
isCreateButton: true,
|
|
23815
|
-
disabled: state.configuration.createAction.disableOnToggle === !!state.globalFilter.toggle || ((_state$configuration$
|
|
23742
|
+
disabled: state.configuration.createAction.disableOnToggle === !!state.globalFilter.toggle || ((_state$configuration$14 = (_state$configuration$15 = state.configuration.createAction).disabled) === null || _state$configuration$14 === void 0 ? void 0 : _state$configuration$14.call(_state$configuration$15, data)),
|
|
23816
23743
|
data: state.configuration.createActionMapping ? aplyMapping({
|
|
23817
23744
|
mapable: {},
|
|
23818
23745
|
mapping: state.configuration.createActionMapping,
|
|
@@ -23860,13 +23787,13 @@ var TableWrapper = function TableWrapper(_ref) {
|
|
|
23860
23787
|
className: "andt-table",
|
|
23861
23788
|
scroll: {
|
|
23862
23789
|
x: '100%',
|
|
23863
|
-
y: (_state$configuration$
|
|
23790
|
+
y: (_state$configuration$16 = state.configuration.height) !== null && _state$configuration$16 !== void 0 ? _state$configuration$16 : '100%'
|
|
23864
23791
|
},
|
|
23865
23792
|
rowClassName: editableRow,
|
|
23866
23793
|
components: cellRenderer,
|
|
23867
23794
|
rowKey: function rowKey(dataRow) {
|
|
23868
|
-
var _state$configuration$
|
|
23869
|
-
return goTroughObject(dataRow, (_state$configuration$
|
|
23795
|
+
var _state$configuration$17, _state$configuration$18;
|
|
23796
|
+
return goTroughObject(dataRow, (_state$configuration$17 = (_state$configuration$18 = state.configuration.rowKey) === null || _state$configuration$18 === void 0 ? void 0 : _state$configuration$18.split('.')) !== null && _state$configuration$17 !== void 0 ? _state$configuration$17 : ['_id'], 0);
|
|
23870
23797
|
},
|
|
23871
23798
|
dataSource: data,
|
|
23872
23799
|
loading: state.loading,
|
|
@@ -23936,22 +23863,22 @@ function DeleteButton(_ref2) {
|
|
|
23936
23863
|
});
|
|
23937
23864
|
}
|
|
23938
23865
|
function CopyButton(_ref3) {
|
|
23939
|
-
var _state$configuration$
|
|
23866
|
+
var _state$configuration$22;
|
|
23940
23867
|
var state = _ref3.state;
|
|
23941
23868
|
var root = useStore();
|
|
23942
|
-
|
|
23869
|
+
new _default$d({
|
|
23943
23870
|
apiInterface: state.configuration.apiInterface,
|
|
23944
23871
|
type: 'Table'
|
|
23945
23872
|
}, root);
|
|
23946
23873
|
var onCopy = /*#__PURE__*/function () {
|
|
23947
23874
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
23948
|
-
var _state$configuration$
|
|
23875
|
+
var _state$configuration$19;
|
|
23949
23876
|
var copyAction, _iterator3, _step3, selectedRow;
|
|
23950
23877
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
23951
23878
|
while (1) switch (_context.prev = _context.next) {
|
|
23952
23879
|
case 0:
|
|
23953
23880
|
copyAction = state.configuration.copyAction;
|
|
23954
|
-
if (((_state$configuration$
|
|
23881
|
+
if (((_state$configuration$19 = state.configuration.copyAction) === null || _state$configuration$19 === void 0 ? void 0 : _state$configuration$19.apiInterface) != undefined) {
|
|
23955
23882
|
_iterator3 = _createForOfIteratorHelper$4(state.selected);
|
|
23956
23883
|
try {
|
|
23957
23884
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -23986,28 +23913,22 @@ function CopyButton(_ref3) {
|
|
|
23986
23913
|
}();
|
|
23987
23914
|
var onCopyAction = /*#__PURE__*/function () {
|
|
23988
23915
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
23989
|
-
var _state$configuration$
|
|
23990
|
-
var copyAction, id,
|
|
23916
|
+
var _state$configuration$20, _state$configuration$21;
|
|
23917
|
+
var copyAction, id, data;
|
|
23991
23918
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
23992
23919
|
while (1) switch (_context3.prev = _context3.next) {
|
|
23993
23920
|
case 0:
|
|
23994
23921
|
copyAction = state.configuration.copyAction;
|
|
23995
|
-
if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$
|
|
23922
|
+
if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$20 = state.configuration.createAction) === null || _state$configuration$20 === void 0 ? void 0 : _state$configuration$20.actionType) != 'Detail')) {
|
|
23996
23923
|
_context3.next = 3;
|
|
23997
23924
|
break;
|
|
23998
23925
|
}
|
|
23999
23926
|
throw new Error('configuration needs to be of type Detail');
|
|
24000
23927
|
case 3:
|
|
24001
23928
|
id = state.selected[0];
|
|
24002
|
-
|
|
24003
|
-
|
|
24004
|
-
|
|
24005
|
-
return apiHandler.readList(undefined, undefined, {
|
|
24006
|
-
pagination: {},
|
|
24007
|
-
columns: [],
|
|
24008
|
-
filters: filter
|
|
24009
|
-
});
|
|
24010
|
-
case 8:
|
|
23929
|
+
_context3.next = 6;
|
|
23930
|
+
return state.getDataById(id);
|
|
23931
|
+
case 6:
|
|
24011
23932
|
data = _context3.sent;
|
|
24012
23933
|
data.data[0] = aplyMapping({
|
|
24013
23934
|
mapable: {},
|
|
@@ -24022,7 +23943,7 @@ function CopyButton(_ref3) {
|
|
|
24022
23943
|
configurationId: copyAction === null || copyAction === void 0 ? void 0 : copyAction.id,
|
|
24023
23944
|
data: data.data[0],
|
|
24024
23945
|
type: copyAction === null || copyAction === void 0 ? void 0 : copyAction.type,
|
|
24025
|
-
mapping: (_state$configuration$
|
|
23946
|
+
mapping: (_state$configuration$21 = state.configuration.createAction) === null || _state$configuration$21 === void 0 ? void 0 : _state$configuration$21.mapping,
|
|
24026
23947
|
mappingData: data.data[0],
|
|
24027
23948
|
callback: function () {
|
|
24028
23949
|
var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
|
|
@@ -24032,6 +23953,8 @@ function CopyButton(_ref3) {
|
|
|
24032
23953
|
_context2.next = 2;
|
|
24033
23954
|
return state.onUpdate(e);
|
|
24034
23955
|
case 2:
|
|
23956
|
+
if (copyAction.resetToggleAfter) state.resetToggle();
|
|
23957
|
+
case 3:
|
|
24035
23958
|
case "end":
|
|
24036
23959
|
return _context2.stop();
|
|
24037
23960
|
}
|
|
@@ -24043,7 +23966,7 @@ function CopyButton(_ref3) {
|
|
|
24043
23966
|
return callback;
|
|
24044
23967
|
}()
|
|
24045
23968
|
});
|
|
24046
|
-
case
|
|
23969
|
+
case 9:
|
|
24047
23970
|
case "end":
|
|
24048
23971
|
return _context3.stop();
|
|
24049
23972
|
}
|
|
@@ -24058,7 +23981,7 @@ function CopyButton(_ref3) {
|
|
|
24058
23981
|
return /*#__PURE__*/jsx(Button, {
|
|
24059
23982
|
type: "primary",
|
|
24060
23983
|
onClick: onCopy,
|
|
24061
|
-
disabled: state.selected.length == 0 || state.selected.length > 1 && ((_state$configuration$
|
|
23984
|
+
disabled: state.selected.length == 0 || state.selected.length > 1 && ((_state$configuration$22 = state.configuration.copyAction) === null || _state$configuration$22 === void 0 ? void 0 : _state$configuration$22.disableOnMultiselect),
|
|
24062
23985
|
children: t('backoffice.basetable.copy')
|
|
24063
23986
|
});
|
|
24064
23987
|
}
|
|
@@ -24210,7 +24133,7 @@ function BulkAction(_ref6) {
|
|
|
24210
24133
|
_context4.t5 = _context4.sent;
|
|
24211
24134
|
_context4.t4.push.call(_context4.t4, _context4.t5);
|
|
24212
24135
|
case 29:
|
|
24213
|
-
if (progressBar) progressBar.setProgressBarPercentage(Math.floor(
|
|
24136
|
+
if (progressBar) progressBar.setProgressBarPercentage(Math.floor(i / selectedData.length * 100));
|
|
24214
24137
|
case 30:
|
|
24215
24138
|
i++;
|
|
24216
24139
|
_context4.next = 4;
|
|
@@ -24218,22 +24141,27 @@ function BulkAction(_ref6) {
|
|
|
24218
24141
|
case 33:
|
|
24219
24142
|
state.onUpdate(data);
|
|
24220
24143
|
if (progressBar) {
|
|
24144
|
+
progressBar.setProgressBarPercentage(100);
|
|
24221
24145
|
progressBar.setProgressBarOpen(false);
|
|
24222
24146
|
progressBar.setProgressBarPercentage(0);
|
|
24223
24147
|
}
|
|
24224
|
-
_context4.next =
|
|
24148
|
+
_context4.next = 42;
|
|
24225
24149
|
break;
|
|
24226
24150
|
case 37:
|
|
24227
24151
|
_context4.prev = 37;
|
|
24228
24152
|
_context4.t6 = _context4["catch"](2);
|
|
24153
|
+
if (progressBar) {
|
|
24154
|
+
progressBar.setProgressBarOpen(false);
|
|
24155
|
+
progressBar.setProgressBarPercentage(0);
|
|
24156
|
+
}
|
|
24229
24157
|
LOG$3.error(new DivaError('Error changing data', {
|
|
24230
24158
|
cause: _context4.t6,
|
|
24231
24159
|
code: 'BACKO_0002'
|
|
24232
24160
|
}));
|
|
24233
24161
|
setShowPopover(t('errorcodes._source.labels.error.BACKO_0002'));
|
|
24234
|
-
case 41:
|
|
24235
|
-
(_action$callback = action.callback) === null || _action$callback === void 0 || _action$callback.call(action, updatedData);
|
|
24236
24162
|
case 42:
|
|
24163
|
+
(_action$callback = action.callback) === null || _action$callback === void 0 || _action$callback.call(action, updatedData);
|
|
24164
|
+
case 43:
|
|
24237
24165
|
case "end":
|
|
24238
24166
|
return _context4.stop();
|
|
24239
24167
|
}
|
|
@@ -24272,6 +24200,8 @@ function BulkAction(_ref6) {
|
|
|
24272
24200
|
}
|
|
24273
24201
|
function SelectionText(_ref8) {
|
|
24274
24202
|
var selected = _ref8.selected;
|
|
24203
|
+
var _useTranslation5 = useTranslation(),
|
|
24204
|
+
t = _useTranslation5.t;
|
|
24275
24205
|
if (!(selected !== null && selected !== void 0 && selected.length)) {
|
|
24276
24206
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
24277
24207
|
}
|
|
@@ -24281,7 +24211,7 @@ function SelectionText(_ref8) {
|
|
|
24281
24211
|
fontWeight: 'normal',
|
|
24282
24212
|
fontSize: 'small'
|
|
24283
24213
|
},
|
|
24284
|
-
children: "".concat(selected.length, "
|
|
24214
|
+
children: "".concat(selected.length, " ") + t('backoffice.table.selected_entries')
|
|
24285
24215
|
});
|
|
24286
24216
|
}
|
|
24287
24217
|
|
|
@@ -25165,16 +25095,44 @@ function useTableData$1 (_ref) {
|
|
|
25165
25095
|
});
|
|
25166
25096
|
}
|
|
25167
25097
|
};
|
|
25098
|
+
var getDataById = /*#__PURE__*/function () {
|
|
25099
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
|
25100
|
+
var filters, data;
|
|
25101
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
25102
|
+
while (1) switch (_context.prev = _context.next) {
|
|
25103
|
+
case 0:
|
|
25104
|
+
filters = {};
|
|
25105
|
+
filters['_id'] = [id, 'eq', false];
|
|
25106
|
+
_context.next = 4;
|
|
25107
|
+
return apiHandler.readList(configuration.mapping, {
|
|
25108
|
+
pagination: _objectSpread$h({}, state.pagination),
|
|
25109
|
+
columns: configuration.columns,
|
|
25110
|
+
filters: filters,
|
|
25111
|
+
sorter: filterData.sorter
|
|
25112
|
+
});
|
|
25113
|
+
case 4:
|
|
25114
|
+
data = _context.sent;
|
|
25115
|
+
return _context.abrupt("return", data);
|
|
25116
|
+
case 6:
|
|
25117
|
+
case "end":
|
|
25118
|
+
return _context.stop();
|
|
25119
|
+
}
|
|
25120
|
+
}, _callee);
|
|
25121
|
+
}));
|
|
25122
|
+
return function getDataById(_x) {
|
|
25123
|
+
return _ref2.apply(this, arguments);
|
|
25124
|
+
};
|
|
25125
|
+
}();
|
|
25168
25126
|
var onSelect = function onSelect(keys) {
|
|
25169
25127
|
setState(_objectSpread$h(_objectSpread$h({}, state), {}, {
|
|
25170
25128
|
selected: keys
|
|
25171
25129
|
}));
|
|
25172
25130
|
};
|
|
25173
25131
|
var onDelete = /*#__PURE__*/function () {
|
|
25174
|
-
var
|
|
25132
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
25175
25133
|
var newData, deleted, _loop, mappingData, index, total, pages, current, data;
|
|
25176
|
-
return _regeneratorRuntime.wrap(function
|
|
25177
|
-
while (1) switch (
|
|
25134
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
25135
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
25178
25136
|
case 0:
|
|
25179
25137
|
setState(_objectSpread$h(_objectSpread$h({}, state), {}, {
|
|
25180
25138
|
deleting: true
|
|
@@ -25184,24 +25142,24 @@ function useTableData$1 (_ref) {
|
|
|
25184
25142
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(index) {
|
|
25185
25143
|
var _newData$filter, _configuration$delete;
|
|
25186
25144
|
var id, deleteResult, deletedIndex;
|
|
25187
|
-
return _regeneratorRuntime.wrap(function _loop$(
|
|
25188
|
-
while (1) switch (
|
|
25145
|
+
return _regeneratorRuntime.wrap(function _loop$(_context2) {
|
|
25146
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
25189
25147
|
case 0:
|
|
25190
25148
|
id = state.selected[index];
|
|
25191
25149
|
mappingData = (_newData$filter = newData.filter(function (nd) {
|
|
25192
25150
|
return nd._id === state.selected[index];
|
|
25193
25151
|
})) === null || _newData$filter === void 0 ? void 0 : _newData$filter[0];
|
|
25194
25152
|
mappingData = _objectSpread$h(_objectSpread$h({}, mappingData), state.mappingData);
|
|
25195
|
-
|
|
25153
|
+
_context2.next = 5;
|
|
25196
25154
|
return apiHandler["delete"](id, (_configuration$delete = configuration.deleteMapping) !== null && _configuration$delete !== void 0 ? _configuration$delete : configuration.mapping, mappingData, true);
|
|
25197
25155
|
case 5:
|
|
25198
|
-
deleteResult =
|
|
25156
|
+
deleteResult = _context2.sent;
|
|
25199
25157
|
if (deleteResult) {
|
|
25200
|
-
|
|
25158
|
+
_context2.next = 9;
|
|
25201
25159
|
break;
|
|
25202
25160
|
}
|
|
25203
25161
|
setError('Fehler beim löschen eines Elementes.');
|
|
25204
|
-
return
|
|
25162
|
+
return _context2.abrupt("return", 1);
|
|
25205
25163
|
case 9:
|
|
25206
25164
|
deletedIndex = newData.findIndex(function (d) {
|
|
25207
25165
|
return (d === null || d === void 0 ? void 0 : d._id) == id;
|
|
@@ -25210,36 +25168,36 @@ function useTableData$1 (_ref) {
|
|
|
25210
25168
|
deleted++;
|
|
25211
25169
|
case 12:
|
|
25212
25170
|
case "end":
|
|
25213
|
-
return
|
|
25171
|
+
return _context2.stop();
|
|
25214
25172
|
}
|
|
25215
25173
|
}, _loop);
|
|
25216
25174
|
});
|
|
25217
25175
|
index = 0;
|
|
25218
25176
|
case 5:
|
|
25219
25177
|
if (!(index < state.selected.length)) {
|
|
25220
|
-
|
|
25178
|
+
_context3.next = 12;
|
|
25221
25179
|
break;
|
|
25222
25180
|
}
|
|
25223
|
-
return
|
|
25181
|
+
return _context3.delegateYield(_loop(index), "t0", 7);
|
|
25224
25182
|
case 7:
|
|
25225
|
-
if (!
|
|
25226
|
-
|
|
25183
|
+
if (!_context3.t0) {
|
|
25184
|
+
_context3.next = 9;
|
|
25227
25185
|
break;
|
|
25228
25186
|
}
|
|
25229
|
-
return
|
|
25187
|
+
return _context3.abrupt("continue", 9);
|
|
25230
25188
|
case 9:
|
|
25231
25189
|
index++;
|
|
25232
|
-
|
|
25190
|
+
_context3.next = 5;
|
|
25233
25191
|
break;
|
|
25234
25192
|
case 12:
|
|
25235
25193
|
total = state.pagination.total - deleted;
|
|
25236
25194
|
pages = Math.ceil(total / state.pagination.pageSize);
|
|
25237
25195
|
current = state.pagination.current > pages ? pages || 1 : state.pagination.current;
|
|
25238
25196
|
if (!(pages > 0 && state.pagination.current > pages && filterServerSide || state.selected.length === 0)) {
|
|
25239
|
-
|
|
25197
|
+
_context3.next = 21;
|
|
25240
25198
|
break;
|
|
25241
25199
|
}
|
|
25242
|
-
|
|
25200
|
+
_context3.next = 18;
|
|
25243
25201
|
return apiHandler.readList(configuration.mapping, {
|
|
25244
25202
|
pagination: _objectSpread$h(_objectSpread$h({}, state.pagination), {}, {
|
|
25245
25203
|
current: current
|
|
@@ -25249,7 +25207,7 @@ function useTableData$1 (_ref) {
|
|
|
25249
25207
|
sorter: filterData.sorter
|
|
25250
25208
|
});
|
|
25251
25209
|
case 18:
|
|
25252
|
-
data =
|
|
25210
|
+
data = _context3.sent;
|
|
25253
25211
|
newData = data.data;
|
|
25254
25212
|
total = data.total;
|
|
25255
25213
|
case 21:
|
|
@@ -25264,12 +25222,12 @@ function useTableData$1 (_ref) {
|
|
|
25264
25222
|
}));
|
|
25265
25223
|
case 22:
|
|
25266
25224
|
case "end":
|
|
25267
|
-
return
|
|
25225
|
+
return _context3.stop();
|
|
25268
25226
|
}
|
|
25269
|
-
},
|
|
25227
|
+
}, _callee2);
|
|
25270
25228
|
}));
|
|
25271
25229
|
return function onDelete() {
|
|
25272
|
-
return
|
|
25230
|
+
return _ref3.apply(this, arguments);
|
|
25273
25231
|
};
|
|
25274
25232
|
}();
|
|
25275
25233
|
function setLoading() {
|
|
@@ -25289,6 +25247,10 @@ function useTableData$1 (_ref) {
|
|
|
25289
25247
|
onChange: onChange,
|
|
25290
25248
|
onUpdate: onUpdate,
|
|
25291
25249
|
onDelete: onDelete,
|
|
25250
|
+
getDataById: getDataById,
|
|
25251
|
+
resetToggle: function resetToggle() {
|
|
25252
|
+
throw new Error('not implemented for CatalogTable');
|
|
25253
|
+
},
|
|
25292
25254
|
triggerRefresh: function triggerRefresh() {
|
|
25293
25255
|
throw new Error('not implemented for CatalogTable');
|
|
25294
25256
|
},
|
|
@@ -25638,38 +25600,74 @@ function useTableData (_ref) {
|
|
|
25638
25600
|
}
|
|
25639
25601
|
return title;
|
|
25640
25602
|
}, [configuration.title, parentData]);
|
|
25603
|
+
var getDataById = /*#__PURE__*/function () {
|
|
25604
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
|
25605
|
+
var _configuration$filter9;
|
|
25606
|
+
var filters, ssf, data;
|
|
25607
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
25608
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
25609
|
+
case 0:
|
|
25610
|
+
filters = {};
|
|
25611
|
+
filters['_id'] = [id, 'eq', false];
|
|
25612
|
+
ssf = _objectSpread$g({
|
|
25613
|
+
pagination: {
|
|
25614
|
+
current: 1,
|
|
25615
|
+
pageSize: 1
|
|
25616
|
+
},
|
|
25617
|
+
columns: configuration.columns,
|
|
25618
|
+
filters: filters
|
|
25619
|
+
}, configuration !== null && configuration !== void 0 && (_configuration$filter9 = configuration.filter) !== null && _configuration$filter9 !== void 0 && (_configuration$filter9 = _configuration$filter9.toggle) !== null && _configuration$filter9 !== void 0 && _configuration$filter9.inQuery ? {
|
|
25620
|
+
genericProps: globalFilter.toggle
|
|
25621
|
+
} : undefined);
|
|
25622
|
+
_context2.next = 5;
|
|
25623
|
+
return apiHandler.readList(parentMapping || configuration.mapping, mapping, ssf);
|
|
25624
|
+
case 5:
|
|
25625
|
+
data = _context2.sent;
|
|
25626
|
+
return _context2.abrupt("return", data);
|
|
25627
|
+
case 7:
|
|
25628
|
+
case "end":
|
|
25629
|
+
return _context2.stop();
|
|
25630
|
+
}
|
|
25631
|
+
}, _callee2);
|
|
25632
|
+
}));
|
|
25633
|
+
return function getDataById(_x2) {
|
|
25634
|
+
return _ref4.apply(this, arguments);
|
|
25635
|
+
};
|
|
25636
|
+
}();
|
|
25641
25637
|
var onChange = /*#__PURE__*/function () {
|
|
25642
|
-
var
|
|
25643
|
-
var _configuration$
|
|
25638
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(p) {
|
|
25639
|
+
var _configuration$filter10, _configuration$filter11, _configuration$filter12, _prefilter$select, _configuration$filter13, _configuration$filter14;
|
|
25644
25640
|
var prefilter,
|
|
25645
25641
|
refresh,
|
|
25642
|
+
clearSelection,
|
|
25646
25643
|
currentData,
|
|
25647
25644
|
filterData,
|
|
25648
25645
|
currentFilterHash,
|
|
25649
25646
|
currentPagination,
|
|
25650
25647
|
currentUrl,
|
|
25651
|
-
_configuration$
|
|
25648
|
+
_configuration$filter15,
|
|
25652
25649
|
ssf,
|
|
25653
25650
|
data,
|
|
25654
25651
|
_data3,
|
|
25655
25652
|
_aplyFilterAndSortati2,
|
|
25656
25653
|
_data4,
|
|
25657
25654
|
pagination,
|
|
25658
|
-
|
|
25659
|
-
return _regeneratorRuntime.wrap(function
|
|
25660
|
-
while (1) switch (
|
|
25655
|
+
_args3 = arguments;
|
|
25656
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
25657
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
25661
25658
|
case 0:
|
|
25662
|
-
prefilter =
|
|
25663
|
-
refresh =
|
|
25659
|
+
prefilter = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : globalFilter;
|
|
25660
|
+
refresh = _args3.length > 2 ? _args3[2] : undefined;
|
|
25661
|
+
clearSelection = _args3.length > 3 ? _args3[3] : undefined;
|
|
25664
25662
|
setState(_objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
25665
25663
|
loading: true
|
|
25666
25664
|
}));
|
|
25667
25665
|
currentData = initData;
|
|
25668
|
-
filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$
|
|
25669
|
-
filterData = Object.fromEntries(Object.entries(filterData).filter(function (
|
|
25670
|
-
var
|
|
25671
|
-
|
|
25672
|
-
var v =
|
|
25666
|
+
filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter10 = configuration.filter) !== null && _configuration$filter10 !== void 0 && (_configuration$filter10 = _configuration$filter10.toggle) !== null && _configuration$filter10 !== void 0 && _configuration$filter10.inQuery) ? prefilter.toggle : undefined), ((_configuration$filter11 = configuration.filter) === null || _configuration$filter11 === void 0 || (_configuration$filter11 = _configuration$filter11.select) === null || _configuration$filter11 === void 0 ? void 0 : _configuration$filter11.applyDefaultValue) !== false || ((_configuration$filter12 = configuration.filter) === null || _configuration$filter12 === void 0 || (_configuration$filter12 = _configuration$filter12.select) === null || _configuration$filter12 === void 0 ? void 0 : _configuration$filter12.defaultValue) !== ((_prefilter$select = prefilter.select) === null || _prefilter$select === void 0 || (_prefilter$select = _prefilter$select[(_configuration$filter13 = (_configuration$filter14 = configuration.filter) === null || _configuration$filter14 === void 0 || (_configuration$filter14 = _configuration$filter14.select) === null || _configuration$filter14 === void 0 ? void 0 : _configuration$filter14.filterField) !== null && _configuration$filter13 !== void 0 ? _configuration$filter13 : '']) === null || _prefilter$select === void 0 ? void 0 : _prefilter$select[0]) ? prefilter.select : undefined), prefilter.timeStamp), prefilter["default"]); //remove all null values
|
|
25667
|
+
filterData = Object.fromEntries(Object.entries(filterData).filter(function (_ref6) {
|
|
25668
|
+
var _ref7 = _slicedToArray(_ref6, 2);
|
|
25669
|
+
_ref7[0];
|
|
25670
|
+
var v = _ref7[1];
|
|
25673
25671
|
return v != null;
|
|
25674
25672
|
}));
|
|
25675
25673
|
currentFilterHash = objectHash(filterData);
|
|
@@ -25678,7 +25676,7 @@ function useTableData (_ref) {
|
|
|
25678
25676
|
});
|
|
25679
25677
|
filterHash.current = currentFilterHash;
|
|
25680
25678
|
if (!filterServerSide) {
|
|
25681
|
-
|
|
25679
|
+
_context3.next = 20;
|
|
25682
25680
|
break;
|
|
25683
25681
|
}
|
|
25684
25682
|
ssf = _objectSpread$g({
|
|
@@ -25686,32 +25684,32 @@ function useTableData (_ref) {
|
|
|
25686
25684
|
columns: configuration.columns,
|
|
25687
25685
|
filters: filterData,
|
|
25688
25686
|
sorter: p.sorter
|
|
25689
|
-
}, configuration !== null && configuration !== void 0 && (_configuration$
|
|
25687
|
+
}, configuration !== null && configuration !== void 0 && (_configuration$filter15 = configuration.filter) !== null && _configuration$filter15 !== void 0 && (_configuration$filter15 = _configuration$filter15.toggle) !== null && _configuration$filter15 !== void 0 && _configuration$filter15.inQuery ? {
|
|
25690
25688
|
genericProps: prefilter.toggle
|
|
25691
25689
|
} : undefined);
|
|
25692
|
-
|
|
25690
|
+
_context3.next = 14;
|
|
25693
25691
|
return apiHandler.readList(parentMapping || configuration.mapping, mapping, ssf);
|
|
25694
|
-
case
|
|
25695
|
-
data =
|
|
25692
|
+
case 14:
|
|
25693
|
+
data = _context3.sent;
|
|
25696
25694
|
currentUrl = apiHandler.getReadListUrl(parentMapping || configuration.mapping, mapping, ssf);
|
|
25697
25695
|
currentData = data.data;
|
|
25698
25696
|
currentPagination = _objectSpread$g(_objectSpread$g({}, currentPagination), {}, {
|
|
25699
25697
|
total: data.total
|
|
25700
25698
|
});
|
|
25701
|
-
|
|
25699
|
+
_context3.next = 29;
|
|
25702
25700
|
break;
|
|
25703
|
-
case
|
|
25701
|
+
case 20:
|
|
25704
25702
|
if (!(!currentData || currentData.length === 0 || refresh)) {
|
|
25705
|
-
|
|
25703
|
+
_context3.next = 26;
|
|
25706
25704
|
break;
|
|
25707
25705
|
}
|
|
25708
|
-
|
|
25706
|
+
_context3.next = 23;
|
|
25709
25707
|
return apiHandler.readList(parentMapping || configuration.mapping, mapping, undefined);
|
|
25710
|
-
case
|
|
25711
|
-
_data3 =
|
|
25708
|
+
case 23:
|
|
25709
|
+
_data3 = _context3.sent;
|
|
25712
25710
|
currentData = _data3.data;
|
|
25713
25711
|
setInitData(currentData);
|
|
25714
|
-
case
|
|
25712
|
+
case 26:
|
|
25715
25713
|
_aplyFilterAndSortati2 = aplyFilterAndSortation(_objectSpread$g(_objectSpread$g({}, p), {}, {
|
|
25716
25714
|
pagination: currentPagination,
|
|
25717
25715
|
filters: filterData,
|
|
@@ -25720,7 +25718,7 @@ function useTableData (_ref) {
|
|
|
25720
25718
|
})), _data4 = _aplyFilterAndSortati2.data, pagination = _aplyFilterAndSortati2.pagination;
|
|
25721
25719
|
currentData = _data4;
|
|
25722
25720
|
currentPagination = pagination;
|
|
25723
|
-
case
|
|
25721
|
+
case 29:
|
|
25724
25722
|
setState(_objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
25725
25723
|
loading: false,
|
|
25726
25724
|
data: currentData,
|
|
@@ -25729,19 +25727,21 @@ function useTableData (_ref) {
|
|
|
25729
25727
|
prefilter: prefilter
|
|
25730
25728
|
}),
|
|
25731
25729
|
currentFetchUrl: currentUrl
|
|
25732
|
-
}
|
|
25730
|
+
}, clearSelection ? {
|
|
25731
|
+
selected: []
|
|
25732
|
+
} : {}));
|
|
25733
25733
|
setFilter({
|
|
25734
25734
|
filters: p.filters,
|
|
25735
25735
|
sorter: p.sorter
|
|
25736
25736
|
});
|
|
25737
|
-
case
|
|
25737
|
+
case 31:
|
|
25738
25738
|
case "end":
|
|
25739
|
-
return
|
|
25739
|
+
return _context3.stop();
|
|
25740
25740
|
}
|
|
25741
|
-
},
|
|
25741
|
+
}, _callee3);
|
|
25742
25742
|
}));
|
|
25743
|
-
return function onChange(
|
|
25744
|
-
return
|
|
25743
|
+
return function onChange(_x3) {
|
|
25744
|
+
return _ref5.apply(this, arguments);
|
|
25745
25745
|
};
|
|
25746
25746
|
}();
|
|
25747
25747
|
var onSelect = function onSelect(keys) {
|
|
@@ -25750,11 +25750,11 @@ function useTableData (_ref) {
|
|
|
25750
25750
|
}));
|
|
25751
25751
|
};
|
|
25752
25752
|
var onDelete = /*#__PURE__*/function () {
|
|
25753
|
-
var
|
|
25753
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
25754
25754
|
var _configuration$apiInt2;
|
|
25755
|
-
var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$
|
|
25756
|
-
return _regeneratorRuntime.wrap(function
|
|
25757
|
-
while (1) switch (
|
|
25755
|
+
var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter16, _configuration$filter17, data;
|
|
25756
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
25757
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
25758
25758
|
case 0:
|
|
25759
25759
|
setState(_objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
25760
25760
|
deleting: true
|
|
@@ -25762,15 +25762,15 @@ function useTableData (_ref) {
|
|
|
25762
25762
|
newData = _toConsumableArray(state.data);
|
|
25763
25763
|
newInitData = initData ? _toConsumableArray(initData) : undefined;
|
|
25764
25764
|
deleted = 0;
|
|
25765
|
-
|
|
25765
|
+
_context5.next = 6;
|
|
25766
25766
|
return _typeof(configuration.apiInterface) == 'object' && _typeof(configuration.apiInterface["delete"]) == 'object' ? (_configuration$apiInt2 = configuration.apiInterface["delete"]) === null || _configuration$apiInt2 === void 0 ? void 0 : _configuration$apiInt2.permission : undefined;
|
|
25767
25767
|
case 6:
|
|
25768
|
-
userPermissions =
|
|
25768
|
+
userPermissions = _context5.sent;
|
|
25769
25769
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(index) {
|
|
25770
|
-
var _configuration$
|
|
25770
|
+
var _configuration$filter18, _configuration$filter19;
|
|
25771
25771
|
var id, _newData$filter, _newData$filter2, mapToggle, _iterator, _step, _globalFilter$toggle, field, _globalFilter$toggle2, _configuration$delete, _configuration$onErro, _configuration$onErro2, deletedIndex, initDeletedIndex;
|
|
25772
|
-
return _regeneratorRuntime.wrap(function _loop$(
|
|
25773
|
-
while (1) switch (
|
|
25772
|
+
return _regeneratorRuntime.wrap(function _loop$(_context4) {
|
|
25773
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
25774
25774
|
case 0:
|
|
25775
25775
|
id = state.selected[index];
|
|
25776
25776
|
if (configuration.rowKey) {
|
|
@@ -25783,7 +25783,7 @@ function useTableData (_ref) {
|
|
|
25783
25783
|
})) === null || _newData$filter2 === void 0 ? void 0 : _newData$filter2[0];
|
|
25784
25784
|
}
|
|
25785
25785
|
mapToggle = {};
|
|
25786
|
-
_iterator = _createForOfIteratorHelper$3((_configuration$
|
|
25786
|
+
_iterator = _createForOfIteratorHelper$3((_configuration$filter18 = (_configuration$filter19 = configuration.filter) === null || _configuration$filter19 === void 0 || (_configuration$filter19 = _configuration$filter19.toggle) === null || _configuration$filter19 === void 0 ? void 0 : _configuration$filter19.fields) !== null && _configuration$filter18 !== void 0 ? _configuration$filter18 : []);
|
|
25787
25787
|
try {
|
|
25788
25788
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
25789
25789
|
field = _step.value;
|
|
@@ -25798,107 +25798,106 @@ function useTableData (_ref) {
|
|
|
25798
25798
|
}
|
|
25799
25799
|
mappingData = _objectSpread$g(_objectSpread$g(_objectSpread$g({}, mappingData), state.mappingData), mapToggle);
|
|
25800
25800
|
deleteResult = undefined;
|
|
25801
|
-
|
|
25801
|
+
_context4.prev = 7;
|
|
25802
25802
|
if (!(userPermissions && !root.actions.userHasPermission(userPermissions))) {
|
|
25803
|
-
|
|
25803
|
+
_context4.next = 11;
|
|
25804
25804
|
break;
|
|
25805
25805
|
}
|
|
25806
25806
|
setError('Sie haben keine Berechtigung ein Mediaitem zu löschen.');
|
|
25807
|
-
return
|
|
25807
|
+
return _context4.abrupt("return", 0);
|
|
25808
25808
|
case 11:
|
|
25809
|
-
|
|
25809
|
+
_context4.next = 13;
|
|
25810
25810
|
return apiHandler["delete"](id, (_configuration$delete = configuration.deleteMapping) !== null && _configuration$delete !== void 0 ? _configuration$delete : configuration.mapping, mappingData);
|
|
25811
25811
|
case 13:
|
|
25812
|
-
deleteResult =
|
|
25813
|
-
|
|
25812
|
+
deleteResult = _context4.sent;
|
|
25813
|
+
_context4.next = 24;
|
|
25814
25814
|
break;
|
|
25815
25815
|
case 16:
|
|
25816
|
-
|
|
25817
|
-
|
|
25818
|
-
if (!(
|
|
25819
|
-
|
|
25816
|
+
_context4.prev = 16;
|
|
25817
|
+
_context4.t0 = _context4["catch"](7);
|
|
25818
|
+
if (!(_context4.t0 instanceof DivaError && _context4.t0.name)) {
|
|
25819
|
+
_context4.next = 22;
|
|
25820
25820
|
break;
|
|
25821
25821
|
}
|
|
25822
|
-
if (!((_configuration$onErro = configuration.onError) !== null && _configuration$onErro !== void 0 && _configuration$onErro[
|
|
25823
|
-
|
|
25822
|
+
if (!((_configuration$onErro = configuration.onError) !== null && _configuration$onErro !== void 0 && _configuration$onErro[_context4.t0.name])) {
|
|
25823
|
+
_context4.next = 22;
|
|
25824
25824
|
break;
|
|
25825
25825
|
}
|
|
25826
|
-
setError((_configuration$onErro2 = configuration.onError) === null || _configuration$onErro2 === void 0 ? void 0 : _configuration$onErro2[
|
|
25827
|
-
return
|
|
25826
|
+
setError((_configuration$onErro2 = configuration.onError) === null || _configuration$onErro2 === void 0 ? void 0 : _configuration$onErro2[_context4.t0.name]);
|
|
25827
|
+
return _context4.abrupt("return", 0);
|
|
25828
25828
|
case 22:
|
|
25829
|
-
setError(
|
|
25830
|
-
return
|
|
25829
|
+
setError(_context4.t0.message);
|
|
25830
|
+
return _context4.abrupt("return", 0);
|
|
25831
25831
|
case 24:
|
|
25832
25832
|
if (deleteResult) {
|
|
25833
|
-
|
|
25833
|
+
_context4.next = 27;
|
|
25834
25834
|
break;
|
|
25835
25835
|
}
|
|
25836
25836
|
setError('Fehler beim löschen eines Elementes.');
|
|
25837
|
-
return
|
|
25837
|
+
return _context4.abrupt("return", 1);
|
|
25838
25838
|
case 27:
|
|
25839
|
-
(_configuration$rowKey = configuration.rowKey) !== null && _configuration$rowKey !== void 0 ? _configuration$rowKey : '_id';
|
|
25840
25839
|
deletedIndex = newData.findIndex(function (d) {
|
|
25841
|
-
var _configuration$
|
|
25842
|
-
return goTroughObject(d, (_configuration$
|
|
25840
|
+
var _configuration$rowKey, _configuration$rowKey2;
|
|
25841
|
+
return goTroughObject(d, (_configuration$rowKey = (_configuration$rowKey2 = configuration.rowKey) === null || _configuration$rowKey2 === void 0 ? void 0 : _configuration$rowKey2.split('.')) !== null && _configuration$rowKey !== void 0 ? _configuration$rowKey : ['_id']) == id;
|
|
25843
25842
|
});
|
|
25844
25843
|
newData.splice(deletedIndex, 1);
|
|
25845
25844
|
initDeletedIndex = newInitData === null || newInitData === void 0 ? void 0 : newInitData.findIndex(function (d) {
|
|
25846
|
-
var _configuration$
|
|
25847
|
-
return goTroughObject(d, (_configuration$
|
|
25845
|
+
var _configuration$rowKey3, _configuration$rowKey4;
|
|
25846
|
+
return goTroughObject(d, (_configuration$rowKey3 = (_configuration$rowKey4 = configuration.rowKey) === null || _configuration$rowKey4 === void 0 ? void 0 : _configuration$rowKey4.split('.')) !== null && _configuration$rowKey3 !== void 0 ? _configuration$rowKey3 : ['_id']) == id;
|
|
25848
25847
|
});
|
|
25849
25848
|
newInitData === null || newInitData === void 0 || newInitData.splice(initDeletedIndex, 1);
|
|
25850
25849
|
deleted++;
|
|
25851
|
-
case
|
|
25850
|
+
case 32:
|
|
25852
25851
|
case "end":
|
|
25853
|
-
return
|
|
25852
|
+
return _context4.stop();
|
|
25854
25853
|
}
|
|
25855
25854
|
}, _loop, null, [[7, 16]]);
|
|
25856
25855
|
});
|
|
25857
25856
|
index = 0;
|
|
25858
25857
|
case 9:
|
|
25859
25858
|
if (!(index < state.selected.length)) {
|
|
25860
|
-
|
|
25859
|
+
_context5.next = 19;
|
|
25861
25860
|
break;
|
|
25862
25861
|
}
|
|
25863
|
-
return
|
|
25862
|
+
return _context5.delegateYield(_loop(index), "t0", 11);
|
|
25864
25863
|
case 11:
|
|
25865
|
-
_ret =
|
|
25864
|
+
_ret = _context5.t0;
|
|
25866
25865
|
if (!(_ret === 0)) {
|
|
25867
|
-
|
|
25866
|
+
_context5.next = 14;
|
|
25868
25867
|
break;
|
|
25869
25868
|
}
|
|
25870
|
-
return
|
|
25869
|
+
return _context5.abrupt("break", 19);
|
|
25871
25870
|
case 14:
|
|
25872
25871
|
if (!(_ret === 1)) {
|
|
25873
|
-
|
|
25872
|
+
_context5.next = 16;
|
|
25874
25873
|
break;
|
|
25875
25874
|
}
|
|
25876
|
-
return
|
|
25875
|
+
return _context5.abrupt("continue", 16);
|
|
25877
25876
|
case 16:
|
|
25878
25877
|
index++;
|
|
25879
|
-
|
|
25878
|
+
_context5.next = 9;
|
|
25880
25879
|
break;
|
|
25881
25880
|
case 19:
|
|
25882
25881
|
total = state.pagination.total - deleted;
|
|
25883
25882
|
pages = Math.ceil(total / state.pagination.pageSize);
|
|
25884
25883
|
current = state.pagination.current > pages ? pages : state.pagination.current;
|
|
25885
25884
|
if (!(state.pagination.current > pages && filterServerSide || state.selected.length === 0)) {
|
|
25886
|
-
|
|
25885
|
+
_context5.next = 28;
|
|
25887
25886
|
break;
|
|
25888
25887
|
}
|
|
25889
|
-
|
|
25888
|
+
_context5.next = 25;
|
|
25890
25889
|
return apiHandler.readList(parentMapping || configuration.mapping, mapping, _objectSpread$g({
|
|
25891
25890
|
pagination: _objectSpread$g(_objectSpread$g({}, state.pagination), {}, {
|
|
25892
25891
|
current: current
|
|
25893
25892
|
}),
|
|
25894
25893
|
columns: configuration.columns,
|
|
25895
|
-
filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$
|
|
25894
|
+
filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter16 = configuration.filter) !== null && _configuration$filter16 !== void 0 && (_configuration$filter16 = _configuration$filter16.toggle) !== null && _configuration$filter16 !== void 0 && _configuration$filter16.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
|
|
25896
25895
|
sorter: filterData.sorter
|
|
25897
|
-
}, configuration !== null && configuration !== void 0 && (_configuration$
|
|
25896
|
+
}, configuration !== null && configuration !== void 0 && (_configuration$filter17 = configuration.filter) !== null && _configuration$filter17 !== void 0 && (_configuration$filter17 = _configuration$filter17.toggle) !== null && _configuration$filter17 !== void 0 && _configuration$filter17.inQuery ? {
|
|
25898
25897
|
genericProps: globalFilter.toggle
|
|
25899
25898
|
} : undefined));
|
|
25900
25899
|
case 25:
|
|
25901
|
-
data =
|
|
25900
|
+
data = _context5.sent;
|
|
25902
25901
|
newData = data.data;
|
|
25903
25902
|
total = data.total;
|
|
25904
25903
|
case 28:
|
|
@@ -25914,17 +25913,17 @@ function useTableData (_ref) {
|
|
|
25914
25913
|
}));
|
|
25915
25914
|
case 30:
|
|
25916
25915
|
case "end":
|
|
25917
|
-
return
|
|
25916
|
+
return _context5.stop();
|
|
25918
25917
|
}
|
|
25919
|
-
},
|
|
25918
|
+
}, _callee4);
|
|
25920
25919
|
}));
|
|
25921
25920
|
return function onDelete() {
|
|
25922
|
-
return
|
|
25921
|
+
return _ref8.apply(this, arguments);
|
|
25923
25922
|
};
|
|
25924
25923
|
}();
|
|
25925
25924
|
var onGlobalFilterSelect = function onGlobalFilterSelect(value) {
|
|
25926
|
-
var _configuration$
|
|
25927
|
-
if (!((_configuration$
|
|
25925
|
+
var _configuration$filter20;
|
|
25926
|
+
if (!((_configuration$filter20 = configuration.filter) !== null && _configuration$filter20 !== void 0 && _configuration$filter20.select)) {
|
|
25928
25927
|
LOG$2.error(new DivaError('No global select filter defiend'));
|
|
25929
25928
|
return;
|
|
25930
25929
|
}
|
|
@@ -25940,8 +25939,8 @@ function useTableData (_ref) {
|
|
|
25940
25939
|
}, filterData), newGlobalFilter);
|
|
25941
25940
|
};
|
|
25942
25941
|
var onGlobalFilterToggle = function onGlobalFilterToggle() {
|
|
25943
|
-
var _configuration$
|
|
25944
|
-
if (!((_configuration$
|
|
25942
|
+
var _configuration$filter21;
|
|
25943
|
+
if (!((_configuration$filter21 = configuration.filter) !== null && _configuration$filter21 !== void 0 && _configuration$filter21.toggle)) {
|
|
25945
25944
|
LOG$2.error(new DivaError('No global toggle filter defined'));
|
|
25946
25945
|
return;
|
|
25947
25946
|
}
|
|
@@ -25955,11 +25954,14 @@ function useTableData (_ref) {
|
|
|
25955
25954
|
setGlobaFilter(newGlobalFilter);
|
|
25956
25955
|
onChange(_objectSpread$g({
|
|
25957
25956
|
pagination: state.pagination
|
|
25958
|
-
}, filterData), newGlobalFilter);
|
|
25957
|
+
}, filterData), newGlobalFilter, undefined, true);
|
|
25958
|
+
};
|
|
25959
|
+
var resetToggle = function resetToggle() {
|
|
25960
|
+
if (globalFilter !== null && globalFilter !== void 0 && globalFilter.toggle) onGlobalFilterToggle();
|
|
25959
25961
|
};
|
|
25960
25962
|
var onGlobalFilterSearch = function onGlobalFilterSearch(value) {
|
|
25961
|
-
var _configuration$
|
|
25962
|
-
if (!((_configuration$
|
|
25963
|
+
var _configuration$filter22;
|
|
25964
|
+
if (!((_configuration$filter22 = configuration.filter) !== null && _configuration$filter22 !== void 0 && _configuration$filter22.search)) {
|
|
25963
25965
|
LOG$2.error(new DivaError('No global search filter defiend'));
|
|
25964
25966
|
return;
|
|
25965
25967
|
}
|
|
@@ -25967,8 +25969,8 @@ function useTableData (_ref) {
|
|
|
25967
25969
|
search: {}
|
|
25968
25970
|
});
|
|
25969
25971
|
if (value) {
|
|
25970
|
-
var _configuration$
|
|
25971
|
-
(_configuration$
|
|
25972
|
+
var _configuration$filter23;
|
|
25973
|
+
(_configuration$filter23 = configuration.filter) === null || _configuration$filter23 === void 0 || _configuration$filter23.search.fields.forEach(function (f) {
|
|
25972
25974
|
if (typeof f == 'string') {
|
|
25973
25975
|
newGlobalFilter.search[f] = [value, 'contains', 0];
|
|
25974
25976
|
} else {
|
|
@@ -25982,8 +25984,8 @@ function useTableData (_ref) {
|
|
|
25982
25984
|
}, filterData), newGlobalFilter);
|
|
25983
25985
|
};
|
|
25984
25986
|
var onGlobalFilterPeriod = function onGlobalFilterPeriod(from, to) {
|
|
25985
|
-
var _configuration$
|
|
25986
|
-
if (!((_configuration$
|
|
25987
|
+
var _configuration$filter24;
|
|
25988
|
+
if (!((_configuration$filter24 = configuration.filter) !== null && _configuration$filter24 !== void 0 && _configuration$filter24.period)) {
|
|
25987
25989
|
LOG$2.error(new DivaError('No global period filter defiend'));
|
|
25988
25990
|
return;
|
|
25989
25991
|
}
|
|
@@ -26005,7 +26007,9 @@ function useTableData (_ref) {
|
|
|
26005
26007
|
onUpdate: onUpdate,
|
|
26006
26008
|
onDelete: onDelete,
|
|
26007
26009
|
onSelect: onSelect,
|
|
26010
|
+
getDataById: getDataById,
|
|
26008
26011
|
triggerRefresh: triggerRefresh,
|
|
26012
|
+
resetToggle: resetToggle,
|
|
26009
26013
|
onSelectedCatalog: onSelectedCatalog,
|
|
26010
26014
|
error: error,
|
|
26011
26015
|
catalogItem: catalogItem,
|
|
@@ -28835,7 +28839,8 @@ function useModule (currentModules) {
|
|
|
28835
28839
|
},
|
|
28836
28840
|
type: 'Configurator',
|
|
28837
28841
|
id: 'WYSIWYG',
|
|
28838
|
-
startWidth: 600
|
|
28842
|
+
startWidth: 600,
|
|
28843
|
+
defaultPinned: true
|
|
28839
28844
|
});
|
|
28840
28845
|
root.contentStore.tools = tools;
|
|
28841
28846
|
return function () {
|
|
@@ -30898,7 +30903,8 @@ var ArticleSelection = function ArticleSelection(_ref) {
|
|
|
30898
30903
|
}), root.contentStore.toolPinned && /*#__PURE__*/jsx(PushpinFilled, {
|
|
30899
30904
|
onClick: function onClick() {
|
|
30900
30905
|
return root.contentStore.toolPinned = !root.contentStore.toolPinned;
|
|
30901
|
-
}
|
|
30906
|
+
},
|
|
30907
|
+
className: button
|
|
30902
30908
|
}), /*#__PURE__*/jsx(Select$2, {
|
|
30903
30909
|
value: articleList.find(function (a) {
|
|
30904
30910
|
return a.value == articleCodex;
|
|
@@ -31085,6 +31091,7 @@ function useWysiwyg$1(_ref) {
|
|
|
31085
31091
|
hideMobileFolder: true,
|
|
31086
31092
|
showSettingsFolder: true,
|
|
31087
31093
|
hideRalColorFilter: false,
|
|
31094
|
+
showOptionCodexInOptionHeader: true,
|
|
31088
31095
|
hideSearchBar: false,
|
|
31089
31096
|
alwaysShowSearchBar: true,
|
|
31090
31097
|
displayMetaDatas: ['codex'],
|
|
@@ -31445,6 +31452,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
31445
31452
|
});
|
|
31446
31453
|
if (_tool) {
|
|
31447
31454
|
root.contentStore.openedToolId = _tool.id;
|
|
31455
|
+
root.contentStore.toolPinned = !!_tool.defaultPinned;
|
|
31448
31456
|
root.contentStore.hideTools = false;
|
|
31449
31457
|
}
|
|
31450
31458
|
}
|
|
@@ -31474,6 +31482,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
31474
31482
|
onClick: function onClick() {
|
|
31475
31483
|
if (root.contentStore.openedToolId != t.id) {
|
|
31476
31484
|
root.contentStore.openedToolId = t.id;
|
|
31485
|
+
root.contentStore.toolPinned = !!t.defaultPinned;
|
|
31477
31486
|
root.contentStore.hideTools = false;
|
|
31478
31487
|
} else {
|
|
31479
31488
|
root.contentStore.hideTools = !root.contentStore.hideTools;
|