jamespot-front-business 1.1.74 → 1.1.75
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 +31 -11
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +31 -11
- package/dist/esm.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs.js
CHANGED
|
@@ -4331,7 +4331,7 @@ function getFormItemType(installedField) {
|
|
|
4331
4331
|
}
|
|
4332
4332
|
break;
|
|
4333
4333
|
case 'textarea':
|
|
4334
|
-
if (installedField.attrType === 'longtext') {
|
|
4334
|
+
if (installedField.attrType === 'longtext' || installedField.attrType === 'text') {
|
|
4335
4335
|
return AppFormItemTypes.TEXTAREA;
|
|
4336
4336
|
}
|
|
4337
4337
|
if (installedField.attrType === 'html') {
|
|
@@ -4344,7 +4344,10 @@ function getFormItemType(installedField) {
|
|
|
4344
4344
|
case 'text':
|
|
4345
4345
|
return AppFormItemTypes.TEXT;
|
|
4346
4346
|
}
|
|
4347
|
-
throw new Error('error converting installed app to V2: installed field type not recognized for field ' +
|
|
4347
|
+
throw new Error('error converting installed app to V2: installed field type not recognized for field ' +
|
|
4348
|
+
installedField.name +
|
|
4349
|
+
':' +
|
|
4350
|
+
JSON.stringify(installedField));
|
|
4348
4351
|
}
|
|
4349
4352
|
function addTitleToView(newName, appS, fixedInfo) {
|
|
4350
4353
|
var _a;
|
|
@@ -4448,7 +4451,7 @@ function InstalledAppStudioAdapter(serverApp, serverApps, state) {
|
|
|
4448
4451
|
version: version,
|
|
4449
4452
|
dateCreation: dateCreation,
|
|
4450
4453
|
checkAccess: false,
|
|
4451
|
-
accessRightList:
|
|
4454
|
+
accessRightList: '',
|
|
4452
4455
|
attrExposed: [],
|
|
4453
4456
|
viewSolr: serverApp.view ? STUDIO_VIEW.SOLR : STUDIO_VIEW.NOT_SOLR,
|
|
4454
4457
|
typeLabel: appTypeServer.typeLabel,
|
|
@@ -4456,7 +4459,9 @@ function InstalledAppStudioAdapter(serverApp, serverApps, state) {
|
|
|
4456
4459
|
},
|
|
4457
4460
|
fields: [],
|
|
4458
4461
|
views,
|
|
4459
|
-
installFor: serverApp.accessRightObjectList
|
|
4462
|
+
installFor: serverApp.accessRightObjectList
|
|
4463
|
+
? buildAudience(serverApp.accessRightObjectList)
|
|
4464
|
+
: [],
|
|
4460
4465
|
audience: serverApp.checkAccess === false ? AUDIENCE.ALL : AUDIENCE.CUSTOM,
|
|
4461
4466
|
};
|
|
4462
4467
|
populateFieldsAndViews(serverApp, studioApp, state);
|
|
@@ -4508,13 +4513,19 @@ function _findAssociatedInstalled(idApp, serverApps) {
|
|
|
4508
4513
|
function serverAppsToStudioApps(serverApps, state) {
|
|
4509
4514
|
const studioApps = serverApps
|
|
4510
4515
|
.map((serverApp) => {
|
|
4511
|
-
|
|
4512
|
-
|
|
4516
|
+
try {
|
|
4517
|
+
if (serverApp.status === jamespot.StudioApplicationStatus.installed) {
|
|
4518
|
+
return InstalledAppStudioAdapter(serverApp, serverApps, state);
|
|
4519
|
+
}
|
|
4520
|
+
else {
|
|
4521
|
+
if (_findAssociatedInstalled(serverApp.idApp, serverApps))
|
|
4522
|
+
return undefined;
|
|
4523
|
+
return DraftAppStudioAdapter(serverApp);
|
|
4524
|
+
}
|
|
4513
4525
|
}
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
return DraftAppStudioAdapter(serverApp);
|
|
4526
|
+
catch (e) {
|
|
4527
|
+
console.error(e);
|
|
4528
|
+
return undefined;
|
|
4518
4529
|
}
|
|
4519
4530
|
})
|
|
4520
4531
|
.filter((app) => app !== undefined);
|
|
@@ -4747,11 +4758,19 @@ const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (intl, {
|
|
|
4747
4758
|
try {
|
|
4748
4759
|
const { result } = yield jApi.application.list();
|
|
4749
4760
|
const taxonomies = yield jApi.taxonomy.list();
|
|
4750
|
-
const
|
|
4761
|
+
const appsPromisesResult = yield Promise.allSettled(result.map((app) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4751
4762
|
const coreApp = (yield jApi.application.get(app.idApp, app.status)).result;
|
|
4752
4763
|
const articlesCount = (yield jApi.article.count(app.idApp)).result;
|
|
4753
4764
|
return Object.assign(Object.assign({}, coreApp), { articlesCount });
|
|
4754
4765
|
})));
|
|
4766
|
+
const apps = appsPromisesResult.map((result) => {
|
|
4767
|
+
return result.status === "fulfilled" ? result.value : null;
|
|
4768
|
+
}).reduce((prev, curr) => {
|
|
4769
|
+
if (curr !== null) {
|
|
4770
|
+
return prev.concat([curr]);
|
|
4771
|
+
}
|
|
4772
|
+
return prev;
|
|
4773
|
+
}, []);
|
|
4755
4774
|
const transformedApps = serverAppsToStudioApps(apps, getState());
|
|
4756
4775
|
transformedApps.forEach((app) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4757
4776
|
app.fields = updateTaxonomies(app.fields, taxonomies, intl);
|
|
@@ -4762,6 +4781,7 @@ const fetchStudioAppsList = toolkit.createAsyncThunk('studio/appsList', (intl, {
|
|
|
4762
4781
|
return transformedApps;
|
|
4763
4782
|
}
|
|
4764
4783
|
catch (_) {
|
|
4784
|
+
console.error(_);
|
|
4765
4785
|
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
4766
4786
|
throw rejectWithValue({ error: 1, errorMsg: 'Error retrieving applications' });
|
|
4767
4787
|
}
|