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/esm.js CHANGED
@@ -535,6 +535,9 @@ const adapter$2 = createEntityAdapter({
535
535
  selectId: (app) => app.name,
536
536
  sortComparer: (a, b) => a.label.localeCompare(b.label),
537
537
  });
538
+ const fetchList = createAsyncThunk('application/fetch', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
539
+ return yield extra.jApi.application.list();
540
+ }));
538
541
  const slice$4 = createSlice({
539
542
  name: 'applications',
540
543
  initialState: adapter$2.getInitialState(),
@@ -543,11 +546,16 @@ const slice$4 = createSlice({
543
546
  addMany: adapter$2.addMany,
544
547
  setAll: adapter$2.setAll,
545
548
  },
549
+ extraReducers: (builder) => {
550
+ builder.addCase(fetchList.fulfilled, (state, action) => {
551
+ adapter$2.setAll(state, action.payload.result);
552
+ });
553
+ },
546
554
  });
547
555
  const selectors$2 = adapter$2.getSelectors((state) => state.entities.applications);
548
556
  const Application = {
549
557
  slice: slice$4,
550
- actions: Object.assign({}, slice$4.actions),
558
+ actions: Object.assign({ fetchList }, slice$4.actions),
551
559
  selectors: selectors$2,
552
560
  };
553
561
 
@@ -2181,7 +2189,7 @@ const WedocApp = {
2181
2189
 
2182
2190
  const fetchRequest = createAsyncThunk('/fetchRequest', ({ uri, idUser }, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
2183
2191
  const jApi = extra.jApi;
2184
- return yield jApi.wedoc.getAccessRequest(uri, idUser);
2192
+ return yield jApi.object.getAccessRequest(uri, idUser);
2185
2193
  }));
2186
2194
 
2187
2195
  const initialState$7 = {
@@ -2457,6 +2465,7 @@ const widgetArticleAttachmentDefinition = {
2457
2465
  panel: {
2458
2466
  useWrapper: true,
2459
2467
  useEditor: true,
2468
+ useSelection: false,
2460
2469
  useWidgets: false,
2461
2470
  },
2462
2471
  };
@@ -2473,6 +2482,7 @@ const widgetArticleButtonDefinition = {
2473
2482
  panel: {
2474
2483
  useWrapper: false,
2475
2484
  useEditor: true,
2485
+ useSelection: false,
2476
2486
  useWidgets: false,
2477
2487
  },
2478
2488
  };
@@ -2500,6 +2510,7 @@ const widgetArticleGalleryDefinition = {
2500
2510
  panel: {
2501
2511
  useWrapper: false,
2502
2512
  useEditor: true,
2513
+ useSelection: false,
2503
2514
  useWidgets: false,
2504
2515
  },
2505
2516
  };
@@ -2518,6 +2529,7 @@ const widgetArticleImageDefinition = {
2518
2529
  panel: {
2519
2530
  useWrapper: false,
2520
2531
  useEditor: true,
2532
+ useSelection: false,
2521
2533
  useWidgets: false,
2522
2534
  },
2523
2535
  };
@@ -2532,6 +2544,7 @@ const widgetArticleSliderDefinition = {
2532
2544
  panel: {
2533
2545
  useWrapper: false,
2534
2546
  useEditor: true,
2547
+ useSelection: false,
2535
2548
  useWidgets: false,
2536
2549
  },
2537
2550
  };
@@ -2552,6 +2565,7 @@ const widgetArticleTextDefinition = {
2552
2565
  panel: {
2553
2566
  useWrapper: false,
2554
2567
  useEditor: true,
2568
+ useSelection: false,
2555
2569
  useWidgets: false,
2556
2570
  },
2557
2571
  };
@@ -2568,6 +2582,7 @@ const widgetArticleTitleDefinition = {
2568
2582
  panel: {
2569
2583
  useWrapper: false,
2570
2584
  useEditor: true,
2585
+ useSelection: false,
2571
2586
  useWidgets: false,
2572
2587
  },
2573
2588
  };
@@ -2586,6 +2601,7 @@ const widgetCheckListDefinition = {
2586
2601
  panel: {
2587
2602
  useWrapper: true,
2588
2603
  useEditor: true,
2604
+ useSelection: false,
2589
2605
  useWidgets: false,
2590
2606
  },
2591
2607
  };
@@ -2603,6 +2619,7 @@ const widgetDatasourceTableDefinition = {
2603
2619
  panel: {
2604
2620
  useWrapper: true,
2605
2621
  useEditor: true,
2622
+ useSelection: true,
2606
2623
  useWidgets: false,
2607
2624
  },
2608
2625
  };
@@ -2624,6 +2641,7 @@ const widgetExcelDatasourceTableDefinition = {
2624
2641
  panel: {
2625
2642
  useWrapper: true,
2626
2643
  useEditor: true,
2644
+ useSelection: true,
2627
2645
  useWidgets: false,
2628
2646
  },
2629
2647
  };
@@ -2645,6 +2663,7 @@ const widgetPresenceDefinition = {
2645
2663
  panel: {
2646
2664
  useWrapper: true,
2647
2665
  useEditor: true,
2666
+ useSelection: false,
2648
2667
  useWidgets: false,
2649
2668
  },
2650
2669
  };
@@ -2663,6 +2682,7 @@ const widgetQuickSurveyDefinition = {
2663
2682
  panel: {
2664
2683
  useWrapper: true,
2665
2684
  useEditor: true,
2685
+ useSelection: false,
2666
2686
  useWidgets: false,
2667
2687
  },
2668
2688
  };
@@ -2676,6 +2696,66 @@ const widgetQuickSurveyContent = {
2676
2696
  isNotDisabled: false,
2677
2697
  };
2678
2698
 
2699
+ const widgetCalendarCalDavDefinition = {
2700
+ label: 'WIDGET_Calendar_CalDav',
2701
+ description: 'WIDGET_Calendar_CalDav_Text',
2702
+ name: WidgetsName.CalendarCalDav,
2703
+ img: '/img/fast-intranet/widget-calendar-calDav.png',
2704
+ available: true,
2705
+ displayLevel: [1, 3],
2706
+ panel: {
2707
+ useWrapper: true,
2708
+ useEditor: true,
2709
+ useSelection: true,
2710
+ useWidgets: false,
2711
+ },
2712
+ };
2713
+ const widgetCalendarCalDavContent = {
2714
+ calEventsLimit: false,
2715
+ calEventsLimitValue: 10,
2716
+ calEventsPromptStatus: 'shared',
2717
+ };
2718
+
2719
+ const widgetContactCardDavDefinition = {
2720
+ label: 'WIDGET_Contact_CardDav',
2721
+ description: 'WIDGET_Contact_CardDav_Text',
2722
+ name: WidgetsName.ContactCardDav,
2723
+ img: '/img/fast-intranet/widget-contact-cardDav.png',
2724
+ available: true,
2725
+ displayLevel: [1, 3],
2726
+ panel: {
2727
+ useWrapper: true,
2728
+ useEditor: true,
2729
+ useSelection: true,
2730
+ useWidgets: false,
2731
+ },
2732
+ };
2733
+ const widgetContactCardDavContent = {
2734
+ contactLimit: false,
2735
+ contactLimitValue: 10,
2736
+ contactPromptStatus: 'shared',
2737
+ };
2738
+
2739
+ const widgetEmailsImapDefinition = {
2740
+ label: 'WIDGET_Email_IMAP',
2741
+ description: 'WIDGET_Email_IMAP_Text',
2742
+ name: WidgetsName.EmailsImap,
2743
+ img: '/img/fast-intranet/widget-emails-imap.png',
2744
+ available: true,
2745
+ displayLevel: [1, 2, 3],
2746
+ panel: {
2747
+ useWrapper: true,
2748
+ useEditor: true,
2749
+ useSelection: true,
2750
+ useWidgets: false,
2751
+ },
2752
+ };
2753
+ const widgetEmailsImapContent = {
2754
+ emailsLimit: false,
2755
+ emailsLimitValue: 10,
2756
+ emailsPromptStatus: 'shared',
2757
+ };
2758
+
2679
2759
  function widgetDefinition(name) {
2680
2760
  switch (name) {
2681
2761
  default:
@@ -2704,12 +2784,19 @@ function widgetDefinition(name) {
2704
2784
  return widgetCheckListDefinition;
2705
2785
  case 'widget-quick-survey':
2706
2786
  return widgetQuickSurveyDefinition;
2787
+ case 'widget-calendar-calDav':
2788
+ return widgetCalendarCalDavDefinition;
2789
+ case 'widget-contact-cardDav':
2790
+ return widgetContactCardDavDefinition;
2791
+ case 'widget-emails-imap':
2792
+ return widgetEmailsImapDefinition;
2707
2793
  }
2708
2794
  }
2709
2795
 
2710
2796
  function widgetFactory(name) {
2711
2797
  return {
2712
2798
  title: '',
2799
+ level: 3,
2713
2800
  widget: widget(name),
2714
2801
  };
2715
2802
  }
@@ -2747,6 +2834,12 @@ function content(name) {
2747
2834
  return Object.assign({}, widgetCheckListContent);
2748
2835
  case 'widget-quick-survey':
2749
2836
  return Object.assign({}, widgetQuickSurveyContent);
2837
+ case 'widget-calendar-calDav':
2838
+ return Object.assign({}, widgetCalendarCalDavContent);
2839
+ case 'widget-contact-cardDav':
2840
+ return Object.assign({}, widgetContactCardDavContent);
2841
+ case 'widget-emails-imap':
2842
+ return Object.assign({}, widgetEmailsImapContent);
2750
2843
  }
2751
2844
  }
2752
2845
 
@@ -2762,6 +2855,9 @@ const initialState$3 = {
2762
2855
  widgetObject: {},
2763
2856
  widgetObjectRights: {},
2764
2857
  widgetAuthor: {},
2858
+ widgetWrapperStyle: {},
2859
+ widgetTitleStyle: {},
2860
+ widgetChipCount: {},
2765
2861
  flushedWidgets: [],
2766
2862
  rtObjectStack: [],
2767
2863
  };
@@ -2802,6 +2898,18 @@ const widgetsSlice = createSlice({
2802
2898
  const { uniqid, author } = action.payload;
2803
2899
  state.widgetAuthor[uniqid] = author;
2804
2900
  },
2901
+ setWidgetChipCount: (state, action) => {
2902
+ const { uniqid, count } = action.payload;
2903
+ state.widgetChipCount[uniqid] = count;
2904
+ },
2905
+ setWidgetWrapperStyle: (state, action) => {
2906
+ const { uniqid, styles } = action.payload;
2907
+ state.widgetWrapperStyle[uniqid] = Object.assign(Object.assign({}, state.widgetWrapperStyle[uniqid]), styles);
2908
+ },
2909
+ setWidgetTitleStyle: (state, action) => {
2910
+ const { uniqid, styles } = action.payload;
2911
+ state.widgetTitleStyle[uniqid] = Object.assign(Object.assign({}, state.widgetTitleStyle[uniqid]), styles);
2912
+ },
2805
2913
  updateWidget: (state, action) => {
2806
2914
  const { uniqid } = action.payload;
2807
2915
  const wrapper = Object.assign({}, state.ids[uniqid]);
@@ -2998,6 +3106,7 @@ const selectWidgets = (state) => state.widgets.ids;
2998
3106
  const selectFlushedWidgets = (state) => state.widgets.flushedWidgets;
2999
3107
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3000
3108
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3109
+ 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; };
3001
3110
  const selectWidgetObject = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObject[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3002
3111
  const selectWidgetObjectUri = (state, uniqid) => {
3003
3112
  const o = state.widgets.widgetObject[uniqid];
@@ -3008,6 +3117,9 @@ const selectWidgetObjectUri = (state, uniqid) => {
3008
3117
  };
3009
3118
  const selectWidgetObjectRights = (state, uniqid) => { var _a; return (_a = state.widgets.widgetObjectRights[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3010
3119
  const selectWidgetAuthor = (state, uniqid) => { var _a; return (_a = state.widgets.widgetAuthor[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
3120
+ const selectWidgetChipCount = (state, uniqid) => { var _a; return (_a = state.widgets.widgetChipCount[uniqid]) !== null && _a !== void 0 ? _a : 0; };
3121
+ const selectWidgetWrapperStyle = (state, uniqid) => { var _a; return (_a = state.widgets.widgetWrapperStyle[uniqid]) !== null && _a !== void 0 ? _a : {}; };
3122
+ const selectWidgetTitleStyle = (state, uniqid) => { var _a; return (_a = state.widgets.widgetTitleStyle[uniqid]) !== null && _a !== void 0 ? _a : {}; };
3011
3123
  const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
3012
3124
  const selectAllWidgetRTObject = (state, uniqid) => state.widgets.rtObjectStack.filter((el) => el.uniqid === uniqid);
3013
3125
  const updateWidgetContent = (uniqid, content, override) => Widget.slice.actions.updateWidget({ uniqid, content, override: override !== null && override !== void 0 ? override : false });
@@ -3033,6 +3145,10 @@ const Widget = {
3033
3145
  selectWidgetObjectRights,
3034
3146
  selectAllWidgetRTObject,
3035
3147
  selectFlushedWidgets,
3148
+ selectWidgetLevel,
3149
+ selectWidgetWrapperStyle,
3150
+ selectWidgetTitleStyle,
3151
+ selectWidgetChipCount,
3036
3152
  },
3037
3153
  };
3038
3154
 
@@ -3089,6 +3205,7 @@ const editorsSlice = createSlice({
3089
3205
  state.editors = [...state.editors.filter((ed) => ed.uniqid !== uniqid)];
3090
3206
  },
3091
3207
  flushAllEditor: (state) => {
3208
+ window.dispatchEvent(new Event('WidgetEditorFlushAll'));
3092
3209
  state.editors.length = 0;
3093
3210
  },
3094
3211
  },
@@ -4943,7 +5060,7 @@ const fetchCurrentStudioApp = createAsyncThunk('studio/fetchCurrentStudioApp', (
4943
5060
  const jApi = extra.jApi;
4944
5061
  const error = { error: 1, errorMsg: 'Error fetching application' };
4945
5062
  try {
4946
- const studioApplicationBase = (yield jApi.application.get(idApp, status)).result;
5063
+ const studioApplicationBase = (yield jApi.application.studioGet(idApp, status)).result;
4947
5064
  const studioApplication = serverAppsToStudioApps([studioApplicationBase], getState())[0];
4948
5065
  if (!studioApplication) {
4949
5066
  return rejectWithValue(error);
@@ -4963,7 +5080,7 @@ const saveCurrentStudioApp = createAsyncThunk('studio/saveCurrentStudioApp', (_,
4963
5080
  }
4964
5081
  const stringifiedApp = JSON.stringify(currentStudioApp);
4965
5082
  try {
4966
- yield jApi.application.save(currentStudioApp.idApp, stringifiedApp, 'saved');
5083
+ yield jApi.application.studioSave(currentStudioApp.idApp, stringifiedApp, 'saved');
4967
5084
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Edition_Saved' }));
4968
5085
  return;
4969
5086
  }
@@ -4981,7 +5098,7 @@ const installStudioApp = createAsyncThunk('studio/installApp', ({ callback }, {
4981
5098
  }
4982
5099
  const xml = appToXml(currentStudioApp);
4983
5100
  try {
4984
- yield jApi.application.install(xml);
5101
+ yield jApi.application.studioInstall(xml);
4985
5102
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Installed' }));
4986
5103
  if (callback)
4987
5104
  callback();
@@ -5156,10 +5273,10 @@ const initialState = {
5156
5273
  const fetchStudioAppsList = createAsyncThunk('studio/appsList', (intl, { extra, rejectWithValue, dispatch, getState }) => __awaiter(void 0, void 0, void 0, function* () {
5157
5274
  const jApi = extra.jApi;
5158
5275
  try {
5159
- const { result } = yield jApi.application.list();
5276
+ const { result } = yield jApi.application.studioList();
5160
5277
  const taxonomies = yield jApi.taxonomy.list();
5161
5278
  const appsPromisesResult = yield Promise.allSettled(result.map((app) => __awaiter(void 0, void 0, void 0, function* () {
5162
- const coreApp = (yield jApi.application.get(app.idApp, app.status)).result;
5279
+ const coreApp = (yield jApi.application.studioGet(app.idApp, app.status)).result;
5163
5280
  const articlesCount = (yield jApi.article.count(app.idApp)).result;
5164
5281
  return Object.assign(Object.assign({}, coreApp), { articlesCount });
5165
5282
  })));
@@ -5214,7 +5331,7 @@ const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName, call
5214
5331
  const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
5215
5332
  const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({ appName }, (author && { author })));
5216
5333
  try {
5217
- yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
5334
+ yield jApi.application.studioSave(newAppId, JSON.stringify(newStudioApp), 'saved');
5218
5335
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Created' }));
5219
5336
  dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
5220
5337
  if (callback)
@@ -5229,7 +5346,7 @@ const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName, call
5229
5346
  const deleteStudioApp = createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5230
5347
  const jApi = extra.jApi;
5231
5348
  try {
5232
- const deleteRes = yield jApi.application.delete(idApp, status);
5349
+ const deleteRes = yield jApi.application.studioDelete(idApp, status);
5233
5350
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Deleted' }));
5234
5351
  return deleteRes;
5235
5352
  }
@@ -5241,7 +5358,7 @@ const deleteStudioApp = createAsyncThunk('studio/deleteApp', ({ idApp, status },
5241
5358
  const suspendStudioApp = createAsyncThunk('studio/suspendStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5242
5359
  const jApi = extra.jApi;
5243
5360
  try {
5244
- yield jApi.application.suspend(idApp);
5361
+ yield jApi.application.studioSuspend(idApp);
5245
5362
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Suspended' }));
5246
5363
  }
5247
5364
  catch (_) {
@@ -5252,7 +5369,7 @@ const suspendStudioApp = createAsyncThunk('studio/suspendStudioApp', ({ idApp },
5252
5369
  const restartStudioApp = createAsyncThunk('studio/restartStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5253
5370
  const jApi = extra.jApi;
5254
5371
  try {
5255
- yield jApi.application.restart(idApp);
5372
+ yield jApi.application.studioRestart(idApp);
5256
5373
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Restarted' }));
5257
5374
  }
5258
5375
  catch (_) {
@@ -5278,7 +5395,7 @@ const cloneStudioApp = createAsyncThunk('studio/cloneStudioApp', ({ idApp, inWor
5278
5395
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
5279
5396
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5280
5397
  try {
5281
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5398
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5282
5399
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Cloned' }));
5283
5400
  return clonedStudioApp;
5284
5401
  }
@@ -5299,7 +5416,7 @@ const createInWorkStudioApp = createAsyncThunk('studio/createInWorkStudioApp', (
5299
5416
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser, true);
5300
5417
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5301
5418
  try {
5302
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5419
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5303
5420
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_CreateInWork' }));
5304
5421
  return clonedStudioApp;
5305
5422
  }