jamespot-front-business 1.1.81 → 1.1.83

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/dist/esm.js CHANGED
@@ -45,6 +45,10 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
45
45
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
46
46
  };
47
47
 
48
+ const isAbortError = (error) => {
49
+ return !!error && typeof error === 'object' && 'aborted' in error && !!error.aborted;
50
+ };
51
+
48
52
  const toastAdapter = createEntityAdapter({
49
53
  selectId: (toast) => toast.id,
50
54
  });
@@ -82,8 +86,234 @@ const Toast = {
82
86
  selectors: selectors$3,
83
87
  };
84
88
 
85
- const isAbortError = (error) => {
86
- return !!error && typeof error === 'object' && 'aborted' in error && !!error.aborted;
89
+ const formatDate$2 = (date) => date.toISOString().slice(0, 19).replace(/T/g, ' ');
90
+ const oneMonthAgo$2 = () => {
91
+ const date = new Date();
92
+ date.setMonth(date.getMonth() - 1);
93
+ return date;
94
+ };
95
+ const initialState$p = {
96
+ data: [],
97
+ loading: 'idle',
98
+ page: 1,
99
+ filters: [
100
+ {
101
+ name: 'dateCreation',
102
+ method: 'between',
103
+ value: {
104
+ start: formatDate$2(oneMonthAgo$2()),
105
+ end: formatDate$2(new Date()),
106
+ }
107
+ }
108
+ ],
109
+ orders: [],
110
+ limit: 30,
111
+ nbResults: 0,
112
+ };
113
+ const fetchLogsNavigation = createAsyncThunk('admin/fetchLogsNavigation', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
114
+ try {
115
+ const logs = (yield extra.jApi.admin.logs.getLogsNavigation(params)).result;
116
+ return logs;
117
+ }
118
+ catch (err) {
119
+ if (!isAbortError(err)) {
120
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
121
+ }
122
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve admin logs navigation' });
123
+ }
124
+ }));
125
+ const adminLogsNavigationSlice = createSlice({
126
+ name: 'logsNavigation',
127
+ initialState: initialState$p,
128
+ reducers: {
129
+ setNavigationOrder: (state, action) => {
130
+ state.orders = [...action.payload];
131
+ state.page = 1;
132
+ },
133
+ setNavigationFilter: (state, action) => {
134
+ state.filters = [...action.payload];
135
+ state.page = 1;
136
+ },
137
+ setNavigationPage: (state, action) => {
138
+ state.page = action.payload;
139
+ },
140
+ },
141
+ extraReducers: (builder) => {
142
+ builder.addCase(fetchLogsNavigation.pending, (state) => {
143
+ state.loading = 'pending';
144
+ });
145
+ builder.addCase(fetchLogsNavigation.fulfilled, (state, action) => {
146
+ var _a;
147
+ state.data = action.payload.data;
148
+ state.nbResults = action.payload.cnt;
149
+ state.limit = (_a = action.payload.limit) !== null && _a !== void 0 ? _a : 30;
150
+ state.page = action.payload.page;
151
+ state.loading = 'idle';
152
+ });
153
+ builder.addCase(fetchLogsNavigation.rejected, (state) => {
154
+ state.loading = 'idle';
155
+ });
156
+ },
157
+ });
158
+
159
+ const formatDate$1 = (date) => date.toISOString().slice(0, 19).replace(/T/g, ' ');
160
+ const oneMonthAgo$1 = () => {
161
+ const date = new Date();
162
+ date.setMonth(date.getMonth() - 1);
163
+ return date;
164
+ };
165
+ const initialState$o = {
166
+ data: [],
167
+ loading: 'idle',
168
+ page: 1,
169
+ filters: [
170
+ {
171
+ name: 'dateCreation',
172
+ method: 'between',
173
+ value: {
174
+ start: formatDate$1(oneMonthAgo$1()),
175
+ end: formatDate$1(new Date()),
176
+ }
177
+ }
178
+ ],
179
+ orders: [],
180
+ limit: 30,
181
+ nbResults: 0,
182
+ };
183
+ const fetchLogsObjects = createAsyncThunk('admin/fetchLogsObjects', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
184
+ try {
185
+ const logs = (yield extra.jApi.admin.logs.getLogsObjects(params)).result;
186
+ return logs;
187
+ }
188
+ catch (err) {
189
+ if (!isAbortError(err)) {
190
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
191
+ }
192
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve admin logs Objects' });
193
+ }
194
+ }));
195
+ const adminLogsObjectsSlice = createSlice({
196
+ name: 'logsObjects',
197
+ initialState: initialState$o,
198
+ reducers: {
199
+ setObjectsOrder: (state, action) => {
200
+ state.orders = [...action.payload];
201
+ state.page = 1;
202
+ },
203
+ setObjectsFilter: (state, action) => {
204
+ state.filters = [...action.payload];
205
+ state.page = 1;
206
+ },
207
+ setObjectsPage: (state, action) => {
208
+ state.page = action.payload;
209
+ },
210
+ },
211
+ extraReducers: (builder) => {
212
+ builder.addCase(fetchLogsObjects.pending, (state) => {
213
+ state.loading = 'pending';
214
+ });
215
+ builder.addCase(fetchLogsObjects.fulfilled, (state, action) => {
216
+ state.data = action.payload.data;
217
+ state.nbResults = action.payload.cnt;
218
+ state.limit = action.payload.limit || 30;
219
+ state.page = action.payload.page;
220
+ state.loading = 'idle';
221
+ });
222
+ builder.addCase(fetchLogsObjects.rejected, (state) => {
223
+ state.loading = 'idle';
224
+ });
225
+ },
226
+ });
227
+
228
+ const formatDate = (date) => date.toISOString().slice(0, 19).replace(/T/g, ' ');
229
+ const oneMonthAgo = () => {
230
+ const date = new Date();
231
+ date.setMonth(date.getMonth() - 1);
232
+ return date;
233
+ };
234
+ const initialState$n = {
235
+ data: [],
236
+ loading: 'idle',
237
+ page: 1,
238
+ filters: [
239
+ {
240
+ name: 'dateCreation',
241
+ method: 'between',
242
+ value: {
243
+ start: formatDate(oneMonthAgo()),
244
+ end: formatDate(new Date()),
245
+ }
246
+ }
247
+ ],
248
+ orders: [],
249
+ limit: 30,
250
+ nbResults: 0,
251
+ };
252
+ const fetchLogsSearch = createAsyncThunk('admin/fetchLogsSearch', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
253
+ try {
254
+ const logs = (yield extra.jApi.admin.logs.getLogsSearch(params)).result;
255
+ return logs;
256
+ }
257
+ catch (err) {
258
+ if (!isAbortError(err)) {
259
+ dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
260
+ }
261
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve admin logs Search' });
262
+ }
263
+ }));
264
+ const adminLogsSearchSlice = createSlice({
265
+ name: 'logsSearch',
266
+ initialState: initialState$n,
267
+ reducers: {
268
+ setSearchOrder: (state, action) => {
269
+ state.orders = [...action.payload];
270
+ state.page = 1;
271
+ },
272
+ setSearchFilter: (state, action) => {
273
+ state.filters = [...action.payload];
274
+ state.page = 1;
275
+ },
276
+ setSearchPage: (state, action) => {
277
+ state.page = action.payload;
278
+ },
279
+ },
280
+ extraReducers: (builder) => {
281
+ builder.addCase(fetchLogsSearch.pending, (state) => {
282
+ state.loading = 'pending';
283
+ });
284
+ builder.addCase(fetchLogsSearch.fulfilled, (state, action) => {
285
+ var _a;
286
+ state.data = action.payload.data;
287
+ state.nbResults = action.payload.cnt;
288
+ state.limit = (_a = action.payload.limit) !== null && _a !== void 0 ? _a : 30;
289
+ state.page = action.payload.page;
290
+ state.loading = 'idle';
291
+ });
292
+ builder.addCase(fetchLogsSearch.rejected, (state) => {
293
+ state.loading = 'idle';
294
+ });
295
+ },
296
+ });
297
+
298
+ const selectAdminLogsNavigation = (state) => state.adminLogs.logsNavigation;
299
+ const selectAdminLogsObjects = (state) => state.adminLogs.logsObjects;
300
+ const selectAdminLogsSearch = (state) => state.adminLogs.logsSearch;
301
+ const adminLogsSliceReducer = combineReducers({
302
+ [adminLogsNavigationSlice.name]: adminLogsNavigationSlice.reducer,
303
+ [adminLogsObjectsSlice.name]: adminLogsObjectsSlice.reducer,
304
+ [adminLogsSearchSlice.name]: adminLogsSearchSlice.reducer,
305
+ });
306
+ const adminLogsSlice = {
307
+ name: 'adminLogs',
308
+ reducer: adminLogsSliceReducer,
309
+ };
310
+ const adminLogsReducer = adminLogsSlice.reducer;
311
+ const AdminLogs = {
312
+ slice: adminLogsSlice,
313
+ actions: Object.assign(Object.assign(Object.assign(Object.assign({}, adminLogsNavigationSlice.actions), adminLogsObjectsSlice.actions), adminLogsSearchSlice.actions), { fetchLogsNavigation,
314
+ fetchLogsObjects,
315
+ fetchLogsSearch }),
316
+ selectors: { selectAdminLogsNavigation, selectAdminLogsObjects, selectAdminLogsSearch },
87
317
  };
88
318
 
89
319
  const initialState$m = {
@@ -480,6 +710,17 @@ const fetchComments = createAsyncThunk('commentList/fetchCommentList', (params,
480
710
  return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve comments' });
481
711
  }
482
712
  }));
713
+ const deleteComment = createAsyncThunk('commentList/deleteComment', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
714
+ var _b;
715
+ try {
716
+ yield extra.jApi.article.deleteComment(params.idComment);
717
+ return true;
718
+ }
719
+ catch (error) {
720
+ dispatch(Toast.actions.error({ label: (_b = error.errorMsg) !== null && _b !== void 0 ? _b : 'GLOBAL_Technical_Error' }));
721
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot delete comment' });
722
+ }
723
+ }));
483
724
  const CommentListSlice = createSlice({
484
725
  name: 'commentList',
485
726
  initialState: initialState$i,
@@ -535,6 +776,22 @@ const CommentListSlice = createSlice({
535
776
  })
536
777
  .addCase(fetchComments.rejected, (state) => {
537
778
  state.loading = 'idle';
779
+ })
780
+ .addCase(deleteComment.pending, (state, action) => {
781
+ state.comments = state.comments.map((c) => {
782
+ if (c.idArticle !== action.meta.arg.idArticle) {
783
+ return c;
784
+ }
785
+ return Object.assign(Object.assign({}, c), { list: c.list.map((comment) => comment.id === action.meta.arg.idComment ? Object.assign(Object.assign({}, comment), { pending: true }) : comment) });
786
+ });
787
+ })
788
+ .addCase(deleteComment.rejected, (state, action) => {
789
+ state.comments = state.comments.map((c) => {
790
+ if (c.idArticle !== action.meta.arg.idArticle) {
791
+ return c;
792
+ }
793
+ return Object.assign(Object.assign({}, c), { list: c.list.map((comment) => comment.id === action.meta.arg.idComment ? Object.assign(Object.assign({}, comment), { pending: false }) : comment) });
794
+ });
538
795
  });
539
796
  },
540
797
  });
@@ -596,13 +853,12 @@ const commentSlice = {
596
853
  };
597
854
  const selectCommentList = (state, idArticle, limit = 0) => {
598
855
  const data = state.comment.commentList.comments.find((c) => c.idArticle === idArticle);
599
- const dataList = data && Array.isArray(data.list) ? data.list : [];
600
- const list = [...dataList].sort((c1, c2) => c1.id - c2.id);
856
+ const list = data ? [...data.list].sort((c1, c2) => c1.id - c2.id) : [];
601
857
  return limit !== 0 ? list.slice(-limit) : list;
602
858
  };
603
859
  const Comment = {
604
860
  slice: commentSlice,
605
- actions: Object.assign({ fetchComments }, CommentListSlice.actions),
861
+ actions: Object.assign({ fetchComments, deleteComment }, CommentListSlice.actions),
606
862
  selectors: {
607
863
  commentList: selectCommentList,
608
864
  },
@@ -4039,13 +4295,43 @@ const specialAttrName = ['title', 'alertAuthor', 'sendAlert'];
4039
4295
  const ignoredFields = ['edito'];
4040
4296
  function updateViewsFromFields(clonedApp, appFields) {
4041
4297
  return Object.assign({}, ...viewsList.map((view) => {
4298
+ var _a, _b, _c, _d, _e, _f;
4042
4299
  const viewItems = {};
4300
+ let viewMissingOptionalFields = [];
4301
+ if (((_a = MapExtraFieldsWithView[view]) === null || _a === void 0 ? void 0 : _a.optional) !== undefined) {
4302
+ viewMissingOptionalFields = viewMissingOptionalFields.concat((_c = (_b = MapExtraFieldsWithView[view]) === null || _b === void 0 ? void 0 : _b.optional) !== null && _c !== void 0 ? _c : []);
4303
+ }
4304
+ let viewMissingFixedFields = [];
4305
+ if (((_d = MapExtraFieldsWithView[view]) === null || _d === void 0 ? void 0 : _d.fixed) !== undefined) {
4306
+ viewMissingFixedFields = viewMissingFixedFields.concat((_f = (_e = MapExtraFieldsWithView[view]) === null || _e === void 0 ? void 0 : _e.fixed) !== null && _f !== void 0 ? _f : []);
4307
+ }
4043
4308
  Object.entries(clonedApp.views[view]).forEach(([fieldId, field]) => {
4044
4309
  if (field.isFixed) {
4045
4310
  viewItems[fieldId] = field;
4311
+ viewMissingFixedFields.splice(viewMissingFixedFields.findIndex((fieldType) => fieldType === field.type), 1);
4046
4312
  }
4047
4313
  if (field.isOptional) {
4048
4314
  viewItems[fieldId] = field;
4315
+ viewMissingOptionalFields.splice(viewMissingOptionalFields.findIndex((fieldType) => fieldType === field.type), 1);
4316
+ }
4317
+ });
4318
+ const missingFieldsSet = new Set(viewMissingFixedFields.concat(viewMissingOptionalFields));
4319
+ const fieldTypeHandlers = {
4320
+ [ExtraAppFieldsItemViews.CREATIONDATE]: () => getDateCreationToView(false),
4321
+ [ExtraAppFieldsItemViews.TITLE]: () => getTitleToView({ ref: 'title', fixedValue: undefined }),
4322
+ [ExtraAppFieldsItemViews.USER]: () => getUserToView(false),
4323
+ [ExtraAppFieldsItemViews.RECEIVEACOPY]: () => getAlertAuthorToView({ ref: 'alertAuthor', fixedValue: undefined }),
4324
+ [ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS]: () => getSendAlertToView({ ref: 'sendAlert', fixedValue: undefined }),
4325
+ [ExtraAppFieldsItemViews.PUBLISHTO]: () => getPublishToToView({ ref: 'publishTo', fixedValue: undefined }),
4326
+ };
4327
+ missingFieldsSet.forEach((fieldType) => {
4328
+ const handler = fieldTypeHandlers[fieldType];
4329
+ if (handler) {
4330
+ const [localFieldId, localField] = handler();
4331
+ viewItems[localFieldId] = localField;
4332
+ }
4333
+ else {
4334
+ console.error('ExtraAppFieldsItemViews does not have this field type: ' + fieldType);
4049
4335
  }
4050
4336
  });
4051
4337
  appFields.forEach((field, idx) => {
@@ -4154,16 +4440,20 @@ function buildView(appS, registeredFields, displayName, displayValue, tables, st
4154
4440
  if (fieldIdx === -1 && fixedInfo) {
4155
4441
  switch (fixedInfo.ref) {
4156
4442
  case 'title':
4157
- addTitleToView(newName, appS, fixedInfo);
4443
+ const [localFieldIdTitle, localFieldTitle] = getTitleToView(fixedInfo);
4444
+ appS.views[newName][localFieldIdTitle] = localFieldTitle;
4158
4445
  break;
4159
4446
  case 'alertAuthor':
4160
- addAlertAuthorToView(newName, appS, fixedInfo);
4447
+ const [localFieldIdAlertAuthor, localFieldAlertAuthor] = getAlertAuthorToView(fixedInfo);
4448
+ appS.views[newName][localFieldIdAlertAuthor] = localFieldAlertAuthor;
4161
4449
  break;
4162
4450
  case 'sendAlert':
4163
- addSendAlertToView(newName, appS, fixedInfo);
4451
+ const [localFieldIdSendAlert, localFieldSendAlert] = getSendAlertToView(fixedInfo);
4452
+ appS.views[newName][localFieldIdSendAlert] = localFieldSendAlert;
4164
4453
  break;
4165
4454
  case 'publishTo':
4166
- addPublishToToView(newName, appS, fixedInfo);
4455
+ const [localFieldIdPublishTo, localFieldPublishTo] = getPublishToToView(fixedInfo);
4456
+ appS.views[newName][localFieldIdPublishTo] = localFieldPublishTo;
4167
4457
  break;
4168
4458
  default:
4169
4459
  console.error('fixed field info with unsupported ref ', fixedInfo);
@@ -4196,15 +4486,18 @@ function buildFilterView(appS, registeredFields, attrExposed, tables, state) {
4196
4486
  function addFieldToViewFromRef(appS, registeredFields, tables, viewName, fieldRef, index, state) {
4197
4487
  switch (fieldRef) {
4198
4488
  case 'title':
4199
- addTitleToView(viewName, appS, { ref: 'title', fixedValue: undefined });
4489
+ const [fieldIDTitle, fieldInfoTitle] = getTitleToView({ ref: 'title', fixedValue: undefined });
4490
+ appS['views'][viewName][fieldIDTitle] = fieldInfoTitle;
4200
4491
  break;
4201
4492
  case 'iduser':
4202
4493
  case 'idUser':
4203
- addUserToView(viewName, appS);
4494
+ const [fieldIDIdUser, fieldInfoIdUser] = getUserToView();
4495
+ appS['views'][viewName][fieldIDIdUser] = fieldInfoIdUser;
4204
4496
  break;
4205
4497
  case 'datecreation':
4206
4498
  case 'dateCreation':
4207
- addDateCreationToView(viewName, appS);
4499
+ const [fieldIDDateCreation, fieldInfoDateCreation] = getDateCreationToView();
4500
+ appS['views'][viewName][fieldIDDateCreation] = fieldInfoDateCreation;
4208
4501
  break;
4209
4502
  default:
4210
4503
  defaultFieldCreation(appS, registeredFields, tables, viewName, fieldRef, index, state);
@@ -4444,85 +4737,97 @@ function getFormItemType(installedField) {
4444
4737
  ':' +
4445
4738
  JSON.stringify(installedField));
4446
4739
  }
4447
- function addTitleToView(newName, appS, fixedInfo) {
4740
+ function getTitleToView(fixedInfo, isUsed = true) {
4448
4741
  var _a;
4449
- const fieldId = 'title';
4450
- appS.views[newName][fieldId] = {
4451
- type: ExtraAppFieldsItemViews.TITLE,
4452
- properties: [],
4453
- isUsed: true,
4454
- isOptional: false,
4455
- isLockedValue: !!(fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue),
4456
- isFixed: true,
4457
- value: (_a = fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== null && _a !== void 0 ? _a : null,
4458
- pos: 0,
4459
- };
4742
+ return [
4743
+ 'title',
4744
+ {
4745
+ type: ExtraAppFieldsItemViews.TITLE,
4746
+ properties: [],
4747
+ isUsed: isUsed,
4748
+ isOptional: false,
4749
+ isLockedValue: !!(fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue),
4750
+ isFixed: true,
4751
+ value: (_a = fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== null && _a !== void 0 ? _a : null,
4752
+ pos: 0,
4753
+ },
4754
+ ];
4460
4755
  }
4461
- function addAlertAuthorToView(newName, appS, fixedInfo) {
4462
- const fieldId = 'alertAuthor';
4463
- appS.views[newName][fieldId] = {
4464
- type: ExtraAppFieldsItemViews.RECEIVEACOPY,
4465
- properties: [],
4466
- isUsed: true,
4467
- isOptional: true,
4468
- isLockedValue: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined,
4469
- isFixed: false,
4470
- value: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined ? fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue : true,
4471
- pos: 300,
4472
- };
4756
+ function getAlertAuthorToView(fixedInfo, isUsed = true) {
4757
+ return [
4758
+ 'alertAuthor',
4759
+ {
4760
+ type: ExtraAppFieldsItemViews.RECEIVEACOPY,
4761
+ properties: [],
4762
+ isUsed: isUsed,
4763
+ isOptional: true,
4764
+ isLockedValue: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined,
4765
+ isFixed: false,
4766
+ value: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined ? fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue : true,
4767
+ pos: 300,
4768
+ },
4769
+ ];
4473
4770
  }
4474
- function addSendAlertToView(newName, appS, fixedInfo) {
4475
- const fieldId = 'sendAlert';
4476
- appS.views[newName][fieldId] = {
4477
- type: ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS,
4478
- properties: [],
4479
- isUsed: true,
4480
- isOptional: true,
4481
- isLockedValue: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined,
4482
- isFixed: false,
4483
- value: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined ? fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue : true,
4484
- pos: 200,
4485
- };
4771
+ function getSendAlertToView(fixedInfo, isUsed = true) {
4772
+ return [
4773
+ 'sendAlert',
4774
+ {
4775
+ type: ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS,
4776
+ properties: [],
4777
+ isUsed: isUsed,
4778
+ isOptional: true,
4779
+ isLockedValue: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined,
4780
+ isFixed: false,
4781
+ value: (fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== undefined ? fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue : true,
4782
+ pos: 200,
4783
+ },
4784
+ ];
4486
4785
  }
4487
- function addPublishToToView(newName, appS, fixedInfo) {
4786
+ function getPublishToToView(fixedInfo, isUsed = true) {
4488
4787
  var _a;
4489
- const fieldId = 'publishTo';
4490
- appS.views[newName][fieldId] = {
4491
- type: ExtraAppFieldsItemViews.PUBLISHTO,
4492
- properties: [],
4493
- isUsed: true,
4494
- isOptional: true,
4495
- isLockedValue: !!(fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue),
4496
- isFixed: false,
4497
- value: (_a = fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== null && _a !== void 0 ? _a : [],
4498
- pos: 100,
4499
- };
4788
+ return [
4789
+ 'publishTo',
4790
+ {
4791
+ type: ExtraAppFieldsItemViews.PUBLISHTO,
4792
+ properties: [],
4793
+ isUsed: isUsed,
4794
+ isOptional: true,
4795
+ isLockedValue: !!(fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue),
4796
+ isFixed: false,
4797
+ value: (_a = fixedInfo === null || fixedInfo === void 0 ? void 0 : fixedInfo.fixedValue) !== null && _a !== void 0 ? _a : [],
4798
+ pos: 100,
4799
+ },
4800
+ ];
4500
4801
  }
4501
- function addUserToView(newName, appS) {
4502
- const fieldId = 'user';
4503
- appS.views[newName][fieldId] = {
4504
- type: ExtraAppFieldsItemViews.USER,
4505
- properties: [],
4506
- isUsed: true,
4507
- isOptional: false,
4508
- isLockedValue: false,
4509
- isFixed: true,
4510
- value: null,
4511
- pos: 1,
4512
- };
4802
+ function getUserToView(isUsed = true) {
4803
+ return [
4804
+ 'user',
4805
+ {
4806
+ type: ExtraAppFieldsItemViews.USER,
4807
+ properties: [],
4808
+ isUsed: isUsed,
4809
+ isOptional: false,
4810
+ isLockedValue: false,
4811
+ isFixed: true,
4812
+ value: null,
4813
+ pos: 1,
4814
+ },
4815
+ ];
4513
4816
  }
4514
- function addDateCreationToView(newName, appS) {
4515
- const fieldId = 'dateCreation';
4516
- appS.views[newName][fieldId] = {
4517
- type: ExtraAppFieldsItemViews.CREATIONDATE,
4518
- properties: [],
4519
- isUsed: true,
4520
- isOptional: true,
4521
- isLockedValue: false,
4522
- isFixed: false,
4523
- value: null,
4524
- pos: 100,
4525
- };
4817
+ function getDateCreationToView(isUsed = true) {
4818
+ return [
4819
+ 'dateCreation',
4820
+ {
4821
+ type: ExtraAppFieldsItemViews.CREATIONDATE,
4822
+ properties: [],
4823
+ isUsed: isUsed,
4824
+ isOptional: true,
4825
+ isLockedValue: false,
4826
+ isFixed: false,
4827
+ value: null,
4828
+ pos: 100,
4829
+ },
4830
+ ];
4526
4831
  }
4527
4832
 
4528
4833
  function InstalledAppStudioAdapter(serverApp, serverApps, state) {
@@ -5203,5 +5508,5 @@ const studio = {
5203
5508
  },
5204
5509
  };
5205
5510
 
5206
- export { APP_STATUS_TYPE, AUDIENCE, Animations, AppColumnsDefaultTypes, AppFieldFormPropertyTypes, AppFormBannedFromViews$1 as AppFormBannedFromViews, AppFormFieldOnlyInView, AppFormFixedList$1 as AppFormFixedList, AppFormItemTypes, AppFormNoAsFieldList, AppFormNonPrimaryList, AppFormPrimaryList, AppFormPrimaryListValues, AppFormUniqueList, AppFormUniqueListCheck, Application, AssetReservation, Bookmark, Comment, Description, Element, ExtraAppFieldsItemViews, Faq, Hook, MagicPad, MapExtraFieldsWithView, MediaLibrary, Model, Network, Platform, STUDIO_VIEW, Share, SocialActions, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, animationsReducer, animationsSlice, fetchMediaLibraryConfig, fetchMediaLibraryFilesStats, fetchMediaLibraryFolders, fetchMediaLibraryFoldersStats, fetchMediaLibraryStats, fetchMediaLibraryUnclassifiedFiles, fetchPads, jland, magicPadSlice, mediaLibraryReducer, mediaLibrarySlice, slice$1 as slice, studio, updateWidgetContent, viewsList };
5511
+ export { APP_STATUS_TYPE, AUDIENCE, AdminLogs, Animations, AppColumnsDefaultTypes, AppFieldFormPropertyTypes, AppFormBannedFromViews$1 as AppFormBannedFromViews, AppFormFieldOnlyInView, AppFormFixedList$1 as AppFormFixedList, AppFormItemTypes, AppFormNoAsFieldList, AppFormNonPrimaryList, AppFormPrimaryList, AppFormPrimaryListValues, AppFormUniqueList, AppFormUniqueListCheck, Application, AssetReservation, Bookmark, Comment, Description, Element, ExtraAppFieldsItemViews, Faq, Hook, MagicPad, MapExtraFieldsWithView, MediaLibrary, Model, Network, Platform, STUDIO_VIEW, Share, SocialActions, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, adminLogsReducer, adminLogsSlice, animationsReducer, animationsSlice, fetchMediaLibraryConfig, fetchMediaLibraryFilesStats, fetchMediaLibraryFolders, fetchMediaLibraryFoldersStats, fetchMediaLibraryStats, fetchMediaLibraryUnclassifiedFiles, fetchPads, jland, magicPadSlice, mediaLibraryReducer, mediaLibrarySlice, slice$1 as slice, studio, updateWidgetContent, viewsList };
5207
5512
  //# sourceMappingURL=esm.js.map