jamespot-front-business 1.1.45 → 1.1.46

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
@@ -117,7 +117,7 @@ const getAnimationsRTHandlers = function (dispatch) {
117
117
  ];
118
118
  };
119
119
 
120
- const initialState$k = {
120
+ const initialState$l = {
121
121
  animationConfiguration: null,
122
122
  isActiveForCurrentUser: false,
123
123
  isInitialized: false,
@@ -125,7 +125,7 @@ const initialState$k = {
125
125
  };
126
126
  const animationsSlice = createSlice({
127
127
  name: 'animations',
128
- initialState: initialState$k,
128
+ initialState: initialState$l,
129
129
  reducers: {},
130
130
  extraReducers: (builder) => {
131
131
  builder.addCase(fetchCurrentAnimation.fulfilled, (state, action) => {
@@ -237,7 +237,7 @@ const Application = {
237
237
  selectors: selectors$1,
238
238
  };
239
239
 
240
- const initialState$j = {
240
+ const initialState$k = {
241
241
  entities: [],
242
242
  loading: 'idle',
243
243
  nbResults: 0,
@@ -248,7 +248,7 @@ const fetchBookableAsset = createAsyncThunk('BookableAsset/fetchBookableAsset',
248
248
  }));
249
249
  const BookableAssetSlice = createSlice({
250
250
  name: 'bookableAsset',
251
- initialState: initialState$j,
251
+ initialState: initialState$k,
252
252
  reducers: {},
253
253
  extraReducers: (builder) => {
254
254
  builder
@@ -269,7 +269,7 @@ const BookableAssetSlice = createSlice({
269
269
  const fetchConfiguration = createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
270
270
  return yield extra.jApi.assetReservation.configuration();
271
271
  }));
272
- const initialState$i = {
272
+ const initialState$j = {
273
273
  description: '',
274
274
  right: {
275
275
  manage: false,
@@ -283,7 +283,7 @@ const initialState$i = {
283
283
  };
284
284
  const AssetReservationConfigurationSlice = createSlice({
285
285
  name: 'configuration',
286
- initialState: initialState$i,
286
+ initialState: initialState$j,
287
287
  reducers: {},
288
288
  extraReducers: (builder) => {
289
289
  builder
@@ -304,7 +304,7 @@ const initForm = {
304
304
  hourStart: '',
305
305
  hourEnd: '',
306
306
  };
307
- const initialState$h = {
307
+ const initialState$i = {
308
308
  entities: [],
309
309
  loading: 'idle',
310
310
  nbResults: 0,
@@ -316,7 +316,7 @@ const fetchReservation = createAsyncThunk('Reservation/fetchReservation', (viewM
316
316
  }));
317
317
  const ReservationSlice = createSlice({
318
318
  name: 'reservation',
319
- initialState: initialState$h,
319
+ initialState: initialState$i,
320
320
  reducers: {
321
321
  setForm: (state, action) => {
322
322
  state.form = action.payload;
@@ -372,7 +372,7 @@ const AssetReservation = {
372
372
  },
373
373
  };
374
374
 
375
- const initialState$g = {
375
+ const initialState$h = {
376
376
  loading: 'idle',
377
377
  comments: [],
378
378
  };
@@ -389,7 +389,7 @@ const fetchComments = createAsyncThunk('commentList/fetchCommentList', (params,
389
389
  }));
390
390
  const CommentListSlice = createSlice({
391
391
  name: 'commentList',
392
- initialState: initialState$g,
392
+ initialState: initialState$h,
393
393
  reducers: {
394
394
  discardComments: (state, action) => {
395
395
  state.comments = state.comments.filter((c) => c.idArticle !== action.payload.idArticle);
@@ -480,7 +480,7 @@ const Comment = {
480
480
  getCommentsLikeRTHandlers,
481
481
  };
482
482
 
483
- const initialState$f = {
483
+ const initialState$g = {
484
484
  bookmarks: [],
485
485
  loading: 'idle',
486
486
  status: undefined,
@@ -543,7 +543,7 @@ const deleteBookmark = createAsyncThunk('bookmarkList/deleteBookmark', (bookmark
543
543
  }));
544
544
  const BookmarkListSlice = createSlice({
545
545
  name: 'bookmarkList',
546
- initialState: initialState$f,
546
+ initialState: initialState$g,
547
547
  reducers: {
548
548
  resetAddBookmarkStatus: (state, action) => {
549
549
  if (state.add[action.payload]) {
@@ -706,7 +706,7 @@ const getBookmarkRTHandlers = function (dispatch) {
706
706
  ];
707
707
  };
708
708
 
709
- const initialState$e = {
709
+ const initialState$f = {
710
710
  bookmark: undefined,
711
711
  status: undefined,
712
712
  loading: 'idle',
@@ -728,7 +728,7 @@ const editBookmark = createAsyncThunk('bookmarkEdit/editBookmark', (bookmark, {
728
728
  }));
729
729
  const BookmarkEditSlice = createSlice({
730
730
  name: 'bookmarkEdit',
731
- initialState: initialState$e,
731
+ initialState: initialState$f,
732
732
  reducers: {
733
733
  setEditBookmark: (state, action) => {
734
734
  state.bookmark = Object.assign({}, action.payload);
@@ -781,7 +781,7 @@ const Bookmark = {
781
781
  getRTHandlers: getBookmarkRTHandlers,
782
782
  };
783
783
 
784
- const initialState$d = {
784
+ const initialState$e = {
785
785
  loading: 'idle',
786
786
  access: { createCategory: false },
787
787
  };
@@ -810,7 +810,7 @@ const fetchFaqConfig = createAsyncThunk('faqConfig/fetch', () => __awaiter(void
810
810
  }));
811
811
  const FaqConfigSlice = createSlice({
812
812
  name: 'config',
813
- initialState: initialState$d,
813
+ initialState: initialState$e,
814
814
  reducers: {},
815
815
  extraReducers: (builder) => {
816
816
  builder
@@ -845,7 +845,7 @@ const FaqConfigSlice = createSlice({
845
845
  },
846
846
  });
847
847
 
848
- const initialState$c = {
848
+ const initialState$d = {
849
849
  loading: 'idle',
850
850
  categories: null,
851
851
  };
@@ -857,7 +857,7 @@ const fetchFaqCategories = createAsyncThunk('faqCategories/fetch', () => __await
857
857
  }));
858
858
  const FaqCategoriesSlice = createSlice({
859
859
  name: 'categories',
860
- initialState: initialState$c,
860
+ initialState: initialState$d,
861
861
  reducers: {},
862
862
  extraReducers: (builder) => {
863
863
  builder
@@ -1165,7 +1165,7 @@ const initialMap = {
1165
1165
  illustration: '',
1166
1166
  assignLicense: false,
1167
1167
  };
1168
- const initialState$b = {
1168
+ const initialState$c = {
1169
1169
  map: Object.assign({}, initialMap),
1170
1170
  loading: 'idle',
1171
1171
  status: undefined,
@@ -1209,13 +1209,13 @@ const createMap = createAsyncThunk('mapCreate/create', ({ map, jlandUrlBase }, {
1209
1209
  }));
1210
1210
  const MapCreateSlice = createSlice({
1211
1211
  name: 'mapCreate',
1212
- initialState: initialState$b,
1212
+ initialState: initialState$c,
1213
1213
  reducers: {
1214
1214
  setMap: (state, action) => {
1215
1215
  state.map = action.payload;
1216
1216
  },
1217
1217
  resetCreateMapState: () => {
1218
- return initialState$b;
1218
+ return initialState$c;
1219
1219
  },
1220
1220
  },
1221
1221
  extraReducers: (builder) => {
@@ -1269,6 +1269,119 @@ const jland = {
1269
1269
  utils: { buildUrlToJland },
1270
1270
  };
1271
1271
 
1272
+ const MediaLibraryAppConst = {
1273
+ route: 'media-library',
1274
+ moduleName: 'MediaLibraryHook',
1275
+ typeMediaLibraryFolder: 'mediaLibraryFolder',
1276
+ typeMediaLibraryFile: 'mediaLibraryFile',
1277
+ };
1278
+ const FILES_PER_PAGE = 18;
1279
+
1280
+ const initialState$b = {
1281
+ loading: 'idle',
1282
+ page: 1,
1283
+ nbResults: 0,
1284
+ folders: [],
1285
+ unclassifiedFiles: { list: [], page: 0, totalPages: 0 },
1286
+ mediaLibraryAccess: false,
1287
+ };
1288
+ const mediaLibrarySlice = createSlice({
1289
+ name: 'mediaLibrary',
1290
+ initialState: initialState$b,
1291
+ reducers: {
1292
+ setPage(state, action) {
1293
+ return Object.assign(Object.assign({}, state), { page: action.payload });
1294
+ },
1295
+ setFolderList(state, action) {
1296
+ return Object.assign(Object.assign({}, state), { entities: [...action.payload] });
1297
+ },
1298
+ setFileUnclassifiedList(state, action) {
1299
+ return Object.assign(Object.assign({}, state), { entitiesUnclassified: Object.assign({}, action.payload) });
1300
+ },
1301
+ },
1302
+ extraReducers: (builder) => {
1303
+ builder
1304
+ .addCase(fetchMediaLibraryFolders.pending, (state) => {
1305
+ state.loading = 'pending';
1306
+ })
1307
+ .addCase(fetchMediaLibraryFolders.fulfilled, (state, action) => {
1308
+ state.loading = 'idle';
1309
+ state.folders = [...action.payload.result.data];
1310
+ state.nbResults = 0;
1311
+ })
1312
+ .addCase(fetchMediaLibraryFolders.rejected, (state) => {
1313
+ state.loading = 'idle';
1314
+ })
1315
+ .addCase(fetchMediaLibraryUnclassifiedFiles.pending, (state) => {
1316
+ state.loading = 'pending';
1317
+ })
1318
+ .addCase(fetchMediaLibraryUnclassifiedFiles.fulfilled, (state, action) => {
1319
+ state.loading = 'idle';
1320
+ state.unclassifiedFiles = {
1321
+ list: [...action.payload.result.data],
1322
+ page: action.payload.result.page,
1323
+ totalPages: Math.ceil(action.payload.result.cnt / action.payload.result.limit),
1324
+ };
1325
+ state.nbResults = 0;
1326
+ })
1327
+ .addCase(fetchMediaLibraryUnclassifiedFiles.rejected, (state) => {
1328
+ state.loading = 'idle';
1329
+ })
1330
+ .addCase(fetchMediaLibraryConfig.fulfilled, (state, action) => {
1331
+ var _a, _b;
1332
+ state.loading = 'idle';
1333
+ state.mediaLibraryAccess = (_b = (_a = action.payload) === null || _a === void 0 ? void 0 : _a.result) !== null && _b !== void 0 ? _b : false;
1334
+ })
1335
+ .addCase(fetchMediaLibraryConfig.rejected, (state) => {
1336
+ state.loading = 'idle';
1337
+ state.mediaLibraryAccess = false;
1338
+ })
1339
+ .addCase(fetchMediaLibraryConfig.pending, (state) => {
1340
+ state.loading = 'pending';
1341
+ state.mediaLibraryAccess = false;
1342
+ });
1343
+ },
1344
+ });
1345
+ const fetchMediaLibraryFolders = createAsyncThunk('MediaLibrary/fetchMediaLibraryFolders', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
1346
+ const args = { type: MediaLibraryAppConst.typeMediaLibraryFolder, format: 'raw-little', limit: 10 };
1347
+ try {
1348
+ return yield extra.jApi.article.list(args);
1349
+ }
1350
+ catch (error) {
1351
+ dispatch(Toast.actions.error({ label: error.errorMsg }));
1352
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve folders' });
1353
+ }
1354
+ }));
1355
+ const fetchMediaLibraryUnclassifiedFiles = createAsyncThunk('MediaLibrary/fetchMediaLibraryUnclassifiedFiles', (page, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
1356
+ try {
1357
+ return yield extra.jApi.mediaLibrary.GetUnclassifiedFiles({
1358
+ format: 'raw-little',
1359
+ page,
1360
+ limit: FILES_PER_PAGE,
1361
+ });
1362
+ }
1363
+ catch (error) {
1364
+ dispatch(Toast.actions.error({ label: error.errorMsg }));
1365
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve UnclassifiedFiles' });
1366
+ }
1367
+ }));
1368
+ const fetchMediaLibraryConfig = createAsyncThunk('MediaLibrary/fetchMediaLibraryConfig', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
1369
+ try {
1370
+ return yield extra.jApi.mediaLibrary.getAccess();
1371
+ }
1372
+ catch (error) {
1373
+ dispatch(Toast.actions.error({ label: error.errorMsg }));
1374
+ return rejectWithValue({ error: 1, errorMsg: 'Cannot get MediaLibrary Config' });
1375
+ }
1376
+ }));
1377
+ const selectMediaLibrary = (state) => state.mediaLibrary;
1378
+ const mediaLibraryReducer = mediaLibrarySlice.reducer;
1379
+ const MediaLibrary = {
1380
+ slice: mediaLibrarySlice,
1381
+ actions: { fetchMediaLibraryFolders, fetchMediaLibraryUnclassifiedFiles, fetchMediaLibraryConfig },
1382
+ selectors: { selectMediaLibrary }
1383
+ };
1384
+
1272
1385
  const adapter = createEntityAdapter({
1273
1386
  selectId: (model) => model.type,
1274
1387
  sortComparer: (a, b) => a.label.localeCompare(b.label),
@@ -3545,5 +3658,5 @@ const studio = {
3545
3658
  },
3546
3659
  };
3547
3660
 
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 };
3661
+ 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, MediaLibrary, Model, Network, Platform, STUDIO_VIEW, Share, StatusType$1 as StatusType, TVDisplay, TinyMCE, Toast, UserCurrent, WedocApp, Widget, WidgetEditor, actions, animationsReducer, animationsSlice, deleteCurrentAnimation, fetchCurrentAnimation, fetchCurrentAnimationApp, fetchMediaLibraryConfig, fetchMediaLibraryFolders, fetchMediaLibraryUnclassifiedFiles, jland, mediaLibraryReducer, mediaLibrarySlice, saveCurrentAnimation, slice, studio, toggleAnimationIsActive, updateWidgetContent, viewsList };
3549
3662
  //# sourceMappingURL=esm.js.map