jamespot-front-business 1.1.84 → 1.1.86

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
@@ -543,6 +543,9 @@ const adapter$2 = toolkit.createEntityAdapter({
543
543
  selectId: (app) => app.name,
544
544
  sortComparer: (a, b) => a.label.localeCompare(b.label),
545
545
  });
546
+ const fetchList = toolkit.createAsyncThunk('application/fetch', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
547
+ return yield extra.jApi.application.list();
548
+ }));
546
549
  const slice$4 = toolkit.createSlice({
547
550
  name: 'applications',
548
551
  initialState: adapter$2.getInitialState(),
@@ -551,11 +554,16 @@ const slice$4 = toolkit.createSlice({
551
554
  addMany: adapter$2.addMany,
552
555
  setAll: adapter$2.setAll,
553
556
  },
557
+ extraReducers: (builder) => {
558
+ builder.addCase(fetchList.fulfilled, (state, action) => {
559
+ adapter$2.setAll(state, action.payload.result);
560
+ });
561
+ },
554
562
  });
555
563
  const selectors$2 = adapter$2.getSelectors((state) => state.entities.applications);
556
564
  const Application = {
557
565
  slice: slice$4,
558
- actions: Object.assign({}, slice$4.actions),
566
+ actions: Object.assign({ fetchList }, slice$4.actions),
559
567
  selectors: selectors$2,
560
568
  };
561
569
 
@@ -2189,7 +2197,7 @@ const WedocApp = {
2189
2197
 
2190
2198
  const fetchRequest = toolkit.createAsyncThunk('/fetchRequest', ({ uri, idUser }, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
2191
2199
  const jApi = extra.jApi;
2192
- return yield jApi.wedoc.getAccessRequest(uri, idUser);
2200
+ return yield jApi.object.getAccessRequest(uri, idUser);
2193
2201
  }));
2194
2202
 
2195
2203
  const initialState$7 = {
@@ -2465,6 +2473,7 @@ const widgetArticleAttachmentDefinition = {
2465
2473
  panel: {
2466
2474
  useWrapper: true,
2467
2475
  useEditor: true,
2476
+ useSelection: false,
2468
2477
  useWidgets: false,
2469
2478
  },
2470
2479
  };
@@ -2481,6 +2490,7 @@ const widgetArticleButtonDefinition = {
2481
2490
  panel: {
2482
2491
  useWrapper: false,
2483
2492
  useEditor: true,
2493
+ useSelection: false,
2484
2494
  useWidgets: false,
2485
2495
  },
2486
2496
  };
@@ -2508,6 +2518,7 @@ const widgetArticleGalleryDefinition = {
2508
2518
  panel: {
2509
2519
  useWrapper: false,
2510
2520
  useEditor: true,
2521
+ useSelection: false,
2511
2522
  useWidgets: false,
2512
2523
  },
2513
2524
  };
@@ -2526,6 +2537,7 @@ const widgetArticleImageDefinition = {
2526
2537
  panel: {
2527
2538
  useWrapper: false,
2528
2539
  useEditor: true,
2540
+ useSelection: false,
2529
2541
  useWidgets: false,
2530
2542
  },
2531
2543
  };
@@ -2540,6 +2552,7 @@ const widgetArticleSliderDefinition = {
2540
2552
  panel: {
2541
2553
  useWrapper: false,
2542
2554
  useEditor: true,
2555
+ useSelection: false,
2543
2556
  useWidgets: false,
2544
2557
  },
2545
2558
  };
@@ -2560,6 +2573,7 @@ const widgetArticleTextDefinition = {
2560
2573
  panel: {
2561
2574
  useWrapper: false,
2562
2575
  useEditor: true,
2576
+ useSelection: false,
2563
2577
  useWidgets: false,
2564
2578
  },
2565
2579
  };
@@ -2576,6 +2590,7 @@ const widgetArticleTitleDefinition = {
2576
2590
  panel: {
2577
2591
  useWrapper: false,
2578
2592
  useEditor: true,
2593
+ useSelection: false,
2579
2594
  useWidgets: false,
2580
2595
  },
2581
2596
  };
@@ -2594,6 +2609,7 @@ const widgetCheckListDefinition = {
2594
2609
  panel: {
2595
2610
  useWrapper: true,
2596
2611
  useEditor: true,
2612
+ useSelection: false,
2597
2613
  useWidgets: false,
2598
2614
  },
2599
2615
  };
@@ -2611,6 +2627,7 @@ const widgetDatasourceTableDefinition = {
2611
2627
  panel: {
2612
2628
  useWrapper: true,
2613
2629
  useEditor: true,
2630
+ useSelection: true,
2614
2631
  useWidgets: false,
2615
2632
  },
2616
2633
  };
@@ -2632,6 +2649,7 @@ const widgetExcelDatasourceTableDefinition = {
2632
2649
  panel: {
2633
2650
  useWrapper: true,
2634
2651
  useEditor: true,
2652
+ useSelection: true,
2635
2653
  useWidgets: false,
2636
2654
  },
2637
2655
  };
@@ -2653,6 +2671,7 @@ const widgetPresenceDefinition = {
2653
2671
  panel: {
2654
2672
  useWrapper: true,
2655
2673
  useEditor: true,
2674
+ useSelection: false,
2656
2675
  useWidgets: false,
2657
2676
  },
2658
2677
  };
@@ -2671,6 +2690,7 @@ const widgetQuickSurveyDefinition = {
2671
2690
  panel: {
2672
2691
  useWrapper: true,
2673
2692
  useEditor: true,
2693
+ useSelection: false,
2674
2694
  useWidgets: false,
2675
2695
  },
2676
2696
  };
@@ -2684,6 +2704,66 @@ const widgetQuickSurveyContent = {
2684
2704
  isNotDisabled: false,
2685
2705
  };
2686
2706
 
2707
+ const widgetCalendarCalDavDefinition = {
2708
+ label: 'WIDGET_Calendar_CalDav',
2709
+ description: 'WIDGET_Calendar_CalDav_Text',
2710
+ name: jamespot.WidgetsName.CalendarCalDav,
2711
+ img: '/img/fast-intranet/widget-calendar-calDav.png',
2712
+ available: true,
2713
+ displayLevel: [1, 3],
2714
+ panel: {
2715
+ useWrapper: true,
2716
+ useEditor: true,
2717
+ useSelection: true,
2718
+ useWidgets: false,
2719
+ },
2720
+ };
2721
+ const widgetCalendarCalDavContent = {
2722
+ calEventsLimit: false,
2723
+ calEventsLimitValue: 10,
2724
+ calEventsPromptStatus: 'shared',
2725
+ };
2726
+
2727
+ const widgetContactCardDavDefinition = {
2728
+ label: 'WIDGET_Contact_CardDav',
2729
+ description: 'WIDGET_Contact_CardDav_Text',
2730
+ name: jamespot.WidgetsName.ContactCardDav,
2731
+ img: '/img/fast-intranet/widget-contact-cardDav.png',
2732
+ available: true,
2733
+ displayLevel: [1, 3],
2734
+ panel: {
2735
+ useWrapper: true,
2736
+ useEditor: true,
2737
+ useSelection: true,
2738
+ useWidgets: false,
2739
+ },
2740
+ };
2741
+ const widgetContactCardDavContent = {
2742
+ contactLimit: false,
2743
+ contactLimitValue: 10,
2744
+ contactPromptStatus: 'shared',
2745
+ };
2746
+
2747
+ const widgetEmailsImapDefinition = {
2748
+ label: 'WIDGET_Email_IMAP',
2749
+ description: 'WIDGET_Email_IMAP_Text',
2750
+ name: jamespot.WidgetsName.EmailsImap,
2751
+ img: '/img/fast-intranet/widget-emails-imap.png',
2752
+ available: true,
2753
+ displayLevel: [1, 2, 3],
2754
+ panel: {
2755
+ useWrapper: true,
2756
+ useEditor: true,
2757
+ useSelection: true,
2758
+ useWidgets: false,
2759
+ },
2760
+ };
2761
+ const widgetEmailsImapContent = {
2762
+ emailsLimit: false,
2763
+ emailsLimitValue: 10,
2764
+ emailsPromptStatus: 'shared',
2765
+ };
2766
+
2687
2767
  function widgetDefinition(name) {
2688
2768
  switch (name) {
2689
2769
  default:
@@ -2712,12 +2792,19 @@ function widgetDefinition(name) {
2712
2792
  return widgetCheckListDefinition;
2713
2793
  case 'widget-quick-survey':
2714
2794
  return widgetQuickSurveyDefinition;
2795
+ case 'widget-calendar-calDav':
2796
+ return widgetCalendarCalDavDefinition;
2797
+ case 'widget-contact-cardDav':
2798
+ return widgetContactCardDavDefinition;
2799
+ case 'widget-emails-imap':
2800
+ return widgetEmailsImapDefinition;
2715
2801
  }
2716
2802
  }
2717
2803
 
2718
2804
  function widgetFactory(name) {
2719
2805
  return {
2720
2806
  title: '',
2807
+ level: 3,
2721
2808
  widget: widget(name),
2722
2809
  };
2723
2810
  }
@@ -2755,6 +2842,12 @@ function content(name) {
2755
2842
  return Object.assign({}, widgetCheckListContent);
2756
2843
  case 'widget-quick-survey':
2757
2844
  return Object.assign({}, widgetQuickSurveyContent);
2845
+ case 'widget-calendar-calDav':
2846
+ return Object.assign({}, widgetCalendarCalDavContent);
2847
+ case 'widget-contact-cardDav':
2848
+ return Object.assign({}, widgetContactCardDavContent);
2849
+ case 'widget-emails-imap':
2850
+ return Object.assign({}, widgetEmailsImapContent);
2758
2851
  }
2759
2852
  }
2760
2853
 
@@ -2770,6 +2863,9 @@ const initialState$3 = {
2770
2863
  widgetObject: {},
2771
2864
  widgetObjectRights: {},
2772
2865
  widgetAuthor: {},
2866
+ widgetWrapperStyle: {},
2867
+ widgetTitleStyle: {},
2868
+ widgetChipCount: {},
2773
2869
  flushedWidgets: [],
2774
2870
  rtObjectStack: [],
2775
2871
  };
@@ -2810,6 +2906,18 @@ const widgetsSlice = toolkit.createSlice({
2810
2906
  const { uniqid, author } = action.payload;
2811
2907
  state.widgetAuthor[uniqid] = author;
2812
2908
  },
2909
+ setWidgetChipCount: (state, action) => {
2910
+ const { uniqid, count } = action.payload;
2911
+ state.widgetChipCount[uniqid] = count;
2912
+ },
2913
+ setWidgetWrapperStyle: (state, action) => {
2914
+ const { uniqid, styles } = action.payload;
2915
+ state.widgetWrapperStyle[uniqid] = Object.assign(Object.assign({}, state.widgetWrapperStyle[uniqid]), styles);
2916
+ },
2917
+ setWidgetTitleStyle: (state, action) => {
2918
+ const { uniqid, styles } = action.payload;
2919
+ state.widgetTitleStyle[uniqid] = Object.assign(Object.assign({}, state.widgetTitleStyle[uniqid]), styles);
2920
+ },
2813
2921
  updateWidget: (state, action) => {
2814
2922
  const { uniqid } = action.payload;
2815
2923
  const wrapper = Object.assign({}, state.ids[uniqid]);
@@ -3006,6 +3114,7 @@ const selectWidgets = (state) => state.widgets.ids;
3006
3114
  const selectFlushedWidgets = (state) => state.widgets.flushedWidgets;
3007
3115
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3008
3116
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3117
+ const selectWidgetLevel = (state, uniqid) => { var _a, _b; return (_b = (_a = state.widgets.ids[uniqid]) === null || _a === void 0 ? void 0 : _a.level) !== null && _b !== void 0 ? _b : undefined; };
3009
3118
  const selectWidgetObject = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObject[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3010
3119
  const selectWidgetObjectUri = (state, uniqid) => {
3011
3120
  const o = state.widgets.widgetObject[uniqid];
@@ -3016,6 +3125,9 @@ const selectWidgetObjectUri = (state, uniqid) => {
3016
3125
  };
3017
3126
  const selectWidgetObjectRights = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObjectRights[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3018
3127
  const selectWidgetAuthor = (state, uniqid) => { var _a; return (_a = state.widgets.widgetAuthor[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3128
+ const selectWidgetChipCount = (state, uniqid) => { var _a; return (_a = state.widgets.widgetChipCount[uniqid]) !== null && _a !== void 0 ? _a : 0; };
3129
+ const selectWidgetWrapperStyle = (state, uniqid) => { var _a; return (_a = state.widgets.widgetWrapperStyle[uniqid]) !== null && _a !== void 0 ? _a : {}; };
3130
+ const selectWidgetTitleStyle = (state, uniqid) => { var _a; return (_a = state.widgets.widgetTitleStyle[uniqid]) !== null && _a !== void 0 ? _a : {}; };
3019
3131
  const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
3020
3132
  const selectAllWidgetRTObject = (state, uniqid) => state.widgets.rtObjectStack.filter((el) => el.uniqid === uniqid);
3021
3133
  const updateWidgetContent = (uniqid, content, override) => Widget.slice.actions.updateWidget({ uniqid, content, override: override !== null && override !== void 0 ? override : false });
@@ -3041,6 +3153,10 @@ const Widget = {
3041
3153
  selectWidgetObjectRights,
3042
3154
  selectAllWidgetRTObject,
3043
3155
  selectFlushedWidgets,
3156
+ selectWidgetLevel,
3157
+ selectWidgetWrapperStyle,
3158
+ selectWidgetTitleStyle,
3159
+ selectWidgetChipCount,
3044
3160
  },
3045
3161
  };
3046
3162
 
@@ -3097,6 +3213,7 @@ const editorsSlice = toolkit.createSlice({
3097
3213
  state.editors = [...state.editors.filter((ed) => ed.uniqid !== uniqid)];
3098
3214
  },
3099
3215
  flushAllEditor: (state) => {
3216
+ window.dispatchEvent(new Event('WidgetEditorFlushAll'));
3100
3217
  state.editors.length = 0;
3101
3218
  },
3102
3219
  },
@@ -4951,7 +5068,7 @@ const fetchCurrentStudioApp = toolkit.createAsyncThunk('studio/fetchCurrentStudi
4951
5068
  const jApi = extra.jApi;
4952
5069
  const error = { error: 1, errorMsg: 'Error fetching application' };
4953
5070
  try {
4954
- const studioApplicationBase = (yield jApi.application.get(idApp, status)).result;
5071
+ const studioApplicationBase = (yield jApi.application.studioGet(idApp, status)).result;
4955
5072
  const studioApplication = serverAppsToStudioApps([studioApplicationBase], getState())[0];
4956
5073
  if (!studioApplication) {
4957
5074
  return rejectWithValue(error);
@@ -4971,7 +5088,7 @@ const saveCurrentStudioApp = toolkit.createAsyncThunk('studio/saveCurrentStudioA
4971
5088
  }
4972
5089
  const stringifiedApp = JSON.stringify(currentStudioApp);
4973
5090
  try {
4974
- yield jApi.application.save(currentStudioApp.idApp, stringifiedApp, 'saved');
5091
+ yield jApi.application.studioSave(currentStudioApp.idApp, stringifiedApp, 'saved');
4975
5092
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Edition_Saved' }));
4976
5093
  return;
4977
5094
  }
@@ -4989,7 +5106,7 @@ const installStudioApp = toolkit.createAsyncThunk('studio/installApp', ({ callba
4989
5106
  }
4990
5107
  const xml = appToXml(currentStudioApp);
4991
5108
  try {
4992
- yield jApi.application.install(xml);
5109
+ yield jApi.application.studioInstall(xml);
4993
5110
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Installed' }));
4994
5111
  if (callback)
4995
5112
  callback();
@@ -5164,10 +5281,10 @@ const initialState = {
5164
5281
  const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (intl, { extra, rejectWithValue, dispatch, getState }) => __awaiter(void 0, void 0, void 0, function* () {
5165
5282
  const jApi = extra.jApi;
5166
5283
  try {
5167
- const { result } = yield jApi.application.list();
5284
+ const { result } = yield jApi.application.studioList();
5168
5285
  const taxonomies = yield jApi.taxonomy.list();
5169
5286
  const appsPromisesResult = yield Promise.allSettled(result.map((app) => __awaiter(void 0, void 0, void 0, function* () {
5170
- const coreApp = (yield jApi.application.get(app.idApp, app.status)).result;
5287
+ const coreApp = (yield jApi.application.studioGet(app.idApp, app.status)).result;
5171
5288
  const articlesCount = (yield jApi.article.count(app.idApp)).result;
5172
5289
  return Object.assign(Object.assign({}, coreApp), { articlesCount });
5173
5290
  })));
@@ -5222,7 +5339,7 @@ const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', ({ appNa
5222
5339
  const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
5223
5340
  const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({ appName }, (author && { author })));
5224
5341
  try {
5225
- yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
5342
+ yield jApi.application.studioSave(newAppId, JSON.stringify(newStudioApp), 'saved');
5226
5343
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Created' }));
5227
5344
  dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
5228
5345
  if (callback)
@@ -5237,7 +5354,7 @@ const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', ({ appNa
5237
5354
  const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5238
5355
  const jApi = extra.jApi;
5239
5356
  try {
5240
- const deleteRes = yield jApi.application.delete(idApp, status);
5357
+ const deleteRes = yield jApi.application.studioDelete(idApp, status);
5241
5358
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Deleted' }));
5242
5359
  return deleteRes;
5243
5360
  }
@@ -5249,7 +5366,7 @@ const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, s
5249
5366
  const suspendStudioApp = toolkit.createAsyncThunk('studio/suspendStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5250
5367
  const jApi = extra.jApi;
5251
5368
  try {
5252
- yield jApi.application.suspend(idApp);
5369
+ yield jApi.application.studioSuspend(idApp);
5253
5370
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Suspended' }));
5254
5371
  }
5255
5372
  catch (_) {
@@ -5260,7 +5377,7 @@ const suspendStudioApp = toolkit.createAsyncThunk('studio/suspendStudioApp', ({
5260
5377
  const restartStudioApp = toolkit.createAsyncThunk('studio/restartStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5261
5378
  const jApi = extra.jApi;
5262
5379
  try {
5263
- yield jApi.application.restart(idApp);
5380
+ yield jApi.application.studioRestart(idApp);
5264
5381
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Restarted' }));
5265
5382
  }
5266
5383
  catch (_) {
@@ -5286,7 +5403,7 @@ const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idAp
5286
5403
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
5287
5404
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5288
5405
  try {
5289
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5406
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5290
5407
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Cloned' }));
5291
5408
  return clonedStudioApp;
5292
5409
  }
@@ -5307,7 +5424,7 @@ const createInWorkStudioApp = toolkit.createAsyncThunk('studio/createInWorkStudi
5307
5424
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser, true);
5308
5425
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5309
5426
  try {
5310
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5427
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5311
5428
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_CreateInWork' }));
5312
5429
  return clonedStudioApp;
5313
5430
  }