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/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 = {
@@ -3197,6 +3205,7 @@ const editorsSlice = createSlice({
3197
3205
  state.editors = [...state.editors.filter((ed) => ed.uniqid !== uniqid)];
3198
3206
  },
3199
3207
  flushAllEditor: (state) => {
3208
+ window.dispatchEvent(new Event('WidgetEditorFlushAll'));
3200
3209
  state.editors.length = 0;
3201
3210
  },
3202
3211
  },
@@ -5051,7 +5060,7 @@ const fetchCurrentStudioApp = createAsyncThunk('studio/fetchCurrentStudioApp', (
5051
5060
  const jApi = extra.jApi;
5052
5061
  const error = { error: 1, errorMsg: 'Error fetching application' };
5053
5062
  try {
5054
- const studioApplicationBase = (yield jApi.application.get(idApp, status)).result;
5063
+ const studioApplicationBase = (yield jApi.application.studioGet(idApp, status)).result;
5055
5064
  const studioApplication = serverAppsToStudioApps([studioApplicationBase], getState())[0];
5056
5065
  if (!studioApplication) {
5057
5066
  return rejectWithValue(error);
@@ -5071,7 +5080,7 @@ const saveCurrentStudioApp = createAsyncThunk('studio/saveCurrentStudioApp', (_,
5071
5080
  }
5072
5081
  const stringifiedApp = JSON.stringify(currentStudioApp);
5073
5082
  try {
5074
- yield jApi.application.save(currentStudioApp.idApp, stringifiedApp, 'saved');
5083
+ yield jApi.application.studioSave(currentStudioApp.idApp, stringifiedApp, 'saved');
5075
5084
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Edition_Saved' }));
5076
5085
  return;
5077
5086
  }
@@ -5089,7 +5098,7 @@ const installStudioApp = createAsyncThunk('studio/installApp', ({ callback }, {
5089
5098
  }
5090
5099
  const xml = appToXml(currentStudioApp);
5091
5100
  try {
5092
- yield jApi.application.install(xml);
5101
+ yield jApi.application.studioInstall(xml);
5093
5102
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Installed' }));
5094
5103
  if (callback)
5095
5104
  callback();
@@ -5264,10 +5273,10 @@ const initialState = {
5264
5273
  const fetchStudioAppsList = createAsyncThunk('studio/appsList', (intl, { extra, rejectWithValue, dispatch, getState }) => __awaiter(void 0, void 0, void 0, function* () {
5265
5274
  const jApi = extra.jApi;
5266
5275
  try {
5267
- const { result } = yield jApi.application.list();
5276
+ const { result } = yield jApi.application.studioList();
5268
5277
  const taxonomies = yield jApi.taxonomy.list();
5269
5278
  const appsPromisesResult = yield Promise.allSettled(result.map((app) => __awaiter(void 0, void 0, void 0, function* () {
5270
- const coreApp = (yield jApi.application.get(app.idApp, app.status)).result;
5279
+ const coreApp = (yield jApi.application.studioGet(app.idApp, app.status)).result;
5271
5280
  const articlesCount = (yield jApi.article.count(app.idApp)).result;
5272
5281
  return Object.assign(Object.assign({}, coreApp), { articlesCount });
5273
5282
  })));
@@ -5322,7 +5331,7 @@ const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName, call
5322
5331
  const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
5323
5332
  const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({ appName }, (author && { author })));
5324
5333
  try {
5325
- yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
5334
+ yield jApi.application.studioSave(newAppId, JSON.stringify(newStudioApp), 'saved');
5326
5335
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Created' }));
5327
5336
  dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
5328
5337
  if (callback)
@@ -5337,7 +5346,7 @@ const createNewStudioApp = createAsyncThunk('studio/createApp', ({ appName, call
5337
5346
  const deleteStudioApp = createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5338
5347
  const jApi = extra.jApi;
5339
5348
  try {
5340
- const deleteRes = yield jApi.application.delete(idApp, status);
5349
+ const deleteRes = yield jApi.application.studioDelete(idApp, status);
5341
5350
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Deleted' }));
5342
5351
  return deleteRes;
5343
5352
  }
@@ -5349,7 +5358,7 @@ const deleteStudioApp = createAsyncThunk('studio/deleteApp', ({ idApp, status },
5349
5358
  const suspendStudioApp = createAsyncThunk('studio/suspendStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5350
5359
  const jApi = extra.jApi;
5351
5360
  try {
5352
- yield jApi.application.suspend(idApp);
5361
+ yield jApi.application.studioSuspend(idApp);
5353
5362
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Suspended' }));
5354
5363
  }
5355
5364
  catch (_) {
@@ -5360,7 +5369,7 @@ const suspendStudioApp = createAsyncThunk('studio/suspendStudioApp', ({ idApp },
5360
5369
  const restartStudioApp = createAsyncThunk('studio/restartStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
5361
5370
  const jApi = extra.jApi;
5362
5371
  try {
5363
- yield jApi.application.restart(idApp);
5372
+ yield jApi.application.studioRestart(idApp);
5364
5373
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Restarted' }));
5365
5374
  }
5366
5375
  catch (_) {
@@ -5386,7 +5395,7 @@ const cloneStudioApp = createAsyncThunk('studio/cloneStudioApp', ({ idApp, inWor
5386
5395
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
5387
5396
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5388
5397
  try {
5389
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5398
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5390
5399
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Cloned' }));
5391
5400
  return clonedStudioApp;
5392
5401
  }
@@ -5407,7 +5416,7 @@ const createInWorkStudioApp = createAsyncThunk('studio/createInWorkStudioApp', (
5407
5416
  const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser, true);
5408
5417
  const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
5409
5418
  try {
5410
- yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
5419
+ yield jApi.application.studioSave(newAppId, clonedStudioAppReady, 'saved');
5411
5420
  dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_CreateInWork' }));
5412
5421
  return clonedStudioApp;
5413
5422
  }