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