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/cjs.js CHANGED
@@ -68,7 +68,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
68
68
  });
69
69
  }
70
70
 
71
- const initialState$h = {
71
+ const initialState$j = {
72
72
  entities: [],
73
73
  loading: 'idle',
74
74
  nbResults: 0,
@@ -79,7 +79,7 @@ const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookable
79
79
  }));
80
80
  const BookableAssetSlice = toolkit.createSlice({
81
81
  name: 'bookableAsset',
82
- initialState: initialState$h,
82
+ initialState: initialState$j,
83
83
  reducers: {},
84
84
  extraReducers: (builder) => {
85
85
  builder
@@ -100,7 +100,7 @@ const BookableAssetSlice = toolkit.createSlice({
100
100
  const fetchConfiguration = toolkit.createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
101
101
  return yield extra.jApi.assetReservation.configuration();
102
102
  }));
103
- const initialState$g = {
103
+ const initialState$i = {
104
104
  description: '',
105
105
  right: {
106
106
  manage: false,
@@ -114,7 +114,7 @@ const initialState$g = {
114
114
  };
115
115
  const AssetReservationConfigurationSlice = toolkit.createSlice({
116
116
  name: 'configuration',
117
- initialState: initialState$g,
117
+ initialState: initialState$i,
118
118
  reducers: {},
119
119
  extraReducers: (builder) => {
120
120
  builder
@@ -135,7 +135,7 @@ const initForm = {
135
135
  hourStart: '',
136
136
  hourEnd: '',
137
137
  };
138
- const initialState$f = {
138
+ const initialState$h = {
139
139
  entities: [],
140
140
  loading: 'idle',
141
141
  nbResults: 0,
@@ -147,7 +147,7 @@ const fetchReservation = toolkit.createAsyncThunk('Reservation/fetchReservation'
147
147
  }));
148
148
  const ReservationSlice = toolkit.createSlice({
149
149
  name: 'reservation',
150
- initialState: initialState$f,
150
+ initialState: initialState$h,
151
151
  reducers: {
152
152
  setForm: (state, action) => {
153
153
  state.form = action.payload;
@@ -240,7 +240,115 @@ const Toast = {
240
240
  selectors: selectors$1,
241
241
  };
242
242
 
243
- const initialState$e = {
243
+ const initialState$g = {
244
+ loading: 'idle',
245
+ comments: [],
246
+ };
247
+ const fetchComments = toolkit.createAsyncThunk('commentList/fetchCommentList', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
248
+ var _a;
249
+ try {
250
+ const res = yield extra.jApi.article.getComments(params, 'raw-list');
251
+ return { idArticle: params.idArticle, list: res.result };
252
+ }
253
+ catch (error) {
254
+ dispatch(Toast.actions.error({ label: (_a = error.errorMsg) !== null && _a !== void 0 ? _a : 'GLOBAL_Technical_Error' }));
255
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve comments' });
256
+ }
257
+ }));
258
+ const CommentListSlice = toolkit.createSlice({
259
+ name: 'commentList',
260
+ initialState: initialState$g,
261
+ reducers: {
262
+ discardComments: (state, action) => {
263
+ state.comments = state.comments.filter((c) => c.idArticle !== action.payload.idArticle);
264
+ },
265
+ },
266
+ extraReducers: (builder) => {
267
+ builder
268
+ .addCase(fetchComments.pending, (state) => {
269
+ state.loading = 'pending';
270
+ })
271
+ .addCase(fetchComments.fulfilled, (state, action) => {
272
+ state.loading = 'idle';
273
+ state.comments = [
274
+ ...state.comments.filter((c) => c.idArticle !== action.payload.idArticle),
275
+ {
276
+ idArticle: action.payload.idArticle,
277
+ list: action.payload.list.reverse(),
278
+ },
279
+ ];
280
+ })
281
+ .addCase(fetchComments.rejected, (state) => {
282
+ state.loading = 'idle';
283
+ });
284
+ },
285
+ });
286
+
287
+ const getCommentRTHandlers = function (dispatch, idArticle) {
288
+ const addCommentHandler = function (message) {
289
+ if (message.namespace === 'JAMESPOT' &&
290
+ message.function === 'comment-create' &&
291
+ message.object.idArticle === idArticle) {
292
+ dispatch(fetchComments({ idArticle }));
293
+ }
294
+ };
295
+ const deleteCommentHandler = function (message) {
296
+ if (message.namespace === 'JAMESPOT' &&
297
+ message.function === 'comment-delete' &&
298
+ Number(message.object.idArticle) === idArticle) {
299
+ dispatch(fetchComments({ idArticle }));
300
+ }
301
+ };
302
+ return [
303
+ {
304
+ namespace: 'JAMESPOT',
305
+ function: 'comment-create',
306
+ handler: addCommentHandler,
307
+ },
308
+ {
309
+ namespace: 'JAMESPOT',
310
+ function: 'comment-delete',
311
+ handler: deleteCommentHandler,
312
+ },
313
+ ];
314
+ };
315
+
316
+ const getCommentsLikeRTHandlers = function (dispatch, idComments, idArticle) {
317
+ const commentLikeHandler = function (message) {
318
+ if (message.namespace === 'CUSTOM-ACTION' &&
319
+ (message.function === 'add' || message.function === 'remove') &&
320
+ message.object.type === 'sociallike' &&
321
+ message.object.targetId &&
322
+ idComments &&
323
+ idComments.includes(message.object.targetId)) {
324
+ dispatch(fetchComments({ idArticle }));
325
+ }
326
+ };
327
+ return idComments ? [
328
+ { namespace: 'CUSTOM-ACTION', function: 'add', handler: commentLikeHandler },
329
+ { namespace: 'CUSTOM-ACTION', function: 'remove', handler: commentLikeHandler },
330
+ ] : [];
331
+ };
332
+
333
+ const CommentReducer = redux.combineReducers({
334
+ [CommentListSlice.name]: CommentListSlice.reducer,
335
+ });
336
+ const commentSlice = {
337
+ name: 'comment',
338
+ reducer: CommentReducer,
339
+ };
340
+ const selectCommentList = (state, idArticle) => state.comment.commentList.comments.find((c) => c.idArticle === idArticle);
341
+ const Comment = {
342
+ slice: commentSlice,
343
+ actions: Object.assign({ fetchComments }, CommentListSlice.actions),
344
+ selectors: {
345
+ commentList: selectCommentList,
346
+ },
347
+ getCommentRTHandlers,
348
+ getCommentsLikeRTHandlers,
349
+ };
350
+
351
+ const initialState$f = {
244
352
  bookmarks: [],
245
353
  loading: 'idle',
246
354
  status: undefined,
@@ -303,7 +411,7 @@ const deleteBookmark = toolkit.createAsyncThunk('bookmarkList/deleteBookmark', (
303
411
  }));
304
412
  const BookmarkListSlice = toolkit.createSlice({
305
413
  name: 'bookmarkList',
306
- initialState: initialState$e,
414
+ initialState: initialState$f,
307
415
  reducers: {
308
416
  resetAddBookmarkStatus: (state, action) => {
309
417
  if (state.add[action.payload]) {
@@ -413,7 +521,7 @@ const BookmarkListSlice = toolkit.createSlice({
413
521
  },
414
522
  });
415
523
 
416
- const getRTHandlers = function (dispatch) {
524
+ const getBookmarkRTHandlers = function (dispatch) {
417
525
  const dispatchOrFetch = function (message, action) {
418
526
  if (jamespot.jEnsure.objectIsType('bookmarkLink', message.object)) {
419
527
  dispatch(action(message.object));
@@ -466,7 +574,7 @@ const getRTHandlers = function (dispatch) {
466
574
  ];
467
575
  };
468
576
 
469
- const initialState$d = {
577
+ const initialState$e = {
470
578
  bookmark: undefined,
471
579
  status: undefined,
472
580
  loading: 'idle',
@@ -488,7 +596,7 @@ const editBookmark = toolkit.createAsyncThunk('bookmarkEdit/editBookmark', (book
488
596
  }));
489
597
  const BookmarkEditSlice = toolkit.createSlice({
490
598
  name: 'bookmarkEdit',
491
- initialState: initialState$d,
599
+ initialState: initialState$e,
492
600
  reducers: {
493
601
  setEditBookmark: (state, action) => {
494
602
  state.bookmark = Object.assign({}, action.payload);
@@ -538,17 +646,17 @@ const Bookmark = {
538
646
  bookmarkListIsInitialized: selectBookmarkListIsInitialized,
539
647
  bookmarkEditBookmark: selectBookmarkEditBookmark
540
648
  },
541
- getRTHandlers: getRTHandlers,
649
+ getRTHandlers: getBookmarkRTHandlers,
542
650
  };
543
651
 
544
- const initialState$c = {
652
+ const initialState$d = {
545
653
  loading: 'idle',
546
654
  access: { createCategory: false },
547
655
  };
548
656
  const fetchFaqConfig = toolkit.createAsyncThunk('faqConfig/fetch', () => __awaiter(void 0, void 0, void 0, function* () {
549
657
  try {
550
658
  const [hookProperties, access] = yield Promise.all([
551
- yield jamespot__default["default"].faq.getHookProperties(['_web', 'appImage', 'appImageText']),
659
+ yield jamespot__default["default"].faq.getHookProperties(['_web', 'appImage', 'appImageText', '_displayComment']),
552
660
  yield jamespot__default["default"].faq.getAccess()
553
661
  ]);
554
662
  return {
@@ -556,6 +664,7 @@ const fetchFaqConfig = toolkit.createAsyncThunk('faqConfig/fetch', () => __await
556
664
  appImage: hookProperties.result.appImage,
557
665
  appImageText: hookProperties.result.appImageText,
558
666
  access: access.result,
667
+ _displayComment: hookProperties.result._displayComment,
559
668
  };
560
669
  }
561
670
  catch (e) {
@@ -569,7 +678,7 @@ const fetchFaqConfig = toolkit.createAsyncThunk('faqConfig/fetch', () => __await
569
678
  }));
570
679
  const FaqConfigSlice = toolkit.createSlice({
571
680
  name: 'config',
572
- initialState: initialState$c,
681
+ initialState: initialState$d,
573
682
  reducers: {},
574
683
  extraReducers: (builder) => {
575
684
  builder
@@ -592,6 +701,9 @@ const FaqConfigSlice = toolkit.createSlice({
592
701
  if (action.payload.access) {
593
702
  state.access = action.payload.access;
594
703
  }
704
+ if (action.payload._displayComment !== undefined) {
705
+ state._displayComment = action.payload._displayComment;
706
+ }
595
707
  return state;
596
708
  })
597
709
  .addCase(fetchFaqConfig.rejected, (state) => {
@@ -601,7 +713,7 @@ const FaqConfigSlice = toolkit.createSlice({
601
713
  },
602
714
  });
603
715
 
604
- const initialState$b = {
716
+ const initialState$c = {
605
717
  loading: 'idle',
606
718
  categories: null,
607
719
  };
@@ -613,7 +725,7 @@ const fetchFaqCategories = toolkit.createAsyncThunk('faqCategories/fetch', () =>
613
725
  }));
614
726
  const FaqCategoriesSlice = toolkit.createSlice({
615
727
  name: 'categories',
616
- initialState: initialState$b,
728
+ initialState: initialState$c,
617
729
  reducers: {},
618
730
  extraReducers: (builder) => {
619
731
  builder
@@ -634,13 +746,13 @@ const FaqCategoriesSlice = toolkit.createSlice({
634
746
  },
635
747
  });
636
748
 
637
- const joinedReducers$5 = toolkit.combineReducers({
749
+ const joinedReducers$6 = toolkit.combineReducers({
638
750
  [FaqConfigSlice.name]: FaqConfigSlice.reducer,
639
751
  [FaqCategoriesSlice.name]: FaqCategoriesSlice.reducer,
640
752
  });
641
753
  const FaqSlice = {
642
754
  name: 'faq',
643
- reducer: joinedReducers$5,
755
+ reducer: joinedReducers$6,
644
756
  };
645
757
  const selectFaqConfig = (state) => {
646
758
  return state.faq.config;
@@ -895,7 +1007,7 @@ const initialMap = {
895
1007
  illustration: '',
896
1008
  assignLicense: false,
897
1009
  };
898
- const initialState$a = {
1010
+ const initialState$b = {
899
1011
  map: Object.assign({}, initialMap),
900
1012
  loading: 'idle',
901
1013
  status: undefined,
@@ -939,13 +1051,13 @@ const createMap = toolkit.createAsyncThunk('mapCreate/create', ({ map, jlandUrlB
939
1051
  }));
940
1052
  const MapCreateSlice = toolkit.createSlice({
941
1053
  name: 'mapCreate',
942
- initialState: initialState$a,
1054
+ initialState: initialState$b,
943
1055
  reducers: {
944
1056
  setMap: (state, action) => {
945
1057
  state.map = action.payload;
946
1058
  },
947
1059
  resetCreateMapState: () => {
948
- return initialState$a;
1060
+ return initialState$b;
949
1061
  },
950
1062
  },
951
1063
  extraReducers: (builder) => {
@@ -975,13 +1087,13 @@ const selectJLandAvailableLicenses = function selectJLandAvailableLicenses(state
975
1087
  const selectMapCreate = function selectMapCreate(state) {
976
1088
  return state.jland.mapCreate;
977
1089
  };
978
- const joinedReducers$4 = toolkit.combineReducers({
1090
+ const joinedReducers$5 = toolkit.combineReducers({
979
1091
  [JLandMapListSlice.name]: JLandMapListSlice.reducer,
980
1092
  [MapCreateSlice.name]: MapCreateSlice.reducer,
981
1093
  });
982
1094
  const jlandSlice = {
983
1095
  name: 'jland',
984
- reducer: joinedReducers$4,
1096
+ reducer: joinedReducers$5,
985
1097
  };
986
1098
  const jland = {
987
1099
  slice: jlandSlice,
@@ -1032,10 +1144,10 @@ const Model = {
1032
1144
  selectors: Object.assign(Object.assign({}, selectors), { selectByIds }),
1033
1145
  };
1034
1146
 
1035
- const initialState$9 = {};
1147
+ const initialState$a = {};
1036
1148
  const NetworkStaticsSlice = toolkit.createSlice({
1037
1149
  name: 'statics',
1038
- initialState: initialState$9,
1150
+ initialState: initialState$a,
1039
1151
  reducers: {
1040
1152
  initNetworkStatics: (_, { payload }) => {
1041
1153
  return payload;
@@ -1043,12 +1155,12 @@ const NetworkStaticsSlice = toolkit.createSlice({
1043
1155
  },
1044
1156
  });
1045
1157
 
1046
- const joinedReducers$3 = toolkit.combineReducers({
1158
+ const joinedReducers$4 = toolkit.combineReducers({
1047
1159
  [NetworkStaticsSlice.name]: NetworkStaticsSlice.reducer,
1048
1160
  });
1049
1161
  const NetworkSlice = {
1050
1162
  name: 'network',
1051
- reducer: joinedReducers$3,
1163
+ reducer: joinedReducers$4,
1052
1164
  };
1053
1165
  const selectNetworkStatics = (state) => {
1054
1166
  return state.network.statics;
@@ -1069,6 +1181,46 @@ const Network = {
1069
1181
  },
1070
1182
  };
1071
1183
 
1184
+ const initialState$9 = {
1185
+ userHighlightFields: [],
1186
+ userAccountStatus: 0
1187
+ };
1188
+ const PlatformConfigSlice = toolkit.createSlice({
1189
+ name: 'config',
1190
+ initialState: initialState$9,
1191
+ reducers: {
1192
+ initPlatformConfig: (_, { payload }) => {
1193
+ return payload;
1194
+ },
1195
+ },
1196
+ });
1197
+
1198
+ const joinedReducers$3 = toolkit.combineReducers({
1199
+ [PlatformConfigSlice.name]: PlatformConfigSlice.reducer,
1200
+ });
1201
+ const PlatformSlice = {
1202
+ name: 'platform',
1203
+ reducer: joinedReducers$3,
1204
+ };
1205
+ const selectPlatformConfig = (state) => {
1206
+ return state.platform.config;
1207
+ };
1208
+ const selectUserHighlightFields = (state) => {
1209
+ return state.platform.config.userHighlightFields;
1210
+ };
1211
+ const selectUserAccountStatus = (state) => {
1212
+ return state.platform.config.userAccountStatus;
1213
+ };
1214
+ const Platform = {
1215
+ slice: PlatformSlice,
1216
+ actions: Object.assign({}, PlatformConfigSlice.actions),
1217
+ selectors: {
1218
+ selectPlatformConfig,
1219
+ selectUserHighlightFields,
1220
+ selectUserAccountStatus,
1221
+ },
1222
+ };
1223
+
1072
1224
  const initialQuery = {
1073
1225
  query: '',
1074
1226
  filters: [],
@@ -1405,12 +1557,12 @@ const widgetArticleAttachmentDefinition = {
1405
1557
  label: 'WIDGET_Article_Attachment',
1406
1558
  description: 'WIDGET_Article_Attachment_Description',
1407
1559
  name: 'widget-article-attachment',
1408
- img: '/img/fast-intranet/widget-file.png',
1560
+ img: '/img/article-widget-thumbnail/widget_thumbnail_files.png',
1409
1561
  available: true,
1410
1562
  panel: {
1411
1563
  useWrapper: true,
1412
1564
  useEditor: true,
1413
- useWidgets: false
1565
+ useWidgets: false,
1414
1566
  },
1415
1567
  };
1416
1568
  const widgetArticleAttachmentContent = {
@@ -1421,12 +1573,12 @@ const widgetArticleGalleryDefinition = {
1421
1573
  label: 'WIDGET_Article_Gallery',
1422
1574
  description: 'WIDGET_Article_Gallery_Description',
1423
1575
  name: 'widget-article-gallery',
1424
- img: '/img/fast-intranet/widget-slider.png',
1576
+ img: '/img/article-widget-thumbnail/widget_thumbnail_slider.png',
1425
1577
  available: true,
1426
1578
  panel: {
1427
1579
  useWrapper: false,
1428
1580
  useEditor: true,
1429
- useWidgets: false
1581
+ useWidgets: false,
1430
1582
  },
1431
1583
  };
1432
1584
  const widgetArticleGalleryContent = {
@@ -1439,39 +1591,34 @@ const widgetArticleImageDefinition = {
1439
1591
  label: 'WIDGET_Article_Image',
1440
1592
  description: 'WIDGET_Article_Image_Description',
1441
1593
  name: 'widget-article-image',
1442
- img: '/img/fast-intranet/widget-image.png',
1594
+ img: '/img/article-widget-thumbnail/widget_thumbnail_illustration.png',
1443
1595
  available: true,
1444
1596
  panel: {
1445
1597
  useWrapper: false,
1446
1598
  useEditor: true,
1447
- useWidgets: false
1599
+ useWidgets: false,
1448
1600
  },
1449
1601
  };
1450
- const widgetArticleImageContent = {
1451
- displayAs: 'image',
1452
- backgroundPosition: 'center',
1453
- backgroundSize: 'cover',
1454
- borderRadius: '8'
1455
- };
1602
+ const widgetArticleImageContent = {};
1456
1603
 
1457
1604
  const widgetArticleButtonDefinition = {
1458
1605
  label: 'WIDGET_Button',
1459
1606
  description: 'WIDGET_Button_Description',
1460
1607
  name: 'widget-article-button',
1461
- img: '/img/fast-intranet/widget-button.png',
1608
+ img: '/img/article-widget-thumbnail/widget_thumbnail_button.png',
1462
1609
  available: true,
1463
1610
  panel: {
1464
1611
  useWrapper: false,
1465
1612
  useEditor: true,
1466
- useWidgets: false
1613
+ useWidgets: false,
1467
1614
  },
1468
1615
  };
1469
1616
  const widgetArticleButtonContent = {
1470
- text: 'This is a button',
1617
+ text: '',
1471
1618
  openingType: 'link',
1472
1619
  openingTypeLink: {
1473
1620
  url: '',
1474
- target: '_blank'
1621
+ target: '_blank',
1475
1622
  },
1476
1623
  variant: 'contained',
1477
1624
  fontSize: '14',
@@ -1485,36 +1632,56 @@ const widgetArticleTextDefinition = {
1485
1632
  label: 'WIDGET_Text',
1486
1633
  description: 'WIDGET_Text_Description',
1487
1634
  name: 'widget-article-text',
1488
- img: '/img/fast-intranet/widget-text.png',
1635
+ img: '/img/article-widget-thumbnail/widget_thumbnail_text.png',
1489
1636
  available: true,
1490
1637
  panel: {
1491
1638
  useWrapper: false,
1492
1639
  useEditor: true,
1493
- useWidgets: false
1640
+ useWidgets: false,
1494
1641
  },
1495
1642
  };
1496
1643
  const widgetArticleTextContent = {
1497
1644
  fontSize: '18',
1498
1645
  lineHeight: '1.6',
1499
- text: ''
1646
+ text: '',
1500
1647
  };
1501
1648
 
1502
1649
  const widgetArticleTitleDefinition = {
1503
1650
  label: 'WIDGET_Title',
1504
1651
  description: 'WIDGET_Title_Description',
1505
1652
  name: 'widget-article-title',
1506
- img: '/img/fast-intranet/widget-text.png',
1653
+ img: '/img/article-widget-thumbnail/widget_thumbnail_title.png',
1507
1654
  available: true,
1508
1655
  panel: {
1509
1656
  useWrapper: false,
1510
1657
  useEditor: true,
1511
- useWidgets: false
1658
+ useWidgets: false,
1512
1659
  },
1513
1660
  };
1514
1661
  const widgetArticleTitleContent = {
1515
1662
  text: '',
1516
1663
  heading: 'h1',
1517
- backgroundColor: 'transparent'
1664
+ backgroundColor: 'transparent',
1665
+ };
1666
+
1667
+ const widgetArticleSliderDefinition = {
1668
+ label: 'WIDGET_Slider',
1669
+ description: 'WIDGET_Slider_Description',
1670
+ name: 'widget-article-slider',
1671
+ img: '/img/article-widget-thumbnail/widget_thumbnail_slider.png',
1672
+ available: true,
1673
+ panel: {
1674
+ useWrapper: false,
1675
+ useEditor: true,
1676
+ useWidgets: false,
1677
+ },
1678
+ };
1679
+ const widgetArticleSliderContent = {
1680
+ slides: [],
1681
+ maxWidth: 800,
1682
+ loop: false,
1683
+ useDots: true,
1684
+ startAt: 0,
1518
1685
  };
1519
1686
 
1520
1687
  function uniqid() {
@@ -1535,7 +1702,7 @@ function widget(name) {
1535
1702
  return {
1536
1703
  uniqid: uniqid(),
1537
1704
  name,
1538
- content: content(name)
1705
+ content: content(name),
1539
1706
  };
1540
1707
  }
1541
1708
  function content(name) {
@@ -1543,6 +1710,8 @@ function content(name) {
1543
1710
  default:
1544
1711
  case 'widget-article-attachment':
1545
1712
  return Object.assign({}, widgetArticleAttachmentContent);
1713
+ case 'widget-article-slider':
1714
+ return Object.assign({}, widgetArticleSliderContent);
1546
1715
  case 'widget-article-gallery':
1547
1716
  return Object.assign({}, widgetArticleGalleryContent);
1548
1717
  case 'widget-article-button':
@@ -1581,6 +1750,8 @@ function widgetDefinition(name) {
1581
1750
  return widgetArticleGalleryDefinition;
1582
1751
  case 'widget-article-attachment':
1583
1752
  return widgetArticleAttachmentDefinition;
1753
+ case 'widget-article-slider':
1754
+ return widgetArticleSliderDefinition;
1584
1755
  case 'widget-article-text':
1585
1756
  return widgetArticleTextDefinition;
1586
1757
  case 'widget-article-title':
@@ -1729,6 +1900,7 @@ const selectWidgetContent = (state, uniqid) => { var _a; return (_a = state.widg
1729
1900
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
1730
1901
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
1731
1902
  const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
1903
+ const updateWidgetContent = (uniqid, content, override) => Widget.slice.actions.updateWidget({ uniqid, content, override: override !== null && override !== void 0 ? override : false });
1732
1904
  const Widget = {
1733
1905
  const: WIDGETS,
1734
1906
  factory: widgetFactory,
@@ -1845,6 +2017,15 @@ exports.AppFormItemTypes = void 0;
1845
2017
  AppFormItemTypes["USERLINK"] = "USERLINK";
1846
2018
  AppFormItemTypes["CONTENTLINK"] = "CONTENTLINK";
1847
2019
  })(exports.AppFormItemTypes || (exports.AppFormItemTypes = {}));
2020
+ exports.ExtraAppFieldsItemViews = void 0;
2021
+ (function (ExtraAppFieldsItemViews) {
2022
+ ExtraAppFieldsItemViews["TITLE"] = "TITLE";
2023
+ ExtraAppFieldsItemViews["USER"] = "USER";
2024
+ ExtraAppFieldsItemViews["PUBLISHTO"] = "PUBLISHTO";
2025
+ ExtraAppFieldsItemViews["SENDALERTTOSUBSCRIBERS"] = "SENDALERTTOSUBSCRIBERS";
2026
+ ExtraAppFieldsItemViews["RECEIVEACOPY"] = "RECEIVEACOPY";
2027
+ ExtraAppFieldsItemViews["CREATIONDATE"] = "CREATIONDATE";
2028
+ })(exports.ExtraAppFieldsItemViews || (exports.ExtraAppFieldsItemViews = {}));
1848
2029
  exports.AppFieldFormPropertyTypes = void 0;
1849
2030
  (function (AppFieldFormPropertyTypes) {
1850
2031
  AppFieldFormPropertyTypes["LABEL"] = "label";
@@ -1858,15 +2039,51 @@ exports.AppFieldFormPropertyTypes = void 0;
1858
2039
  const AppFormUniqueList = [exports.AppFormItemTypes.DESCRIPTION, exports.AppFormItemTypes.IMAGE];
1859
2040
  const AppFormBannedFromViews = new Map();
1860
2041
  AppFormBannedFromViews.set(exports.AppFormItemTypes.IMAGE, ['list', 'filter', 'view']);
2042
+ const MapExtraFieldsWithView = {
2043
+ create: {
2044
+ fixed: [exports.ExtraAppFieldsItemViews.TITLE],
2045
+ optional: [
2046
+ exports.ExtraAppFieldsItemViews.PUBLISHTO,
2047
+ exports.ExtraAppFieldsItemViews.SENDALERTTOSUBSCRIBERS,
2048
+ exports.ExtraAppFieldsItemViews.RECEIVEACOPY,
2049
+ ],
2050
+ },
2051
+ popup: {
2052
+ fixed: [exports.ExtraAppFieldsItemViews.TITLE],
2053
+ optional: [exports.ExtraAppFieldsItemViews.PUBLISHTO],
2054
+ },
2055
+ edit: {
2056
+ fixed: [exports.ExtraAppFieldsItemViews.TITLE],
2057
+ optional: [exports.ExtraAppFieldsItemViews.PUBLISHTO],
2058
+ },
2059
+ list: {
2060
+ fixed: [exports.ExtraAppFieldsItemViews.TITLE, exports.ExtraAppFieldsItemViews.USER],
2061
+ optional: [exports.ExtraAppFieldsItemViews.CREATIONDATE],
2062
+ },
2063
+ filter: {
2064
+ fixed: [exports.ExtraAppFieldsItemViews.TITLE, exports.ExtraAppFieldsItemViews.USER],
2065
+ optional: [exports.ExtraAppFieldsItemViews.CREATIONDATE],
2066
+ },
2067
+ view: {
2068
+ fixed: [exports.ExtraAppFieldsItemViews.TITLE],
2069
+ optional: [],
2070
+ },
2071
+ };
1861
2072
 
1862
2073
  function InstalledAppStudioAdapter(serverApp, serverApps) {
1863
2074
  const { version, dateCreation } = serverApp.manifest;
1864
2075
  const appTypeServer = serverApp.typeModel;
2076
+ const views = Object.assign({}, ...viewsList.map((view) => ({
2077
+ [view]: [],
2078
+ })));
1865
2079
  const studioApp = {
1866
2080
  idApp: serverApp.idApp,
1867
2081
  status: _formatStatus(serverApp),
1868
2082
  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 })),
1869
2083
  fields: [],
2084
+ views,
2085
+ installFor: serverApp.accessRightObjectList,
2086
+ audience: serverApp.checkAccess === false ? AUDIENCE.ALL : AUDIENCE.CUSTOM,
1870
2087
  };
1871
2088
  const inWorkAppVersion = _findAssociatedDraft(serverApp.idApp, serverApps);
1872
2089
  if (!inWorkAppVersion)
@@ -1886,6 +2103,9 @@ function DraftAppStudioAdapter(serverApp) {
1886
2103
  status: _formatStatus(serverApp),
1887
2104
  manifest: parsedJson.manifest,
1888
2105
  fields: parsedJson.fields,
2106
+ views: parsedJson.views,
2107
+ audience: parsedJson.audience,
2108
+ installFor: parsedJson.installFor,
1889
2109
  };
1890
2110
  }
1891
2111
  function _formatStatus(serverApp) {
@@ -2011,6 +2231,37 @@ function cloneStudioAppFromExistingApp(existingApp, author) {
2011
2231
 
2012
2232
  function createNewStudioApp$1({ author, appName }) {
2013
2233
  const newAppId = uuid.v4();
2234
+ const views = Object.assign({}, ...viewsList.map((view) => {
2235
+ var _a, _b;
2236
+ const viewItems = {};
2237
+ (_a = MapExtraFieldsWithView[view]) === null || _a === void 0 ? void 0 : _a.fixed.forEach((fixedField, idx) => {
2238
+ viewItems[uuid.v4()] = {
2239
+ type: fixedField,
2240
+ properties: [],
2241
+ isUsed: true,
2242
+ isOptional: false,
2243
+ isFixed: true,
2244
+ isLockedValue: false,
2245
+ value: null,
2246
+ pos: idx,
2247
+ };
2248
+ });
2249
+ (_b = MapExtraFieldsWithView[view]) === null || _b === void 0 ? void 0 : _b.optional.forEach((optionalField, idx) => {
2250
+ viewItems[uuid.v4()] = {
2251
+ type: optionalField,
2252
+ properties: [],
2253
+ isUsed: true,
2254
+ isOptional: true,
2255
+ isFixed: false,
2256
+ isLockedValue: false,
2257
+ value: optionalField === 'SENDALERTTOSUBSCRIBERS' || optionalField === 'RECEIVEACOPY' ? true : null,
2258
+ pos: (idx + 1) * 100,
2259
+ };
2260
+ });
2261
+ return {
2262
+ [view]: viewItems,
2263
+ };
2264
+ }));
2014
2265
  return {
2015
2266
  newAppId,
2016
2267
  newStudioApp: {
@@ -2037,6 +2288,9 @@ function createNewStudioApp$1({ author, appName }) {
2037
2288
  articlesCount: 0,
2038
2289
  },
2039
2290
  fields: [],
2291
+ views,
2292
+ audience: AUDIENCE.ALL,
2293
+ installFor: [],
2040
2294
  },
2041
2295
  };
2042
2296
  }
@@ -2292,11 +2546,14 @@ exports.AppFormUniqueList = AppFormUniqueList;
2292
2546
  exports.Application = Application;
2293
2547
  exports.AssetReservation = AssetReservation;
2294
2548
  exports.Bookmark = Bookmark;
2549
+ exports.Comment = Comment;
2295
2550
  exports.Faq = Faq;
2296
2551
  exports.MODE_EDIT = MODE_EDIT;
2297
2552
  exports.MODE_VIEW = MODE_VIEW;
2553
+ exports.MapExtraFieldsWithView = MapExtraFieldsWithView;
2298
2554
  exports.Model = Model;
2299
2555
  exports.Network = Network;
2556
+ exports.Platform = Platform;
2300
2557
  exports.STUDIO_VIEW = STUDIO_VIEW;
2301
2558
  exports.Share = Share;
2302
2559
  exports.TVDisplay = TVDisplay;
@@ -2310,5 +2567,6 @@ exports.actions = actions;
2310
2567
  exports.jland = jland;
2311
2568
  exports.slice = slice;
2312
2569
  exports.studio = studio;
2570
+ exports.updateWidgetContent = updateWidgetContent;
2313
2571
  exports.viewsList = viewsList;
2314
2572
  //# sourceMappingURL=cjs.js.map