jamespot-front-business 1.1.32 → 1.1.33
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 +152 -40
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +152 -40
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +43 -2
- package/package.json +1 -1
package/dist/cjs.js
CHANGED
|
@@ -68,7 +68,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const initialState$
|
|
71
|
+
const initialState$h = {
|
|
72
72
|
entities: [],
|
|
73
73
|
loading: 'idle',
|
|
74
74
|
nbResults: 0,
|
|
@@ -79,7 +79,7 @@ const fetchBookableAsset = toolkit.createAsyncThunk('BookableAsset/fetchBookable
|
|
|
79
79
|
}));
|
|
80
80
|
const BookableAssetSlice = toolkit.createSlice({
|
|
81
81
|
name: 'bookableAsset',
|
|
82
|
-
initialState: initialState$
|
|
82
|
+
initialState: initialState$h,
|
|
83
83
|
reducers: {},
|
|
84
84
|
extraReducers: (builder) => {
|
|
85
85
|
builder
|
|
@@ -100,7 +100,7 @@ const BookableAssetSlice = toolkit.createSlice({
|
|
|
100
100
|
const fetchConfiguration = toolkit.createAsyncThunk('AssetReservation/configuration', (_, { extra }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
101
101
|
return yield extra.jApi.assetReservation.configuration();
|
|
102
102
|
}));
|
|
103
|
-
const initialState$
|
|
103
|
+
const initialState$g = {
|
|
104
104
|
description: '',
|
|
105
105
|
right: {
|
|
106
106
|
manage: false,
|
|
@@ -114,7 +114,7 @@ const initialState$f = {
|
|
|
114
114
|
};
|
|
115
115
|
const AssetReservationConfigurationSlice = toolkit.createSlice({
|
|
116
116
|
name: 'configuration',
|
|
117
|
-
initialState: initialState$
|
|
117
|
+
initialState: initialState$g,
|
|
118
118
|
reducers: {},
|
|
119
119
|
extraReducers: (builder) => {
|
|
120
120
|
builder
|
|
@@ -135,7 +135,7 @@ const initForm = {
|
|
|
135
135
|
hourStart: '',
|
|
136
136
|
hourEnd: '',
|
|
137
137
|
};
|
|
138
|
-
const initialState$
|
|
138
|
+
const initialState$f = {
|
|
139
139
|
entities: [],
|
|
140
140
|
loading: 'idle',
|
|
141
141
|
nbResults: 0,
|
|
@@ -147,7 +147,7 @@ const fetchReservation = toolkit.createAsyncThunk('Reservation/fetchReservation'
|
|
|
147
147
|
}));
|
|
148
148
|
const ReservationSlice = toolkit.createSlice({
|
|
149
149
|
name: 'reservation',
|
|
150
|
-
initialState: initialState$
|
|
150
|
+
initialState: initialState$f,
|
|
151
151
|
reducers: {
|
|
152
152
|
setForm: (state, action) => {
|
|
153
153
|
state.form = action.payload;
|
|
@@ -240,7 +240,7 @@ const Toast = {
|
|
|
240
240
|
selectors: selectors$1,
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
const initialState$
|
|
243
|
+
const initialState$e = {
|
|
244
244
|
bookmarks: [],
|
|
245
245
|
loading: 'idle',
|
|
246
246
|
status: undefined,
|
|
@@ -303,7 +303,7 @@ const deleteBookmark = toolkit.createAsyncThunk('bookmarkList/deleteBookmark', (
|
|
|
303
303
|
}));
|
|
304
304
|
const BookmarkListSlice = toolkit.createSlice({
|
|
305
305
|
name: 'bookmarkList',
|
|
306
|
-
initialState: initialState$
|
|
306
|
+
initialState: initialState$e,
|
|
307
307
|
reducers: {
|
|
308
308
|
resetAddBookmarkStatus: (state, action) => {
|
|
309
309
|
if (state.add[action.payload]) {
|
|
@@ -466,7 +466,7 @@ const getRTHandlers = function (dispatch) {
|
|
|
466
466
|
];
|
|
467
467
|
};
|
|
468
468
|
|
|
469
|
-
const initialState$
|
|
469
|
+
const initialState$d = {
|
|
470
470
|
bookmark: undefined,
|
|
471
471
|
status: undefined,
|
|
472
472
|
loading: 'idle',
|
|
@@ -488,7 +488,7 @@ const editBookmark = toolkit.createAsyncThunk('bookmarkEdit/editBookmark', (book
|
|
|
488
488
|
}));
|
|
489
489
|
const BookmarkEditSlice = toolkit.createSlice({
|
|
490
490
|
name: 'bookmarkEdit',
|
|
491
|
-
initialState: initialState$
|
|
491
|
+
initialState: initialState$d,
|
|
492
492
|
reducers: {
|
|
493
493
|
setEditBookmark: (state, action) => {
|
|
494
494
|
state.bookmark = Object.assign({}, action.payload);
|
|
@@ -541,7 +541,7 @@ const Bookmark = {
|
|
|
541
541
|
getRTHandlers: getRTHandlers,
|
|
542
542
|
};
|
|
543
543
|
|
|
544
|
-
const initialState$
|
|
544
|
+
const initialState$c = {
|
|
545
545
|
loading: 'idle',
|
|
546
546
|
access: { createCategory: false },
|
|
547
547
|
};
|
|
@@ -569,7 +569,7 @@ const fetchFaqConfig = toolkit.createAsyncThunk('faqConfig/fetch', () => __await
|
|
|
569
569
|
}));
|
|
570
570
|
const FaqConfigSlice = toolkit.createSlice({
|
|
571
571
|
name: 'config',
|
|
572
|
-
initialState: initialState$
|
|
572
|
+
initialState: initialState$c,
|
|
573
573
|
reducers: {},
|
|
574
574
|
extraReducers: (builder) => {
|
|
575
575
|
builder
|
|
@@ -601,7 +601,7 @@ const FaqConfigSlice = toolkit.createSlice({
|
|
|
601
601
|
},
|
|
602
602
|
});
|
|
603
603
|
|
|
604
|
-
const initialState$
|
|
604
|
+
const initialState$b = {
|
|
605
605
|
loading: 'idle',
|
|
606
606
|
categories: null,
|
|
607
607
|
};
|
|
@@ -613,7 +613,7 @@ const fetchFaqCategories = toolkit.createAsyncThunk('faqCategories/fetch', () =>
|
|
|
613
613
|
}));
|
|
614
614
|
const FaqCategoriesSlice = toolkit.createSlice({
|
|
615
615
|
name: 'categories',
|
|
616
|
-
initialState: initialState$
|
|
616
|
+
initialState: initialState$b,
|
|
617
617
|
reducers: {},
|
|
618
618
|
extraReducers: (builder) => {
|
|
619
619
|
builder
|
|
@@ -895,7 +895,7 @@ const initialMap = {
|
|
|
895
895
|
illustration: '',
|
|
896
896
|
assignLicense: false,
|
|
897
897
|
};
|
|
898
|
-
const initialState$
|
|
898
|
+
const initialState$a = {
|
|
899
899
|
map: Object.assign({}, initialMap),
|
|
900
900
|
loading: 'idle',
|
|
901
901
|
status: undefined,
|
|
@@ -939,13 +939,13 @@ const createMap = toolkit.createAsyncThunk('mapCreate/create', ({ map, jlandUrlB
|
|
|
939
939
|
}));
|
|
940
940
|
const MapCreateSlice = toolkit.createSlice({
|
|
941
941
|
name: 'mapCreate',
|
|
942
|
-
initialState: initialState$
|
|
942
|
+
initialState: initialState$a,
|
|
943
943
|
reducers: {
|
|
944
944
|
setMap: (state, action) => {
|
|
945
945
|
state.map = action.payload;
|
|
946
946
|
},
|
|
947
947
|
resetCreateMapState: () => {
|
|
948
|
-
return initialState$
|
|
948
|
+
return initialState$a;
|
|
949
949
|
},
|
|
950
950
|
},
|
|
951
951
|
extraReducers: (builder) => {
|
|
@@ -1032,10 +1032,10 @@ const Model = {
|
|
|
1032
1032
|
selectors: Object.assign(Object.assign({}, selectors), { selectByIds }),
|
|
1033
1033
|
};
|
|
1034
1034
|
|
|
1035
|
-
const initialState$
|
|
1035
|
+
const initialState$9 = {};
|
|
1036
1036
|
const NetworkStaticsSlice = toolkit.createSlice({
|
|
1037
1037
|
name: 'statics',
|
|
1038
|
-
initialState: initialState$
|
|
1038
|
+
initialState: initialState$9,
|
|
1039
1039
|
reducers: {
|
|
1040
1040
|
initNetworkStatics: (_, { payload }) => {
|
|
1041
1041
|
return payload;
|
|
@@ -1091,7 +1091,7 @@ const fetchRecentFiles = toolkit.createAsyncThunk('/fetchRecentFiles', (_, { ext
|
|
|
1091
1091
|
return yield jApi.wedoc.getFiles(Object.assign(Object.assign({}, initialQuery), { filters, limit: 4 }));
|
|
1092
1092
|
}));
|
|
1093
1093
|
|
|
1094
|
-
const initialState$
|
|
1094
|
+
const initialState$8 = {
|
|
1095
1095
|
entities: [],
|
|
1096
1096
|
nbEntities: 0,
|
|
1097
1097
|
entitiesRecent: [],
|
|
@@ -1103,7 +1103,7 @@ const initialState$7 = {
|
|
|
1103
1103
|
};
|
|
1104
1104
|
const WedocAppSlice = toolkit.createSlice({
|
|
1105
1105
|
name: 'wedoc',
|
|
1106
|
-
initialState: initialState$
|
|
1106
|
+
initialState: initialState$8,
|
|
1107
1107
|
reducers: {
|
|
1108
1108
|
update: (state, action) => {
|
|
1109
1109
|
state.entities = [
|
|
@@ -1176,14 +1176,14 @@ const fetchRequest = toolkit.createAsyncThunk('/fetchRequest', ({ uri, idUser },
|
|
|
1176
1176
|
return yield jApi.wedoc.getAccessRequest(uri, idUser);
|
|
1177
1177
|
}));
|
|
1178
1178
|
|
|
1179
|
-
const initialState$
|
|
1179
|
+
const initialState$7 = {
|
|
1180
1180
|
entities: [],
|
|
1181
1181
|
nbEntities: 0,
|
|
1182
1182
|
loading: 'idle',
|
|
1183
1183
|
};
|
|
1184
1184
|
const ShareSlice = toolkit.createSlice({
|
|
1185
1185
|
name: 'share',
|
|
1186
|
-
initialState: initialState$
|
|
1186
|
+
initialState: initialState$7,
|
|
1187
1187
|
reducers: {
|
|
1188
1188
|
remove: (state, action) => {
|
|
1189
1189
|
state.entities = [
|
|
@@ -1221,7 +1221,7 @@ const Share = {
|
|
|
1221
1221
|
},
|
|
1222
1222
|
};
|
|
1223
1223
|
|
|
1224
|
-
const initialState$
|
|
1224
|
+
const initialState$6 = {
|
|
1225
1225
|
channels: undefined,
|
|
1226
1226
|
loading: 'idle',
|
|
1227
1227
|
loadingChannelDeletion: 'idle',
|
|
@@ -1264,7 +1264,7 @@ const deleteChannel = toolkit.createAsyncThunk('/deleteChannel', ({ channel }, {
|
|
|
1264
1264
|
}));
|
|
1265
1265
|
const ChannelsListSlice = toolkit.createSlice({
|
|
1266
1266
|
name: 'channelsList',
|
|
1267
|
-
initialState: Object.assign({}, initialState$
|
|
1267
|
+
initialState: Object.assign({}, initialState$6),
|
|
1268
1268
|
reducers: {},
|
|
1269
1269
|
extraReducers: (builder) => {
|
|
1270
1270
|
builder
|
|
@@ -1333,10 +1333,10 @@ const TVDisplay = {
|
|
|
1333
1333
|
},
|
|
1334
1334
|
};
|
|
1335
1335
|
|
|
1336
|
-
const initialState$
|
|
1336
|
+
const initialState$5 = {};
|
|
1337
1337
|
const TinyMCEOptionsSlice = toolkit.createSlice({
|
|
1338
1338
|
name: 'options',
|
|
1339
|
-
initialState: initialState$
|
|
1339
|
+
initialState: initialState$5,
|
|
1340
1340
|
reducers: {
|
|
1341
1341
|
initOptions: (_, { payload }) => {
|
|
1342
1342
|
return { common: payload };
|
|
@@ -1362,7 +1362,7 @@ const TinyMCE = {
|
|
|
1362
1362
|
},
|
|
1363
1363
|
};
|
|
1364
1364
|
|
|
1365
|
-
const initialState$
|
|
1365
|
+
const initialState$4 = {
|
|
1366
1366
|
id: 0,
|
|
1367
1367
|
mainType: 'user',
|
|
1368
1368
|
type: 'user',
|
|
@@ -1376,7 +1376,7 @@ const initialState$3 = {
|
|
|
1376
1376
|
};
|
|
1377
1377
|
const slice = toolkit.createSlice({
|
|
1378
1378
|
name: 'userCurrent',
|
|
1379
|
-
initialState: initialState$
|
|
1379
|
+
initialState: initialState$4,
|
|
1380
1380
|
reducers: {
|
|
1381
1381
|
init: (_, { payload }) => {
|
|
1382
1382
|
return payload;
|
|
@@ -1594,7 +1594,7 @@ function widgetDefinition(name) {
|
|
|
1594
1594
|
|
|
1595
1595
|
const MODE_EDIT = 'edit';
|
|
1596
1596
|
const MODE_VIEW = 'view';
|
|
1597
|
-
const initialState$
|
|
1597
|
+
const initialState$3 = {
|
|
1598
1598
|
token: undefined,
|
|
1599
1599
|
ids: {},
|
|
1600
1600
|
layers: {},
|
|
@@ -1606,7 +1606,7 @@ const initialState$2 = {
|
|
|
1606
1606
|
};
|
|
1607
1607
|
const widgetsSlice = toolkit.createSlice({
|
|
1608
1608
|
name: 'widgets',
|
|
1609
|
-
initialState: initialState$
|
|
1609
|
+
initialState: initialState$3,
|
|
1610
1610
|
reducers: {
|
|
1611
1611
|
registerWidget: (state, action) => {
|
|
1612
1612
|
const { uniqid, widget } = action.payload;
|
|
@@ -1748,12 +1748,12 @@ const Widget = {
|
|
|
1748
1748
|
},
|
|
1749
1749
|
};
|
|
1750
1750
|
|
|
1751
|
-
const initialState$
|
|
1751
|
+
const initialState$2 = {
|
|
1752
1752
|
editors: [],
|
|
1753
1753
|
};
|
|
1754
1754
|
const editorsSlice = toolkit.createSlice({
|
|
1755
1755
|
name: 'editors',
|
|
1756
|
-
initialState: initialState$
|
|
1756
|
+
initialState: initialState$2,
|
|
1757
1757
|
reducers: {
|
|
1758
1758
|
registerEditor: (state, action) => {
|
|
1759
1759
|
const { uniqid, name } = action.payload;
|
|
@@ -1979,6 +1979,51 @@ function serverAppsToStudioApps(serverApps) {
|
|
|
1979
1979
|
return studioApps;
|
|
1980
1980
|
}
|
|
1981
1981
|
|
|
1982
|
+
const initialState$1 = {
|
|
1983
|
+
currentStudioApp: null,
|
|
1984
|
+
fetchCurrentStudioAppStatus: 'idle',
|
|
1985
|
+
};
|
|
1986
|
+
const fetchCurrentStudioApp = toolkit.createAsyncThunk('studio/fetchCurrentStudioApp', ({ idApp, status }, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1987
|
+
const jApi = extra.jApi;
|
|
1988
|
+
const error = { error: 1, errorMsg: 'Error fetching application' };
|
|
1989
|
+
try {
|
|
1990
|
+
const studioApplicationBase = (yield jApi.application.get(idApp, status)).result;
|
|
1991
|
+
const studioApplication = serverAppsToStudioApps([studioApplicationBase])[0];
|
|
1992
|
+
if (!studioApplication) {
|
|
1993
|
+
return rejectWithValue(error);
|
|
1994
|
+
}
|
|
1995
|
+
return studioApplication;
|
|
1996
|
+
}
|
|
1997
|
+
catch (_) {
|
|
1998
|
+
return rejectWithValue(error);
|
|
1999
|
+
}
|
|
2000
|
+
}));
|
|
2001
|
+
const CurrentStudioAppSlice = toolkit.createSlice({
|
|
2002
|
+
name: 'currentStudioApp',
|
|
2003
|
+
initialState: initialState$1,
|
|
2004
|
+
reducers: {
|
|
2005
|
+
setCurrentApp: (state, action) => {
|
|
2006
|
+
state.currentStudioApp = action.payload;
|
|
2007
|
+
},
|
|
2008
|
+
},
|
|
2009
|
+
extraReducers: (builder) => {
|
|
2010
|
+
builder
|
|
2011
|
+
.addCase(fetchCurrentStudioApp.pending, (state) => {
|
|
2012
|
+
if (state.fetchCurrentStudioAppStatus === 'idle')
|
|
2013
|
+
state.fetchCurrentStudioAppStatus = 'pending';
|
|
2014
|
+
})
|
|
2015
|
+
.addCase(fetchCurrentStudioApp.fulfilled, (state, action) => {
|
|
2016
|
+
if (state.fetchCurrentStudioAppStatus === 'pending')
|
|
2017
|
+
state.fetchCurrentStudioAppStatus = 'idle';
|
|
2018
|
+
state.currentStudioApp = action.payload;
|
|
2019
|
+
})
|
|
2020
|
+
.addCase(fetchCurrentStudioApp.rejected, (state) => {
|
|
2021
|
+
if (state.fetchCurrentStudioAppStatus === 'pending')
|
|
2022
|
+
state.fetchCurrentStudioAppStatus = 'idle';
|
|
2023
|
+
});
|
|
2024
|
+
},
|
|
2025
|
+
});
|
|
2026
|
+
|
|
1982
2027
|
function cloneStudioAppFromExistingApp(existingApp, author) {
|
|
1983
2028
|
const newApp = existingApp.inWorkVersion
|
|
1984
2029
|
? JSON.parse(JSON.stringify(existingApp.inWorkVersion))
|
|
@@ -1991,6 +2036,37 @@ function cloneStudioAppFromExistingApp(existingApp, author) {
|
|
|
1991
2036
|
return [newApp, newAppId];
|
|
1992
2037
|
}
|
|
1993
2038
|
|
|
2039
|
+
function createNewStudioApp$1({ author }) {
|
|
2040
|
+
const newAppId = uuid.v4();
|
|
2041
|
+
return {
|
|
2042
|
+
newAppId,
|
|
2043
|
+
newStudioApp: {
|
|
2044
|
+
idApp: newAppId,
|
|
2045
|
+
status: APP_STATUS_TYPE.DRAFT,
|
|
2046
|
+
author: author || '',
|
|
2047
|
+
manifest: {
|
|
2048
|
+
appShortName: newAppId,
|
|
2049
|
+
appName: newAppId,
|
|
2050
|
+
author: author || '',
|
|
2051
|
+
description: '',
|
|
2052
|
+
typeLabel: '',
|
|
2053
|
+
cssColor: '#392994',
|
|
2054
|
+
cssClass: {
|
|
2055
|
+
label: 'star',
|
|
2056
|
+
value: 'star',
|
|
2057
|
+
},
|
|
2058
|
+
version: 0.1,
|
|
2059
|
+
dateCreation: new Date().toISOString(),
|
|
2060
|
+
viewSolr: 'solr',
|
|
2061
|
+
checkAccess: false,
|
|
2062
|
+
accessRightList: '',
|
|
2063
|
+
attrExposed: [],
|
|
2064
|
+
articlesCount: 0,
|
|
2065
|
+
},
|
|
2066
|
+
},
|
|
2067
|
+
};
|
|
2068
|
+
}
|
|
2069
|
+
|
|
1994
2070
|
const initialState = {
|
|
1995
2071
|
studioAppsList: [],
|
|
1996
2072
|
loadingStudioAppsList: 'idle',
|
|
@@ -1998,6 +2074,7 @@ const initialState = {
|
|
|
1998
2074
|
suspendStudioAppStatus: 'idle',
|
|
1999
2075
|
restartStudioAppStatus: 'idle',
|
|
2000
2076
|
cloneStudioAppStatus: 'idle',
|
|
2077
|
+
createNewStudioAppStatus: 'idle',
|
|
2001
2078
|
};
|
|
2002
2079
|
const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (_, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2003
2080
|
const jApi = extra.jApi;
|
|
@@ -2010,7 +2087,21 @@ const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (_, { ex
|
|
|
2010
2087
|
})));
|
|
2011
2088
|
}
|
|
2012
2089
|
catch (_) {
|
|
2013
|
-
|
|
2090
|
+
throw rejectWithValue({ error: 1, errorMsg: 'Error retrieving applications' });
|
|
2091
|
+
}
|
|
2092
|
+
}));
|
|
2093
|
+
const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', (_, { extra, dispatch, rejectWithValue, getState }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2094
|
+
var _a;
|
|
2095
|
+
const jApi = extra.jApi;
|
|
2096
|
+
const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
|
|
2097
|
+
const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({}, (author && { author })));
|
|
2098
|
+
try {
|
|
2099
|
+
yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
|
|
2100
|
+
dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
|
|
2101
|
+
return newStudioApp;
|
|
2102
|
+
}
|
|
2103
|
+
catch (_) {
|
|
2104
|
+
throw rejectWithValue({ error: 1, errorMsg: 'Error creating application' });
|
|
2014
2105
|
}
|
|
2015
2106
|
}));
|
|
2016
2107
|
const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -2041,12 +2132,12 @@ const restartStudioApp = toolkit.createAsyncThunk('studio/restartStudioApp', ({
|
|
|
2041
2132
|
}
|
|
2042
2133
|
}));
|
|
2043
2134
|
const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idApp }, { extra, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2044
|
-
var
|
|
2135
|
+
var _b;
|
|
2045
2136
|
const jApi = extra.jApi;
|
|
2046
2137
|
const existingStudioApp = getState().studio.studioAppsList.studioAppsList.find((app) => app.idApp === idApp);
|
|
2047
2138
|
if (!existingStudioApp)
|
|
2048
2139
|
return rejectWithValue({ error: 1, errorMsg: 'Error cloning application' });
|
|
2049
|
-
const currentUser = (
|
|
2140
|
+
const currentUser = (_b = getState().userCurrent) === null || _b === void 0 ? void 0 : _b.uri;
|
|
2050
2141
|
const [clonedStudioApp, newAppId] = cloneStudioAppFromExistingApp(existingStudioApp, currentUser);
|
|
2051
2142
|
const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
|
|
2052
2143
|
try {
|
|
@@ -2160,29 +2251,50 @@ const StudioAppsListSlice = toolkit.createSlice({
|
|
|
2160
2251
|
.addCase(cloneStudioApp.rejected, (state) => {
|
|
2161
2252
|
if (state.cloneStudioAppStatus === 'pending')
|
|
2162
2253
|
state.cloneStudioAppStatus = 'idle';
|
|
2254
|
+
})
|
|
2255
|
+
.addCase(createNewStudioApp.pending, (state) => {
|
|
2256
|
+
if (state.createNewStudioAppStatus === 'idle')
|
|
2257
|
+
state.createNewStudioAppStatus = 'pending';
|
|
2258
|
+
})
|
|
2259
|
+
.addCase(createNewStudioApp.fulfilled, (state, action) => {
|
|
2260
|
+
if (state.createNewStudioAppStatus === 'pending') {
|
|
2261
|
+
state.createNewStudioAppStatus = 'idle';
|
|
2262
|
+
}
|
|
2263
|
+
state.studioAppsList = [...state.studioAppsList, action.payload];
|
|
2264
|
+
})
|
|
2265
|
+
.addCase(createNewStudioApp.rejected, (state) => {
|
|
2266
|
+
if (state.createNewStudioAppStatus === 'pending')
|
|
2267
|
+
state.createNewStudioAppStatus = 'idle';
|
|
2163
2268
|
});
|
|
2164
2269
|
},
|
|
2165
2270
|
});
|
|
2166
2271
|
|
|
2167
2272
|
const joinedReducers = redux.combineReducers({
|
|
2168
2273
|
[StudioAppsListSlice.name]: StudioAppsListSlice.reducer,
|
|
2274
|
+
[CurrentStudioAppSlice.name]: CurrentStudioAppSlice.reducer,
|
|
2169
2275
|
});
|
|
2170
|
-
|
|
2276
|
+
function selectStudioAppsList(state) {
|
|
2171
2277
|
return state.studio.studioAppsList;
|
|
2172
|
-
}
|
|
2278
|
+
}
|
|
2279
|
+
function selectCurrentStudioApp(state) {
|
|
2280
|
+
return state.studio.currentStudioApp;
|
|
2281
|
+
}
|
|
2173
2282
|
const studioSlice = {
|
|
2174
2283
|
name: 'studio',
|
|
2175
2284
|
reducer: joinedReducers,
|
|
2176
2285
|
};
|
|
2177
2286
|
const studio = {
|
|
2178
2287
|
slice: studioSlice,
|
|
2179
|
-
actions: Object.assign(Object.assign({}, StudioAppsListSlice.actions), { fetchStudioAppsList,
|
|
2288
|
+
actions: Object.assign(Object.assign(Object.assign({}, StudioAppsListSlice.actions), CurrentStudioAppSlice.actions), { fetchStudioAppsList,
|
|
2180
2289
|
deleteStudioApp,
|
|
2181
2290
|
suspendStudioApp,
|
|
2182
2291
|
restartStudioApp,
|
|
2183
|
-
cloneStudioApp
|
|
2292
|
+
cloneStudioApp,
|
|
2293
|
+
createNewStudioApp,
|
|
2294
|
+
fetchCurrentStudioApp }),
|
|
2184
2295
|
selectors: {
|
|
2185
2296
|
selectStudioAppsList,
|
|
2297
|
+
selectCurrentStudioApp,
|
|
2186
2298
|
},
|
|
2187
2299
|
};
|
|
2188
2300
|
|