jamespot-front-business 1.1.43 → 1.1.45

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
@@ -51,7 +51,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
51
51
  const toastAdapter = toolkit.createEntityAdapter({
52
52
  selectId: (toast) => toast.id,
53
53
  });
54
- const slice$3 = toolkit.createSlice({
54
+ const slice$4 = toolkit.createSlice({
55
55
  name: 'toasts',
56
56
  initialState: toastAdapter.getInitialState(),
57
57
  reducers: {
@@ -65,9 +65,9 @@ const addMessage = (_a, type, timeout) => {
65
65
  if (type === void 0) { type = 'success'; }
66
66
  if (timeout === void 0) { timeout = 3000; }
67
67
  return (dispatch) => {
68
- dispatch(slice$3.actions.addOne(Object.assign(Object.assign({ id }, toast), { timeout, type })));
68
+ dispatch(slice$4.actions.addOne(Object.assign(Object.assign({ id }, toast), { timeout, type })));
69
69
  setTimeout(() => {
70
- dispatch(slice$3.actions.removeOne(id));
70
+ dispatch(slice$4.actions.removeOne(id));
71
71
  }, timeout);
72
72
  return id;
73
73
  };
@@ -80,8 +80,8 @@ const actions = {
80
80
  };
81
81
  const selectors$2 = toastAdapter.getSelectors((state) => state.toasts);
82
82
  const Toast = {
83
- slice: slice$3,
84
- actions: Object.assign(Object.assign({}, actions), slice$3.actions),
83
+ slice: slice$4,
84
+ actions: Object.assign(Object.assign({}, actions), slice$4.actions),
85
85
  selectors: selectors$2,
86
86
  };
87
87
 
@@ -146,11 +146,13 @@ const animationsSlice = toolkit.createSlice({
146
146
  });
147
147
  builder.addCase(toggleAnimationIsActive.pending, (state) => {
148
148
  state.isToggleLoading = true;
149
+ state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
149
150
  });
150
151
  builder.addCase(toggleAnimationIsActive.fulfilled, (state) => {
151
152
  state.isToggleLoading = false;
152
153
  });
153
154
  builder.addCase(toggleAnimationIsActive.rejected, (state) => {
155
+ state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
154
156
  state.isToggleLoading = false;
155
157
  });
156
158
  },
@@ -212,16 +214,22 @@ const selectAnimationConfigurationApp = (state) => state.animations.animationCon
212
214
  const animationsReducer = animationsSlice.reducer;
213
215
  const Animations = {
214
216
  slice: animationsSlice,
215
- actions: { saveCurrentAnimation, fetchCurrentAnimation, deleteCurrentAnimation, toggleAnimationIsActive, fetchCurrentAnimationApp },
217
+ actions: {
218
+ saveCurrentAnimation,
219
+ fetchCurrentAnimation,
220
+ deleteCurrentAnimation,
221
+ toggleAnimationIsActive,
222
+ fetchCurrentAnimationApp,
223
+ },
216
224
  selectors: { selectCurrentAnimation, isActiveAnimation, isToggleLoading, selectAnimationConfigurationApp },
217
- getAnimationsRTHandlers
225
+ getAnimationsRTHandlers,
218
226
  };
219
227
 
220
228
  const adapter$1 = toolkit.createEntityAdapter({
221
229
  selectId: (app) => app.name,
222
230
  sortComparer: (a, b) => a.label.localeCompare(b.label),
223
231
  });
224
- const slice$2 = toolkit.createSlice({
232
+ const slice$3 = toolkit.createSlice({
225
233
  name: 'applications',
226
234
  initialState: adapter$1.getInitialState(),
227
235
  reducers: {
@@ -232,8 +240,8 @@ const slice$2 = toolkit.createSlice({
232
240
  });
233
241
  const selectors$1 = adapter$1.getSelectors((state) => state.entities.applications);
234
242
  const Application = {
235
- slice: slice$2,
236
- actions: Object.assign({}, slice$2.actions),
243
+ slice: slice$3,
244
+ actions: Object.assign({}, slice$3.actions),
237
245
  selectors: selectors$1,
238
246
  };
239
247
 
@@ -904,6 +912,32 @@ const Faq = {
904
912
  },
905
913
  };
906
914
 
915
+ const buildDrivesArrayFromObject = (drives) => {
916
+ if (!drives)
917
+ return [];
918
+ return Object.keys(drives).filter((k) => drives[k]);
919
+ };
920
+
921
+ const slice$2 = toolkit.createSlice({
922
+ name: 'hooks',
923
+ initialState: {},
924
+ reducers: {
925
+ initHooks: (_, { payload }) => {
926
+ return payload;
927
+ },
928
+ },
929
+ });
930
+ const selectHooks = (state) => state.hooks;
931
+ const selectHook = (state, hook) => {
932
+ return state.hooks[hook];
933
+ };
934
+ const Hook = {
935
+ slice: slice$2,
936
+ actions: slice$2.actions,
937
+ selectors: { selectHooks, selectHook },
938
+ utils: { buildDrivesArrayFromObject },
939
+ };
940
+
907
941
  const extractJlandUrlBaseFromMap = (map) => {
908
942
  const mapUrl = map.urlToJland;
909
943
  if (!mapUrl) {
@@ -2146,7 +2180,7 @@ const STUDIO_VIEW = {
2146
2180
  SOLR: '1',
2147
2181
  NOT_SOLR: '0',
2148
2182
  };
2149
- const viewsList = ['create', 'popup', 'edit', 'list', 'filter', 'view'];
2183
+ const viewsList = ['create', 'popup', 'edit', 'filter', 'list', 'view'];
2150
2184
  exports.AppFormItemTypes = void 0;
2151
2185
  (function (AppFormItemTypes) {
2152
2186
  AppFormItemTypes["IMAGE"] = "IMAGE";
@@ -3266,7 +3300,6 @@ function createNewStudioApp$1({ author, appName }) {
3266
3300
  }
3267
3301
 
3268
3302
  const initialState = {
3269
- studioAppsList: [],
3270
3303
  loadingStudioAppsList: 'idle',
3271
3304
  deleteStudioAppStatus: 'idle',
3272
3305
  suspendStudioAppStatus: 'idle',
@@ -3342,12 +3375,12 @@ const restartStudioApp = toolkit.createAsyncThunk('studio/restartStudioApp', ({
3342
3375
  }
3343
3376
  }));
3344
3377
  const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idApp }, { extra, getState, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
3345
- var _b;
3378
+ var _b, _c;
3346
3379
  const jApi = extra.jApi;
3347
- const existingStudioApp = getState().studio.studioAppsList.studioAppsList.find((app) => app.idApp === idApp);
3380
+ const existingStudioApp = (_b = getState().studio.studioAppsList.studioAppsList) === null || _b === void 0 ? void 0 : _b.find((app) => app.idApp === idApp);
3348
3381
  if (!existingStudioApp)
3349
3382
  return rejectWithValue({ error: 1, errorMsg: 'Error cloning application' });
3350
- const currentUser = (_b = getState().userCurrent) === null || _b === void 0 ? void 0 : _b.uri;
3383
+ const currentUser = (_c = getState().userCurrent) === null || _c === void 0 ? void 0 : _c.uri;
3351
3384
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
3352
3385
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
3353
3386
  try {
@@ -3389,10 +3422,11 @@ const StudioAppsListSlice = toolkit.createSlice({
3389
3422
  state.deleteStudioAppStatus = 'pending';
3390
3423
  })
3391
3424
  .addCase(deleteStudioApp.fulfilled, (state, action) => {
3425
+ var _a, _b;
3392
3426
  if (state.deleteStudioAppStatus === 'pending') {
3393
3427
  state.deleteStudioAppStatus = 'idle';
3394
3428
  }
3395
- state.studioAppsList = state.studioAppsList.reduce((acc, app) => {
3429
+ state.studioAppsList = (_b = (_a = state.studioAppsList) === null || _a === void 0 ? void 0 : _a.reduce((acc, app) => {
3396
3430
  const { idApp } = action.meta.arg;
3397
3431
  let { status } = action.meta.arg;
3398
3432
  if (status === APP_STATUS_TYPE.INSTALLED)
@@ -3405,7 +3439,7 @@ const StudioAppsListSlice = toolkit.createSlice({
3405
3439
  delete app.inWorkVersion;
3406
3440
  }
3407
3441
  return [...acc, app];
3408
- }, []);
3442
+ }, [])) !== null && _b !== void 0 ? _b : [];
3409
3443
  })
3410
3444
  .addCase(deleteStudioApp.rejected, (state) => {
3411
3445
  if (state.deleteStudioAppStatus === 'pending')
@@ -3416,17 +3450,18 @@ const StudioAppsListSlice = toolkit.createSlice({
3416
3450
  state.suspendStudioAppStatus = 'pending';
3417
3451
  })
3418
3452
  .addCase(suspendStudioApp.fulfilled, (state, action) => {
3453
+ var _a, _b;
3419
3454
  if (state.suspendStudioAppStatus === 'pending') {
3420
3455
  state.suspendStudioAppStatus = 'idle';
3421
3456
  }
3422
- state.studioAppsList = state.studioAppsList.map((app) => {
3457
+ state.studioAppsList = (_b = (_a = state.studioAppsList) === null || _a === void 0 ? void 0 : _a.map((app) => {
3423
3458
  const { idApp } = action.meta.arg;
3424
3459
  if (app.idApp === idApp) {
3425
3460
  app.status = APP_STATUS_TYPE.SUSPENDED;
3426
3461
  return app;
3427
3462
  }
3428
3463
  return app;
3429
- });
3464
+ })) !== null && _b !== void 0 ? _b : [];
3430
3465
  })
3431
3466
  .addCase(suspendStudioApp.rejected, (state) => {
3432
3467
  if (state.suspendStudioAppStatus === 'pending')
@@ -3437,17 +3472,18 @@ const StudioAppsListSlice = toolkit.createSlice({
3437
3472
  state.restartStudioAppStatus = 'pending';
3438
3473
  })
3439
3474
  .addCase(restartStudioApp.fulfilled, (state, action) => {
3475
+ var _a, _b;
3440
3476
  if (state.restartStudioAppStatus === 'pending') {
3441
3477
  state.restartStudioAppStatus = 'idle';
3442
3478
  }
3443
- state.studioAppsList = state.studioAppsList.map((app) => {
3479
+ state.studioAppsList = (_b = (_a = state.studioAppsList) === null || _a === void 0 ? void 0 : _a.map((app) => {
3444
3480
  const { idApp } = action.meta.arg;
3445
3481
  if (app.idApp === idApp) {
3446
3482
  app.status = APP_STATUS_TYPE.INSTALLED;
3447
3483
  return app;
3448
3484
  }
3449
3485
  return app;
3450
- });
3486
+ })) !== null && _b !== void 0 ? _b : [];
3451
3487
  })
3452
3488
  .addCase(restartStudioApp.rejected, (state) => {
3453
3489
  if (state.restartStudioAppStatus === 'pending')
@@ -3458,10 +3494,11 @@ const StudioAppsListSlice = toolkit.createSlice({
3458
3494
  state.cloneStudioAppStatus = 'pending';
3459
3495
  })
3460
3496
  .addCase(cloneStudioApp.fulfilled, (state, action) => {
3497
+ var _a;
3461
3498
  if (state.cloneStudioAppStatus === 'pending') {
3462
3499
  state.cloneStudioAppStatus = 'idle';
3463
3500
  }
3464
- state.studioAppsList = [...state.studioAppsList, action.payload];
3501
+ state.studioAppsList = [...((_a = state.studioAppsList) !== null && _a !== void 0 ? _a : []), action.payload];
3465
3502
  })
3466
3503
  .addCase(cloneStudioApp.rejected, (state) => {
3467
3504
  if (state.cloneStudioAppStatus === 'pending')
@@ -3472,10 +3509,11 @@ const StudioAppsListSlice = toolkit.createSlice({
3472
3509
  state.createNewStudioAppStatus = 'pending';
3473
3510
  })
3474
3511
  .addCase(createNewStudioApp.fulfilled, (state, action) => {
3512
+ var _a;
3475
3513
  if (state.createNewStudioAppStatus === 'pending') {
3476
3514
  state.createNewStudioAppStatus = 'idle';
3477
3515
  }
3478
- state.studioAppsList = [...state.studioAppsList, action.payload];
3516
+ state.studioAppsList = [...((_a = state.studioAppsList) !== null && _a !== void 0 ? _a : []), action.payload];
3479
3517
  })
3480
3518
  .addCase(createNewStudioApp.rejected, (state) => {
3481
3519
  if (state.createNewStudioAppStatus === 'pending')
@@ -3531,6 +3569,7 @@ exports.AssetReservation = AssetReservation;
3531
3569
  exports.Bookmark = Bookmark;
3532
3570
  exports.Comment = Comment;
3533
3571
  exports.Faq = Faq;
3572
+ exports.Hook = Hook;
3534
3573
  exports.MODE_EDIT = MODE_EDIT;
3535
3574
  exports.MODE_VIEW = MODE_VIEW;
3536
3575
  exports.MapExtraFieldsWithView = MapExtraFieldsWithView;