jamespot-front-business 1.1.85 → 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 = {
@@ -3205,6 +3213,7 @@ const editorsSlice = toolkit.createSlice({
3205
3213
  state.editors = [...state.editors.filter((ed) => ed.uniqid !== uniqid)];
3206
3214
  },
3207
3215
  flushAllEditor: (state) => {
3216
+ window.dispatchEvent(new Event('WidgetEditorFlushAll'));
3208
3217
  state.editors.length = 0;
3209
3218
  },
3210
3219
  },
@@ -5059,7 +5068,7 @@ const fetchCurrentStudioApp = toolkit.createAsyncThunk('studio/fetchCurrentStudi
5059
5068
  const jApi = extra.jApi;
5060
5069
  const error = { error: 1, errorMsg: 'Error fetching application' };
5061
5070
  try {
5062
- const studioApplicationBase = (yield jApi.application.get(idApp, status)).result;
5071
+ const studioApplicationBase = (yield jApi.application.studioGet(idApp, status)).result;
5063
5072
  const studioApplication = serverAppsToStudioApps([studioApplicationBase], getState())[0];
5064
5073
  if (!studioApplication) {
5065
5074
  return rejectWithValue(error);
@@ -5079,7 +5088,7 @@ const saveCurrentStudioApp = toolkit.createAsyncThunk('studio/saveCurrentStudioA
5079
5088
  }
5080
5089
  const stringifiedApp = JSON.stringify(currentStudioApp);
5081
5090
  try {
5082
- yield jApi.application.save(currentStudioApp.idApp, stringifiedApp, 'saved');
5091
+ yield jApi.application.studioSave(currentStudioApp.idApp, stringifiedApp, 'saved');
5083
5092
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Edition_Saved' }));
5084
5093
  return;
5085
5094
  }
@@ -5097,7 +5106,7 @@ const installStudioApp = toolkit.createAsyncThunk('studio/installApp', ({ callba
5097
5106
  }
5098
5107
  const xml = appToXml(currentStudioApp);
5099
5108
  try {
5100
- yield jApi.application.install(xml);
5109
+ yield jApi.application.studioInstall(xml);
5101
5110
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Installed' }));
5102
5111
  if (callback)
5103
5112
  callback();
@@ -5272,10 +5281,10 @@ const initialState = {
5272
5281
  const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (intl, { extra, rejectWithValue, dispatch, getState }) => __awaiter(void 0, void 0, void 0, function* () {
5273
5282
  const jApi = extra.jApi;
5274
5283
  try {
5275
- const { result } = yield jApi.application.list();
5284
+ const { result } = yield jApi.application.studioList();
5276
5285
  const taxonomies = yield jApi.taxonomy.list();
5277
5286
  const appsPromisesResult = yield Promise.allSettled(result.map((app) => __awaiter(void 0, void 0, void 0, function* () {
5278
- const coreApp = (yield jApi.application.get(app.idApp, app.status)).result;
5287
+ const coreApp = (yield jApi.application.studioGet(app.idApp, app.status)).result;
5279
5288
  const articlesCount = (yield jApi.article.count(app.idApp)).result;
5280
5289
  return Object.assign(Object.assign({}, coreApp), { articlesCount });
5281
5290
  })));
@@ -5330,7 +5339,7 @@ const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', ({ appNa
5330
5339
  const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
5331
5340
  const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({ appName }, (author && { author })));
5332
5341
  try {
5333
- yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
5342
+ yield jApi.application.studioSave(newAppId, JSON.stringify(newStudioApp), 'saved');
5334
5343
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Created' }));
5335
5344
  dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
5336
5345
  if (callback)
@@ -5345,7 +5354,7 @@ const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', ({ appNa
5345
5354
  const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5346
5355
  const jApi = extra.jApi;
5347
5356
  try {
5348
- const deleteRes = yield jApi.application.delete(idApp, status);
5357
+ const deleteRes = yield jApi.application.studioDelete(idApp, status);
5349
5358
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Deleted' }));
5350
5359
  return deleteRes;
5351
5360
  }
@@ -5357,7 +5366,7 @@ const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, s
5357
5366
  const suspendStudioApp = toolkit.createAsyncThunk('studio/suspendStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5358
5367
  const jApi = extra.jApi;
5359
5368
  try {
5360
- yield jApi.application.suspend(idApp);
5369
+ yield jApi.application.studioSuspend(idApp);
5361
5370
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Suspended' }));
5362
5371
  }
5363
5372
  catch (_) {
@@ -5368,7 +5377,7 @@ const suspendStudioApp = toolkit.createAsyncThunk('studio/suspendStudioApp', ({
5368
5377
  const restartStudioApp = toolkit.createAsyncThunk('studio/restartStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5369
5378
  const jApi = extra.jApi;
5370
5379
  try {
5371
- yield jApi.application.restart(idApp);
5380
+ yield jApi.application.studioRestart(idApp);
5372
5381
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Restarted' }));
5373
5382
  }
5374
5383
  catch (_) {
@@ -5394,7 +5403,7 @@ const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idAp
5394
5403
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
5395
5404
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5396
5405
  try {
5397
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5406
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5398
5407
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Cloned' }));
5399
5408
  return clonedStudioApp;
5400
5409
  }
@@ -5415,7 +5424,7 @@ const createInWorkStudioApp = toolkit.createAsyncThunk('studio/createInWorkStudi
5415
5424
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser, true);
5416
5425
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5417
5426
  try {
5418
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5427
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5419
5428
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_CreateInWork' }));
5420
5429
  return clonedStudioApp;
5421
5430
  }