jamespot-front-business 1.1.20 → 1.1.22

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
@@ -4,7 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var toolkit = require('@reduxjs/toolkit');
6
6
  var redux = require('redux');
7
- var jamespotUserApi = require('jamespot-user-api');
7
+ var jamespot = require('jamespot-user-api');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var jamespot__default = /*#__PURE__*/_interopDefaultLegacy(jamespot);
8
12
 
9
13
  const adapter$1 = toolkit.createEntityAdapter({
10
14
  selectId: (app) => app.name,
@@ -63,7 +67,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
63
67
  });
64
68
  }
65
69
 
66
- const initialState$b = {
70
+ const initialState$d = {
67
71
  entities: [],
68
72
  loading: 'idle',
69
73
  nbResults: 0,
@@ -74,7 +78,7 @@ const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookable
74
78
  }));
75
79
  const BookableAssetSlice = toolkit.createSlice({
76
80
  name: 'bookableAsset',
77
- initialState: initialState$b,
81
+ initialState: initialState$d,
78
82
  reducers: {},
79
83
  extraReducers: (builder) => {
80
84
  builder
@@ -95,7 +99,7 @@ const BookableAssetSlice = toolkit.createSlice({
95
99
  const fetchConfiguration = toolkit.createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
96
100
  return yield extra.jApi.assetReservation.configuration();
97
101
  }));
98
- const initialState$a = {
102
+ const initialState$c = {
99
103
  description: '',
100
104
  right: {
101
105
  manage: false,
@@ -109,7 +113,7 @@ const initialState$a = {
109
113
  };
110
114
  const AssetReservationConfigurationSlice = toolkit.createSlice({
111
115
  name: 'configuration',
112
- initialState: initialState$a,
116
+ initialState: initialState$c,
113
117
  reducers: {},
114
118
  extraReducers: (builder) => {
115
119
  builder
@@ -130,7 +134,7 @@ const initForm = {
130
134
  hourStart: '',
131
135
  hourEnd: '',
132
136
  };
133
- const initialState$9 = {
137
+ const initialState$b = {
134
138
  entities: [],
135
139
  loading: 'idle',
136
140
  nbResults: 0,
@@ -142,7 +146,7 @@ const fetchReservation = toolkit.createAsyncThunk('Reservation/fetchReservation'
142
146
  }));
143
147
  const ReservationSlice = toolkit.createSlice({
144
148
  name: 'reservation',
145
- initialState: initialState$9,
149
+ initialState: initialState$b,
146
150
  reducers: {
147
151
  setForm: (state, action) => {
148
152
  state.form = action.payload;
@@ -235,7 +239,7 @@ const Toast = {
235
239
  selectors: selectors$1,
236
240
  };
237
241
 
238
- const initialState$8 = {
242
+ const initialState$a = {
239
243
  bookmarks: [],
240
244
  loading: 'idle',
241
245
  status: undefined,
@@ -261,7 +265,7 @@ const fetchBookmark = toolkit.createAsyncThunk('bookmarkList/fetchbookmarkList',
261
265
  const addBookmark = toolkit.createAsyncThunk('bookmarkList/addBookmark', (bookmark, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
262
266
  var _a;
263
267
  try {
264
- if (jamespotUserApi.jEnsure.isBookmarkLink(bookmark)) {
268
+ if (jamespot.jEnsure.isBookmarkLink(bookmark)) {
265
269
  const result = yield extra.jApi.bookmark.addFormattedLink(bookmark.targetId, bookmark.targetType, 'raw-list');
266
270
  return result;
267
271
  }
@@ -298,7 +302,7 @@ const deleteBookmark = toolkit.createAsyncThunk('bookmarkList/deleteBookmark', (
298
302
  }));
299
303
  const BookmarkListSlice = toolkit.createSlice({
300
304
  name: 'bookmarkList',
301
- initialState: initialState$8,
305
+ initialState: initialState$a,
302
306
  reducers: {
303
307
  resetAddBookmarkStatus: (state, action) => {
304
308
  if (state.add[action.payload]) {
@@ -410,7 +414,7 @@ const BookmarkListSlice = toolkit.createSlice({
410
414
 
411
415
  const getRTHandlers = function (dispatch) {
412
416
  const dispatchOrFetch = function (message, action) {
413
- if (jamespotUserApi.jEnsure.objectIsType('bookmarkLink', message.object)) {
417
+ if (jamespot.jEnsure.objectIsType('bookmarkLink', message.object)) {
414
418
  dispatch(action(message.object));
415
419
  }
416
420
  else {
@@ -461,7 +465,7 @@ const getRTHandlers = function (dispatch) {
461
465
  ];
462
466
  };
463
467
 
464
- const initialState$7 = {
468
+ const initialState$9 = {
465
469
  bookmark: undefined,
466
470
  status: undefined,
467
471
  loading: 'idle',
@@ -483,7 +487,7 @@ const editBookmark = toolkit.createAsyncThunk('bookmarkEdit/editBookmark', (book
483
487
  }));
484
488
  const BookmarkEditSlice = toolkit.createSlice({
485
489
  name: 'bookmarkEdit',
486
- initialState: initialState$7,
490
+ initialState: initialState$9,
487
491
  reducers: {
488
492
  setEditBookmark: (state, action) => {
489
493
  state.bookmark = Object.assign({}, action.payload);
@@ -536,6 +540,63 @@ const Bookmark = {
536
540
  getRTHandlers: getRTHandlers,
537
541
  };
538
542
 
543
+ const initialState$8 = {
544
+ loading: 'idle',
545
+ };
546
+ 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
+ };
555
+ }));
556
+ const FaqConfigSlice = toolkit.createSlice({
557
+ name: 'config',
558
+ initialState: initialState$8,
559
+ reducers: {},
560
+ extraReducers: (builder) => {
561
+ builder
562
+ .addCase(fetchFaqConfig.pending, (state) => {
563
+ if (state.loading === 'idle')
564
+ state.loading = 'pending';
565
+ })
566
+ .addCase(fetchFaqConfig.fulfilled, (state, action) => {
567
+ if (state.loading == 'pending')
568
+ state.loading = 'idle';
569
+ state._web = action.payload._web;
570
+ state.taxonomyId = action.payload.taxonomyId;
571
+ return state;
572
+ })
573
+ .addCase(fetchFaqConfig.rejected, (state) => {
574
+ if (state.loading == 'pending')
575
+ state.loading = 'idle';
576
+ });
577
+ },
578
+ });
579
+
580
+ const joinedReducers$3 = toolkit.combineReducers({
581
+ [FaqConfigSlice.name]: FaqConfigSlice.reducer,
582
+ });
583
+ const FaqSlice = {
584
+ name: 'faq',
585
+ reducer: joinedReducers$3,
586
+ };
587
+ const selectFaqConfig = (state) => {
588
+ return state.faq.config;
589
+ };
590
+ const Faq = {
591
+ slice: FaqSlice,
592
+ actions: {
593
+ fetchFaqConfig,
594
+ },
595
+ selectors: {
596
+ selectFaqConfig,
597
+ },
598
+ };
599
+
539
600
  const extractJlandUrlBaseFromMap = (map) => {
540
601
  const mapUrl = map.urlToJland;
541
602
  if (!mapUrl) {
@@ -771,7 +832,7 @@ const initialMap = {
771
832
  illustration: '',
772
833
  assignLicense: false,
773
834
  };
774
- const initialState$6 = {
835
+ const initialState$7 = {
775
836
  map: Object.assign({}, initialMap),
776
837
  loading: 'idle',
777
838
  status: undefined,
@@ -815,13 +876,13 @@ const createMap = toolkit.createAsyncThunk('mapCreate/create', ({ map, jlandUrlB
815
876
  }));
816
877
  const MapCreateSlice = toolkit.createSlice({
817
878
  name: 'mapCreate',
818
- initialState: initialState$6,
879
+ initialState: initialState$7,
819
880
  reducers: {
820
881
  setMap: (state, action) => {
821
882
  state.map = action.payload;
822
883
  },
823
884
  resetCreateMapState: () => {
824
- return initialState$6;
885
+ return initialState$7;
825
886
  },
826
887
  },
827
888
  extraReducers: (builder) => {
@@ -851,13 +912,13 @@ const selectJLandAvailableLicenses = function selectJLandAvailableLicenses(state
851
912
  const selectMapCreate = function selectMapCreate(state) {
852
913
  return state.jland.mapCreate;
853
914
  };
854
- const joinedReducers$1 = toolkit.combineReducers({
915
+ const joinedReducers$2 = toolkit.combineReducers({
855
916
  [JLandMapListSlice.name]: JLandMapListSlice.reducer,
856
917
  [MapCreateSlice.name]: MapCreateSlice.reducer,
857
918
  });
858
919
  const jlandSlice = {
859
920
  name: 'jland',
860
- reducer: joinedReducers$1,
921
+ reducer: joinedReducers$2,
861
922
  };
862
923
  const jland = {
863
924
  slice: jlandSlice,
@@ -885,7 +946,7 @@ const getModelIconSrc = (model, size) => {
885
946
  size: size !== null && size !== void 0 ? size : 'fitx600',
886
947
  uri: `icons/${model && model.icon ? model.icon : `article`}-white`,
887
948
  };
888
- return jamespotUserApi.formatImgUrl(imgProps);
949
+ return jamespot.formatImgUrl(imgProps);
889
950
  };
890
951
  const slice$1 = toolkit.createSlice({
891
952
  name: 'models',
@@ -908,6 +969,43 @@ const Model = {
908
969
  selectors: Object.assign(Object.assign({}, selectors), { selectByIds }),
909
970
  };
910
971
 
972
+ const initialState$6 = {};
973
+ const NetworkStaticsSlice = toolkit.createSlice({
974
+ name: 'statics',
975
+ initialState: initialState$6,
976
+ reducers: {
977
+ initNetworkStatics: (_, { payload }) => {
978
+ return payload;
979
+ },
980
+ },
981
+ });
982
+
983
+ const joinedReducers$1 = toolkit.combineReducers({
984
+ [NetworkStaticsSlice.name]: NetworkStaticsSlice.reducer,
985
+ });
986
+ const NetworkSlice = {
987
+ name: 'network',
988
+ reducer: joinedReducers$1,
989
+ };
990
+ const selectNetworkStatics = (state) => {
991
+ return state.network.statics;
992
+ };
993
+ const selectNetworkPublic = (state) => {
994
+ return state.network.statics.networkPublic;
995
+ };
996
+ const selectNetworkMe = (state) => {
997
+ return state.network.statics.networkMe;
998
+ };
999
+ const Network = {
1000
+ slice: NetworkSlice,
1001
+ actions: Object.assign({}, NetworkStaticsSlice.actions),
1002
+ selectors: {
1003
+ selectNetworkStatics,
1004
+ selectNetworkPublic,
1005
+ selectNetworkMe,
1006
+ },
1007
+ };
1008
+
911
1009
  const initialQuery = {
912
1010
  query: '',
913
1011
  filters: [],
@@ -1197,7 +1295,7 @@ const get = (state) => {
1197
1295
  return state.userCurrent;
1198
1296
  };
1199
1297
  const isAdmin = (userCurrent) => {
1200
- return userCurrent.level === jamespotUserApi.UserLevel.ADMIN;
1298
+ return userCurrent.level === jamespot.UserLevel.ADMIN;
1201
1299
  };
1202
1300
  const UserCurrent = {
1203
1301
  slice: slice,
@@ -1614,9 +1712,11 @@ const WidgetEditor = {
1614
1712
  exports.Application = Application;
1615
1713
  exports.AssetReservation = AssetReservation;
1616
1714
  exports.Bookmark = Bookmark;
1715
+ exports.Faq = Faq;
1617
1716
  exports.MODE_EDIT = MODE_EDIT;
1618
1717
  exports.MODE_VIEW = MODE_VIEW;
1619
1718
  exports.Model = Model;
1719
+ exports.Network = Network;
1620
1720
  exports.Share = Share;
1621
1721
  exports.TVDisplay = TVDisplay;
1622
1722
  exports.Toast = Toast;