jamespot-front-business 1.1.86 → 1.1.88
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 +149 -18
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +146 -19
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +1723 -562
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -56,6 +56,11 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
56
56
|
const isAbortError = (error) => {
|
|
57
57
|
return !!error && typeof error === 'object' && 'aborted' in error && !!error.aborted;
|
|
58
58
|
};
|
|
59
|
+
const getErrorMessage = (error, defaultError) => {
|
|
60
|
+
return error && typeof error === 'object' && 'errorMsg' in error && typeof error.errorMsg === 'string'
|
|
61
|
+
? error.errorMsg
|
|
62
|
+
: defaultError !== null && defaultError !== void 0 ? defaultError : 'GLOBAL_Technical_Error';
|
|
63
|
+
};
|
|
59
64
|
|
|
60
65
|
const toastAdapter = toolkit.createEntityAdapter({
|
|
61
66
|
selectId: (toast) => toast.id,
|
|
@@ -100,7 +105,7 @@ const oneMonthAgo$2 = () => {
|
|
|
100
105
|
date.setMonth(date.getMonth() - 1);
|
|
101
106
|
return date;
|
|
102
107
|
};
|
|
103
|
-
const initialState$
|
|
108
|
+
const initialState$q = {
|
|
104
109
|
data: [],
|
|
105
110
|
loading: 'idle',
|
|
106
111
|
page: 1,
|
|
@@ -132,7 +137,7 @@ const fetchLogsNavigation = toolkit.createAsyncThunk('admin/fetchLogsNavigation'
|
|
|
132
137
|
}));
|
|
133
138
|
const adminLogsNavigationSlice = toolkit.createSlice({
|
|
134
139
|
name: 'logsNavigation',
|
|
135
|
-
initialState: initialState$
|
|
140
|
+
initialState: initialState$q,
|
|
136
141
|
reducers: {
|
|
137
142
|
setNavigationOrder: (state, action) => {
|
|
138
143
|
state.orders = [...action.payload];
|
|
@@ -170,7 +175,7 @@ const oneMonthAgo$1 = () => {
|
|
|
170
175
|
date.setMonth(date.getMonth() - 1);
|
|
171
176
|
return date;
|
|
172
177
|
};
|
|
173
|
-
const initialState$
|
|
178
|
+
const initialState$p = {
|
|
174
179
|
data: [],
|
|
175
180
|
loading: 'idle',
|
|
176
181
|
page: 1,
|
|
@@ -202,7 +207,7 @@ const fetchLogsObjects = toolkit.createAsyncThunk('admin/fetchLogsObjects', (par
|
|
|
202
207
|
}));
|
|
203
208
|
const adminLogsObjectsSlice = toolkit.createSlice({
|
|
204
209
|
name: 'logsObjects',
|
|
205
|
-
initialState: initialState$
|
|
210
|
+
initialState: initialState$p,
|
|
206
211
|
reducers: {
|
|
207
212
|
setObjectsOrder: (state, action) => {
|
|
208
213
|
state.orders = [...action.payload];
|
|
@@ -239,7 +244,7 @@ const oneMonthAgo = () => {
|
|
|
239
244
|
date.setMonth(date.getMonth() - 1);
|
|
240
245
|
return date;
|
|
241
246
|
};
|
|
242
|
-
const initialState$
|
|
247
|
+
const initialState$o = {
|
|
243
248
|
data: [],
|
|
244
249
|
loading: 'idle',
|
|
245
250
|
page: 1,
|
|
@@ -271,7 +276,7 @@ const fetchLogsSearch = toolkit.createAsyncThunk('admin/fetchLogsSearch', (param
|
|
|
271
276
|
}));
|
|
272
277
|
const adminLogsSearchSlice = toolkit.createSlice({
|
|
273
278
|
name: 'logsSearch',
|
|
274
|
-
initialState: initialState$
|
|
279
|
+
initialState: initialState$o,
|
|
275
280
|
reducers: {
|
|
276
281
|
setSearchOrder: (state, action) => {
|
|
277
282
|
state.orders = [...action.payload];
|
|
@@ -324,7 +329,7 @@ const AdminLogs = {
|
|
|
324
329
|
selectors: { selectAdminLogsNavigation, selectAdminLogsObjects, selectAdminLogsSearch },
|
|
325
330
|
};
|
|
326
331
|
|
|
327
|
-
const initialState$
|
|
332
|
+
const initialState$n = {
|
|
328
333
|
animationConfiguration: null,
|
|
329
334
|
isActiveForCurrentUser: false,
|
|
330
335
|
isInitialized: false,
|
|
@@ -332,7 +337,7 @@ const initialState$m = {
|
|
|
332
337
|
};
|
|
333
338
|
const animationsListSlice = toolkit.createSlice({
|
|
334
339
|
name: 'animationsList',
|
|
335
|
-
initialState: initialState$
|
|
340
|
+
initialState: initialState$n,
|
|
336
341
|
reducers: {},
|
|
337
342
|
extraReducers: (builder) => {
|
|
338
343
|
builder.addCase(fetchCurrentAnimation.fulfilled, (state, action) => {
|
|
@@ -567,7 +572,7 @@ const Application = {
|
|
|
567
572
|
selectors: selectors$2,
|
|
568
573
|
};
|
|
569
574
|
|
|
570
|
-
const initialState$
|
|
575
|
+
const initialState$m = {
|
|
571
576
|
entities: [],
|
|
572
577
|
loading: 'idle',
|
|
573
578
|
nbResults: 0,
|
|
@@ -583,7 +588,7 @@ const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookable
|
|
|
583
588
|
}));
|
|
584
589
|
const BookableAssetSlice = toolkit.createSlice({
|
|
585
590
|
name: 'bookableAsset',
|
|
586
|
-
initialState: initialState$
|
|
591
|
+
initialState: initialState$m,
|
|
587
592
|
reducers: {},
|
|
588
593
|
extraReducers: (builder) => {
|
|
589
594
|
builder
|
|
@@ -604,7 +609,7 @@ const BookableAssetSlice = toolkit.createSlice({
|
|
|
604
609
|
const fetchConfiguration = toolkit.createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
605
610
|
return yield extra.jApi.assetReservation.configuration();
|
|
606
611
|
}));
|
|
607
|
-
const initialState$
|
|
612
|
+
const initialState$l = {
|
|
608
613
|
description: '',
|
|
609
614
|
right: {
|
|
610
615
|
manage: false,
|
|
@@ -618,7 +623,7 @@ const initialState$k = {
|
|
|
618
623
|
};
|
|
619
624
|
const AssetReservationConfigurationSlice = toolkit.createSlice({
|
|
620
625
|
name: 'configuration',
|
|
621
|
-
initialState: initialState$
|
|
626
|
+
initialState: initialState$l,
|
|
622
627
|
reducers: {},
|
|
623
628
|
extraReducers: (builder) => {
|
|
624
629
|
builder
|
|
@@ -639,7 +644,7 @@ const initForm = {
|
|
|
639
644
|
hourStart: '',
|
|
640
645
|
hourEnd: '',
|
|
641
646
|
};
|
|
642
|
-
const initialState$
|
|
647
|
+
const initialState$k = {
|
|
643
648
|
entities: [],
|
|
644
649
|
loading: 'idle',
|
|
645
650
|
nbResults: 0,
|
|
@@ -655,7 +660,7 @@ const fetchReservation = toolkit.createAsyncThunk('Reservation/fetchReservation'
|
|
|
655
660
|
}));
|
|
656
661
|
const ReservationSlice = toolkit.createSlice({
|
|
657
662
|
name: 'reservation',
|
|
658
|
-
initialState: initialState$
|
|
663
|
+
initialState: initialState$k,
|
|
659
664
|
reducers: {
|
|
660
665
|
setForm: (state, action) => {
|
|
661
666
|
state.form = action.payload;
|
|
@@ -711,14 +716,17 @@ const AssetReservation = {
|
|
|
711
716
|
},
|
|
712
717
|
};
|
|
713
718
|
|
|
714
|
-
const initialState$
|
|
719
|
+
const initialState$j = {
|
|
715
720
|
loading: 'idle',
|
|
716
721
|
comments: [],
|
|
717
722
|
};
|
|
718
723
|
const fetchComments = toolkit.createAsyncThunk('commentList/fetchCommentList', (params, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
719
724
|
var _a;
|
|
720
725
|
try {
|
|
721
|
-
const res = yield extra.jApi.article.getComments(params,
|
|
726
|
+
const res = yield extra.jApi.article.getComments(params, {
|
|
727
|
+
format: 'raw-list',
|
|
728
|
+
formatExtension: ['socialActions'],
|
|
729
|
+
});
|
|
722
730
|
return { idArticle: params.idArticle, list: res.result };
|
|
723
731
|
}
|
|
724
732
|
catch (error) {
|
|
@@ -739,7 +747,7 @@ const deleteComment = toolkit.createAsyncThunk('commentList/deleteComment', (par
|
|
|
739
747
|
}));
|
|
740
748
|
const CommentListSlice = toolkit.createSlice({
|
|
741
749
|
name: 'commentList',
|
|
742
|
-
initialState: initialState$
|
|
750
|
+
initialState: initialState$j,
|
|
743
751
|
reducers: {
|
|
744
752
|
discardComments: (state, action) => {
|
|
745
753
|
state.comments = state.comments.filter((c) => c.idArticle !== action.payload.idArticle);
|
|
@@ -882,6 +890,125 @@ const Comment = {
|
|
|
882
890
|
getCommentsLikeRTHandlers,
|
|
883
891
|
};
|
|
884
892
|
|
|
893
|
+
const initialState$i = {
|
|
894
|
+
loading: 'idle',
|
|
895
|
+
reports: [],
|
|
896
|
+
page: 1,
|
|
897
|
+
tab: 'all',
|
|
898
|
+
filters: [],
|
|
899
|
+
orders: [],
|
|
900
|
+
limit: 10,
|
|
901
|
+
nbResults: 0,
|
|
902
|
+
pendingReports: [],
|
|
903
|
+
};
|
|
904
|
+
const contentReportSlice = toolkit.createSlice({
|
|
905
|
+
name: 'contentReport',
|
|
906
|
+
initialState: initialState$i,
|
|
907
|
+
reducers: {
|
|
908
|
+
setTab: (state, action) => {
|
|
909
|
+
state.tab = action.payload;
|
|
910
|
+
state.page = 1;
|
|
911
|
+
state.orders = [];
|
|
912
|
+
state.filters = [];
|
|
913
|
+
},
|
|
914
|
+
setPage: (state, action) => {
|
|
915
|
+
state.page = action.payload;
|
|
916
|
+
},
|
|
917
|
+
setFilters: (state, action) => {
|
|
918
|
+
state.filters = action.payload;
|
|
919
|
+
},
|
|
920
|
+
setOrders: (state, action) => {
|
|
921
|
+
state.orders = action.payload;
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
extraReducers: (builder) => {
|
|
925
|
+
builder
|
|
926
|
+
.addCase(fetchReports.pending, (state) => {
|
|
927
|
+
if (state.loading === 'idle')
|
|
928
|
+
state.loading = 'pending';
|
|
929
|
+
})
|
|
930
|
+
.addCase(fetchReports.fulfilled, (state, action) => {
|
|
931
|
+
if (state.loading == 'pending')
|
|
932
|
+
state.loading = 'idle';
|
|
933
|
+
state.reports = action.payload.data;
|
|
934
|
+
state.nbResults = action.payload.cnt;
|
|
935
|
+
return state;
|
|
936
|
+
})
|
|
937
|
+
.addCase(fetchReports.rejected, (state) => {
|
|
938
|
+
if (state.loading == 'pending')
|
|
939
|
+
state.loading = 'idle';
|
|
940
|
+
})
|
|
941
|
+
.addCase(updateStatus.pending, (state, action) => {
|
|
942
|
+
const report = state.reports.find((report) => report.uri === action.meta.arg.uri);
|
|
943
|
+
if (report) {
|
|
944
|
+
state.pendingReports = [...state.pendingReports, Object.assign(Object.assign({}, report), { requestId: action.meta.requestId })];
|
|
945
|
+
state.reports = state.reports.map((report) => {
|
|
946
|
+
return report.uri !== action.meta.arg.uri
|
|
947
|
+
? report
|
|
948
|
+
: Object.assign(Object.assign({}, report), { status: action.meta.arg.status });
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
})
|
|
952
|
+
.addCase(updateStatus.fulfilled, (state, action) => {
|
|
953
|
+
state.pendingReports = state.pendingReports.filter((report) => report.requestId !== action.meta.requestId);
|
|
954
|
+
})
|
|
955
|
+
.addCase(updateStatus.rejected, (state, action) => {
|
|
956
|
+
const report = state.pendingReports.find((report) => report.requestId === action.meta.requestId);
|
|
957
|
+
if (!report)
|
|
958
|
+
return;
|
|
959
|
+
state.reports = state.reports.map((r) => {
|
|
960
|
+
if (r.id !== report.id)
|
|
961
|
+
return r;
|
|
962
|
+
return report;
|
|
963
|
+
});
|
|
964
|
+
state.pendingReports = state.pendingReports.filter((r) => r.requestId !== action.meta.requestId);
|
|
965
|
+
});
|
|
966
|
+
},
|
|
967
|
+
});
|
|
968
|
+
const fetchReports = toolkit.createAsyncThunk('contentReport/fetchReports', (_params, { rejectWithValue, extra, dispatch, getState }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
969
|
+
var _a;
|
|
970
|
+
const state = getState().contentReport;
|
|
971
|
+
const userId = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.id;
|
|
972
|
+
try {
|
|
973
|
+
const filters = state.tab === 'my' && userId ? [...state.filters, { name: 'idUser', value: userId }] : [...state.filters];
|
|
974
|
+
const orders = state.orders.length > 0 ? state.orders : [{ name: 'dateCreation', sort: 'DESC' }];
|
|
975
|
+
return (yield extra.jApi.contentReport.getReports({
|
|
976
|
+
filters,
|
|
977
|
+
orders,
|
|
978
|
+
page: state.page,
|
|
979
|
+
limit: state.limit,
|
|
980
|
+
})).result;
|
|
981
|
+
}
|
|
982
|
+
catch (error) {
|
|
983
|
+
if (!isAbortError(error)) {
|
|
984
|
+
dispatch(Toast.actions.error({ label: getErrorMessage(error) }));
|
|
985
|
+
}
|
|
986
|
+
return rejectWithValue({ error: 1, errorMsg: 'Cannot fetch pads' });
|
|
987
|
+
}
|
|
988
|
+
}));
|
|
989
|
+
const updateStatus = toolkit.createAsyncThunk('contentReport/updateStatus', (params, { dispatch, rejectWithValue, extra }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
990
|
+
try {
|
|
991
|
+
yield extra.jApi.contentReport.updateStatus(params);
|
|
992
|
+
dispatch(Toast.actions.success({ label: 'GLOBAL_Successfully_Saved' }));
|
|
993
|
+
return true;
|
|
994
|
+
}
|
|
995
|
+
catch (error) {
|
|
996
|
+
if (!isAbortError(error)) {
|
|
997
|
+
dispatch(Toast.actions.error({ label: getErrorMessage(error) }));
|
|
998
|
+
}
|
|
999
|
+
return rejectWithValue({ error: 1, errorMsg: 'Cannot fetch pads' });
|
|
1000
|
+
}
|
|
1001
|
+
}));
|
|
1002
|
+
const selectContentReport = (state) => state.contentReport;
|
|
1003
|
+
const ContentReport = {
|
|
1004
|
+
slice: contentReportSlice,
|
|
1005
|
+
actions: {
|
|
1006
|
+
fetchReports,
|
|
1007
|
+
updateStatus,
|
|
1008
|
+
},
|
|
1009
|
+
selectors: { selectContentReport },
|
|
1010
|
+
};
|
|
1011
|
+
|
|
885
1012
|
const initialState$h = {
|
|
886
1013
|
bookmarks: [],
|
|
887
1014
|
loading: 'idle',
|
|
@@ -3229,7 +3356,7 @@ const WidgetEditor = {
|
|
|
3229
3356
|
};
|
|
3230
3357
|
|
|
3231
3358
|
const adapter = toolkit.createEntityAdapter({
|
|
3232
|
-
selectId: (socialAction) => `${socialAction.
|
|
3359
|
+
selectId: (socialAction) => `${socialAction.targetId}-${socialAction.type}`,
|
|
3233
3360
|
});
|
|
3234
3361
|
const slice = toolkit.createSlice({
|
|
3235
3362
|
name: 'socialActions',
|
|
@@ -5653,6 +5780,7 @@ exports.Application = Application;
|
|
|
5653
5780
|
exports.AssetReservation = AssetReservation;
|
|
5654
5781
|
exports.Bookmark = Bookmark;
|
|
5655
5782
|
exports.Comment = Comment;
|
|
5783
|
+
exports.ContentReport = ContentReport;
|
|
5656
5784
|
exports.ExtraAppFieldsItemViews = ExtraAppFieldsItemViews;
|
|
5657
5785
|
exports.Faq = Faq;
|
|
5658
5786
|
exports.Hook = Hook;
|
|
@@ -5678,6 +5806,7 @@ exports.adminLogsReducer = adminLogsReducer;
|
|
|
5678
5806
|
exports.adminLogsSlice = adminLogsSlice;
|
|
5679
5807
|
exports.animationsReducer = animationsReducer;
|
|
5680
5808
|
exports.animationsSlice = animationsSlice;
|
|
5809
|
+
exports.contentReportSlice = contentReportSlice;
|
|
5681
5810
|
exports.fetchMediaLibraryConfig = fetchMediaLibraryConfig;
|
|
5682
5811
|
exports.fetchMediaLibraryFilesStats = fetchMediaLibraryFilesStats;
|
|
5683
5812
|
exports.fetchMediaLibraryFolders = fetchMediaLibraryFolders;
|
|
@@ -5685,12 +5814,14 @@ exports.fetchMediaLibraryFoldersStats = fetchMediaLibraryFoldersStats;
|
|
|
5685
5814
|
exports.fetchMediaLibraryStats = fetchMediaLibraryStats;
|
|
5686
5815
|
exports.fetchMediaLibraryUnclassifiedFiles = fetchMediaLibraryUnclassifiedFiles;
|
|
5687
5816
|
exports.fetchPads = fetchPads;
|
|
5817
|
+
exports.fetchReports = fetchReports;
|
|
5688
5818
|
exports.jland = jland;
|
|
5689
5819
|
exports.magicPadSlice = magicPadSlice;
|
|
5690
5820
|
exports.mediaLibraryReducer = mediaLibraryReducer;
|
|
5691
5821
|
exports.mediaLibrarySlice = mediaLibrarySlice;
|
|
5692
5822
|
exports.slice = slice$1;
|
|
5693
5823
|
exports.studio = studio;
|
|
5824
|
+
exports.updateStatus = updateStatus;
|
|
5694
5825
|
exports.updateWidgetContent = updateWidgetContent;
|
|
5695
5826
|
exports.viewsList = viewsList;
|
|
5696
5827
|
//# sourceMappingURL=cjs.js.map
|