jamespot-front-business 1.1.91 → 1.1.93

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 CHANGED
@@ -1395,9 +1395,17 @@ const toggleExtraBotActivation = toolkit.createAsyncThunk('extraBot/toggleActiva
1395
1395
  try {
1396
1396
  const enabled = !extraBot.enabled;
1397
1397
  const res = (yield extra.jApi.article.update(Object.assign(Object.assign({}, extraBot), { enabled }), { format: jamespot.Format.VIEW })).result;
1398
- dispatch(Toast.actions.success({
1399
- label: enabled ? 'APP_ExtraBot_Toast_ActivationSuccess' : 'APP_ExtraBot_Toast_DeactivationSuccess',
1400
- }));
1398
+ if (res.enabled !== extraBot.enabled) {
1399
+ dispatch(Toast.actions.success({
1400
+ label: enabled ? 'APP_ExtraBot_Toast_ActivationSuccess' : 'APP_ExtraBot_Toast_DeactivationSuccess',
1401
+ }));
1402
+ dispatch(fetchExtraBotListAll());
1403
+ }
1404
+ else {
1405
+ dispatch(Toast.actions.error({
1406
+ label: 'APP_ExtraBot_Toast_FailedToChangeActivation',
1407
+ }));
1408
+ }
1401
1409
  return res;
1402
1410
  }
1403
1411
  catch (err) {
@@ -1414,8 +1422,9 @@ const saveExtraBot = toolkit.createAsyncThunk('extraBot/save', ({ extraBot }, {
1414
1422
  let user;
1415
1423
  delete data.avatar;
1416
1424
  if (extraBot.uri) {
1417
- res = (yield extra.jApi.article.update(data, { format: jamespot.Format.VIEW }))
1418
- .result;
1425
+ res = (yield extra.jApi.article.update(data, {
1426
+ format: jamespot.Format.VIEW,
1427
+ })).result;
1419
1428
  user = (yield extra.jApi.extraBot.updateBot(res.uri)).result;
1420
1429
  }
1421
1430
  else {
@@ -4426,7 +4435,9 @@ function renderWidget(fieldType, fieldProperties) {
4426
4435
  </options>
4427
4436
  ${hasDefaultValue || userCanModifyByComment
4428
4437
  ? `<params>
4429
- ${hasDefaultValue ? `<param key="defaultValue" value="${optionEditor.value.defaultSelectOptionValue.value}"/>` : ''}
4438
+ ${hasDefaultValue
4439
+ ? `<param key="defaultValue" value="${optionEditor.value.defaultSelectOptionValue.value}"/>`
4440
+ : ''}
4430
4441
  ${userCanModifyByComment ? `<param key="explain" value="1"/>` : ''}
4431
4442
  </params>`
4432
4443
  : ''}
@@ -4517,7 +4528,7 @@ function renderWidget(fieldType, fieldProperties) {
4517
4528
  function renderProperty(properties, propertyToFind) {
4518
4529
  const labelProperty = properties === null || properties === void 0 ? void 0 : properties.find((property) => property.propertyType === propertyToFind);
4519
4530
  if (labelProperty) {
4520
- const value = labelProperty.value.replaceAll("\"", "&quot;");
4531
+ const value = labelProperty.value.replaceAll('"', '&quot;');
4521
4532
  return `${propertyToFind.toLowerCase()}="${value}"`;
4522
4533
  }
4523
4534
  return '';
@@ -4623,7 +4634,7 @@ function renderDisplays(studioApp) {
4623
4634
  const viewField = Object.entries(viewContent)
4624
4635
  .filter((a) => a[1].isUsed)
4625
4636
  .sort((a, b) => a[1].pos - b[1].pos);
4626
- toRet += `<display view="${internal2XmlView[viewName]}" mode="${viewName === 'view' ? 'view' : 'form'}">
4637
+ toRet += `<display view="${internal2XmlView[viewName]}${viewName === 'view' && studioApp.manifest.displayContentLegacyTable ? 'Disabled' : ''}" mode="${viewName === 'view' ? 'view' : 'form'}">
4627
4638
  ${viewField.map(([fieldId, view]) => renderDisplayAttr(fieldId, view)).join('')}
4628
4639
  </display>`;
4629
4640
  }
@@ -4765,6 +4776,7 @@ const installedToV2ViewNames = {
4765
4776
  create: 'create',
4766
4777
  edit: 'edit',
4767
4778
  display: 'view',
4779
+ displayDisabled: 'view',
4768
4780
  };
4769
4781
  const specialAttrName = ['title', 'alertAuthor', 'sendAlert'];
4770
4782
  const ignoredFields = ['edito'];
@@ -5306,12 +5318,13 @@ function getDateCreationToView(isUsed = true) {
5306
5318
  }
5307
5319
 
5308
5320
  function InstalledAppStudioAdapter(serverApp, serverApps, state) {
5309
- var _a, _b, _c, _d;
5321
+ var _a, _b, _c, _d, _e, _f;
5310
5322
  const { version, dateCreation } = serverApp.manifest;
5311
5323
  const appTypeServer = serverApp.typeModel;
5312
5324
  const views = Object.assign({}, ...viewsList.map((view) => ({
5313
5325
  [view]: {},
5314
5326
  })));
5327
+ const typedApp = serverApp;
5315
5328
  const studioApp = {
5316
5329
  idApp: serverApp.idApp,
5317
5330
  status: _formatStatus(serverApp),
@@ -5331,6 +5344,7 @@ function InstalledAppStudioAdapter(serverApp, serverApps, state) {
5331
5344
  viewSolr: serverApp.view ? STUDIO_VIEW.SOLR : STUDIO_VIEW.NOT_SOLR,
5332
5345
  typeLabel: appTypeServer.typeLabel,
5333
5346
  articlesCount: (_d = serverApp.articlesCount) !== null && _d !== void 0 ? _d : 0,
5347
+ displayContentLegacyTable: !!((_f = (_e = typedApp === null || typedApp === void 0 ? void 0 : typedApp.typeModel) === null || _e === void 0 ? void 0 : _e.displays) === null || _f === void 0 ? void 0 : _f['displayDisabled']),
5334
5348
  },
5335
5349
  fields: [],
5336
5350
  views,