jamespot-front-business 1.1.35 → 1.1.37

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
@@ -60,7 +60,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
60
60
  });
61
61
  }
62
62
 
63
- const initialState$h = {
63
+ const initialState$j = {
64
64
  entities: [],
65
65
  loading: 'idle',
66
66
  nbResults: 0,
@@ -71,7 +71,7 @@ const fetchBookableAsset = createAsyncThunk('BookableAsset/fetchBookableAsset',
71
71
  }));
72
72
  const BookableAssetSlice = createSlice({
73
73
  name: 'bookableAsset',
74
- initialState: initialState$h,
74
+ initialState: initialState$j,
75
75
  reducers: {},
76
76
  extraReducers: (builder) => {
77
77
  builder
@@ -92,7 +92,7 @@ const BookableAssetSlice = createSlice({
92
92
  const fetchConfiguration = createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
93
93
  return yield extra.jApi.assetReservation.configuration();
94
94
  }));
95
- const initialState$g = {
95
+ const initialState$i = {
96
96
  description: '',
97
97
  right: {
98
98
  manage: false,
@@ -106,7 +106,7 @@ const initialState$g = {
106
106
  };
107
107
  const AssetReservationConfigurationSlice = createSlice({
108
108
  name: 'configuration',
109
- initialState: initialState$g,
109
+ initialState: initialState$i,
110
110
  reducers: {},
111
111
  extraReducers: (builder) => {
112
112
  builder
@@ -127,7 +127,7 @@ const initForm = {
127
127
  hourStart: '',
128
128
  hourEnd: '',
129
129
  };
130
- const initialState$f = {
130
+ const initialState$h = {
131
131
  entities: [],
132
132
  loading: 'idle',
133
133
  nbResults: 0,
@@ -139,7 +139,7 @@ const fetchReservation = createAsyncThunk('Reservation/fetchReservation', (viewM
139
139
  }));
140
140
  const ReservationSlice = createSlice({
141
141
  name: 'reservation',
142
- initialState: initialState$f,
142
+ initialState: initialState$h,
143
143
  reducers: {
144
144
  setForm: (state, action) => {
145
145
  state.form = action.payload;
@@ -232,7 +232,115 @@ const Toast = {
232
232
  selectors: selectors$1,
233
233
  };
234
234
 
235
- const initialState$e = {
235
+ const initialState$g = {
236
+ loading: 'idle',
237
+ comments: [],
238
+ };
239
+ const fetchComments = createAsyncThunk('commentList/fetchCommentList', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
240
+ var _a;
241
+ try {
242
+ const res = yield extra.jApi.article.getComments(params, 'raw-list');
243
+ return { idArticle: params.idArticle, list: res.result };
244
+ }
245
+ catch (error) {
246
+ dispatch(Toast.actions.error({ label: (_a = error.errorMsg) !== null && _a !== void 0 ? _a : 'GLOBAL_Technical_Error' }));
247
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve comments' });
248
+ }
249
+ }));
250
+ const CommentListSlice = createSlice({
251
+ name: 'commentList',
252
+ initialState: initialState$g,
253
+ reducers: {
254
+ discardComments: (state, action) => {
255
+ state.comments = state.comments.filter((c) => c.idArticle !== action.payload.idArticle);
256
+ },
257
+ },
258
+ extraReducers: (builder) => {
259
+ builder
260
+ .addCase(fetchComments.pending, (state) => {
261
+ state.loading = 'pending';
262
+ })
263
+ .addCase(fetchComments.fulfilled, (state, action) => {
264
+ state.loading = 'idle';
265
+ state.comments = [
266
+ ...state.comments.filter((c) => c.idArticle !== action.payload.idArticle),
267
+ {
268
+ idArticle: action.payload.idArticle,
269
+ list: action.payload.list.reverse(),
270
+ },
271
+ ];
272
+ })
273
+ .addCase(fetchComments.rejected, (state) => {
274
+ state.loading = 'idle';
275
+ });
276
+ },
277
+ });
278
+
279
+ const getCommentRTHandlers = function (dispatch, idArticle) {
280
+ const addCommentHandler = function (message) {
281
+ if (message.namespace === 'JAMESPOT' &&
282
+ message.function === 'comment-create' &&
283
+ message.object.idArticle === idArticle) {
284
+ dispatch(fetchComments({ idArticle }));
285
+ }
286
+ };
287
+ const deleteCommentHandler = function (message) {
288
+ if (message.namespace === 'JAMESPOT' &&
289
+ message.function === 'comment-delete' &&
290
+ Number(message.object.idArticle) === idArticle) {
291
+ dispatch(fetchComments({ idArticle }));
292
+ }
293
+ };
294
+ return [
295
+ {
296
+ namespace: 'JAMESPOT',
297
+ function: 'comment-create',
298
+ handler: addCommentHandler,
299
+ },
300
+ {
301
+ namespace: 'JAMESPOT',
302
+ function: 'comment-delete',
303
+ handler: deleteCommentHandler,
304
+ },
305
+ ];
306
+ };
307
+
308
+ const getCommentsLikeRTHandlers = function (dispatch, idComments, idArticle) {
309
+ const commentLikeHandler = function (message) {
310
+ if (message.namespace === 'CUSTOM-ACTION' &&
311
+ (message.function === 'add' || message.function === 'remove') &&
312
+ message.object.type === 'sociallike' &&
313
+ message.object.targetId &&
314
+ idComments &&
315
+ idComments.includes(message.object.targetId)) {
316
+ dispatch(fetchComments({ idArticle }));
317
+ }
318
+ };
319
+ return idComments ? [
320
+ { namespace: 'CUSTOM-ACTION', function: 'add', handler: commentLikeHandler },
321
+ { namespace: 'CUSTOM-ACTION', function: 'remove', handler: commentLikeHandler },
322
+ ] : [];
323
+ };
324
+
325
+ const CommentReducer = combineReducers$1({
326
+ [CommentListSlice.name]: CommentListSlice.reducer,
327
+ });
328
+ const commentSlice = {
329
+ name: 'comment',
330
+ reducer: CommentReducer,
331
+ };
332
+ const selectCommentList = (state, idArticle) => state.comment.commentList.comments.find((c) => c.idArticle === idArticle);
333
+ const Comment = {
334
+ slice: commentSlice,
335
+ actions: Object.assign({ fetchComments }, CommentListSlice.actions),
336
+ selectors: {
337
+ commentList: selectCommentList,
338
+ },
339
+ getCommentRTHandlers,
340
+ getCommentsLikeRTHandlers,
341
+ };
342
+
343
+ const initialState$f = {
236
344
  bookmarks: [],
237
345
  loading: 'idle',
238
346
  status: undefined,
@@ -295,7 +403,7 @@ const deleteBookmark = createAsyncThunk('bookmarkList/deleteBookmark', (bookmark
295
403
  }));
296
404
  const BookmarkListSlice = createSlice({
297
405
  name: 'bookmarkList',
298
- initialState: initialState$e,
406
+ initialState: initialState$f,
299
407
  reducers: {
300
408
  resetAddBookmarkStatus: (state, action) => {
301
409
  if (state.add[action.payload]) {
@@ -405,7 +513,7 @@ const BookmarkListSlice = createSlice({
405
513
  },
406
514
  });
407
515
 
408
- const getRTHandlers = function (dispatch) {
516
+ const getBookmarkRTHandlers = function (dispatch) {
409
517
  const dispatchOrFetch = function (message, action) {
410
518
  if (jEnsure.objectIsType('bookmarkLink', message.object)) {
411
519
  dispatch(action(message.object));
@@ -458,7 +566,7 @@ const getRTHandlers = function (dispatch) {
458
566
  ];
459
567
  };
460
568
 
461
- const initialState$d = {
569
+ const initialState$e = {
462
570
  bookmark: undefined,
463
571
  status: undefined,
464
572
  loading: 'idle',
@@ -480,7 +588,7 @@ const editBookmark = createAsyncThunk('bookmarkEdit/editBookmark', (bookmark, {
480
588
  }));
481
589
  const BookmarkEditSlice = createSlice({
482
590
  name: 'bookmarkEdit',
483
- initialState: initialState$d,
591
+ initialState: initialState$e,
484
592
  reducers: {
485
593
  setEditBookmark: (state, action) => {
486
594
  state.bookmark = Object.assign({}, action.payload);
@@ -530,17 +638,17 @@ const Bookmark = {
530
638
  bookmarkListIsInitialized: selectBookmarkListIsInitialized,
531
639
  bookmarkEditBookmark: selectBookmarkEditBookmark
532
640
  },
533
- getRTHandlers: getRTHandlers,
641
+ getRTHandlers: getBookmarkRTHandlers,
534
642
  };
535
643
 
536
- const initialState$c = {
644
+ const initialState$d = {
537
645
  loading: 'idle',
538
646
  access: { createCategory: false },
539
647
  };
540
648
  const fetchFaqConfig = createAsyncThunk('faqConfig/fetch', () => __awaiter(void 0, void 0, void 0, function* () {
541
649
  try {
542
650
  const [hookProperties, access] = yield Promise.all([
543
- yield jamespot.faq.getHookProperties(['_web', 'appImage', 'appImageText']),
651
+ yield jamespot.faq.getHookProperties(['_web', 'appImage', 'appImageText', '_displayComment']),
544
652
  yield jamespot.faq.getAccess()
545
653
  ]);
546
654
  return {
@@ -548,6 +656,7 @@ const fetchFaqConfig = createAsyncThunk('faqConfig/fetch', () => __awaiter(void
548
656
  appImage: hookProperties.result.appImage,
549
657
  appImageText: hookProperties.result.appImageText,
550
658
  access: access.result,
659
+ _displayComment: hookProperties.result._displayComment,
551
660
  };
552
661
  }
553
662
  catch (e) {
@@ -561,7 +670,7 @@ const fetchFaqConfig = createAsyncThunk('faqConfig/fetch', () => __awaiter(void
561
670
  }));
562
671
  const FaqConfigSlice = createSlice({
563
672
  name: 'config',
564
- initialState: initialState$c,
673
+ initialState: initialState$d,
565
674
  reducers: {},
566
675
  extraReducers: (builder) => {
567
676
  builder
@@ -584,6 +693,9 @@ const FaqConfigSlice = createSlice({
584
693
  if (action.payload.access) {
585
694
  state.access = action.payload.access;
586
695
  }
696
+ if (action.payload._displayComment !== undefined) {
697
+ state._displayComment = action.payload._displayComment;
698
+ }
587
699
  return state;
588
700
  })
589
701
  .addCase(fetchFaqConfig.rejected, (state) => {
@@ -593,7 +705,7 @@ const FaqConfigSlice = createSlice({
593
705
  },
594
706
  });
595
707
 
596
- const initialState$b = {
708
+ const initialState$c = {
597
709
  loading: 'idle',
598
710
  categories: null,
599
711
  };
@@ -605,7 +717,7 @@ const fetchFaqCategories = createAsyncThunk('faqCategories/fetch', () => __await
605
717
  }));
606
718
  const FaqCategoriesSlice = createSlice({
607
719
  name: 'categories',
608
- initialState: initialState$b,
720
+ initialState: initialState$c,
609
721
  reducers: {},
610
722
  extraReducers: (builder) => {
611
723
  builder
@@ -626,13 +738,13 @@ const FaqCategoriesSlice = createSlice({
626
738
  },
627
739
  });
628
740
 
629
- const joinedReducers$5 = combineReducers({
741
+ const joinedReducers$6 = combineReducers({
630
742
  [FaqConfigSlice.name]: FaqConfigSlice.reducer,
631
743
  [FaqCategoriesSlice.name]: FaqCategoriesSlice.reducer,
632
744
  });
633
745
  const FaqSlice = {
634
746
  name: 'faq',
635
- reducer: joinedReducers$5,
747
+ reducer: joinedReducers$6,
636
748
  };
637
749
  const selectFaqConfig = (state) => {
638
750
  return state.faq.config;
@@ -887,7 +999,7 @@ const initialMap = {
887
999
  illustration: '',
888
1000
  assignLicense: false,
889
1001
  };
890
- const initialState$a = {
1002
+ const initialState$b = {
891
1003
  map: Object.assign({}, initialMap),
892
1004
  loading: 'idle',
893
1005
  status: undefined,
@@ -931,13 +1043,13 @@ const createMap = createAsyncThunk('mapCreate/create', ({ map, jlandUrlBase }, {
931
1043
  }));
932
1044
  const MapCreateSlice = createSlice({
933
1045
  name: 'mapCreate',
934
- initialState: initialState$a,
1046
+ initialState: initialState$b,
935
1047
  reducers: {
936
1048
  setMap: (state, action) => {
937
1049
  state.map = action.payload;
938
1050
  },
939
1051
  resetCreateMapState: () => {
940
- return initialState$a;
1052
+ return initialState$b;
941
1053
  },
942
1054
  },
943
1055
  extraReducers: (builder) => {
@@ -967,13 +1079,13 @@ const selectJLandAvailableLicenses = function selectJLandAvailableLicenses(state
967
1079
  const selectMapCreate = function selectMapCreate(state) {
968
1080
  return state.jland.mapCreate;
969
1081
  };
970
- const joinedReducers$4 = combineReducers({
1082
+ const joinedReducers$5 = combineReducers({
971
1083
  [JLandMapListSlice.name]: JLandMapListSlice.reducer,
972
1084
  [MapCreateSlice.name]: MapCreateSlice.reducer,
973
1085
  });
974
1086
  const jlandSlice = {
975
1087
  name: 'jland',
976
- reducer: joinedReducers$4,
1088
+ reducer: joinedReducers$5,
977
1089
  };
978
1090
  const jland = {
979
1091
  slice: jlandSlice,
@@ -1024,10 +1136,10 @@ const Model = {
1024
1136
  selectors: Object.assign(Object.assign({}, selectors), { selectByIds }),
1025
1137
  };
1026
1138
 
1027
- const initialState$9 = {};
1139
+ const initialState$a = {};
1028
1140
  const NetworkStaticsSlice = createSlice({
1029
1141
  name: 'statics',
1030
- initialState: initialState$9,
1142
+ initialState: initialState$a,
1031
1143
  reducers: {
1032
1144
  initNetworkStatics: (_, { payload }) => {
1033
1145
  return payload;
@@ -1035,12 +1147,12 @@ const NetworkStaticsSlice = createSlice({
1035
1147
  },
1036
1148
  });
1037
1149
 
1038
- const joinedReducers$3 = combineReducers({
1150
+ const joinedReducers$4 = combineReducers({
1039
1151
  [NetworkStaticsSlice.name]: NetworkStaticsSlice.reducer,
1040
1152
  });
1041
1153
  const NetworkSlice = {
1042
1154
  name: 'network',
1043
- reducer: joinedReducers$3,
1155
+ reducer: joinedReducers$4,
1044
1156
  };
1045
1157
  const selectNetworkStatics = (state) => {
1046
1158
  return state.network.statics;
@@ -1061,6 +1173,46 @@ const Network = {
1061
1173
  },
1062
1174
  };
1063
1175
 
1176
+ const initialState$9 = {
1177
+ userHighlightFields: [],
1178
+ userAccountStatus: 0
1179
+ };
1180
+ const PlatformConfigSlice = createSlice({
1181
+ name: 'config',
1182
+ initialState: initialState$9,
1183
+ reducers: {
1184
+ initPlatformConfig: (_, { payload }) => {
1185
+ return payload;
1186
+ },
1187
+ },
1188
+ });
1189
+
1190
+ const joinedReducers$3 = combineReducers({
1191
+ [PlatformConfigSlice.name]: PlatformConfigSlice.reducer,
1192
+ });
1193
+ const PlatformSlice = {
1194
+ name: 'platform',
1195
+ reducer: joinedReducers$3,
1196
+ };
1197
+ const selectPlatformConfig = (state) => {
1198
+ return state.platform.config;
1199
+ };
1200
+ const selectUserHighlightFields = (state) => {
1201
+ return state.platform.config.userHighlightFields;
1202
+ };
1203
+ const selectUserAccountStatus = (state) => {
1204
+ return state.platform.config.userAccountStatus;
1205
+ };
1206
+ const Platform = {
1207
+ slice: PlatformSlice,
1208
+ actions: Object.assign({}, PlatformConfigSlice.actions),
1209
+ selectors: {
1210
+ selectPlatformConfig,
1211
+ selectUserHighlightFields,
1212
+ selectUserAccountStatus,
1213
+ },
1214
+ };
1215
+
1064
1216
  const initialQuery = {
1065
1217
  query: '',
1066
1218
  filters: [],
@@ -1397,12 +1549,12 @@ const widgetArticleAttachmentDefinition = {
1397
1549
  label: 'WIDGET_Article_Attachment',
1398
1550
  description: 'WIDGET_Article_Attachment_Description',
1399
1551
  name: 'widget-article-attachment',
1400
- img: '/img/fast-intranet/widget-file.png',
1552
+ img: '/img/article-widget-thumbnail/widget_thumbnail_files.png',
1401
1553
  available: true,
1402
1554
  panel: {
1403
1555
  useWrapper: true,
1404
1556
  useEditor: true,
1405
- useWidgets: false
1557
+ useWidgets: false,
1406
1558
  },
1407
1559
  };
1408
1560
  const widgetArticleAttachmentContent = {
@@ -1413,12 +1565,12 @@ const widgetArticleGalleryDefinition = {
1413
1565
  label: 'WIDGET_Article_Gallery',
1414
1566
  description: 'WIDGET_Article_Gallery_Description',
1415
1567
  name: 'widget-article-gallery',
1416
- img: '/img/fast-intranet/widget-slider.png',
1568
+ img: '/img/article-widget-thumbnail/widget_thumbnail_slider.png',
1417
1569
  available: true,
1418
1570
  panel: {
1419
1571
  useWrapper: false,
1420
1572
  useEditor: true,
1421
- useWidgets: false
1573
+ useWidgets: false,
1422
1574
  },
1423
1575
  };
1424
1576
  const widgetArticleGalleryContent = {
@@ -1431,39 +1583,34 @@ const widgetArticleImageDefinition = {
1431
1583
  label: 'WIDGET_Article_Image',
1432
1584
  description: 'WIDGET_Article_Image_Description',
1433
1585
  name: 'widget-article-image',
1434
- img: '/img/fast-intranet/widget-image.png',
1586
+ img: '/img/article-widget-thumbnail/widget_thumbnail_illustration.png',
1435
1587
  available: true,
1436
1588
  panel: {
1437
1589
  useWrapper: false,
1438
1590
  useEditor: true,
1439
- useWidgets: false
1591
+ useWidgets: false,
1440
1592
  },
1441
1593
  };
1442
- const widgetArticleImageContent = {
1443
- displayAs: 'image',
1444
- backgroundPosition: 'center',
1445
- backgroundSize: 'cover',
1446
- borderRadius: '8'
1447
- };
1594
+ const widgetArticleImageContent = {};
1448
1595
 
1449
1596
  const widgetArticleButtonDefinition = {
1450
1597
  label: 'WIDGET_Button',
1451
1598
  description: 'WIDGET_Button_Description',
1452
1599
  name: 'widget-article-button',
1453
- img: '/img/fast-intranet/widget-button.png',
1600
+ img: '/img/article-widget-thumbnail/widget_thumbnail_button.png',
1454
1601
  available: true,
1455
1602
  panel: {
1456
1603
  useWrapper: false,
1457
1604
  useEditor: true,
1458
- useWidgets: false
1605
+ useWidgets: false,
1459
1606
  },
1460
1607
  };
1461
1608
  const widgetArticleButtonContent = {
1462
- text: 'This is a button',
1609
+ text: '',
1463
1610
  openingType: 'link',
1464
1611
  openingTypeLink: {
1465
1612
  url: '',
1466
- target: '_blank'
1613
+ target: '_blank',
1467
1614
  },
1468
1615
  variant: 'contained',
1469
1616
  fontSize: '14',
@@ -1477,36 +1624,56 @@ const widgetArticleTextDefinition = {
1477
1624
  label: 'WIDGET_Text',
1478
1625
  description: 'WIDGET_Text_Description',
1479
1626
  name: 'widget-article-text',
1480
- img: '/img/fast-intranet/widget-text.png',
1627
+ img: '/img/article-widget-thumbnail/widget_thumbnail_text.png',
1481
1628
  available: true,
1482
1629
  panel: {
1483
1630
  useWrapper: false,
1484
1631
  useEditor: true,
1485
- useWidgets: false
1632
+ useWidgets: false,
1486
1633
  },
1487
1634
  };
1488
1635
  const widgetArticleTextContent = {
1489
1636
  fontSize: '18',
1490
1637
  lineHeight: '1.6',
1491
- text: ''
1638
+ text: '',
1492
1639
  };
1493
1640
 
1494
1641
  const widgetArticleTitleDefinition = {
1495
1642
  label: 'WIDGET_Title',
1496
1643
  description: 'WIDGET_Title_Description',
1497
1644
  name: 'widget-article-title',
1498
- img: '/img/fast-intranet/widget-text.png',
1645
+ img: '/img/article-widget-thumbnail/widget_thumbnail_title.png',
1499
1646
  available: true,
1500
1647
  panel: {
1501
1648
  useWrapper: false,
1502
1649
  useEditor: true,
1503
- useWidgets: false
1650
+ useWidgets: false,
1504
1651
  },
1505
1652
  };
1506
1653
  const widgetArticleTitleContent = {
1507
1654
  text: '',
1508
1655
  heading: 'h1',
1509
- backgroundColor: 'transparent'
1656
+ backgroundColor: 'transparent',
1657
+ };
1658
+
1659
+ const widgetArticleSliderDefinition = {
1660
+ label: 'WIDGET_Slider',
1661
+ description: 'WIDGET_Slider_Description',
1662
+ name: 'widget-article-slider',
1663
+ img: '/img/article-widget-thumbnail/widget_thumbnail_slider.png',
1664
+ available: true,
1665
+ panel: {
1666
+ useWrapper: false,
1667
+ useEditor: true,
1668
+ useWidgets: false,
1669
+ },
1670
+ };
1671
+ const widgetArticleSliderContent = {
1672
+ slides: [],
1673
+ maxWidth: 800,
1674
+ loop: false,
1675
+ useDots: true,
1676
+ startAt: 0,
1510
1677
  };
1511
1678
 
1512
1679
  function uniqid() {
@@ -1527,7 +1694,7 @@ function widget(name) {
1527
1694
  return {
1528
1695
  uniqid: uniqid(),
1529
1696
  name,
1530
- content: content(name)
1697
+ content: content(name),
1531
1698
  };
1532
1699
  }
1533
1700
  function content(name) {
@@ -1535,6 +1702,8 @@ function content(name) {
1535
1702
  default:
1536
1703
  case 'widget-article-attachment':
1537
1704
  return Object.assign({}, widgetArticleAttachmentContent);
1705
+ case 'widget-article-slider':
1706
+ return Object.assign({}, widgetArticleSliderContent);
1538
1707
  case 'widget-article-gallery':
1539
1708
  return Object.assign({}, widgetArticleGalleryContent);
1540
1709
  case 'widget-article-button':
@@ -1573,6 +1742,8 @@ function widgetDefinition(name) {
1573
1742
  return widgetArticleGalleryDefinition;
1574
1743
  case 'widget-article-attachment':
1575
1744
  return widgetArticleAttachmentDefinition;
1745
+ case 'widget-article-slider':
1746
+ return widgetArticleSliderDefinition;
1576
1747
  case 'widget-article-text':
1577
1748
  return widgetArticleTextDefinition;
1578
1749
  case 'widget-article-title':
@@ -1721,6 +1892,7 @@ const selectWidgetContent = (state, uniqid) => { var _a; return (_a = state.widg
1721
1892
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
1722
1893
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
1723
1894
  const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
1895
+ const updateWidgetContent = (uniqid, content, override) => Widget.slice.actions.updateWidget({ uniqid, content, override: override !== null && override !== void 0 ? override : false });
1724
1896
  const Widget = {
1725
1897
  const: WIDGETS,
1726
1898
  factory: widgetFactory,
@@ -1837,6 +2009,15 @@ var AppFormItemTypes;
1837
2009
  AppFormItemTypes["USERLINK"] = "USERLINK";
1838
2010
  AppFormItemTypes["CONTENTLINK"] = "CONTENTLINK";
1839
2011
  })(AppFormItemTypes || (AppFormItemTypes = {}));
2012
+ var ExtraAppFieldsItemViews;
2013
+ (function (ExtraAppFieldsItemViews) {
2014
+ ExtraAppFieldsItemViews["TITLE"] = "TITLE";
2015
+ ExtraAppFieldsItemViews["USER"] = "USER";
2016
+ ExtraAppFieldsItemViews["PUBLISHTO"] = "PUBLISHTO";
2017
+ ExtraAppFieldsItemViews["SENDALERTTOSUBSCRIBERS"] = "SENDALERTTOSUBSCRIBERS";
2018
+ ExtraAppFieldsItemViews["RECEIVEACOPY"] = "RECEIVEACOPY";
2019
+ ExtraAppFieldsItemViews["CREATIONDATE"] = "CREATIONDATE";
2020
+ })(ExtraAppFieldsItemViews || (ExtraAppFieldsItemViews = {}));
1840
2021
  var AppFieldFormPropertyTypes;
1841
2022
  (function (AppFieldFormPropertyTypes) {
1842
2023
  AppFieldFormPropertyTypes["LABEL"] = "label";
@@ -1850,15 +2031,51 @@ var AppFieldFormPropertyTypes;
1850
2031
  const AppFormUniqueList = [AppFormItemTypes.DESCRIPTION, AppFormItemTypes.IMAGE];
1851
2032
  const AppFormBannedFromViews = new Map();
1852
2033
  AppFormBannedFromViews.set(AppFormItemTypes.IMAGE, ['list', 'filter', 'view']);
2034
+ const MapExtraFieldsWithView = {
2035
+ create: {
2036
+ fixed: [ExtraAppFieldsItemViews.TITLE],
2037
+ optional: [
2038
+ ExtraAppFieldsItemViews.PUBLISHTO,
2039
+ ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS,
2040
+ ExtraAppFieldsItemViews.RECEIVEACOPY,
2041
+ ],
2042
+ },
2043
+ popup: {
2044
+ fixed: [ExtraAppFieldsItemViews.TITLE],
2045
+ optional: [ExtraAppFieldsItemViews.PUBLISHTO],
2046
+ },
2047
+ edit: {
2048
+ fixed: [ExtraAppFieldsItemViews.TITLE],
2049
+ optional: [ExtraAppFieldsItemViews.PUBLISHTO],
2050
+ },
2051
+ list: {
2052
+ fixed: [ExtraAppFieldsItemViews.TITLE, ExtraAppFieldsItemViews.USER],
2053
+ optional: [ExtraAppFieldsItemViews.CREATIONDATE],
2054
+ },
2055
+ filter: {
2056
+ fixed: [ExtraAppFieldsItemViews.TITLE, ExtraAppFieldsItemViews.USER],
2057
+ optional: [ExtraAppFieldsItemViews.CREATIONDATE],
2058
+ },
2059
+ view: {
2060
+ fixed: [ExtraAppFieldsItemViews.TITLE],
2061
+ optional: [],
2062
+ },
2063
+ };
1853
2064
 
1854
2065
  function InstalledAppStudioAdapter(serverApp, serverApps) {
1855
2066
  const { version, dateCreation } = serverApp.manifest;
1856
2067
  const appTypeServer = serverApp.typeModel;
2068
+ const views = Object.assign({}, ...viewsList.map((view) => ({
2069
+ [view]: [],
2070
+ })));
1857
2071
  const studioApp = {
1858
2072
  idApp: serverApp.idApp,
1859
2073
  status: _formatStatus(serverApp),
1860
2074
  manifest: Object.assign({ appShortName: serverApp.name, appName: serverApp.label, description: serverApp.description, author: serverApp.author, cssColor: appTypeServer.cssColor, cssClass: { label: appTypeServer.cssClass, value: appTypeServer.cssClass }, version: version, dateCreation: dateCreation, checkAccess: serverApp.checkAccess, attrExposed: serverApp.attrExposed, viewSolr: serverApp.view, typeLabel: appTypeServer.typeLabel }, (serverApp.articlesCount && { articlesCount: serverApp.articlesCount })),
1861
2075
  fields: [],
2076
+ views,
2077
+ installFor: serverApp.accessRightObjectList,
2078
+ audience: serverApp.checkAccess === false ? AUDIENCE.ALL : AUDIENCE.CUSTOM,
1862
2079
  };
1863
2080
  const inWorkAppVersion = _findAssociatedDraft(serverApp.idApp, serverApps);
1864
2081
  if (!inWorkAppVersion)
@@ -1878,6 +2095,9 @@ function DraftAppStudioAdapter(serverApp) {
1878
2095
  status: _formatStatus(serverApp),
1879
2096
  manifest: parsedJson.manifest,
1880
2097
  fields: parsedJson.fields,
2098
+ views: parsedJson.views,
2099
+ audience: parsedJson.audience,
2100
+ installFor: parsedJson.installFor,
1881
2101
  };
1882
2102
  }
1883
2103
  function _formatStatus(serverApp) {
@@ -2003,6 +2223,37 @@ function cloneStudioAppFromExistingApp(existingApp, author) {
2003
2223
 
2004
2224
  function createNewStudioApp$1({ author, appName }) {
2005
2225
  const newAppId = v4();
2226
+ const views = Object.assign({}, ...viewsList.map((view) => {
2227
+ var _a, _b;
2228
+ const viewItems = {};
2229
+ (_a = MapExtraFieldsWithView[view]) === null || _a === void 0 ? void 0 : _a.fixed.forEach((fixedField, idx) => {
2230
+ viewItems[v4()] = {
2231
+ type: fixedField,
2232
+ properties: [],
2233
+ isUsed: true,
2234
+ isOptional: false,
2235
+ isFixed: true,
2236
+ isLockedValue: false,
2237
+ value: null,
2238
+ pos: idx,
2239
+ };
2240
+ });
2241
+ (_b = MapExtraFieldsWithView[view]) === null || _b === void 0 ? void 0 : _b.optional.forEach((optionalField, idx) => {
2242
+ viewItems[v4()] = {
2243
+ type: optionalField,
2244
+ properties: [],
2245
+ isUsed: true,
2246
+ isOptional: true,
2247
+ isFixed: false,
2248
+ isLockedValue: false,
2249
+ value: optionalField === 'SENDALERTTOSUBSCRIBERS' || optionalField === 'RECEIVEACOPY' ? true : null,
2250
+ pos: (idx + 1) * 100,
2251
+ };
2252
+ });
2253
+ return {
2254
+ [view]: viewItems,
2255
+ };
2256
+ }));
2006
2257
  return {
2007
2258
  newAppId,
2008
2259
  newStudioApp: {
@@ -2029,6 +2280,9 @@ function createNewStudioApp$1({ author, appName }) {
2029
2280
  articlesCount: 0,
2030
2281
  },
2031
2282
  fields: [],
2283
+ views,
2284
+ audience: AUDIENCE.ALL,
2285
+ installFor: [],
2032
2286
  },
2033
2287
  };
2034
2288
  }
@@ -2277,5 +2531,5 @@ const studio = {
2277
2531
  },
2278
2532
  };
2279
2533
 
2280
- export { APP_STATUS_TYPE, AUDIENCE, AppFieldFormPropertyTypes, AppFormBannedFromViews, AppFormItemTypes, AppFormUniqueList, Application, AssetReservation, Bookmark, Faq, MODE_EDIT, MODE_VIEW, Model, Network, STUDIO_VIEW, Share, StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, jland, slice, studio, viewsList };
2534
+ export { APP_STATUS_TYPE, AUDIENCE, AppFieldFormPropertyTypes, AppFormBannedFromViews, AppFormItemTypes, AppFormUniqueList, Application, AssetReservation, Bookmark, Comment, ExtraAppFieldsItemViews, Faq, MODE_EDIT, MODE_VIEW, MapExtraFieldsWithView, Model, Network, Platform, STUDIO_VIEW, Share, StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, jland, slice, studio, updateWidgetContent, viewsList };
2281
2535
  //# sourceMappingURL=esm.js.map