jamespot-front-business 1.1.11 → 1.1.13
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 +133 -48
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +133 -49
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +238 -85
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -63,7 +63,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
const initialState$
|
|
66
|
+
const initialState$9 = {
|
|
67
67
|
entities: [],
|
|
68
68
|
loading: 'idle',
|
|
69
69
|
nbResults: 0,
|
|
@@ -74,7 +74,7 @@ const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookable
|
|
|
74
74
|
}));
|
|
75
75
|
const BookableAssetSlice = toolkit.createSlice({
|
|
76
76
|
name: 'bookableAsset',
|
|
77
|
-
initialState: initialState$
|
|
77
|
+
initialState: initialState$9,
|
|
78
78
|
reducers: {},
|
|
79
79
|
extraReducers: (builder) => {
|
|
80
80
|
builder
|
|
@@ -95,7 +95,7 @@ const BookableAssetSlice = toolkit.createSlice({
|
|
|
95
95
|
const fetchConfiguration = toolkit.createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
96
|
return yield extra.jApi.assetReservation.configuration();
|
|
97
97
|
}));
|
|
98
|
-
const initialState$
|
|
98
|
+
const initialState$8 = {
|
|
99
99
|
description: '',
|
|
100
100
|
right: {
|
|
101
101
|
manage: false,
|
|
@@ -109,7 +109,7 @@ const initialState$7 = {
|
|
|
109
109
|
};
|
|
110
110
|
const AssetReservationConfigurationSlice = toolkit.createSlice({
|
|
111
111
|
name: 'configuration',
|
|
112
|
-
initialState: initialState$
|
|
112
|
+
initialState: initialState$8,
|
|
113
113
|
reducers: {},
|
|
114
114
|
extraReducers: (builder) => {
|
|
115
115
|
builder
|
|
@@ -130,7 +130,7 @@ const initForm = {
|
|
|
130
130
|
hourStart: '',
|
|
131
131
|
hourEnd: '',
|
|
132
132
|
};
|
|
133
|
-
const initialState$
|
|
133
|
+
const initialState$7 = {
|
|
134
134
|
entities: [],
|
|
135
135
|
loading: 'idle',
|
|
136
136
|
nbResults: 0,
|
|
@@ -142,7 +142,7 @@ const fetchReservation = toolkit.createAsyncThunk('Reservation/fetchReservation'
|
|
|
142
142
|
}));
|
|
143
143
|
const ReservationSlice = toolkit.createSlice({
|
|
144
144
|
name: 'reservation',
|
|
145
|
-
initialState: initialState$
|
|
145
|
+
initialState: initialState$7,
|
|
146
146
|
reducers: {
|
|
147
147
|
setForm: (state, action) => {
|
|
148
148
|
state.form = action.payload;
|
|
@@ -235,7 +235,7 @@ const Toast = {
|
|
|
235
235
|
selectors: selectors$1,
|
|
236
236
|
};
|
|
237
237
|
|
|
238
|
-
const initialState$
|
|
238
|
+
const initialState$6 = {
|
|
239
239
|
bookmarks: [],
|
|
240
240
|
loading: 'idle',
|
|
241
241
|
status: undefined,
|
|
@@ -298,7 +298,7 @@ const deleteBookmark = toolkit.createAsyncThunk('bookmarkList/deleteBookmark', (
|
|
|
298
298
|
}));
|
|
299
299
|
const BookmarkListSlice = toolkit.createSlice({
|
|
300
300
|
name: 'bookmarkList',
|
|
301
|
-
initialState: initialState$
|
|
301
|
+
initialState: initialState$6,
|
|
302
302
|
reducers: {
|
|
303
303
|
resetAddBookmarkStatus: (state, action) => {
|
|
304
304
|
if (state.add[action.payload]) {
|
|
@@ -455,7 +455,7 @@ const getRTHandlers = function (dispatch) {
|
|
|
455
455
|
];
|
|
456
456
|
};
|
|
457
457
|
|
|
458
|
-
const initialState$
|
|
458
|
+
const initialState$5 = {
|
|
459
459
|
bookmark: undefined,
|
|
460
460
|
status: undefined,
|
|
461
461
|
loading: 'idle',
|
|
@@ -477,7 +477,7 @@ const editBookmark = toolkit.createAsyncThunk('bookmarkEdit/editBookmark', (book
|
|
|
477
477
|
}));
|
|
478
478
|
const BookmarkEditSlice = toolkit.createSlice({
|
|
479
479
|
name: 'bookmarkEdit',
|
|
480
|
-
initialState: initialState$
|
|
480
|
+
initialState: initialState$5,
|
|
481
481
|
reducers: {
|
|
482
482
|
setEditBookmark: (state, action) => {
|
|
483
483
|
state.bookmark = Object.assign({}, action.payload);
|
|
@@ -556,10 +556,6 @@ const fetchJLandMaps = toolkit.createAsyncThunk('/fetchMaps', ({ jlandUrlBase, r
|
|
|
556
556
|
const mapsPromise = retrieveAllMaps ? jApi.jland.getAllMapsAsAdmin() : jApi.article.list(config);
|
|
557
557
|
mapsPromise
|
|
558
558
|
.then((mapsResp) => {
|
|
559
|
-
if (mapsResp.error || mapsResp.errorMsg) {
|
|
560
|
-
reject({ error: 1, errorMsg: 'Error retrieving maps and liceses' });
|
|
561
|
-
return;
|
|
562
|
-
}
|
|
563
559
|
const maps = mapsResp.result.data;
|
|
564
560
|
const result = maps.map((currentMap) => {
|
|
565
561
|
const newMap = Object.assign({}, currentMap);
|
|
@@ -568,7 +564,10 @@ const fetchJLandMaps = toolkit.createAsyncThunk('/fetchMaps', ({ jlandUrlBase, r
|
|
|
568
564
|
});
|
|
569
565
|
resolve(result);
|
|
570
566
|
})
|
|
571
|
-
.catch(() => {
|
|
567
|
+
.catch((err) => {
|
|
568
|
+
if (err.error) {
|
|
569
|
+
reject(err);
|
|
570
|
+
}
|
|
572
571
|
reject({ error: 1, errorMsg: 'Error retrieving maps' });
|
|
573
572
|
});
|
|
574
573
|
});
|
|
@@ -576,17 +575,20 @@ const fetchJLandMaps = toolkit.createAsyncThunk('/fetchMaps', ({ jlandUrlBase, r
|
|
|
576
575
|
const fetchJLandAvailableLicenses = toolkit.createAsyncThunk('/fetchAvailableLicenses', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
577
576
|
const jApi = extra.jApi;
|
|
578
577
|
return yield new Promise((resolve, reject) => {
|
|
579
|
-
jApi.license
|
|
580
|
-
.
|
|
578
|
+
jApi.admin.license
|
|
579
|
+
.getLicensesNotAssigned('jlandmap')
|
|
581
580
|
.then((response) => {
|
|
582
|
-
if (response.error) {
|
|
583
|
-
reject({ error: 1, errorMsg: response.errorMsg });
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
581
|
resolve(response.result);
|
|
587
582
|
})
|
|
588
|
-
.catch(() => {
|
|
589
|
-
|
|
583
|
+
.catch((err) => {
|
|
584
|
+
if (err.error) {
|
|
585
|
+
reject(err);
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
588
|
+
reject({
|
|
589
|
+
error: 1,
|
|
590
|
+
errorMsg: 'Error while retrieving licenses not assigned',
|
|
591
|
+
});
|
|
590
592
|
});
|
|
591
593
|
});
|
|
592
594
|
}));
|
|
@@ -597,20 +599,20 @@ const unassignLicense = toolkit.createAsyncThunk('/unassignLicense', ({ map, ret
|
|
|
597
599
|
return false;
|
|
598
600
|
}
|
|
599
601
|
return yield new Promise((resolve, reject) => {
|
|
600
|
-
jApi.license
|
|
601
|
-
.
|
|
602
|
+
jApi.admin.license
|
|
603
|
+
.unAssignLicense(map.uri)
|
|
602
604
|
.then((response) => {
|
|
603
|
-
if (response.error) {
|
|
604
|
-
reject({ error: 1, errorMsg: response.errorMsg });
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
605
|
if (response.result) {
|
|
608
606
|
dispatch(fetchJLandAvailableLicenses());
|
|
609
607
|
dispatch(fetchJLandMaps({ jlandUrlBase, retrieveAllMaps }));
|
|
610
608
|
}
|
|
611
609
|
resolve(response.result);
|
|
612
610
|
})
|
|
613
|
-
.catch(() => {
|
|
611
|
+
.catch((err) => {
|
|
612
|
+
if (err.error) {
|
|
613
|
+
reject(err);
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
614
616
|
reject({ error: 1, errorMsg: 'Error unassign license' });
|
|
615
617
|
});
|
|
616
618
|
});
|
|
@@ -625,16 +627,16 @@ const deleteJlandMap = toolkit.createAsyncThunk('/deleteLicense', ({ map, retrie
|
|
|
625
627
|
jApi.article
|
|
626
628
|
.delete(map.id)
|
|
627
629
|
.then((response) => {
|
|
628
|
-
if (response.error) {
|
|
629
|
-
reject({ error: 1, errorMsg: response.errorMsg });
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
630
|
resolve(response.result);
|
|
633
631
|
dispatch(fetchJLandMaps({ jlandUrlBase, retrieveAllMaps }));
|
|
634
632
|
dispatch(fetchJLandAvailableLicenses());
|
|
635
633
|
})
|
|
636
|
-
.catch((
|
|
637
|
-
|
|
634
|
+
.catch((err) => {
|
|
635
|
+
if (err.error) {
|
|
636
|
+
reject(err);
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
reject({ error: 1, errorMsg: err.errorMsg + '' });
|
|
638
640
|
});
|
|
639
641
|
});
|
|
640
642
|
}));
|
|
@@ -645,20 +647,20 @@ const assignLicense = toolkit.createAsyncThunk('/assignLicense', ({ map, retriev
|
|
|
645
647
|
}
|
|
646
648
|
const jApi = extra.jApi;
|
|
647
649
|
return yield new Promise((resolve, reject) => {
|
|
648
|
-
jApi.license
|
|
650
|
+
jApi.admin.license
|
|
649
651
|
.assignLicense(map.uri)
|
|
650
652
|
.then((response) => {
|
|
651
|
-
if (response.error) {
|
|
652
|
-
reject({ error: 1, errorMsg: response.errorMsg });
|
|
653
|
-
return;
|
|
654
|
-
}
|
|
655
653
|
if (response.result) {
|
|
656
654
|
dispatch(fetchJLandAvailableLicenses());
|
|
657
655
|
dispatch(fetchJLandMaps({ jlandUrlBase, retrieveAllMaps }));
|
|
658
656
|
}
|
|
659
657
|
resolve(response.result);
|
|
660
658
|
})
|
|
661
|
-
.catch(() => {
|
|
659
|
+
.catch((err) => {
|
|
660
|
+
if (err.error) {
|
|
661
|
+
reject(err);
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
662
664
|
reject({ error: 1, errorMsg: 'Error assign license' });
|
|
663
665
|
});
|
|
664
666
|
});
|
|
@@ -763,7 +765,7 @@ const initialMap = {
|
|
|
763
765
|
illustration: '',
|
|
764
766
|
assignLicense: false,
|
|
765
767
|
};
|
|
766
|
-
const initialState$
|
|
768
|
+
const initialState$4 = {
|
|
767
769
|
map: Object.assign({}, initialMap),
|
|
768
770
|
loading: 'idle',
|
|
769
771
|
status: undefined,
|
|
@@ -807,13 +809,13 @@ const createMap = toolkit.createAsyncThunk('mapCreate/create', ({ map, jlandUrlB
|
|
|
807
809
|
}));
|
|
808
810
|
const MapCreateSlice = toolkit.createSlice({
|
|
809
811
|
name: 'mapCreate',
|
|
810
|
-
initialState: initialState$
|
|
812
|
+
initialState: initialState$4,
|
|
811
813
|
reducers: {
|
|
812
814
|
setMap: (state, action) => {
|
|
813
815
|
state.map = action.payload;
|
|
814
816
|
},
|
|
815
817
|
resetCreateMapState: () => {
|
|
816
|
-
return initialState$
|
|
818
|
+
return initialState$4;
|
|
817
819
|
},
|
|
818
820
|
},
|
|
819
821
|
extraReducers: (builder) => {
|
|
@@ -843,13 +845,13 @@ const selectJLandAvailableLicenses = function selectJLandAvailableLicenses(state
|
|
|
843
845
|
const selectMapCreate = function selectMapCreate(state) {
|
|
844
846
|
return state.jland.mapCreate;
|
|
845
847
|
};
|
|
846
|
-
const joinedReducers = toolkit.combineReducers({
|
|
848
|
+
const joinedReducers$1 = toolkit.combineReducers({
|
|
847
849
|
[JLandMapListSlice.name]: JLandMapListSlice.reducer,
|
|
848
850
|
[MapCreateSlice.name]: MapCreateSlice.reducer,
|
|
849
851
|
});
|
|
850
852
|
const jlandSlice = {
|
|
851
853
|
name: 'jland',
|
|
852
|
-
reducer: joinedReducers,
|
|
854
|
+
reducer: joinedReducers$1,
|
|
853
855
|
};
|
|
854
856
|
const jland = {
|
|
855
857
|
slice: jlandSlice,
|
|
@@ -862,7 +864,7 @@ const jland = {
|
|
|
862
864
|
selectors: {
|
|
863
865
|
selectJLandMaps,
|
|
864
866
|
selectJLandAvailableLicenses,
|
|
865
|
-
selectMapCreate
|
|
867
|
+
selectMapCreate,
|
|
866
868
|
},
|
|
867
869
|
utils: { buildUrlToJland },
|
|
868
870
|
};
|
|
@@ -887,6 +889,88 @@ const Model = {
|
|
|
887
889
|
selectors,
|
|
888
890
|
};
|
|
889
891
|
|
|
892
|
+
const initialState$3 = {
|
|
893
|
+
channels: undefined,
|
|
894
|
+
loading: 'idle',
|
|
895
|
+
loadingChannelDeletion: 'idle',
|
|
896
|
+
};
|
|
897
|
+
const fetchChannels = toolkit.createAsyncThunk('/fetchChannels', (page, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
898
|
+
const askedPage = page !== null && page !== void 0 ? page : 1;
|
|
899
|
+
const jApi = extra.jApi;
|
|
900
|
+
return yield new Promise((resolve, reject) => {
|
|
901
|
+
const config = {
|
|
902
|
+
type: 'tvDisplayChannel',
|
|
903
|
+
format: 'raw-list',
|
|
904
|
+
page: askedPage,
|
|
905
|
+
};
|
|
906
|
+
jApi.article
|
|
907
|
+
.list(config)
|
|
908
|
+
.then((channelsResp) => {
|
|
909
|
+
resolve(channelsResp.result);
|
|
910
|
+
})
|
|
911
|
+
.catch((ex) => {
|
|
912
|
+
var _a, _b;
|
|
913
|
+
reject({ error: (_a = ex.error) !== null && _a !== void 0 ? _a : 1, errorMsg: (_b = ex.errorMsg) !== null && _b !== void 0 ? _b : 'Error retrieving channels' });
|
|
914
|
+
});
|
|
915
|
+
});
|
|
916
|
+
}));
|
|
917
|
+
const ChannelsListSlice = toolkit.createSlice({
|
|
918
|
+
name: 'channelsList',
|
|
919
|
+
initialState: Object.assign({}, initialState$3),
|
|
920
|
+
reducers: {},
|
|
921
|
+
extraReducers: (builder) => {
|
|
922
|
+
builder
|
|
923
|
+
.addCase(fetchChannels.pending, (state) => {
|
|
924
|
+
if (state.loading === 'idle') {
|
|
925
|
+
state.loading = 'pending';
|
|
926
|
+
}
|
|
927
|
+
})
|
|
928
|
+
.addCase(fetchChannels.fulfilled, (state, action) => {
|
|
929
|
+
if (state.loading === 'pending') {
|
|
930
|
+
state.loading = 'idle';
|
|
931
|
+
state.channels = action.payload;
|
|
932
|
+
}
|
|
933
|
+
})
|
|
934
|
+
.addCase(fetchChannels.rejected, (state) => {
|
|
935
|
+
if (state.loading === 'pending') {
|
|
936
|
+
state.loading = 'idle';
|
|
937
|
+
}
|
|
938
|
+
});
|
|
939
|
+
},
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
function isChannelConfigured(channel) {
|
|
943
|
+
if (channel.tvChannelType === 'DYNAMIC') {
|
|
944
|
+
return !!channel.tvChannelBackgroundColor && !!channel.tvChannelGroupTarget;
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
return !!channel.tvChannelBackgroundColor && channel.tvChannelNumImages !== 0;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
const joinedReducers = toolkit.combineReducers({
|
|
952
|
+
[ChannelsListSlice.name]: ChannelsListSlice.reducer,
|
|
953
|
+
});
|
|
954
|
+
const TVDisplaySlice = {
|
|
955
|
+
name: 'tvDisplay',
|
|
956
|
+
reducer: joinedReducers,
|
|
957
|
+
};
|
|
958
|
+
const selectChannelsList = function selectChannelsList(state) {
|
|
959
|
+
return state.tvDisplay.channelsList;
|
|
960
|
+
};
|
|
961
|
+
const TVDisplay = {
|
|
962
|
+
slice: TVDisplaySlice,
|
|
963
|
+
actions: {
|
|
964
|
+
fetchChannels,
|
|
965
|
+
},
|
|
966
|
+
selectors: {
|
|
967
|
+
selectChannelsList,
|
|
968
|
+
},
|
|
969
|
+
utils: {
|
|
970
|
+
isChannelConfigured,
|
|
971
|
+
},
|
|
972
|
+
};
|
|
973
|
+
|
|
890
974
|
const initialState$2 = {
|
|
891
975
|
id: 0,
|
|
892
976
|
mainType: 'user',
|
|
@@ -1331,6 +1415,7 @@ exports.Bookmark = Bookmark;
|
|
|
1331
1415
|
exports.MODE_EDIT = MODE_EDIT;
|
|
1332
1416
|
exports.MODE_VIEW = MODE_VIEW;
|
|
1333
1417
|
exports.Model = Model;
|
|
1418
|
+
exports.TVDisplay = TVDisplay;
|
|
1334
1419
|
exports.Toast = Toast;
|
|
1335
1420
|
exports.UserCurrent = UserCurrent;
|
|
1336
1421
|
exports.Widget = Widget;
|