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/esm.js
CHANGED
|
@@ -4323,7 +4323,7 @@ function getFormItemType(installedField) {
|
|
|
4323
4323
|
}
|
|
4324
4324
|
break;
|
|
4325
4325
|
case 'textarea':
|
|
4326
|
-
if (installedField.attrType === 'longtext') {
|
|
4326
|
+
if (installedField.attrType === 'longtext' || installedField.attrType === 'text') {
|
|
4327
4327
|
return AppFormItemTypes.TEXTAREA;
|
|
4328
4328
|
}
|
|
4329
4329
|
if (installedField.attrType === 'html') {
|
|
@@ -4336,7 +4336,10 @@ function getFormItemType(installedField) {
|
|
|
4336
4336
|
case 'text':
|
|
4337
4337
|
return AppFormItemTypes.TEXT;
|
|
4338
4338
|
}
|
|
4339
|
-
throw new Error('error converting installed app to V2: installed field type not recognized for field ' +
|
|
4339
|
+
throw new Error('error converting installed app to V2: installed field type not recognized for field ' +
|
|
4340
|
+
installedField.name +
|
|
4341
|
+
':' +
|
|
4342
|
+
JSON.stringify(installedField));
|
|
4340
4343
|
}
|
|
4341
4344
|
function addTitleToView(newName, appS, fixedInfo) {
|
|
4342
4345
|
var _a;
|
|
@@ -4440,7 +4443,7 @@ function InstalledAppStudioAdapter(serverApp, serverApps, state) {
|
|
|
4440
4443
|
version: version,
|
|
4441
4444
|
dateCreation: dateCreation,
|
|
4442
4445
|
checkAccess: false,
|
|
4443
|
-
accessRightList:
|
|
4446
|
+
accessRightList: '',
|
|
4444
4447
|
attrExposed: [],
|
|
4445
4448
|
viewSolr: serverApp.view ? STUDIO_VIEW.SOLR : STUDIO_VIEW.NOT_SOLR,
|
|
4446
4449
|
typeLabel: appTypeServer.typeLabel,
|
|
@@ -4448,7 +4451,9 @@ function InstalledAppStudioAdapter(serverApp, serverApps, state) {
|
|
|
4448
4451
|
},
|
|
4449
4452
|
fields: [],
|
|
4450
4453
|
views,
|
|
4451
|
-
installFor: serverApp.accessRightObjectList
|
|
4454
|
+
installFor: serverApp.accessRightObjectList
|
|
4455
|
+
? buildAudience(serverApp.accessRightObjectList)
|
|
4456
|
+
: [],
|
|
4452
4457
|
audience: serverApp.checkAccess === false ? AUDIENCE.ALL : AUDIENCE.CUSTOM,
|
|
4453
4458
|
};
|
|
4454
4459
|
populateFieldsAndViews(serverApp, studioApp, state);
|
|
@@ -4500,13 +4505,19 @@ function _findAssociatedInstalled(idApp, serverApps) {
|
|
|
4500
4505
|
function serverAppsToStudioApps(serverApps, state) {
|
|
4501
4506
|
const studioApps = serverApps
|
|
4502
4507
|
.map((serverApp) => {
|
|
4503
|
-
|
|
4504
|
-
|
|
4508
|
+
try {
|
|
4509
|
+
if (serverApp.status === StudioApplicationStatus.installed) {
|
|
4510
|
+
return InstalledAppStudioAdapter(serverApp, serverApps, state);
|
|
4511
|
+
}
|
|
4512
|
+
else {
|
|
4513
|
+
if (_findAssociatedInstalled(serverApp.idApp, serverApps))
|
|
4514
|
+
return undefined;
|
|
4515
|
+
return DraftAppStudioAdapter(serverApp);
|
|
4516
|
+
}
|
|
4505
4517
|
}
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
return DraftAppStudioAdapter(serverApp);
|
|
4518
|
+
catch (e) {
|
|
4519
|
+
console.error(e);
|
|
4520
|
+
return undefined;
|
|
4510
4521
|
}
|
|
4511
4522
|
})
|
|
4512
4523
|
.filter((app) => app !== undefined);
|
|
@@ -4739,11 +4750,19 @@ const fetchStudioAppsList = createAsyncThunk('studio/appsList', (intl, { extra,
|
|
|
4739
4750
|
try {
|
|
4740
4751
|
const { result } = yield jApi.application.list();
|
|
4741
4752
|
const taxonomies = yield jApi.taxonomy.list();
|
|
4742
|
-
const
|
|
4753
|
+
const appsPromisesResult = yield Promise.allSettled(result.map((app) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4743
4754
|
const coreApp = (yield jApi.application.get(app.idApp, app.status)).result;
|
|
4744
4755
|
const articlesCount = (yield jApi.article.count(app.idApp)).result;
|
|
4745
4756
|
return Object.assign(Object.assign({}, coreApp), { articlesCount });
|
|
4746
4757
|
})));
|
|
4758
|
+
const apps = appsPromisesResult.map((result) => {
|
|
4759
|
+
return result.status === "fulfilled" ? result.value : null;
|
|
4760
|
+
}).reduce((prev, curr) => {
|
|
4761
|
+
if (curr !== null) {
|
|
4762
|
+
return prev.concat([curr]);
|
|
4763
|
+
}
|
|
4764
|
+
return prev;
|
|
4765
|
+
}, []);
|
|
4747
4766
|
const transformedApps = serverAppsToStudioApps(apps, getState());
|
|
4748
4767
|
transformedApps.forEach((app) => __awaiter(void 0, void 0, void 0, function* () {
|
|
4749
4768
|
app.fields = updateTaxonomies(app.fields, taxonomies, intl);
|
|
@@ -4754,6 +4773,7 @@ const fetchStudioAppsList = createAsyncThunk('studio/appsList', (intl, { extra,
|
|
|
4754
4773
|
return transformedApps;
|
|
4755
4774
|
}
|
|
4756
4775
|
catch (_) {
|
|
4776
|
+
console.error(_);
|
|
4757
4777
|
dispatch(Toast.actions.error({ label: 'GLOBAL_Technical_Error' }));
|
|
4758
4778
|
throw rejectWithValue({ error: 1, errorMsg: 'Error retrieving applications' });
|
|
4759
4779
|
}
|