jamespot-front-business 1.1.22 → 1.1.24

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
@@ -67,7 +67,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
67
67
  });
68
68
  }
69
69
 
70
- const initialState$d = {
70
+ const initialState$e = {
71
71
  entities: [],
72
72
  loading: 'idle',
73
73
  nbResults: 0,
@@ -78,7 +78,7 @@ const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookable
78
78
  }));
79
79
  const BookableAssetSlice = toolkit.createSlice({
80
80
  name: 'bookableAsset',
81
- initialState: initialState$d,
81
+ initialState: initialState$e,
82
82
  reducers: {},
83
83
  extraReducers: (builder) => {
84
84
  builder
@@ -99,7 +99,7 @@ const BookableAssetSlice = toolkit.createSlice({
99
99
  const fetchConfiguration = toolkit.createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
100
100
  return yield extra.jApi.assetReservation.configuration();
101
101
  }));
102
- const initialState$c = {
102
+ const initialState$d = {
103
103
  description: '',
104
104
  right: {
105
105
  manage: false,
@@ -113,7 +113,7 @@ const initialState$c = {
113
113
  };
114
114
  const AssetReservationConfigurationSlice = toolkit.createSlice({
115
115
  name: 'configuration',
116
- initialState: initialState$c,
116
+ initialState: initialState$d,
117
117
  reducers: {},
118
118
  extraReducers: (builder) => {
119
119
  builder
@@ -134,7 +134,7 @@ const initForm = {
134
134
  hourStart: '',
135
135
  hourEnd: '',
136
136
  };
137
- const initialState$b = {
137
+ const initialState$c = {
138
138
  entities: [],
139
139
  loading: 'idle',
140
140
  nbResults: 0,
@@ -146,7 +146,7 @@ const fetchReservation = toolkit.createAsyncThunk('Reservation/fetchReservation'
146
146
  }));
147
147
  const ReservationSlice = toolkit.createSlice({
148
148
  name: 'reservation',
149
- initialState: initialState$b,
149
+ initialState: initialState$c,
150
150
  reducers: {
151
151
  setForm: (state, action) => {
152
152
  state.form = action.payload;
@@ -239,7 +239,7 @@ const Toast = {
239
239
  selectors: selectors$1,
240
240
  };
241
241
 
242
- const initialState$a = {
242
+ const initialState$b = {
243
243
  bookmarks: [],
244
244
  loading: 'idle',
245
245
  status: undefined,
@@ -302,7 +302,7 @@ const deleteBookmark = toolkit.createAsyncThunk('bookmarkList/deleteBookmark', (
302
302
  }));
303
303
  const BookmarkListSlice = toolkit.createSlice({
304
304
  name: 'bookmarkList',
305
- initialState: initialState$a,
305
+ initialState: initialState$b,
306
306
  reducers: {
307
307
  resetAddBookmarkStatus: (state, action) => {
308
308
  if (state.add[action.payload]) {
@@ -465,7 +465,7 @@ const getRTHandlers = function (dispatch) {
465
465
  ];
466
466
  };
467
467
 
468
- const initialState$9 = {
468
+ const initialState$a = {
469
469
  bookmark: undefined,
470
470
  status: undefined,
471
471
  loading: 'idle',
@@ -487,7 +487,7 @@ const editBookmark = toolkit.createAsyncThunk('bookmarkEdit/editBookmark', (book
487
487
  }));
488
488
  const BookmarkEditSlice = toolkit.createSlice({
489
489
  name: 'bookmarkEdit',
490
- initialState: initialState$9,
490
+ initialState: initialState$a,
491
491
  reducers: {
492
492
  setEditBookmark: (state, action) => {
493
493
  state.bookmark = Object.assign({}, action.payload);
@@ -540,22 +540,35 @@ const Bookmark = {
540
540
  getRTHandlers: getRTHandlers,
541
541
  };
542
542
 
543
- const initialState$8 = {
543
+ const initialState$9 = {
544
544
  loading: 'idle',
545
+ access: { createCategory: false },
545
546
  };
546
547
  const fetchFaqConfig = toolkit.createAsyncThunk('faqConfig/fetch', () => __awaiter(void 0, void 0, void 0, function* () {
547
- const [hookProperties, taxonomy] = yield Promise.all([
548
- yield jamespot__default["default"].faq.getHookProperties(),
549
- yield jamespot__default["default"].faq.getTaxonomy(),
550
- ]);
551
- return {
552
- taxonomyId: taxonomy.result.id,
553
- _web: hookProperties.result._web,
554
- };
548
+ try {
549
+ const [hookProperties, access] = yield Promise.all([
550
+ yield jamespot__default["default"].faq.getHookProperties(['_web', 'appImage', 'appImageText']),
551
+ yield jamespot__default["default"].faq.getAccess()
552
+ ]);
553
+ return {
554
+ _web: hookProperties.result._web,
555
+ appImage: hookProperties.result.appImage,
556
+ appImageText: hookProperties.result.appImageText,
557
+ access: access.result,
558
+ };
559
+ }
560
+ catch (e) {
561
+ if (e.error === 403) {
562
+ return {
563
+ _web: '0',
564
+ };
565
+ }
566
+ throw e;
567
+ }
555
568
  }));
556
569
  const FaqConfigSlice = toolkit.createSlice({
557
570
  name: 'config',
558
- initialState: initialState$8,
571
+ initialState: initialState$9,
559
572
  reducers: {},
560
573
  extraReducers: (builder) => {
561
574
  builder
@@ -566,8 +579,18 @@ const FaqConfigSlice = toolkit.createSlice({
566
579
  .addCase(fetchFaqConfig.fulfilled, (state, action) => {
567
580
  if (state.loading == 'pending')
568
581
  state.loading = 'idle';
569
- state._web = action.payload._web;
570
- state.taxonomyId = action.payload.taxonomyId;
582
+ if (action.payload._web !== undefined) {
583
+ state._web = action.payload._web;
584
+ }
585
+ if (action.payload.appImage) {
586
+ state.appImage = action.payload.appImage;
587
+ }
588
+ if (action.payload.appImageText) {
589
+ state.appImageText = action.payload.appImageText;
590
+ }
591
+ if (action.payload.access) {
592
+ state.access = action.payload.access;
593
+ }
571
594
  return state;
572
595
  })
573
596
  .addCase(fetchFaqConfig.rejected, (state) => {
@@ -577,8 +600,42 @@ const FaqConfigSlice = toolkit.createSlice({
577
600
  },
578
601
  });
579
602
 
603
+ const initialState$8 = {
604
+ loading: 'idle',
605
+ categories: null,
606
+ };
607
+ const fetchFaqCategories = toolkit.createAsyncThunk('faqCategories/fetch', () => __awaiter(void 0, void 0, void 0, function* () {
608
+ const categories = yield jamespot__default["default"].faq.getCategoriesList();
609
+ return {
610
+ categories: categories.result.data,
611
+ };
612
+ }));
613
+ const FaqCategoriesSlice = toolkit.createSlice({
614
+ name: 'categories',
615
+ initialState: initialState$8,
616
+ reducers: {},
617
+ extraReducers: (builder) => {
618
+ builder
619
+ .addCase(fetchFaqCategories.pending, (state) => {
620
+ if (state.loading === 'idle')
621
+ state.loading = 'pending';
622
+ })
623
+ .addCase(fetchFaqCategories.fulfilled, (state, action) => {
624
+ if (state.loading == 'pending')
625
+ state.loading = 'idle';
626
+ state.categories = action.payload.categories;
627
+ return state;
628
+ })
629
+ .addCase(fetchFaqCategories.rejected, (state) => {
630
+ if (state.loading == 'pending')
631
+ state.loading = 'idle';
632
+ });
633
+ },
634
+ });
635
+
580
636
  const joinedReducers$3 = toolkit.combineReducers({
581
637
  [FaqConfigSlice.name]: FaqConfigSlice.reducer,
638
+ [FaqCategoriesSlice.name]: FaqCategoriesSlice.reducer,
582
639
  });
583
640
  const FaqSlice = {
584
641
  name: 'faq',
@@ -587,13 +644,18 @@ const FaqSlice = {
587
644
  const selectFaqConfig = (state) => {
588
645
  return state.faq.config;
589
646
  };
647
+ const selectFaqCategories = (state) => {
648
+ return state.faq.categories;
649
+ };
590
650
  const Faq = {
591
651
  slice: FaqSlice,
592
652
  actions: {
593
653
  fetchFaqConfig,
654
+ fetchFaqCategories,
594
655
  },
595
656
  selectors: {
596
657
  selectFaqConfig,
658
+ selectFaqCategories,
597
659
  },
598
660
  };
599
661
 
@@ -1297,13 +1359,16 @@ const get = (state) => {
1297
1359
  const isAdmin = (userCurrent) => {
1298
1360
  return userCurrent.level === jamespot.UserLevel.ADMIN;
1299
1361
  };
1362
+ const isLogged = (userCurrent) => {
1363
+ return userCurrent.id !== 0;
1364
+ };
1300
1365
  const UserCurrent = {
1301
1366
  slice: slice,
1302
1367
  actions: Object.assign({}, slice.actions),
1303
1368
  selectors: {
1304
1369
  get,
1305
1370
  },
1306
- utils: { isAdmin },
1371
+ utils: { isAdmin, isLogged },
1307
1372
  };
1308
1373
 
1309
1374
  const widgetArticleAttachmentDefinition = {
@@ -1337,10 +1402,7 @@ const widgetArticleGalleryDefinition = {
1337
1402
  const widgetArticleGalleryContent = {
1338
1403
  files: [],
1339
1404
  gap: '4',
1340
- columnCount: '3',
1341
- galleryDisplay: 'landscape',
1342
- heightMode: 'auto',
1343
- heightModeValue: '200',
1405
+ column: '3',
1344
1406
  };
1345
1407
 
1346
1408
  const widgetArticleImageDefinition = {
@@ -1636,6 +1698,7 @@ const selectWidgets = (state) => state.widgets.ids;
1636
1698
  const selectWidgetContent = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) === null || _a === void 0 ? void 0 : _a.widget.content; };
1637
1699
  const selectWidgetState = (state, uniqid) => { var _a; return (_a = state.widgets.states[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
1638
1700
  const selectWidget = (state, uniqid) => { var _a; return (_a = state.widgets.ids[uniqid]) !== null && _a !== void 0 ? _a : undefined; };
1701
+ const isActive = (state, uniqid) => state.widgets.currentEditableWidgetId === uniqid;
1639
1702
  const Widget = {
1640
1703
  const: WIDGETS,
1641
1704
  factory: widgetFactory,
@@ -1645,6 +1708,7 @@ const Widget = {
1645
1708
  },
1646
1709
  slice: widgetsSlice,
1647
1710
  selectors: {
1711
+ isActive,
1648
1712
  selectToken,
1649
1713
  selectWidgets,
1650
1714
  selectWidget,