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/esm.js CHANGED
@@ -43,7 +43,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
43
43
  const toastAdapter = createEntityAdapter({
44
44
  selectId: (toast) => toast.id,
45
45
  });
46
- const slice$3 = createSlice({
46
+ const slice$4 = createSlice({
47
47
  name: 'toasts',
48
48
  initialState: toastAdapter.getInitialState(),
49
49
  reducers: {
@@ -57,9 +57,9 @@ const addMessage = (_a, type, timeout) => {
57
57
  if (type === void 0) { type = 'success'; }
58
58
  if (timeout === void 0) { timeout = 3000; }
59
59
  return (dispatch) => {
60
- dispatch(slice$3.actions.addOne(Object.assign(Object.assign({ id }, toast), { timeout, type })));
60
+ dispatch(slice$4.actions.addOne(Object.assign(Object.assign({ id }, toast), { timeout, type })));
61
61
  setTimeout(() => {
62
- dispatch(slice$3.actions.removeOne(id));
62
+ dispatch(slice$4.actions.removeOne(id));
63
63
  }, timeout);
64
64
  return id;
65
65
  };
@@ -72,8 +72,8 @@ const actions = {
72
72
  };
73
73
  const selectors$2 = toastAdapter.getSelectors((state) => state.toasts);
74
74
  const Toast = {
75
- slice: slice$3,
76
- actions: Object.assign(Object.assign({}, actions), slice$3.actions),
75
+ slice: slice$4,
76
+ actions: Object.assign(Object.assign({}, actions), slice$4.actions),
77
77
  selectors: selectors$2,
78
78
  };
79
79
 
@@ -138,11 +138,13 @@ const animationsSlice = createSlice({
138
138
  });
139
139
  builder.addCase(toggleAnimationIsActive.pending, (state) => {
140
140
  state.isToggleLoading = true;
141
+ state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
141
142
  });
142
143
  builder.addCase(toggleAnimationIsActive.fulfilled, (state) => {
143
144
  state.isToggleLoading = false;
144
145
  });
145
146
  builder.addCase(toggleAnimationIsActive.rejected, (state) => {
147
+ state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
146
148
  state.isToggleLoading = false;
147
149
  });
148
150
  },
@@ -204,16 +206,22 @@ const selectAnimationConfigurationApp = (state) => state.animations.animationCon
204
206
  const animationsReducer = animationsSlice.reducer;
205
207
  const Animations = {
206
208
  slice: animationsSlice,
207
- actions: { saveCurrentAnimation, fetchCurrentAnimation, deleteCurrentAnimation, toggleAnimationIsActive, fetchCurrentAnimationApp },
209
+ actions: {
210
+ saveCurrentAnimation,
211
+ fetchCurrentAnimation,
212
+ deleteCurrentAnimation,
213
+ toggleAnimationIsActive,
214
+ fetchCurrentAnimationApp,
215
+ },
208
216
  selectors: { selectCurrentAnimation, isActiveAnimation, isToggleLoading, selectAnimationConfigurationApp },
209
- getAnimationsRTHandlers
217
+ getAnimationsRTHandlers,
210
218
  };
211
219
 
212
220
  const adapter$1 = createEntityAdapter({
213
221
  selectId: (app) => app.name,
214
222
  sortComparer: (a, b) => a.label.localeCompare(b.label),
215
223
  });
216
- const slice$2 = createSlice({
224
+ const slice$3 = createSlice({
217
225
  name: 'applications',
218
226
  initialState: adapter$1.getInitialState(),
219
227
  reducers: {
@@ -224,8 +232,8 @@ const slice$2 = createSlice({
224
232
  });
225
233
  const selectors$1 = adapter$1.getSelectors((state) => state.entities.applications);
226
234
  const Application = {
227
- slice: slice$2,
228
- actions: Object.assign({}, slice$2.actions),
235
+ slice: slice$3,
236
+ actions: Object.assign({}, slice$3.actions),
229
237
  selectors: selectors$1,
230
238
  };
231
239
 
@@ -896,6 +904,32 @@ const Faq = {
896
904
  },
897
905
  };
898
906
 
907
+ const buildDrivesArrayFromObject = (drives) => {
908
+ if (!drives)
909
+ return [];
910
+ return Object.keys(drives).filter((k) => drives[k]);
911
+ };
912
+
913
+ const slice$2 = createSlice({
914
+ name: 'hooks',
915
+ initialState: {},
916
+ reducers: {
917
+ initHooks: (_, { payload }) => {
918
+ return payload;
919
+ },
920
+ },
921
+ });
922
+ const selectHooks = (state) => state.hooks;
923
+ const selectHook = (state, hook) => {
924
+ return state.hooks[hook];
925
+ };
926
+ const Hook = {
927
+ slice: slice$2,
928
+ actions: slice$2.actions,
929
+ selectors: { selectHooks, selectHook },
930
+ utils: { buildDrivesArrayFromObject },
931
+ };
932
+
899
933
  const extractJlandUrlBaseFromMap = (map) => {
900
934
  const mapUrl = map.urlToJland;
901
935
  if (!mapUrl) {
@@ -2138,7 +2172,7 @@ const STUDIO_VIEW = {
2138
2172
  SOLR: '1',
2139
2173
  NOT_SOLR: '0',
2140
2174
  };
2141
- const viewsList = ['create', 'popup', 'edit', 'list', 'filter', 'view'];
2175
+ const viewsList = ['create', 'popup', 'edit', 'filter', 'list', 'view'];
2142
2176
  var AppFormItemTypes;
2143
2177
  (function (AppFormItemTypes) {
2144
2178
  AppFormItemTypes["IMAGE"] = "IMAGE";
@@ -3258,7 +3292,6 @@ function createNewStudioApp$1({ author, appName }) {
3258
3292
  }
3259
3293
 
3260
3294
  const initialState = {
3261
- studioAppsList: [],
3262
3295
  loadingStudioAppsList: 'idle',
3263
3296
  deleteStudioAppStatus: 'idle',
3264
3297
  suspendStudioAppStatus: 'idle',
@@ -3334,12 +3367,12 @@ const restartStudioApp = createAsyncThunk('studio/restartStudioApp', ({ idApp },
3334
3367
  }
3335
3368
  }));
3336
3369
  const cloneStudioApp = createAsyncThunk('studio/cloneStudioApp', ({ idApp }, { extra, getState, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
3337
- var _b;
3370
+ var _b, _c;
3338
3371
  const jApi = extra.jApi;
3339
- const existingStudioApp = getState().studio.studioAppsList.studioAppsList.find((app) => app.idApp === idApp);
3372
+ const existingStudioApp = (_b = getState().studio.studioAppsList.studioAppsList) === null || _b === void 0 ? void 0 : _b.find((app) => app.idApp === idApp);
3340
3373
  if (!existingStudioApp)
3341
3374
  return rejectWithValue({ error: 1, errorMsg: 'Error cloning application' });
3342
- const currentUser = (_b = getState().userCurrent) === null || _b === void 0 ? void 0 : _b.uri;
3375
+ const currentUser = (_c = getState().userCurrent) === null || _c === void 0 ? void 0 : _c.uri;
3343
3376
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
3344
3377
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
3345
3378
  try {
@@ -3381,10 +3414,11 @@ const StudioAppsListSlice = createSlice({
3381
3414
  state.deleteStudioAppStatus = 'pending';
3382
3415
  })
3383
3416
  .addCase(deleteStudioApp.fulfilled, (state, action) => {
3417
+ var _a, _b;
3384
3418
  if (state.deleteStudioAppStatus === 'pending') {
3385
3419
  state.deleteStudioAppStatus = 'idle';
3386
3420
  }
3387
- state.studioAppsList = state.studioAppsList.reduce((acc, app) => {
3421
+ state.studioAppsList = (_b = (_a = state.studioAppsList) === null || _a === void 0 ? void 0 : _a.reduce((acc, app) => {
3388
3422
  const { idApp } = action.meta.arg;
3389
3423
  let { status } = action.meta.arg;
3390
3424
  if (status === APP_STATUS_TYPE.INSTALLED)
@@ -3397,7 +3431,7 @@ const StudioAppsListSlice = createSlice({
3397
3431
  delete app.inWorkVersion;
3398
3432
  }
3399
3433
  return [...acc, app];
3400
- }, []);
3434
+ }, [])) !== null && _b !== void 0 ? _b : [];
3401
3435
  })
3402
3436
  .addCase(deleteStudioApp.rejected, (state) => {
3403
3437
  if (state.deleteStudioAppStatus === 'pending')
@@ -3408,17 +3442,18 @@ const StudioAppsListSlice = createSlice({
3408
3442
  state.suspendStudioAppStatus = 'pending';
3409
3443
  })
3410
3444
  .addCase(suspendStudioApp.fulfilled, (state, action) => {
3445
+ var _a, _b;
3411
3446
  if (state.suspendStudioAppStatus === 'pending') {
3412
3447
  state.suspendStudioAppStatus = 'idle';
3413
3448
  }
3414
- state.studioAppsList = state.studioAppsList.map((app) => {
3449
+ state.studioAppsList = (_b = (_a = state.studioAppsList) === null || _a === void 0 ? void 0 : _a.map((app) => {
3415
3450
  const { idApp } = action.meta.arg;
3416
3451
  if (app.idApp === idApp) {
3417
3452
  app.status = APP_STATUS_TYPE.SUSPENDED;
3418
3453
  return app;
3419
3454
  }
3420
3455
  return app;
3421
- });
3456
+ })) !== null && _b !== void 0 ? _b : [];
3422
3457
  })
3423
3458
  .addCase(suspendStudioApp.rejected, (state) => {
3424
3459
  if (state.suspendStudioAppStatus === 'pending')
@@ -3429,17 +3464,18 @@ const StudioAppsListSlice = createSlice({
3429
3464
  state.restartStudioAppStatus = 'pending';
3430
3465
  })
3431
3466
  .addCase(restartStudioApp.fulfilled, (state, action) => {
3467
+ var _a, _b;
3432
3468
  if (state.restartStudioAppStatus === 'pending') {
3433
3469
  state.restartStudioAppStatus = 'idle';
3434
3470
  }
3435
- state.studioAppsList = state.studioAppsList.map((app) => {
3471
+ state.studioAppsList = (_b = (_a = state.studioAppsList) === null || _a === void 0 ? void 0 : _a.map((app) => {
3436
3472
  const { idApp } = action.meta.arg;
3437
3473
  if (app.idApp === idApp) {
3438
3474
  app.status = APP_STATUS_TYPE.INSTALLED;
3439
3475
  return app;
3440
3476
  }
3441
3477
  return app;
3442
- });
3478
+ })) !== null && _b !== void 0 ? _b : [];
3443
3479
  })
3444
3480
  .addCase(restartStudioApp.rejected, (state) => {
3445
3481
  if (state.restartStudioAppStatus === 'pending')
@@ -3450,10 +3486,11 @@ const StudioAppsListSlice = createSlice({
3450
3486
  state.cloneStudioAppStatus = 'pending';
3451
3487
  })
3452
3488
  .addCase(cloneStudioApp.fulfilled, (state, action) => {
3489
+ var _a;
3453
3490
  if (state.cloneStudioAppStatus === 'pending') {
3454
3491
  state.cloneStudioAppStatus = 'idle';
3455
3492
  }
3456
- state.studioAppsList = [...state.studioAppsList, action.payload];
3493
+ state.studioAppsList = [...((_a = state.studioAppsList) !== null && _a !== void 0 ? _a : []), action.payload];
3457
3494
  })
3458
3495
  .addCase(cloneStudioApp.rejected, (state) => {
3459
3496
  if (state.cloneStudioAppStatus === 'pending')
@@ -3464,10 +3501,11 @@ const StudioAppsListSlice = createSlice({
3464
3501
  state.createNewStudioAppStatus = 'pending';
3465
3502
  })
3466
3503
  .addCase(createNewStudioApp.fulfilled, (state, action) => {
3504
+ var _a;
3467
3505
  if (state.createNewStudioAppStatus === 'pending') {
3468
3506
  state.createNewStudioAppStatus = 'idle';
3469
3507
  }
3470
- state.studioAppsList = [...state.studioAppsList, action.payload];
3508
+ state.studioAppsList = [...((_a = state.studioAppsList) !== null && _a !== void 0 ? _a : []), action.payload];
3471
3509
  })
3472
3510
  .addCase(createNewStudioApp.rejected, (state) => {
3473
3511
  if (state.createNewStudioAppStatus === 'pending')
@@ -3507,5 +3545,5 @@ const studio = {
3507
3545
  },
3508
3546
  };
3509
3547
 
3510
- export { APP_STATUS_TYPE, AUDIENCE, Animations, AppColumnsDefaultTypes, AppFieldFormPropertyTypes, AppFormBannedFromViews$1 as AppFormBannedFromViews, AppFormFieldOnlyInView, AppFormFixedList$1 as AppFormFixedList, AppFormItemTypes, AppFormNoAsFieldList, AppFormNonPrimaryList, AppFormPrimaryList, AppFormUniqueList, Application, AssetReservation, Bookmark, Comment, ExtraAppFieldsItemViews, Faq, MODE_EDIT, MODE_VIEW, MapExtraFieldsWithView, Model, Network, Platform, STUDIO_VIEW, Share, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, animationsReducer, animationsSlice, deleteCurrentAnimation, fetchCurrentAnimation, fetchCurrentAnimationApp, jland, saveCurrentAnimation, slice, studio, toggleAnimationIsActive, updateWidgetContent, viewsList };
3548
+ export { APP_STATUS_TYPE, AUDIENCE, Animations, AppColumnsDefaultTypes, AppFieldFormPropertyTypes, AppFormBannedFromViews$1 as AppFormBannedFromViews, AppFormFieldOnlyInView, AppFormFixedList$1 as AppFormFixedList, AppFormItemTypes, AppFormNoAsFieldList, AppFormNonPrimaryList, AppFormPrimaryList, AppFormUniqueList, Application, AssetReservation, Bookmark, Comment, ExtraAppFieldsItemViews, Faq, Hook, MODE_EDIT, MODE_VIEW, MapExtraFieldsWithView, Model, Network, Platform, STUDIO_VIEW, Share, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, animationsReducer, animationsSlice, deleteCurrentAnimation, fetchCurrentAnimation, fetchCurrentAnimationApp, jland, saveCurrentAnimation, slice, studio, toggleAnimationIsActive, updateWidgetContent, viewsList };
3511
3549
  //# sourceMappingURL=esm.js.map