@sapui5/sap.suite.ui.generic.template 1.143.0 → 1.144.0

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.
Files changed (84) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +1 -1
  3. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/ControllerImplementation.js +16 -11
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_zh_CN.properties +1 -1
  5. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  6. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  7. package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +14 -6
  8. package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +2 -2
  9. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +1 -1
  10. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ko.properties +2 -2
  11. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  12. package/src/sap/suite/ui/generic/template/ObjectPage/annotationHelpers/AnnotationHelperActionButtons.js +8 -2
  13. package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +7 -13
  14. package/src/sap/suite/ui/generic/template/ObjectPage/controller/PasteHandler.js +9 -3
  15. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  16. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Actions.fragment.xml +2 -1
  17. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  18. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  19. package/src/sap/suite/ui/generic/template/designtime/utils/designtimeHelper.js +0 -3
  20. package/src/sap/suite/ui/generic/template/detailTemplates/detailUtils.js +1 -11
  21. package/src/sap/suite/ui/generic/template/fragments/HeaderRatingIndicator.fragment.xml +2 -1
  22. package/src/sap/suite/ui/generic/template/fragments/TableColumns.fragment.xml +0 -1
  23. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +14 -7
  24. package/src/sap/suite/ui/generic/template/genericUtilities/metadataAnalyser.js +33 -2
  25. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
  26. package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +2 -2
  27. package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +23 -6
  28. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +67 -14
  29. package/src/sap/suite/ui/generic/template/lib/ContextMenuHandler.js +9 -0
  30. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +48 -29
  31. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +6 -4
  32. package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +104 -59
  33. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +0 -2
  34. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +0 -2
  35. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +0 -2
  36. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +0 -2
  37. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +0 -2
  38. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +0 -2
  39. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +0 -2
  40. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +0 -2
  41. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +0 -2
  42. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +0 -2
  43. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +0 -2
  44. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +0 -2
  45. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saptrc.properties +0 -2
  46. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +2 -4
  47. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +0 -2
  48. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +0 -2
  49. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +0 -2
  50. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +0 -2
  51. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +0 -2
  52. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +0 -2
  53. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +0 -2
  54. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +0 -2
  55. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +0 -2
  56. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +0 -2
  57. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +0 -2
  58. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +0 -2
  59. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +0 -2
  60. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +0 -2
  61. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +0 -2
  62. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +0 -2
  63. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +0 -2
  64. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +0 -2
  65. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +0 -2
  66. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +0 -2
  67. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +0 -2
  68. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +0 -2
  69. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +0 -2
  70. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +0 -2
  71. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +0 -2
  72. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +0 -2
  73. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +0 -2
  74. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +0 -2
  75. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +0 -2
  76. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +0 -2
  77. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +0 -2
  78. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +0 -2
  79. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +0 -2
  80. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +0 -2
  81. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +0 -2
  82. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +0 -2
  83. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  84. package/src/sap/suite/ui/generic/template/library.js +1 -1
@@ -240,7 +240,7 @@ sap.ui.define(["sap/ui/base/Object",
240
240
  return oRet;
241
241
  }
242
242
 
243
- function getDeleteEntityPromise(bIsActiveEntity, bHasActiveEntity, oContext) {
243
+ function getDeleteEntityPromise(bIsActiveEntity, bHasActiveEntity, oContext, oSibling) {
244
244
  var oRet = new Promise(function(resolve, reject) {
245
245
  var fnHandleSuccess = function() {
246
246
  var sEntitySet = ModelUtil.getEntitySetFromContext(oContext);
@@ -265,11 +265,27 @@ sap.ui.define(["sap/ui/base/Object",
265
265
  reject();
266
266
  }
267
267
  };
268
- var oDeletePromise = deleteEntities({
269
- pathes: [oContext.getPath()],
268
+ var fnHandleReject = function() {
269
+ if (bIsActiveEntity && oSibling) {
270
+ // Refresh page then we deleted active object + draft
271
+ // We have 412 response and user decided not to delete active object.
272
+ // Page need to be refreshed to update OP state according to model
273
+ var oComponent = oController.getOwnerComponent();
274
+ oServices.oViewDependencyHelper.setMeToDirty(oComponent);
275
+ }
276
+ reject();
277
+ };
278
+ var oSettings = {
279
+ pathes: [],
270
280
  withWarningDialog: true
271
- });
272
- oDeletePromise.then(fnHandleResponse, reject);
281
+ };
282
+ if (bIsActiveEntity && oSibling) {
283
+ oSettings.pathes.push(oSibling.getPath());
284
+ oSettings.onlyOneDraftPlusActive = true;
285
+ }
286
+ oSettings.pathes.push(oContext.getPath());
287
+ var oDeletePromise = deleteEntities(oSettings);
288
+ oDeletePromise.then(fnHandleResponse, fnHandleReject);
273
289
  });
274
290
  return oRet;
275
291
  }
@@ -790,7 +806,7 @@ sap.ui.define(["sap/ui/base/Object",
790
806
  // Cache the error message to avoid duplicate display later
791
807
  MessageUtils.cacheWarningMessage(oErrorReponse.error);
792
808
  }
793
- });
809
+ });
794
810
  fnShowWarningPopupIfRequired(oParsedResult.aMessagesForUserDecision, fnDone.bind(null, aResponse));
795
811
  };
796
812
  var fnDone = function(aResponses){
@@ -1094,6 +1110,7 @@ sap.ui.define(["sap/ui/base/Object",
1094
1110
  /* eslint-disable */
1095
1111
  var handleError = testableHelper.testable(handleError, "handleError");
1096
1112
  var getActionUtil = testableHelper.testable(getActionUtil, "getActionUtil");
1113
+ var deleteEntities = testableHelper.testable(deleteEntities, "deleteEntities");
1097
1114
  /* eslint-enable */
1098
1115
 
1099
1116
  return {
@@ -29,7 +29,8 @@ sap.ui.define(["sap/ui/base/Object",
29
29
  "sap/m/VBox",
30
30
  "sap/suite/ui/generic/template/genericUtilities/utils",
31
31
  "sap/ui/core/Element",
32
- "sap/ui/generic/app/util/ModelUtil"
32
+ "sap/ui/generic/app/util/ModelUtil",
33
+ "sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
33
34
  ], function(
34
35
  BaseObject,
35
36
  Event,
@@ -62,7 +63,8 @@ sap.ui.define(["sap/ui/base/Object",
62
63
  VBox,
63
64
  genericUtils,
64
65
  Element,
65
- ModelUtil
66
+ ModelUtil,
67
+ metadataAnalyser
66
68
  ) {
67
69
  "use strict";
68
70
 
@@ -2688,20 +2690,54 @@ sap.ui.define(["sap/ui/base/Object",
2688
2690
 
2689
2691
  /**
2690
2692
  * This method remove the unsupported columns to get exported like 1/n navigation columns.
2691
- *
2693
+ *
2692
2694
  * @param {Object} oExportEvent - event handler for export.
2693
2695
  */
2694
- function removeUnsupportedExportColumns(oExportEvent) {
2695
- var aColumns = oExportEvent.oSource.getTable().getColumns();
2696
- aColumns.forEach(oColumn => {
2697
- var aCustomData = oColumn.getCustomData();
2698
- aCustomData.forEach(oCustomdata => {
2699
- // Here if any columns custom data marked with "isExportable" key then we are ignoring those columns during export.
2700
- if (oCustomdata.getKey() === "isExportable") {
2701
- oExportEvent.mParameters.exportSettings.workbook.columns.splice(oExportEvent.mParameters.exportSettings.workbook.columns.findIndex((oCol) => oCol.columnId === oColumn.sId), 1);
2696
+ function removeUnsupportedColumnsToExport(oExportEvent) {
2697
+ var sEntitySet = oExportEvent.oSource.getEntitySet();
2698
+ var oTable = oExportEvent.oSource.getTable();
2699
+ var isSplitCell = oExportEvent.mParameters.exportSettings.fileType === "PDF" || (oExportEvent.mParameters.exportSettings.fileType === "XLSX" && oExportEvent.mParameters.userExportSettings.splitCells);
2700
+ if (!isSplitCell) {
2701
+ // without split cells
2702
+ for (let i = 0; i < oExportEvent.mParameters.exportSettings.workbook.columns.length;) {
2703
+ var oColumn = oExportEvent.mParameters.exportSettings.workbook.columns[i];
2704
+ if (typeof oColumn.property === "string") {
2705
+ if (metadataAnalyser.checkFor1ToNProperty(oTable, sEntitySet, oColumn.property)) {
2706
+ oExportEvent.mParameters.exportSettings.workbook.columns.splice(i, 1);
2707
+ continue;
2708
+ }
2709
+ } else {
2710
+ var aProperty = oColumn.property;
2711
+ if (metadataAnalyser.checkFor1ToNProperty(oTable, sEntitySet, aProperty[0]) || metadataAnalyser.checkFor1ToNProperty(oTable, sEntitySet, aProperty[1])) {
2712
+ oExportEvent.mParameters.exportSettings.workbook.columns.splice(i, 1);
2713
+ continue;
2714
+ }
2702
2715
  }
2703
- });
2704
- });
2716
+ i++;
2717
+ }
2718
+ } else {
2719
+ // With split cells
2720
+ for (let i = 0; i < oExportEvent.mParameters.exportSettings.workbook.columns.length;) {
2721
+ var oColumn = oExportEvent.mParameters.exportSettings.workbook.columns[i];
2722
+ if (oColumn.columnId && typeof oColumn.property === "string") {
2723
+ // checking for additional column.
2724
+ // in general, additional column don't have column Id.
2725
+ var bHasAdditionalColumns = i < oExportEvent.mParameters.exportSettings.workbook.columns.length - 2 && !oExportEvent.mParameters.exportSettings.workbook.columns[i + 1].columnId;
2726
+ if (bHasAdditionalColumns) {
2727
+ if (metadataAnalyser.checkFor1ToNProperty(oTable, sEntitySet, oColumn.property) || metadataAnalyser.checkFor1ToNProperty(oTable, sEntitySet, oExportEvent.mParameters.exportSettings.workbook.columns[i + 1].property)) {
2728
+ oExportEvent.mParameters.exportSettings.workbook.columns.splice(i, 2);
2729
+ continue;
2730
+ }
2731
+ } else {
2732
+ if (metadataAnalyser.checkFor1ToNProperty(oTable, sEntitySet, oColumn.property)) {
2733
+ oExportEvent.mParameters.exportSettings.workbook.columns.splice(i, 1);
2734
+ continue;
2735
+ }
2736
+ }
2737
+ }
2738
+ i++;
2739
+ }
2740
+ }
2705
2741
  }
2706
2742
 
2707
2743
  /**
@@ -2731,7 +2767,7 @@ sap.ui.define(["sap/ui/base/Object",
2731
2767
  filterSettings: (bIncludeFilterSettings ? aFilterSettings : []),
2732
2768
  includeFilterSettings: bIncludeFilterSettings
2733
2769
  };
2734
- removeUnsupportedExportColumns(oExportEvent);
2770
+ removeUnsupportedColumnsToExport(oExportEvent);
2735
2771
  //Invoke the extension
2736
2772
  oController.onBeforeExportTableExtension(oExportParams);
2737
2773
  }
@@ -2765,6 +2801,20 @@ sap.ui.define(["sap/ui/base/Object",
2765
2801
  oServices.oApplication.getNavigationHandler().navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, fnHandleError, null, sNavMode);
2766
2802
  }
2767
2803
 
2804
+ /**
2805
+ * Provide functionality for QuickView e-mail SmartField
2806
+ * @param {object} oEvent
2807
+ */
2808
+ function onSmartFieldPress(oEvent) {
2809
+ var oSmartField = oEvent.getSource();
2810
+ oEvent.getSource()._getComputedMetadata().then(function (oComputedMetaData) {
2811
+ if (oComputedMetaData && oComputedMetaData.property && oComputedMetaData.property.property && oComputedMetaData.property.property['com.sap.vocabularies.Communication.v1.IsEmailAddress'] && oComputedMetaData.property.property['com.sap.vocabularies.Communication.v1.IsEmailAddress'].Bool) {
2812
+ oEvent.preventDefault();
2813
+ fnRenderTeamsContactCollabOptions(oSmartField, oSmartField.getValue());
2814
+ }
2815
+ });
2816
+ }
2817
+
2768
2818
  /* eslint-disable */
2769
2819
  var fnBuildSelectionVariantForNavigation = testableHelper.testable(fnBuildSelectionVariantForNavigation, "fnBuildSelectionVariantForNavigation");
2770
2820
  var fnEvaluateParameters = testableHelper.testable(fnEvaluateParameters, "fnEvaluateParameters");
@@ -2774,6 +2824,8 @@ sap.ui.define(["sap/ui/base/Object",
2774
2824
  var getDataForDeleteDialog = testableHelper.testable(getDataForDeleteDialog, "getDataForDeleteDialog");
2775
2825
  var fnNavigateIntentSmartLink = testableHelper.testable(fnNavigateIntentSmartLink, "CommonEventHandlers_fnNavigateIntentSmartLink");
2776
2826
  var getPaginatorInfo = testableHelper.testable(getPaginatorInfo, "getPaginatorInfo");
2827
+ var fnRenderTeamsContactCollabOptions = testableHelper.testable(fnRenderTeamsContactCollabOptions, "fnRenderTeamsContactCollabOptions");
2828
+ var removeUnsupportedColumnsToExport = testableHelper.testable(removeUnsupportedColumnsToExport, "removeUnsupportedColumnsToExport");
2777
2829
  /* eslint-enable */
2778
2830
 
2779
2831
  return {
@@ -2816,6 +2868,7 @@ sap.ui.define(["sap/ui/base/Object",
2816
2868
  handleSideEffectForField: fnHandleSideEffectForField,
2817
2869
  onSmartFieldModeToggled: onSmartFieldModeToggled,
2818
2870
  onRenderTeamsContactCollabOptions: fnRenderTeamsContactCollabOptions,
2871
+ onSmartFieldPress: onSmartFieldPress,
2819
2872
  hideTableCells: fnHideTableCells,
2820
2873
  navigateIntentOnNewTab: fnNavigateIntentOnNewTab
2821
2874
  };
@@ -190,6 +190,15 @@ sap.ui.define([
190
190
  var getHandler = function(bEnabled){
191
191
  return bEnabled && oConfiguration.executeAction.bind(null, oFocusInfo, oToolbarControlData, oButton);
192
192
  };
193
+ /**
194
+ * Skip if the action is unbound (doesn't require selection), i.e. no sap:action-for annotation is available.
195
+ * Currently, we just check for any sap:action-for annotation. To be correct, we might need to check whether the action is bound to the entity set of the table, esp.
196
+ * in case of function imports added to line items used on the object page, but bound to the parent entity set, e.g. a function import to create a child entity.
197
+ */
198
+ var oFunctionImport = oController.getOwnerComponent().getModel().getMetaModel().getODataFunctionImport(oToolbarControlData.Action);
199
+ if (oFunctionImport && !oFunctionImport["sap:action-for"]) {
200
+ return;
201
+ }
193
202
  // Check whether the action should be enabled
194
203
  var oEnablementInfo = oCommonUtils.getToolbarActionEnablementInfo(oToolbarControlData, oFocusInfo.applicableContexts, oSourceControl);
195
204
  // If the "oEnablementInfo" contains "enabledPromise", wait till the promise fulfilled and return the handler
@@ -239,10 +239,12 @@ sap.ui.define([
239
239
  const mPropertyMap = {};
240
240
  const oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(oController.getOwnerComponent().getEntitySet());
241
241
  oEntityType.property.forEach((oProperty)=>{
242
- mPropertyMap[oProperty.name] = {
243
- description: getLabel(oProperty),
244
- dataType: oProperty.type
245
- };
242
+ if (isVisible(oProperty)) {
243
+ mPropertyMap[oProperty.name] = {
244
+ description: getLabel(oProperty),
245
+ dataType: oProperty.type
246
+ };
247
+ }
246
248
  });
247
249
  return mPropertyMap;
248
250
  }
@@ -301,14 +303,12 @@ sap.ui.define([
301
303
 
302
304
  Object.keys(oAiCallResult).forEach((sKey)=>{
303
305
  const oProperty = oEntityType.property.find((oProperty)=>oProperty.name === sKey);
304
- const {bIsVisible,bIsEditable} = isEditable(oProperty);
305
- if (bIsVisible) {
306
- if (bIsEditable) {
306
+ if (isEditable(oProperty)) {
307
307
  updatableFields[sKey] = oAiCallResult[sKey];
308
308
  } else {
309
309
  nonUpdatableFields[sKey] = oAiCallResult[sKey];
310
310
  }
311
- }
311
+
312
312
  });
313
313
  return {updatableFields,nonUpdatableFields};
314
314
  }
@@ -334,16 +334,10 @@ sap.ui.define([
334
334
 
335
335
  function isEditable(oProperty) {
336
336
 
337
- const oRes = {
338
- bIsVisible: true,
339
- bIsEditable: true
340
- };
341
-
342
337
  //Check for sap:updatable
343
338
  const sUpdatable = oProperty["sap:updatable"];
344
339
  if (sUpdatable) {
345
- oRes.bIsEditable = (sUpdatable === "false") ? false : true;
346
- return oRes;
340
+ return sUpdatable === "false" ? false : true;
347
341
  }
348
342
 
349
343
  //Check for "com.sap.vocabularies.Common.v1.FieldControl"
@@ -351,35 +345,54 @@ sap.ui.define([
351
345
 
352
346
  if (oAnnotation && oAnnotation["EnumMember"]) {
353
347
  const enumNumberType = oAnnotation["EnumMember"];
354
- oRes.bIsVisible = (enumNumberType === 'com.sap.vocabularies.Common.v1.FieldControlType/Hidden') ? false : true;
355
- oRes.bIsEditable = (enumNumberType === 'com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly') ? false : true;
356
- return oRes;
348
+ return enumNumberType === 'com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly' ? false : true;
349
+ }
350
+
351
+
352
+ //Check for "sap:field-control"
353
+ const sFieldControl = oProperty["sap:field-control"];
354
+
355
+ if (sFieldControl) {
356
+ const iFieldControlValue = oObjectPageContext.getObject()[sFieldControl];
357
+ return iFieldControlValue === 1 ? false : true;
358
+ }
359
+
360
+ //If no restriction is present then by default all fields are editable
361
+ return true;
362
+ }
363
+
364
+ function isVisible(oProperty) {
365
+
366
+ //Check for "com.sap.vocabularies.Common.v1.FieldControl"
367
+ const oAnnotation = oProperty["com.sap.vocabularies.Common.v1.FieldControl"];
368
+
369
+ if (oAnnotation && oAnnotation["EnumMember"]) {
370
+ const enumNumberType = oAnnotation["EnumMember"];
371
+ return enumNumberType === 'com.sap.vocabularies.Common.v1.FieldControlType/Hidden' ? false : true;
357
372
  }
358
373
 
359
374
  //Check for Hidden annotation i.e com.sap.vocabularies.UI.v1.Hidden
360
375
  const oHiddenAnnotation = oProperty["com.sap.vocabularies.UI.v1.Hidden"];
361
376
  if (oHiddenAnnotation) {
362
- oRes.bIsVisible = false; // <Annotation Term="UI.Hidden"/>
377
+ let bIsVisible = false; // <Annotation Term="UI.Hidden"/>
363
378
  if (oHiddenAnnotation["Bool"]) {
364
- oRes.bIsVisible = (oHiddenAnnotation["Bool"] === "true") ? false : true;
379
+ bIsVisible = (oHiddenAnnotation["Bool"] === "true") ? false : true;
365
380
  } else if (oHiddenAnnotation["Path"]) {
366
- oRes.bIsVisible = !oObjectPageContext.getObject()[oHiddenAnnotation["Path"]];
381
+ bIsVisible = !oObjectPageContext.getObject()[oHiddenAnnotation["Path"]];
367
382
  }
368
- return oRes;
383
+ return bIsVisible;
369
384
  }
370
-
385
+
371
386
  //Check for "sap:field-control"
372
387
  const sFieldControl = oProperty["sap:field-control"];
373
388
 
374
389
  if (sFieldControl) {
375
390
  const iFieldControlValue = oObjectPageContext.getObject()[sFieldControl];
376
- oRes.bIsVisible = (iFieldControlValue === 0) ? false : true;
377
- oRes.bIsEditable = (iFieldControlValue === 1) ? false : true;
378
- return oRes;
391
+ return iFieldControlValue === 0 ? false : true;
379
392
  }
380
393
 
381
- //If no restriction is present then by default all fields are editable
382
- return oRes;
394
+ //If no restriction is present then by default all fields are visible
395
+ return true;
383
396
  }
384
397
 
385
398
  function resetTransientContext() {
@@ -415,7 +428,13 @@ sap.ui.define([
415
428
  editable: isEditable,
416
429
  enabled: isEditable,
417
430
  contextEditable: isEditable,
418
- change: onSmartFieldChange.bind(this)
431
+ change: onSmartFieldChange.bind(this),
432
+ editableChanged: (oEvent)=>{
433
+ //SmartField changes the editable state of inner controls based on various factors, so to make sure that the editable state remains as per our requirement we are forcing it here
434
+ if (oEvent.getParameter("editable") !== isEditable) {
435
+ oEvent.getSource().setEditable(isEditable);
436
+ }
437
+ }
419
438
  });
420
439
  if (isEditable) {
421
440
  aEditableFields.push(oSmartField);
@@ -36,6 +36,7 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
36
36
  text="Easy Fill"
37
37
  type="Default"
38
38
  icon="sap-icon://ai"
39
+ fesr:press="fe2:ef:analyzeText"
39
40
  enabled="{easyFillDialogModel>/isEasyFillButtonEnabled}"
40
41
  press="onEasyFillSubmitInputToAI">
41
42
  </Button>
@@ -43,6 +44,7 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
43
44
  id="EasyFillClearAll"
44
45
  type = "Transparent"
45
46
  press="onEasyFillClearAll"
47
+ fesr:press="fe2:ef:clearAll"
46
48
  text="{i18n>EASYFILL_CLEAR_ALL}">
47
49
  </Button>
48
50
  </FlexBox>
@@ -58,8 +60,8 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
58
60
  <HBox gap="0.5rem" justifyContent = "End" alignItems = "Center" renderType="Bare" class="sapSmartTemplatesObjectPageEasyFillReviewAreaBanner">
59
61
  <Link text="{i18n>AI_LINK_NOTICE_TITLE}" press="onLinkPress"/>
60
62
  <Label text="{i18n>AI_WARNING_TEXT}"/>
61
- <Button icon = "sap-icon://thumb-up" type = "Transparent" fesr:press="fe:ef:thumbsup" enabled="{easyFillDialogModel>/feedbackEnabled}" press="onFeedbackPress"/>
62
- <Button icon = "sap-icon://thumb-down" type="Transparent" fesr:press="fe:ef:thumbsdown" enabled="{easyFillDialogModel>/feedbackEnabled}" press="onFeedbackPress"/>
63
+ <Button icon = "sap-icon://thumb-up" type = "Transparent" fesr:press="fe2:ef:thumbsup" enabled="{easyFillDialogModel>/feedbackEnabled}" press="onFeedbackPress"/>
64
+ <Button icon = "sap-icon://thumb-down" type="Transparent" fesr:press="fe2:ef:thumbsdown" enabled="{easyFillDialogModel>/feedbackEnabled}" press="onFeedbackPress"/>
63
65
  </HBox>
64
66
  <VBox class="sapSmartTemplatesObjectPageEasyFillReviewAreaSmartFormWrapper" renderType = "Bare" visible="{easyFillDialogModel>/isUpdatableVisible}">
65
67
  <core:Fragment fragmentName="sap.suite.ui.generic.template.lib.ai.EasyFill.fragments.EasyFillUpdatebleSmartForm" type="XML"/>
@@ -73,10 +75,10 @@ xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
73
75
  </FlexBox>
74
76
  </content>
75
77
  <beginButton>
76
- <Button text="{i18n>EASY_FILL_CONFIRM}" enabled="{easyFillDialogModel>/isSaveEnabled}" press="onSaveFromEasyFillDialog" type="Emphasized"/>
78
+ <Button text="{i18n>EASY_FILL_CONFIRM}" fesr:press="fe2:ef:confirm" enabled="{easyFillDialogModel>/isSaveEnabled}" press="onSaveFromEasyFillDialog" type="Emphasized"/>
77
79
  </beginButton>
78
80
  <endButton>
79
- <Button text="{i18n>CANCEL}" press="onCancelEasyFillDialog"/>
81
+ <Button text="{i18n>CANCEL}" press="onCancelEasyFillDialog" fesr:press="fe2:ef:cancel"/>
80
82
  </endButton>
81
83
  </Dialog>
82
84
  </core:FragmentDefinition>
@@ -56,61 +56,93 @@ sap.ui.define([
56
56
 
57
57
  var sEntitySet = oController.getOwnerComponent().getEntitySet();
58
58
 
59
- var mFilterProperties = {}; // todo : Add the properties from navigation entites
59
+ var mFilterProperties = {}; // Now also includes 1:1 navigation properties
60
60
  var oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sEntitySet);
61
- oEntityType.property.map(function (oProperty) {
62
- var sTokenType = "ValueHelp"; // Other values are "Calendar" | "Time" | "MenuWithCheckBox" | "MenuWithSingleSelect"
63
- if (filterHelper.isPropertyFilterable(oProperty)) {
64
-
65
- var bIsCodeListRequired;
66
- var bIsHidden = false;
67
- var bIsHiddenFilter = false;
68
- var sFilterRestriction = "";
69
- oProperty.extensions && oProperty.extensions.forEach(function(oExtension) {
70
- if (oExtension.name === "value-list" && oExtension.value === "fixed-values") {
71
- sTokenType = "MenuWithCheckBox";
72
- bIsCodeListRequired = true;
73
- }
74
- // Check for hidden annotation
75
- if (oExtension.name === "hidden") {
76
- bIsHidden = oExtension.value === "true";
77
- }
78
- // Check for hidden-filter annotation
79
- if (oExtension.name === "hidden-filter") {
80
- bIsHiddenFilter = oExtension.value === "true";
81
- }
82
- // Check for filter-restriction annotation
83
- if (oExtension.name === "filter-restriction") {
84
- sFilterRestriction = oExtension.value;
85
- }
86
- });
87
61
 
88
- // Calculate the token type based on the property type and display format
89
- // It will be better if this is done at the control level
90
- if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
91
- (oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
92
- sTokenType = "Calendar";
93
- } else if (oProperty.type === "Edm.DateTimeOffset") {
94
- sTokenType = "Time";
62
+ // Helper to add properties to mFilterProperties, with optional prefix
63
+ function addPropertiesFromEntityType(entityType, prefix) {
64
+ entityType.property.forEach(function (oProperty) {
65
+ var sTokenType = "ValueHelp";
66
+ if (filterHelper.isPropertyFilterable(oProperty)) {
67
+ var bIsCodeListRequired;
68
+ var bIsHidden = false;
69
+ var bIsHiddenFilter = false;
70
+ var sFilterRestriction = "";
71
+ oProperty.extensions && oProperty.extensions.forEach(function(oExtension) {
72
+ if (oExtension.name === "value-list" && oExtension.value === "fixed-values") {
73
+ sTokenType = "MenuWithCheckBox";
74
+ bIsCodeListRequired = true;
75
+ }
76
+ if (oExtension.name === "hidden") {
77
+ bIsHidden = oExtension.value === "true";
78
+ }
79
+ if (oExtension.name === "hidden-filter") {
80
+ bIsHiddenFilter = oExtension.value === "true";
81
+ }
82
+ if (oExtension.name === "filter-restriction") {
83
+ sFilterRestriction = oExtension.value;
84
+ }
85
+ });
86
+ if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
87
+ (oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
88
+ sTokenType = "Calendar";
89
+ } else if (oProperty.type === "Edm.DateTimeOffset") {
90
+ sTokenType = "Time";
91
+ }
92
+ var propName = prefix ? prefix + "." + oProperty.name : oProperty.name;
93
+ mFilterProperties[propName] = {
94
+ name: propName,
95
+ dataType: oProperty.type,
96
+ defaultValue : [],
97
+ filterable: true,
98
+ sortable: false,
99
+ codeList : bIsCodeListRequired,
100
+ type: sTokenType,
101
+ unit: oProperty["sap:unit"] || "",
102
+ required: oProperty["sap:required-in-filter"] === "true" ? true : false,
103
+ hidden: bIsHidden,
104
+ hiddenFilter: bIsHiddenFilter,
105
+ filterRestriction: sFilterRestriction || undefined
106
+ };
95
107
  }
108
+ });
109
+ }
96
110
 
97
- mFilterProperties[oProperty.name] = {
98
- name: oProperty.name,
99
- //label: oProperty.label, Name is added from the filter item control
100
- dataType: oProperty.type,
101
- defaultValue : [], // Fill values from FLP user defaults , SV or other sources
102
- filterable: true,
103
- sortable: false,
104
- codeList : bIsCodeListRequired,
105
- type: sTokenType,
106
- unit: oProperty["sap:unit"] || "",
107
- required: oProperty["sap:required-in-filter"] === "true" ? true : false,
108
- hidden: bIsHidden,
109
- hiddenFilter: bIsHiddenFilter,
110
- filterRestriction: sFilterRestriction || undefined // Only set if has value
111
- };
112
- }
113
- });
111
+ // Add direct properties
112
+ addPropertiesFromEntityType(oEntityType, "");
113
+
114
+ // Add 1:1 navigation properties' properties
115
+ if (oEntityType.navigationProperty) {
116
+ oEntityType.navigationProperty.forEach(function(navProp) {
117
+ // Try to determine if this is a 1:1 association
118
+ // Heuristic: check if navProp["sap:creatable"], ["sap:updatable"], ["sap:deletable"] are true/undefined, and navProp["relationship"] exists
119
+ // and multiplicity is 0..1 or 1 (not *). This is a best effort, as OData V2 meta is not always explicit.
120
+ var oAssocEnd = null;
121
+ var oAssoc = null;
122
+ if (oSFBMetaModel && navProp.relationship) {
123
+ // Try to get association from meta model
124
+ oAssoc = oSFBMetaModel.getODataAssociationEnd && oSFBMetaModel.getODataAssociationEnd(oEntityType, navProp.name);
125
+ oAssocEnd = oAssoc;
126
+ }
127
+ // Fallback: check navProp["to"] and navProp["from"]
128
+ var isOneToOne = false;
129
+ if (oAssocEnd && oAssocEnd.multiplicity && (oAssocEnd.multiplicity === "0..1" || oAssocEnd.multiplicity === "1")) {
130
+ isOneToOne = true;
131
+ }
132
+ if (isOneToOne) {
133
+ // Get the target entity type
134
+ var sTargetType = navProp.type || (oAssocEnd && oAssocEnd.type);
135
+ if (sTargetType) {
136
+ // Remove namespace if present
137
+ //var sShortType = sTargetType.split(".").pop();
138
+ var oTargetEntityType = oSFBMetaModel.getODataEntityType && oSFBMetaModel.getODataEntityType(sTargetType);
139
+ if (oTargetEntityType) {
140
+ addPropertiesFromEntityType(oTargetEntityType, navProp.name);
141
+ }
142
+ }
143
+ }
144
+ });
145
+ }
114
146
 
115
147
  oEasyFilterMetadata = {
116
148
  version: 1,
@@ -435,7 +467,7 @@ sap.ui.define([
435
467
  oTemplateUtils.oComponentUtils.getBusyHelper().setBusy(oQueryPromise);
436
468
  }
437
469
 
438
- function fnTokensChanged(oEvent) {
470
+ function fnTokensChanged(oEvent) {
439
471
  var oSmartFilterbar = oState.oSmartFilterbar;
440
472
  var oFiltersFromAI = oEvent.getParameter("tokens");
441
473
  var sSmartFilterBarId = oSmartFilterbar.getId();
@@ -456,19 +488,32 @@ sap.ui.define([
456
488
  oSmartFilterBarVariant.customFilters.editState = oVariantDataFromAI.oEditStateFilter;
457
489
  }
458
490
 
459
- if (oSmartFilterBarVariant.semanticDates) {
460
- var { Low: value1, High: value2 } = oVariantDataFromAI.aSelectOptions[0].Ranges[0];
461
- var dateData = oSmartFilterBarVariant.semanticDates.Dates[0].Data;
462
- dateData.operation = "DATERANGE";
463
- dateData.value1 = value1;
464
- dateData.value2 = value2 || value1;
491
+ //checking if the variant of SFB has previous semantic dates and if there are new filter values from easy filter then update the SFB variant
492
+ if (oSmartFilterBarVariant.semanticDates?.Dates) {
493
+ oSmartFilterBarVariant.semanticDates.Dates.forEach(function (semanticDate) {
494
+ var propertyName = semanticDate.PropertyName;
495
+
496
+ // Find matching property in aSelectOptions
497
+ var matchingSelectOption = oVariantDataFromAI.aSelectOptions.find(function (selectOption) {
498
+ return selectOption.PropertyName === propertyName;
499
+ });
500
+
501
+ // If matching property found and has ranges
502
+ if (matchingSelectOption?.Ranges?.length > 0) {
503
+ var { Low: value1 = null, High: value2 = null } = matchingSelectOption.Ranges[0];
504
+ // Update the semantic date data in the smart filter bar
505
+ var dateData = semanticDate.Data;
506
+ dateData.operation = "DATERANGE";
507
+ dateData.value1 = value1;
508
+ dateData.value2 = value2 || value1; // Use value1 if value2 is null/empty
509
+ }
510
+ });
465
511
  }
466
512
 
467
513
  oSmartFilterBarWrapper.setState(oSmartFilterBarVariant);
468
514
  oSmartFilterbar.getSmartVariant() && oSmartFilterbar.getSmartVariant().currentVariantSetModified(true);
469
515
  oSmartFilterbar.search();
470
516
  }
471
-
472
517
  /**
473
518
  * Event handler for the EasyFilter control's showValueHelp event.
474
519
  * Identifies the input field for which the value help is requested and triggers the value help opening from SFB.
@@ -368,8 +368,6 @@ RTA_CONFIGURATION_TITLE_FILTER_BAR=\u062A\u0643\u0648\u064A\u0646 \u0634\u0631\u
368
368
 
369
369
  RTA_CONFIGURATION_TITLE_OBJECT_PAGE=\u062A\u0643\u0648\u064A\u0646 \u0635\u0641\u062D\u0629 \u0627\u0644\u0643\u0627\u0626\u0646
370
370
 
371
- RTA_CONFIGURATION_INFO_MESSAGE=\u0644\u0627 \u064A\u0645\u0643\u0646 \u062A\u0637\u0628\u064A\u0642 \u0628\u0639\u0636 \u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0625\u0644\u0627 \u0639\u0644\u0649 \u0623\u0646\u0648\u0627\u0639 \u062C\u062F\u0627\u0648\u0644 \u0645\u0639\u064A\u0646\u0629. \u0648\u0644\u0646 \u062A\u0643\u0648\u0646 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A \u0645\u0631\u0626\u064A\u0629 \u0625\u0644\u0627 \u0628\u0639\u062F \u0625\u0639\u0627\u062F\u0629 \u062A\u062D\u0645\u064A\u0644 \u0627\u0644\u062A\u0637\u0628\u064A\u0642.
372
-
373
371
  RTA_CONFIGURATION_CANCEL=\u0625\u0644\u063A\u0627\u0621
374
372
 
375
373
  RTA_CONFIGURATION_APPLY=\u062A\u0637\u0628\u064A\u0642
@@ -368,8 +368,6 @@ RTA_CONFIGURATION_TITLE_FILTER_BAR=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0
368
368
 
369
369
  RTA_CONFIGURATION_TITLE_OBJECT_PAGE=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043D\u0435 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u0437\u0430 \u043E\u0431\u0435\u043A\u0442
370
370
 
371
- RTA_CONFIGURATION_INFO_MESSAGE=\u041D\u044F\u043A\u043E\u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043C\u043E\u0436\u0435 \u0434\u0430 \u0431\u044A\u0434\u0430\u0442 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0441\u0430\u043C\u043E \u0437\u0430 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438 \u0432\u0438\u0434\u043E\u0432\u0435 \u0442\u0430\u0431\u043B\u0438\u0446\u0438. \u041F\u0440\u043E\u043C\u0435\u043D\u0438\u0442\u0435 \u0449\u0435 \u0431\u044A\u0434\u0430\u0442 \u0432\u0438\u0434\u0438\u043C\u0438 \u0441\u043B\u0435\u0434 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E \u0437\u0430\u0440\u0435\u0436\u0434\u0430\u043D\u0435 \u043D\u0430 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435\u0442\u043E.
372
-
373
371
  RTA_CONFIGURATION_CANCEL=\u041E\u0442\u043C\u044F\u043D\u0430
374
372
 
375
373
  RTA_CONFIGURATION_APPLY=\u041F\u0440\u0438\u043B\u0430\u0433\u0430\u043D\u0435
@@ -368,8 +368,6 @@ RTA_CONFIGURATION_TITLE_FILTER_BAR=Configurar la barra de filtres
368
368
 
369
369
  RTA_CONFIGURATION_TITLE_OBJECT_PAGE=Configurar p\u00E0gina d'objecte
370
370
 
371
- RTA_CONFIGURATION_INFO_MESSAGE=Algunes opcions nom\u00E9s es poden aplicar a determinats tipus de taules. Les modificacions nom\u00E9s seran visibles despr\u00E9s de tornar a carregar l'aplicaci\u00F3.
372
-
373
371
  RTA_CONFIGURATION_CANCEL=Cancel\u00B7lar
374
372
 
375
373
  RTA_CONFIGURATION_APPLY=Aplicar
@@ -368,8 +368,6 @@ RTA_CONFIGURATION_TITLE_FILTER_BAR=Konfiguri\u0161i traku filtera
368
368
 
369
369
  RTA_CONFIGURATION_TITLE_OBJECT_PAGE=Konfiguri\u0161i stranicu objekta
370
370
 
371
- RTA_CONFIGURATION_INFO_MESSAGE=Neka pode\u0161avanja se mogu primijeniti samo na odre\u0111ene tipove tabela. Promjene \u0107e biti vidljive samo nakon \u0161to se aplikacija ponovo u\u010Dita.
372
-
373
371
  RTA_CONFIGURATION_CANCEL=Odustani
374
372
 
375
373
  RTA_CONFIGURATION_APPLY=Primijeni
@@ -368,8 +368,6 @@ RTA_CONFIGURATION_TITLE_FILTER_BAR=Konfigurovat panel filtrov\u00E1n\u00ED
368
368
 
369
369
  RTA_CONFIGURATION_TITLE_OBJECT_PAGE=Konfigurovat str\u00E1nku objektu
370
370
 
371
- RTA_CONFIGURATION_INFO_MESSAGE=N\u011Bkter\u00E1 nastaven\u00ED lze pou\u017E\u00EDt pouze pro ur\u010Dit\u00E9 typy tabulek. Zm\u011Bny budou viditeln\u00E9 a\u017E po op\u011Btovn\u00E9m na\u010Dten\u00ED aplikace.
372
-
373
371
  RTA_CONFIGURATION_CANCEL=Zru\u0161it
374
372
 
375
373
  RTA_CONFIGURATION_APPLY=Pou\u017E\u00EDt
@@ -368,8 +368,6 @@ RTA_CONFIGURATION_TITLE_FILTER_BAR=Ffurfweddu Bar Hidlo
368
368
 
369
369
  RTA_CONFIGURATION_TITLE_OBJECT_PAGE=Ffurfweddu Tudalen Gwrthrych
370
370
 
371
- RTA_CONFIGURATION_INFO_MESSAGE=Gall rhai gosodiadau ond cael eu rhoi ar waith i fathau penodol o dablau. Dim ond ar \u00F4l i'r rhaglen ail-lwytho y bydd y newidiadau ar gael i'w gweld.
372
-
373
371
  RTA_CONFIGURATION_CANCEL=Canslo
374
372
 
375
373
  RTA_CONFIGURATION_APPLY=Rhoi ar waith