jamespot-front-business 1.1.58 → 1.1.60
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 +107 -30
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +107 -30
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +762 -25
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -85,6 +85,38 @@ const Toast = {
|
|
|
85
85
|
selectors: selectors$2,
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
const initialState$m = {
|
|
89
|
+
animationConfiguration: null,
|
|
90
|
+
isActiveForCurrentUser: false,
|
|
91
|
+
isInitialized: false,
|
|
92
|
+
isToggleLoading: false,
|
|
93
|
+
};
|
|
94
|
+
const animationsListSlice = toolkit.createSlice({
|
|
95
|
+
name: 'animationsList',
|
|
96
|
+
initialState: initialState$m,
|
|
97
|
+
reducers: {},
|
|
98
|
+
extraReducers: (builder) => {
|
|
99
|
+
builder.addCase(fetchCurrentAnimation.fulfilled, (state, action) => {
|
|
100
|
+
state.isActiveForCurrentUser = action.payload.isActiveForCurrentUser;
|
|
101
|
+
state.animationConfiguration = action.payload.animationConfiguration;
|
|
102
|
+
state.isInitialized = action.payload.isInitialized;
|
|
103
|
+
});
|
|
104
|
+
builder.addCase(fetchCurrentAnimationApp.fulfilled, (state, action) => {
|
|
105
|
+
state.animationConfigurationApp = action.payload;
|
|
106
|
+
});
|
|
107
|
+
builder.addCase(toggleAnimationIsActive.pending, (state) => {
|
|
108
|
+
state.isToggleLoading = true;
|
|
109
|
+
state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
|
|
110
|
+
});
|
|
111
|
+
builder.addCase(toggleAnimationIsActive.fulfilled, (state) => {
|
|
112
|
+
state.isToggleLoading = false;
|
|
113
|
+
});
|
|
114
|
+
builder.addCase(toggleAnimationIsActive.rejected, (state) => {
|
|
115
|
+
state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
|
|
116
|
+
state.isToggleLoading = false;
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
});
|
|
88
120
|
const fetchCurrentAnimation = toolkit.createAsyncThunk('animations/fetchCurrentAnimation', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
121
|
try {
|
|
90
122
|
const animationConfiguration = (yield extra.jApi.animations.GetCurrentAnimation()).result;
|
|
@@ -173,42 +205,83 @@ const getAnimationsRTHandlers = function (dispatch) {
|
|
|
173
205
|
];
|
|
174
206
|
};
|
|
175
207
|
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
208
|
+
const fetchAnimationStats = toolkit.createAsyncThunk('animations/fetchAnimationStats', ({ name }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
209
|
+
try {
|
|
210
|
+
const stats = (yield extra.jApi.animations.GetAnimationStats(name)).result.data;
|
|
211
|
+
return stats;
|
|
212
|
+
}
|
|
213
|
+
catch (_) {
|
|
214
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
215
|
+
return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve animation stats' });
|
|
216
|
+
}
|
|
217
|
+
}));
|
|
218
|
+
const animationStatsInitialState$1 = {
|
|
219
|
+
stats: [],
|
|
220
|
+
loading: 'idle',
|
|
181
221
|
};
|
|
182
|
-
const
|
|
183
|
-
name: '
|
|
184
|
-
initialState:
|
|
222
|
+
const animationStatsSlice = toolkit.createSlice({
|
|
223
|
+
name: 'animationStats',
|
|
224
|
+
initialState: animationStatsInitialState$1,
|
|
185
225
|
reducers: {},
|
|
186
226
|
extraReducers: (builder) => {
|
|
187
|
-
builder.addCase(
|
|
188
|
-
state.
|
|
189
|
-
state.animationConfiguration = action.payload.animationConfiguration;
|
|
190
|
-
state.isInitialized = action.payload.isInitialized;
|
|
227
|
+
builder.addCase(fetchAnimationStats.pending, (state) => {
|
|
228
|
+
state.loading = 'pending';
|
|
191
229
|
});
|
|
192
|
-
builder.addCase(
|
|
193
|
-
state.
|
|
230
|
+
builder.addCase(fetchAnimationStats.fulfilled, (state, action) => {
|
|
231
|
+
state.loading = 'idle';
|
|
232
|
+
state.stats = action.payload;
|
|
194
233
|
});
|
|
195
|
-
builder.addCase(
|
|
196
|
-
state.
|
|
197
|
-
state.isActiveForCurrentUser = !state.isActiveForCurrentUser;
|
|
234
|
+
builder.addCase(fetchAnimationStats.rejected, (state) => {
|
|
235
|
+
state.loading = 'idle';
|
|
198
236
|
});
|
|
199
|
-
|
|
200
|
-
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
const fetchAnimationStatsCurrent = toolkit.createAsyncThunk('animations/fetchAnimationStatsCurrent', (uri, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
241
|
+
try {
|
|
242
|
+
const stats = (yield extra.jApi.animations.GetAnimationStatsCurrent(uri)).result;
|
|
243
|
+
return stats;
|
|
244
|
+
}
|
|
245
|
+
catch (_) {
|
|
246
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
247
|
+
return rejectWithValue({ error: 1, errorMsg: 'Cannot retrieve animation stats current' });
|
|
248
|
+
}
|
|
249
|
+
}));
|
|
250
|
+
const animationStatsInitialState = {
|
|
251
|
+
stats: null,
|
|
252
|
+
loading: 'idle',
|
|
253
|
+
};
|
|
254
|
+
const animationStatsCurrentSlice = toolkit.createSlice({
|
|
255
|
+
name: 'animationStatsCurrent',
|
|
256
|
+
initialState: animationStatsInitialState,
|
|
257
|
+
reducers: {},
|
|
258
|
+
extraReducers: (builder) => {
|
|
259
|
+
builder.addCase(fetchAnimationStatsCurrent.pending, (state) => {
|
|
260
|
+
state.loading = 'pending';
|
|
201
261
|
});
|
|
202
|
-
builder.addCase(
|
|
203
|
-
state.
|
|
204
|
-
state.
|
|
262
|
+
builder.addCase(fetchAnimationStatsCurrent.fulfilled, (state, action) => {
|
|
263
|
+
state.loading = 'idle';
|
|
264
|
+
state.stats = action.payload;
|
|
205
265
|
});
|
|
206
|
-
|
|
266
|
+
builder.addCase(fetchAnimationStatsCurrent.rejected, (state) => {
|
|
267
|
+
state.loading = 'idle';
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
const selectCurrentAnimation = (state) => state.animations.animationsList.animationConfiguration;
|
|
273
|
+
const isActiveAnimation = (state) => state.animations.animationsList.isActiveForCurrentUser;
|
|
274
|
+
const isToggleLoading = (state) => state.animations.animationsList.isToggleLoading;
|
|
275
|
+
const selectAnimationConfigurationApp = (state) => state.animations.animationsList.animationConfigurationApp;
|
|
276
|
+
const animationsSliceReducer = toolkit.combineReducers({
|
|
277
|
+
[animationsListSlice.name]: animationsListSlice.reducer,
|
|
278
|
+
[animationStatsSlice.name]: animationStatsSlice.reducer,
|
|
279
|
+
[animationStatsCurrentSlice.name]: animationStatsCurrentSlice.reducer,
|
|
207
280
|
});
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
281
|
+
const animationsSlice = {
|
|
282
|
+
name: 'animations',
|
|
283
|
+
reducer: animationsSliceReducer,
|
|
284
|
+
};
|
|
212
285
|
const animationsReducer = animationsSlice.reducer;
|
|
213
286
|
const Animations = {
|
|
214
287
|
slice: animationsSlice,
|
|
@@ -218,6 +291,8 @@ const Animations = {
|
|
|
218
291
|
deleteCurrentAnimation,
|
|
219
292
|
toggleAnimationIsActive,
|
|
220
293
|
fetchCurrentAnimationApp,
|
|
294
|
+
fetchAnimationStats,
|
|
295
|
+
fetchAnimationStatsCurrent,
|
|
221
296
|
},
|
|
222
297
|
selectors: { selectCurrentAnimation, isActiveAnimation, isToggleLoading, selectAnimationConfigurationApp },
|
|
223
298
|
getAnimationsRTHandlers,
|
|
@@ -782,6 +857,7 @@ const bookmarkSlice = {
|
|
|
782
857
|
const selectBookmarkList = (state) => state.bookmark.bookmarkList;
|
|
783
858
|
const selectBookmarkListIsInitialized = (state) => state.bookmark.bookmarkList.isInitialized;
|
|
784
859
|
const selectBookmarkEditBookmark = (state) => state.bookmark.bookmarkEdit.bookmark;
|
|
860
|
+
const selectBookmarkByArticleId = (state, idArticle) => state.bookmark.bookmarkList.bookmarks.find((bookmark) => bookmark.targetId === idArticle);
|
|
785
861
|
const Bookmark = {
|
|
786
862
|
slice: bookmarkSlice,
|
|
787
863
|
actions: Object.assign(Object.assign({ fetchBookmark,
|
|
@@ -793,6 +869,7 @@ const Bookmark = {
|
|
|
793
869
|
bookmarkList: selectBookmarkList,
|
|
794
870
|
bookmarkListIsInitialized: selectBookmarkListIsInitialized,
|
|
795
871
|
bookmarkEditBookmark: selectBookmarkEditBookmark,
|
|
872
|
+
bookmarkByArticleId: selectBookmarkByArticleId,
|
|
796
873
|
},
|
|
797
874
|
getRTHandlers: getBookmarkRTHandlers,
|
|
798
875
|
};
|
|
@@ -1416,10 +1493,10 @@ const mediaLibrarySlice = toolkit.createSlice({
|
|
|
1416
1493
|
return Object.assign(Object.assign({}, state), { page: action.payload });
|
|
1417
1494
|
},
|
|
1418
1495
|
setFolderList(state, action) {
|
|
1419
|
-
return Object.assign(Object.assign({}, state), {
|
|
1496
|
+
return Object.assign(Object.assign({}, state), { folders: action.payload });
|
|
1420
1497
|
},
|
|
1421
1498
|
setFileUnclassifiedList(state, action) {
|
|
1422
|
-
return Object.assign(Object.assign({}, state), {
|
|
1499
|
+
return Object.assign(Object.assign({}, state), { unclassifiedFiles: action.payload });
|
|
1423
1500
|
},
|
|
1424
1501
|
},
|
|
1425
1502
|
extraReducers: (builder) => {
|
|
@@ -1718,7 +1795,7 @@ const fetchRecentFiles = toolkit.createAsyncThunk('/fetchRecentFiles', (_, { ext
|
|
|
1718
1795
|
const jApi = extra.jApi;
|
|
1719
1796
|
const state = getState();
|
|
1720
1797
|
const filters = state.wedoc.tab === 'my-documents' ? [{ name: 'idUser', value: '0' }] : [];
|
|
1721
|
-
return yield jApi.wedoc.getFiles(Object.assign(Object.assign({}, initialQuery), { filters, limit:
|
|
1798
|
+
return yield jApi.wedoc.getFiles(Object.assign(Object.assign({}, initialQuery), { filters, limit: 3 }));
|
|
1722
1799
|
}));
|
|
1723
1800
|
|
|
1724
1801
|
const initialState$8 = {
|