jamespot-front-business 1.1.33 → 1.1.35
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 +99 -120
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +99 -112
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +56 -235
- package/package.json +1 -1
package/dist/cjs.js
CHANGED
|
@@ -1818,109 +1818,46 @@ const APP_STATUS_TYPE = {
|
|
|
1818
1818
|
INSTALLED: exports.StatusType.installed,
|
|
1819
1819
|
SUSPENDED: exports.StatusType.suspended,
|
|
1820
1820
|
};
|
|
1821
|
-
exports.AppFormItemType = void 0;
|
|
1822
|
-
(function (AppFormItemType) {
|
|
1823
|
-
AppFormItemType["TITLE"] = "TITLE";
|
|
1824
|
-
AppFormItemType["IMAGE"] = "IMAGE";
|
|
1825
|
-
AppFormItemType["DESCRIPTION"] = "DESCRIPTION";
|
|
1826
|
-
AppFormItemType["IDUSER"] = "IDUSER";
|
|
1827
|
-
AppFormItemType["PUBLISHTO"] = "PUBLISHTO";
|
|
1828
|
-
AppFormItemType["SENDALERTTOSUBSCRIBERS"] = "SENDALERTTOSUBSCRIBERS";
|
|
1829
|
-
AppFormItemType["RECEIVEACOPY"] = "RECEIVEACOPY";
|
|
1830
|
-
AppFormItemType["TEXT"] = "TEXT";
|
|
1831
|
-
AppFormItemType["TEXTAREA"] = "TEXTAREA";
|
|
1832
|
-
AppFormItemType["TEXTAREAHTML"] = "TEXTAREAHTML";
|
|
1833
|
-
AppFormItemType["DATE"] = "DATE";
|
|
1834
|
-
AppFormItemType["DATETIME"] = "DATETIME";
|
|
1835
|
-
AppFormItemType["RANGE"] = "RANGE";
|
|
1836
|
-
AppFormItemType["NUMBER"] = "NUMBER";
|
|
1837
|
-
AppFormItemType["URL"] = "URL";
|
|
1838
|
-
AppFormItemType["EMAIL"] = "EMAIL";
|
|
1839
|
-
AppFormItemType["SELECT"] = "SELECT";
|
|
1840
|
-
AppFormItemType["CHECKBOX"] = "CHECKBOX";
|
|
1841
|
-
AppFormItemType["TOGGLE"] = "TOGGLE";
|
|
1842
|
-
AppFormItemType["RADIO"] = "RADIO";
|
|
1843
|
-
AppFormItemType["TAGS"] = "TAGS";
|
|
1844
|
-
AppFormItemType["ADDFILEATTACHMENT"] = "ADDFILEATTACHMENT";
|
|
1845
|
-
AppFormItemType["AUDIENCE"] = "AUDIENCE";
|
|
1846
|
-
AppFormItemType["CODEHTML"] = "CODEHTML";
|
|
1847
|
-
AppFormItemType["DATECREATION"] = "DATECREATION";
|
|
1848
|
-
AppFormItemType["USERLINK"] = "USERLINK";
|
|
1849
|
-
AppFormItemType["CONTENTLINK"] = "CONTENTLINK";
|
|
1850
|
-
})(exports.AppFormItemType || (exports.AppFormItemType = {}));
|
|
1851
|
-
const AppFormPrimaryList = [exports.AppFormItemType.DESCRIPTION];
|
|
1852
|
-
const AppFormNotFields = [exports.AppFormItemType.AUDIENCE, exports.AppFormItemType.RANGE];
|
|
1853
|
-
const AppFormFixedHeadList = {
|
|
1854
|
-
create: [exports.AppFormItemType.TITLE],
|
|
1855
|
-
popup: [exports.AppFormItemType.TITLE],
|
|
1856
|
-
edit: [exports.AppFormItemType.TITLE],
|
|
1857
|
-
list: [exports.AppFormItemType.TITLE, exports.AppFormItemType.IDUSER],
|
|
1858
|
-
filter: [exports.AppFormItemType.TITLE, exports.AppFormItemType.IDUSER],
|
|
1859
|
-
view: [exports.AppFormItemType.TITLE],
|
|
1860
|
-
};
|
|
1861
|
-
const AppFormFixedFootList4View = {
|
|
1862
|
-
create: [exports.AppFormItemType.PUBLISHTO, exports.AppFormItemType.SENDALERTTOSUBSCRIBERS, exports.AppFormItemType.RECEIVEACOPY],
|
|
1863
|
-
popup: [exports.AppFormItemType.PUBLISHTO],
|
|
1864
|
-
edit: [exports.AppFormItemType.PUBLISHTO],
|
|
1865
|
-
list: [exports.AppFormItemType.DATECREATION],
|
|
1866
|
-
filter: [exports.AppFormItemType.DATECREATION],
|
|
1867
|
-
view: [],
|
|
1868
|
-
};
|
|
1869
|
-
const AppFormFixedList = [
|
|
1870
|
-
exports.AppFormItemType.TITLE,
|
|
1871
|
-
exports.AppFormItemType.PUBLISHTO,
|
|
1872
|
-
exports.AppFormItemType.SENDALERTTOSUBSCRIBERS,
|
|
1873
|
-
exports.AppFormItemType.RECEIVEACOPY,
|
|
1874
|
-
exports.AppFormItemType.IDUSER,
|
|
1875
|
-
exports.AppFormItemType.DATECREATION,
|
|
1876
|
-
];
|
|
1877
|
-
const AppFormUniqueList = [exports.AppFormItemType.DESCRIPTION, exports.AppFormItemType.IMAGE];
|
|
1878
|
-
const AppFormBannedFromViews = new Map();
|
|
1879
|
-
AppFormBannedFromViews.set(exports.AppFormItemType.IMAGE, ['list', 'filter', 'view']);
|
|
1880
|
-
const AppListFilter = [
|
|
1881
|
-
exports.AppFormItemType.TITLE,
|
|
1882
|
-
exports.AppFormItemType.DESCRIPTION,
|
|
1883
|
-
exports.AppFormItemType.TEXT,
|
|
1884
|
-
exports.AppFormItemType.TEXTAREA,
|
|
1885
|
-
exports.AppFormItemType.TEXTAREAHTML,
|
|
1886
|
-
exports.AppFormItemType.DATE,
|
|
1887
|
-
exports.AppFormItemType.DATETIME,
|
|
1888
|
-
exports.AppFormItemType.RANGE,
|
|
1889
|
-
exports.AppFormItemType.NUMBER,
|
|
1890
|
-
exports.AppFormItemType.URL,
|
|
1891
|
-
exports.AppFormItemType.EMAIL,
|
|
1892
|
-
exports.AppFormItemType.SELECT,
|
|
1893
|
-
exports.AppFormItemType.TOGGLE,
|
|
1894
|
-
exports.AppFormItemType.CHECKBOX,
|
|
1895
|
-
exports.AppFormItemType.RADIO,
|
|
1896
|
-
exports.AppFormItemType.TAGS,
|
|
1897
|
-
exports.AppFormItemType.PUBLISHTO,
|
|
1898
|
-
exports.AppFormItemType.SENDALERTTOSUBSCRIBERS,
|
|
1899
|
-
exports.AppFormItemType.RECEIVEACOPY,
|
|
1900
|
-
exports.AppFormItemType.ADDFILEATTACHMENT,
|
|
1901
|
-
exports.AppFormItemType.CODEHTML,
|
|
1902
|
-
exports.AppFormItemType.IDUSER,
|
|
1903
|
-
exports.AppFormItemType.DATECREATION,
|
|
1904
|
-
exports.AppFormItemType.USERLINK,
|
|
1905
|
-
exports.AppFormItemType.CONTENTLINK,
|
|
1906
|
-
];
|
|
1907
|
-
const AppFormNoFixedValueList = {
|
|
1908
|
-
create: [exports.AppFormItemType.IMAGE, exports.AppFormItemType.ADDFILEATTACHMENT, exports.AppFormItemType.CODEHTML],
|
|
1909
|
-
popup: [exports.AppFormItemType.IMAGE, exports.AppFormItemType.ADDFILEATTACHMENT, exports.AppFormItemType.CODEHTML],
|
|
1910
|
-
edit: [exports.AppFormItemType.IMAGE, exports.AppFormItemType.ADDFILEATTACHMENT, exports.AppFormItemType.CODEHTML],
|
|
1911
|
-
list: AppListFilter,
|
|
1912
|
-
filter: AppListFilter,
|
|
1913
|
-
view: AppListFilter,
|
|
1914
|
-
};
|
|
1915
|
-
const AppFormNoAsFieldList = AppFormFixedList.concat(AppFormNotFields)
|
|
1916
|
-
.concat(exports.AppFormItemType.IDUSER)
|
|
1917
|
-
.concat(exports.AppFormItemType.TITLE);
|
|
1918
|
-
const AppFormFieldOnlyInView = [exports.AppFormItemType.CODEHTML];
|
|
1919
|
-
const AppFormNonPrimaryList = AppFormNoAsFieldList.concat(AppFormFieldOnlyInView).concat(AppFormPrimaryList);
|
|
1920
1821
|
const STUDIO_VIEW = {
|
|
1921
1822
|
SOLR: '1',
|
|
1922
1823
|
NOT_SOLR: '0',
|
|
1923
1824
|
};
|
|
1825
|
+
const viewsList = ['create', 'popup', 'edit', 'list', 'filter', 'view'];
|
|
1826
|
+
exports.AppFormItemTypes = void 0;
|
|
1827
|
+
(function (AppFormItemTypes) {
|
|
1828
|
+
AppFormItemTypes["IMAGE"] = "IMAGE";
|
|
1829
|
+
AppFormItemTypes["DESCRIPTION"] = "DESCRIPTION";
|
|
1830
|
+
AppFormItemTypes["TEXT"] = "TEXT";
|
|
1831
|
+
AppFormItemTypes["TEXTAREA"] = "TEXTAREA";
|
|
1832
|
+
AppFormItemTypes["TEXTAREAHTML"] = "TEXTAREAHTML";
|
|
1833
|
+
AppFormItemTypes["DATE"] = "DATE";
|
|
1834
|
+
AppFormItemTypes["DATETIME"] = "DATETIME";
|
|
1835
|
+
AppFormItemTypes["NUMBER"] = "NUMBER";
|
|
1836
|
+
AppFormItemTypes["URL"] = "URL";
|
|
1837
|
+
AppFormItemTypes["EMAIL"] = "EMAIL";
|
|
1838
|
+
AppFormItemTypes["SELECT"] = "SELECT";
|
|
1839
|
+
AppFormItemTypes["CHECKBOX"] = "CHECKBOX";
|
|
1840
|
+
AppFormItemTypes["TOGGLE"] = "TOGGLE";
|
|
1841
|
+
AppFormItemTypes["RADIO"] = "RADIO";
|
|
1842
|
+
AppFormItemTypes["TAGS"] = "TAGS";
|
|
1843
|
+
AppFormItemTypes["ADDFILEATTACHMENT"] = "ADDFILEATTACHMENT";
|
|
1844
|
+
AppFormItemTypes["CODEHTML"] = "CODEHTML";
|
|
1845
|
+
AppFormItemTypes["USERLINK"] = "USERLINK";
|
|
1846
|
+
AppFormItemTypes["CONTENTLINK"] = "CONTENTLINK";
|
|
1847
|
+
})(exports.AppFormItemTypes || (exports.AppFormItemTypes = {}));
|
|
1848
|
+
exports.AppFieldFormPropertyTypes = void 0;
|
|
1849
|
+
(function (AppFieldFormPropertyTypes) {
|
|
1850
|
+
AppFieldFormPropertyTypes["LABEL"] = "label";
|
|
1851
|
+
AppFieldFormPropertyTypes["DESCRIPTION"] = "description";
|
|
1852
|
+
AppFieldFormPropertyTypes["RICHTEXT"] = "richtext";
|
|
1853
|
+
AppFieldFormPropertyTypes["CHECKBOX"] = "checkbox";
|
|
1854
|
+
AppFieldFormPropertyTypes["OPTIONS_EDITOR"] = "options_editor";
|
|
1855
|
+
AppFieldFormPropertyTypes["TAXONOMY"] = "taxonomy";
|
|
1856
|
+
AppFieldFormPropertyTypes["CONTENTTYPE"] = "contenttype";
|
|
1857
|
+
})(exports.AppFieldFormPropertyTypes || (exports.AppFieldFormPropertyTypes = {}));
|
|
1858
|
+
const AppFormUniqueList = [exports.AppFormItemTypes.DESCRIPTION, exports.AppFormItemTypes.IMAGE];
|
|
1859
|
+
const AppFormBannedFromViews = new Map();
|
|
1860
|
+
AppFormBannedFromViews.set(exports.AppFormItemTypes.IMAGE, ['list', 'filter', 'view']);
|
|
1924
1861
|
|
|
1925
1862
|
function InstalledAppStudioAdapter(serverApp, serverApps) {
|
|
1926
1863
|
const { version, dateCreation } = serverApp.manifest;
|
|
@@ -1929,6 +1866,7 @@ function InstalledAppStudioAdapter(serverApp, serverApps) {
|
|
|
1929
1866
|
idApp: serverApp.idApp,
|
|
1930
1867
|
status: _formatStatus(serverApp),
|
|
1931
1868
|
manifest: Object.assign({ appShortName: serverApp.name, appName: serverApp.label, description: serverApp.description, author: serverApp.author, cssColor: appTypeServer.cssColor, cssClass: { label: appTypeServer.cssClass, value: appTypeServer.cssClass }, version: version, dateCreation: dateCreation, checkAccess: serverApp.checkAccess, attrExposed: serverApp.attrExposed, viewSolr: serverApp.view, typeLabel: appTypeServer.typeLabel }, (serverApp.articlesCount && { articlesCount: serverApp.articlesCount })),
|
|
1869
|
+
fields: [],
|
|
1932
1870
|
};
|
|
1933
1871
|
const inWorkAppVersion = _findAssociatedDraft(serverApp.idApp, serverApps);
|
|
1934
1872
|
if (!inWorkAppVersion)
|
|
@@ -1947,6 +1885,7 @@ function DraftAppStudioAdapter(serverApp) {
|
|
|
1947
1885
|
idApp: serverApp.idApp,
|
|
1948
1886
|
status: _formatStatus(serverApp),
|
|
1949
1887
|
manifest: parsedJson.manifest,
|
|
1888
|
+
fields: parsedJson.fields,
|
|
1950
1889
|
};
|
|
1951
1890
|
}
|
|
1952
1891
|
function _formatStatus(serverApp) {
|
|
@@ -1982,6 +1921,7 @@ function serverAppsToStudioApps(serverApps) {
|
|
|
1982
1921
|
const initialState$1 = {
|
|
1983
1922
|
currentStudioApp: null,
|
|
1984
1923
|
fetchCurrentStudioAppStatus: 'idle',
|
|
1924
|
+
saveCurrentStudioAppStatus: 'idle',
|
|
1985
1925
|
};
|
|
1986
1926
|
const fetchCurrentStudioApp = toolkit.createAsyncThunk('studio/fetchCurrentStudioApp', ({ idApp, status }, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1987
1927
|
const jApi = extra.jApi;
|
|
@@ -1998,6 +1938,24 @@ const fetchCurrentStudioApp = toolkit.createAsyncThunk('studio/fetchCurrentStudi
|
|
|
1998
1938
|
return rejectWithValue(error);
|
|
1999
1939
|
}
|
|
2000
1940
|
}));
|
|
1941
|
+
const saveCurrentStudioApp = toolkit.createAsyncThunk('studio/saveCurrentStudioApp', (_, { extra, rejectWithValue, getState, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1942
|
+
const jApi = extra.jApi;
|
|
1943
|
+
const error = { error: 1, errorMsg: 'Error saving application' };
|
|
1944
|
+
const currentStudioApp = getState().studio.currentStudioApp.currentStudioApp;
|
|
1945
|
+
if (!currentStudioApp) {
|
|
1946
|
+
return rejectWithValue(error);
|
|
1947
|
+
}
|
|
1948
|
+
const stringifiedApp = JSON.stringify(currentStudioApp);
|
|
1949
|
+
try {
|
|
1950
|
+
yield jApi.application.save(currentStudioApp.idApp, stringifiedApp, 'saved');
|
|
1951
|
+
dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Edition_Saved' }));
|
|
1952
|
+
return;
|
|
1953
|
+
}
|
|
1954
|
+
catch (_) {
|
|
1955
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
1956
|
+
return rejectWithValue(error);
|
|
1957
|
+
}
|
|
1958
|
+
}));
|
|
2001
1959
|
const CurrentStudioAppSlice = toolkit.createSlice({
|
|
2002
1960
|
name: 'currentStudioApp',
|
|
2003
1961
|
initialState: initialState$1,
|
|
@@ -2005,6 +1963,9 @@ const CurrentStudioAppSlice = toolkit.createSlice({
|
|
|
2005
1963
|
setCurrentApp: (state, action) => {
|
|
2006
1964
|
state.currentStudioApp = action.payload;
|
|
2007
1965
|
},
|
|
1966
|
+
resetCurrentApp: (state) => {
|
|
1967
|
+
state.currentStudioApp = null;
|
|
1968
|
+
},
|
|
2008
1969
|
},
|
|
2009
1970
|
extraReducers: (builder) => {
|
|
2010
1971
|
builder
|
|
@@ -2020,6 +1981,18 @@ const CurrentStudioAppSlice = toolkit.createSlice({
|
|
|
2020
1981
|
.addCase(fetchCurrentStudioApp.rejected, (state) => {
|
|
2021
1982
|
if (state.fetchCurrentStudioAppStatus === 'pending')
|
|
2022
1983
|
state.fetchCurrentStudioAppStatus = 'idle';
|
|
1984
|
+
})
|
|
1985
|
+
.addCase(saveCurrentStudioApp.pending, (state) => {
|
|
1986
|
+
if (state.saveCurrentStudioAppStatus === 'idle')
|
|
1987
|
+
state.saveCurrentStudioAppStatus = 'pending';
|
|
1988
|
+
})
|
|
1989
|
+
.addCase(saveCurrentStudioApp.fulfilled, (state) => {
|
|
1990
|
+
if (state.saveCurrentStudioAppStatus === 'pending')
|
|
1991
|
+
state.saveCurrentStudioAppStatus = 'idle';
|
|
1992
|
+
})
|
|
1993
|
+
.addCase(saveCurrentStudioApp.rejected, (state) => {
|
|
1994
|
+
if (state.saveCurrentStudioAppStatus === 'pending')
|
|
1995
|
+
state.saveCurrentStudioAppStatus = 'idle';
|
|
2023
1996
|
});
|
|
2024
1997
|
},
|
|
2025
1998
|
});
|
|
@@ -2036,7 +2009,7 @@ function cloneStudioAppFromExistingApp(existingApp, author) {
|
|
|
2036
2009
|
return [newApp, newAppId];
|
|
2037
2010
|
}
|
|
2038
2011
|
|
|
2039
|
-
function createNewStudioApp$1({ author }) {
|
|
2012
|
+
function createNewStudioApp$1({ author, appName }) {
|
|
2040
2013
|
const newAppId = uuid.v4();
|
|
2041
2014
|
return {
|
|
2042
2015
|
newAppId,
|
|
@@ -2045,8 +2018,8 @@ function createNewStudioApp$1({ author }) {
|
|
|
2045
2018
|
status: APP_STATUS_TYPE.DRAFT,
|
|
2046
2019
|
author: author || '',
|
|
2047
2020
|
manifest: {
|
|
2048
|
-
appShortName:
|
|
2049
|
-
appName:
|
|
2021
|
+
appShortName: appName,
|
|
2022
|
+
appName: appName,
|
|
2050
2023
|
author: author || '',
|
|
2051
2024
|
description: '',
|
|
2052
2025
|
typeLabel: '',
|
|
@@ -2063,6 +2036,7 @@ function createNewStudioApp$1({ author }) {
|
|
|
2063
2036
|
attrExposed: [],
|
|
2064
2037
|
articlesCount: 0,
|
|
2065
2038
|
},
|
|
2039
|
+
fields: [],
|
|
2066
2040
|
},
|
|
2067
2041
|
};
|
|
2068
2042
|
}
|
|
@@ -2076,7 +2050,7 @@ const initialState = {
|
|
|
2076
2050
|
cloneStudioAppStatus: 'idle',
|
|
2077
2051
|
createNewStudioAppStatus: 'idle',
|
|
2078
2052
|
};
|
|
2079
|
-
const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (_, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2053
|
+
const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (_, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2080
2054
|
const jApi = extra.jApi;
|
|
2081
2055
|
try {
|
|
2082
2056
|
const { result } = yield jApi.application.list();
|
|
@@ -2087,51 +2061,61 @@ const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (_, { ex
|
|
|
2087
2061
|
})));
|
|
2088
2062
|
}
|
|
2089
2063
|
catch (_) {
|
|
2064
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
2090
2065
|
throw rejectWithValue({ error: 1, errorMsg: 'Error retrieving applications' });
|
|
2091
2066
|
}
|
|
2092
2067
|
}));
|
|
2093
|
-
const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', (
|
|
2068
|
+
const createNewStudioApp = toolkit.createAsyncThunk('studio/createApp', ({ appName }, { extra, dispatch, rejectWithValue, getState }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2094
2069
|
var _a;
|
|
2095
2070
|
const jApi = extra.jApi;
|
|
2096
2071
|
const author = (_a = getState().userCurrent) === null || _a === void 0 ? void 0 : _a.uri;
|
|
2097
|
-
const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({}, (author && { author })));
|
|
2072
|
+
const { newAppId, newStudioApp } = createNewStudioApp$1(Object.assign({ appName }, (author && { author })));
|
|
2098
2073
|
try {
|
|
2099
2074
|
yield jApi.application.save(newAppId, JSON.stringify(newStudioApp), 'saved');
|
|
2075
|
+
dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Created' }));
|
|
2100
2076
|
dispatch(CurrentStudioAppSlice.actions.setCurrentApp(newStudioApp));
|
|
2101
2077
|
return newStudioApp;
|
|
2102
2078
|
}
|
|
2103
2079
|
catch (_) {
|
|
2080
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
2104
2081
|
throw rejectWithValue({ error: 1, errorMsg: 'Error creating application' });
|
|
2105
2082
|
}
|
|
2106
2083
|
}));
|
|
2107
|
-
const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2084
|
+
const deleteStudioApp = toolkit.createAsyncThunk('studio/deleteApp', ({ idApp, status }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2108
2085
|
const jApi = extra.jApi;
|
|
2109
2086
|
try {
|
|
2110
|
-
|
|
2087
|
+
const deleteRes = yield jApi.application.delete(idApp, status);
|
|
2088
|
+
dispatch(Toast.actions.success({ label: 'APPSTUDIO_StudioApp_Deleted' }));
|
|
2089
|
+
return deleteRes;
|
|
2111
2090
|
}
|
|
2112
2091
|
catch (_) {
|
|
2092
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
2113
2093
|
return rejectWithValue({ error: 1, errorMsg: 'Error deleting application' });
|
|
2114
2094
|
}
|
|
2115
2095
|
}));
|
|
2116
|
-
const suspendStudioApp = toolkit.createAsyncThunk('studio/suspendStudioApp', ({ idApp }, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2096
|
+
const suspendStudioApp = toolkit.createAsyncThunk('studio/suspendStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2117
2097
|
const jApi = extra.jApi;
|
|
2118
2098
|
try {
|
|
2119
2099
|
yield jApi.application.suspend(idApp);
|
|
2100
|
+
dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Suspended' }));
|
|
2120
2101
|
}
|
|
2121
2102
|
catch (_) {
|
|
2103
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
2122
2104
|
throw rejectWithValue({ error: 1, errorMsg: 'Error suspending application' });
|
|
2123
2105
|
}
|
|
2124
2106
|
}));
|
|
2125
|
-
const restartStudioApp = toolkit.createAsyncThunk('studio/restartStudioApp', ({ idApp }, { extra, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2107
|
+
const restartStudioApp = toolkit.createAsyncThunk('studio/restartStudioApp', ({ idApp }, { extra, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2126
2108
|
const jApi = extra.jApi;
|
|
2127
2109
|
try {
|
|
2128
2110
|
yield jApi.application.restart(idApp);
|
|
2111
|
+
dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Restarted' }));
|
|
2129
2112
|
}
|
|
2130
2113
|
catch (_) {
|
|
2114
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
2131
2115
|
throw rejectWithValue({ error: 1, errorMsg: 'Error restarting application' });
|
|
2132
2116
|
}
|
|
2133
2117
|
}));
|
|
2134
|
-
const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idApp }, { extra, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2118
|
+
const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idApp }, { extra, getState, rejectWithValue, dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2135
2119
|
var _b;
|
|
2136
2120
|
const jApi = extra.jApi;
|
|
2137
2121
|
const existingStudioApp = getState().studio.studioAppsList.studioAppsList.find((app) => app.idApp === idApp);
|
|
@@ -2142,9 +2126,11 @@ const cloneStudioApp = toolkit.createAsyncThunk('studio/cloneStudioApp', ({ idAp
|
|
|
2142
2126
|
const clonedStudioAppReady = JSON.stringify(clonedStudioApp);
|
|
2143
2127
|
try {
|
|
2144
2128
|
yield jApi.application.save(newAppId, clonedStudioAppReady, 'saved');
|
|
2129
|
+
dispatch(Toast.actions.success({ label: 'APPSTUDIO_AppItem_Cloned' }));
|
|
2145
2130
|
return clonedStudioApp;
|
|
2146
2131
|
}
|
|
2147
2132
|
catch (_) {
|
|
2133
|
+
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
2148
2134
|
return rejectWithValue({ error: 1, errorMsg: 'Error cloning application' });
|
|
2149
2135
|
}
|
|
2150
2136
|
}));
|
|
@@ -2291,7 +2277,8 @@ const studio = {
|
|
|
2291
2277
|
restartStudioApp,
|
|
2292
2278
|
cloneStudioApp,
|
|
2293
2279
|
createNewStudioApp,
|
|
2294
|
-
fetchCurrentStudioApp
|
|
2280
|
+
fetchCurrentStudioApp,
|
|
2281
|
+
saveCurrentStudioApp }),
|
|
2295
2282
|
selectors: {
|
|
2296
2283
|
selectStudioAppsList,
|
|
2297
2284
|
selectCurrentStudioApp,
|
|
@@ -2301,15 +2288,6 @@ const studio = {
|
|
|
2301
2288
|
exports.APP_STATUS_TYPE = APP_STATUS_TYPE;
|
|
2302
2289
|
exports.AUDIENCE = AUDIENCE;
|
|
2303
2290
|
exports.AppFormBannedFromViews = AppFormBannedFromViews;
|
|
2304
|
-
exports.AppFormFieldOnlyInView = AppFormFieldOnlyInView;
|
|
2305
|
-
exports.AppFormFixedFootList4View = AppFormFixedFootList4View;
|
|
2306
|
-
exports.AppFormFixedHeadList = AppFormFixedHeadList;
|
|
2307
|
-
exports.AppFormFixedList = AppFormFixedList;
|
|
2308
|
-
exports.AppFormNoAsFieldList = AppFormNoAsFieldList;
|
|
2309
|
-
exports.AppFormNoFixedValueList = AppFormNoFixedValueList;
|
|
2310
|
-
exports.AppFormNonPrimaryList = AppFormNonPrimaryList;
|
|
2311
|
-
exports.AppFormNotFields = AppFormNotFields;
|
|
2312
|
-
exports.AppFormPrimaryList = AppFormPrimaryList;
|
|
2313
2291
|
exports.AppFormUniqueList = AppFormUniqueList;
|
|
2314
2292
|
exports.Application = Application;
|
|
2315
2293
|
exports.AssetReservation = AssetReservation;
|
|
@@ -2332,4 +2310,5 @@ exports.actions = actions;
|
|
|
2332
2310
|
exports.jland = jland;
|
|
2333
2311
|
exports.slice = slice;
|
|
2334
2312
|
exports.studio = studio;
|
|
2313
|
+
exports.viewsList = viewsList;
|
|
2335
2314
|
//# sourceMappingURL=cjs.js.map
|