@sapui5/sap.suite.ui.generic.template 1.148.0 → 1.149.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 (132) 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/i18n/i18n_fr_CA.properties +2 -2
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  5. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  6. package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +254 -224
  7. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_de.properties +1 -1
  8. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +1 -1
  9. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  10. package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +76 -33
  11. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ar.properties +4 -0
  12. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_bg.properties +4 -0
  13. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ca.properties +4 -0
  14. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_cnr.properties +4 -0
  15. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_cs.properties +4 -0
  16. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_cy.properties +4 -0
  17. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_da.properties +4 -0
  18. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_de.properties +6 -2
  19. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_el.properties +4 -0
  20. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en.properties +4 -0
  21. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_GB.properties +4 -0
  22. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_es.properties +4 -0
  23. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_es_MX.properties +4 -0
  24. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_et.properties +4 -0
  25. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_fi.properties +4 -0
  26. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_fr.properties +4 -0
  27. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_fr_CA.properties +4 -0
  28. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_hi.properties +4 -0
  29. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_hr.properties +4 -0
  30. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_hu.properties +4 -0
  31. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_id.properties +5 -1
  32. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_it.properties +4 -0
  33. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_iw.properties +4 -0
  34. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ja.properties +4 -0
  35. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_kk.properties +4 -0
  36. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ko.properties +4 -0
  37. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_lt.properties +4 -0
  38. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_lv.properties +4 -0
  39. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_mk.properties +4 -0
  40. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ms.properties +4 -0
  41. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_nl.properties +4 -0
  42. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_no.properties +4 -0
  43. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pl.properties +4 -0
  44. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pt.properties +5 -1
  45. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pt_PT.properties +4 -0
  46. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ro.properties +4 -0
  47. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ru.properties +4 -0
  48. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sh.properties +4 -0
  49. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sk.properties +4 -0
  50. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sl.properties +4 -0
  51. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sr.properties +4 -0
  52. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sv.properties +4 -0
  53. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_th.properties +4 -0
  54. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_tr.properties +4 -0
  55. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_uk.properties +5 -1
  56. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_vi.properties +4 -0
  57. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_zh_CN.properties +4 -0
  58. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_zh_TW.properties +4 -0
  59. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  60. package/src/sap/suite/ui/generic/template/ObjectPage/view/Details.view.xml +1 -0
  61. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Actions.fragment.xml +13 -13
  62. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  63. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  64. package/src/sap/suite/ui/generic/template/detailTemplates/DiscardEditHandler.js +9 -0
  65. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +43 -35
  66. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
  67. package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +9 -7
  68. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +57 -6
  69. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillAIOrchestrator.js +182 -0
  70. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillApplyHandler.js +476 -0
  71. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillDialogController.js +311 -0
  72. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFieldCollector.js +669 -0
  73. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFormRenderer.js +217 -0
  74. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +326 -1120
  75. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillTableRenderer.js +491 -0
  76. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +14 -10
  77. package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +11 -8
  78. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +23 -7
  79. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +23 -7
  80. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +23 -7
  81. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +23 -7
  82. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +23 -7
  83. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +23 -7
  84. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +23 -7
  85. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +23 -7
  86. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +23 -7
  87. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +23 -7
  88. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +23 -7
  89. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +23 -7
  90. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +23 -7
  91. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +23 -7
  92. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +23 -7
  93. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +23 -7
  94. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +24 -8
  95. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +25 -9
  96. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +23 -7
  97. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +24 -8
  98. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +23 -7
  99. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +23 -7
  100. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +23 -7
  101. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +23 -7
  102. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +23 -7
  103. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +23 -7
  104. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +23 -7
  105. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +23 -7
  106. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +23 -7
  107. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +23 -7
  108. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +23 -7
  109. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +24 -8
  110. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +23 -7
  111. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +23 -7
  112. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +23 -7
  113. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +23 -7
  114. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +23 -7
  115. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +23 -7
  116. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +23 -7
  117. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +23 -7
  118. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +23 -7
  119. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +23 -7
  120. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +23 -7
  121. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +23 -7
  122. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +23 -7
  123. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +23 -7
  124. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +23 -7
  125. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +23 -7
  126. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +23 -7
  127. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  128. package/src/sap/suite/ui/generic/template/library.js +1 -1
  129. package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +8 -3
  130. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/ObjectPageSectionHandler.js +0 -282
  131. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillNonUpdatableSmartForm.fragment.xml +0 -18
  132. package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillUpdatebleSmartForm.fragment.xml +0 -15
@@ -3222,7 +3222,7 @@ sap.ui.define(["sap/ui/base/Object",
3222
3222
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
3223
3223
  * @public
3224
3224
  * @extends sap.ui.base.Object
3225
- * @version 1.148.0
3225
+ * @version 1.149.0
3226
3226
  * @since 1.30.0
3227
3227
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3228
3228
  */
@@ -68,7 +68,7 @@ sap.ui.define([
68
68
  interfaces: [],
69
69
  controls: [],
70
70
  elements: [],
71
- version: "1.148.0",
71
+ version: "1.149.0",
72
72
  extensions: {
73
73
  //Configuration used for rule loading of Support Assistant
74
74
  "sap.ui.support": {
@@ -413,7 +413,7 @@ html[dir='rtl'] .sapSmartTemplatesObjectPage .sapSmartTemplatesObjectPageSubSect
413
413
 
414
414
  .sapSmartTemplatesObjectPageEasyFillReviewArea {
415
415
  background-color: var(--sapShell_Background);
416
- padding-left: 2rem;
416
+ height: 100%;
417
417
 
418
418
  .sapSmartTemplatesObjectPageEasyFillReviewAreaTitleUpdatable {
419
419
  bottom: 1.5rem;
@@ -467,9 +467,14 @@ html[dir='rtl'] .sapSmartTemplatesObjectPage .sapSmartTemplatesObjectPageSubSect
467
467
  }
468
468
 
469
469
  .sapSmartTemplatesObjectPageEasyFillAINoticePopover {
470
- width: 22.8125rem;
471
-
472
470
  .sapSmartTemplatesObjectPageEasyFillAINotice {
473
471
  padding: 1rem 1rem 0.5rem 1rem;
474
472
  }
473
+ }
474
+
475
+ .sapUxAPObjectPageHeaderContent .sapUxAPObjectPageHeaderContentItem {
476
+ line-height: 2rem;
477
+ .sapMBtn {
478
+ padding-top: 0px;
479
+ }
475
480
  }
@@ -1,282 +0,0 @@
1
- sap.ui.define([
2
- ],function(){
3
- "use strict";
4
- /**
5
- * This class extracts the what sections are present according to the property from the manifest and EntityType and show it in objectpage
6
- * Currently it only supports the default annotations from the ObjectPage, In future we should make sure to add Custom Sections and Reusable Components to integrate in it
7
- * @namespace suite.ui.generic.template.lib.ai.EasyFill.ObjectPageSectionHandler.js
8
- * @private
9
- */
10
- return {
11
- getSectionsForObjectPageView: function (oEntityType,oLLMResult,oRb) {
12
- let aSections = [];
13
- //Extract the Header Information,Section and SubObject table information
14
- aSections = aSections.concat(this.getSectionsForHeader(oEntityType,oRb))
15
- .concat(this.getSectionsForObjectPageFacets(oEntityType));
16
- const aTree = this.transformToTree(aSections,oEntityType);
17
- // return aTree;
18
- return this.filterTreeByLLMResult(aTree,oLLMResult);
19
- },
20
-
21
- getSectionsForCondensedView: function (oLLMResult) {
22
- return this.transformToTreeExpanded(oLLMResult);
23
- },
24
-
25
- getSectionsForObjectPageFacets: function (oEntityType) {
26
- const aSectionFacets = oEntityType["com.sap.vocabularies.UI.v1.Facets"];
27
- if (aSectionFacets && aSectionFacets.length > 0) {
28
- return this.extractFacetInfoRecursively(oEntityType,aSectionFacets,[]);
29
- }
30
- return [];
31
- },
32
-
33
- //We have to write a recursive code, as there might be nested CollectionFacets
34
- extractFacetInfoRecursively: function(oEntityType,aFacets,aTitle) {
35
- let aRes = [];
36
- aFacets.forEach((oFacet) => {
37
- if (oFacet.RecordType === "com.sap.vocabularies.UI.v1.CollectionFacet") {
38
- const aInnerFacets = oFacet.Facets;
39
- if (aInnerFacets && aInnerFacets.length > 0) {
40
- aRes = aRes.concat(this.extractFacetInfoRecursively(oEntityType,aInnerFacets,aTitle.concat(oFacet.Label.String ? oFacet.Label.String : [])));
41
- }
42
- } else {
43
- aRes = aRes.concat(this.extractSectionInfoFromReferenceFacet(oEntityType,[oFacet],aTitle));
44
- }
45
- });
46
- return aRes;
47
- },
48
-
49
- //For HeaderFacets we only have one section and the rest of the fields will be part of it, currently we are not supporting multiple subsections in the header
50
- getSectionsForHeader: function (oEntityType,oRb) {
51
- let aRes = [];
52
- //Fetch the HeaderInfo and HeaderFacets, if not present return empty array, as we will not be able to find any section without it
53
- const oHeaderInfo = oEntityType["com.sap.vocabularies.UI.v1.HeaderInfo"];
54
- const aHeaderFacets = oEntityType["com.sap.vocabularies.UI.v1.HeaderFacets"];
55
-
56
- if (oHeaderInfo && Object.keys(oHeaderInfo).length > 0) {
57
- const aKeys = Object.keys(oHeaderInfo).filter(sKey => oHeaderInfo[sKey].RecordType === "com.sap.vocabularies.UI.v1.DataField");
58
- aKeys?.forEach((sKey) => {
59
- aRes.push({title:[oRb.getText("EASY_FILL_SECTION_HEADER"),oRb.getText("EASY_FILL_SECTION_HEADER")],property: oHeaderInfo[sKey].Value.Path});
60
- });
61
- }
62
-
63
- if (aHeaderFacets && aHeaderFacets.length > 0) {
64
- const aSection = this.extractSectionInfoFromReferenceFacet(oEntityType,aHeaderFacets);
65
- aSection.forEach((oSection) => {
66
- oSection.title = [oRb.getText("EASY_FILL_SECTION_HEADER"),oRb.getText("EASY_FILL_SECTION_HEADER")];
67
- });
68
- aRes.push(...aSection);
69
- }
70
-
71
- return aRes;
72
- },
73
-
74
- //Use it once you get the reference facets, if the sText is already known then we will give that as priority
75
- extractSectionInfoFromReferenceFacet: function(oEntityType,aFacets,aText = []) {
76
- // eslint-disable-next-line no-warning-comments
77
- //TODO: Handle the LineItem Code here only and SemanticObjects for intentbased Navigation
78
- const aRes = [];
79
- aFacets.forEach((oFacet) => {
80
- //We are skipping the IntentBased Navigation for now, as we will be handling it in a different way, as we need to check the SemanticObject and Action for it,
81
- //so we will be doing it in a different method
82
- if (oFacet.RecordType === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation") {
83
- return;
84
- }
85
-
86
- const aTempText = [...aText];
87
- const sAnnotationPath = oFacet.Target.AnnotationPath.substring(1);
88
- const oAnnotation = oEntityType[sAnnotationPath];
89
- let sTitle = null;
90
-
91
- if (oFacet?.Label) {
92
- sTitle = oFacet.Label.String;
93
- } else if (oAnnotation?.Label) {
94
- sTitle = oAnnotation.Label.String;
95
- } else if (oFacet?.Title) {
96
- sTitle = oFacet.Title.String;
97
- } else if (oAnnotation?.Title) {
98
- sTitle = oAnnotation.Title.String;
99
- }
100
-
101
-
102
- // if (oFacet.Label) {
103
- // sTitle = oFacet.Label.String;
104
- // } else if (oFacet.Title) {
105
- // sTitle = oFacet.Title.String;
106
- // }
107
-
108
- if (sTitle) {
109
- aTempText.push(sTitle);
110
- }
111
-
112
- if (oAnnotation) {
113
- if (oAnnotation.Data) {
114
- oAnnotation.Data.forEach((oData) => {
115
- if (!this.isSupportedRecordType(oData.RecordType)) {
116
- return;
117
- }
118
- aRes.push({title:aTempText,property:oData.Value.Path});
119
- });
120
- } else if (Array.isArray(oAnnotation)) {
121
- const aArray = oAnnotation;
122
- aArray.forEach((oAnno) => {
123
- if (!this.isSupportedRecordType(oAnno.RecordType)) {
124
- return;
125
- }
126
- aRes.push({title:aTempText,property:oAnno.Value.Path});
127
- });
128
- } else if (oAnnotation.Value && oAnnotation.Value.Path) {
129
- aRes.push({title:aTempText,property:oAnnotation.Value.Path});
130
- }
131
- }
132
- });
133
- return aRes;
134
- },
135
-
136
- //We have to support most of the below annotations in our future waves
137
- isSupportedRecordType: function(sRecordType) {
138
- if (sRecordType === "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" || sRecordType === "com.sap.vocabularies.UI.v1.DataFieldForAnnotation"
139
- || sRecordType === "com.sap.vocabularies.UI.v1.DataFieldForAction"
140
- ) {
141
- return false;
142
- }
143
- return true;
144
- },
145
-
146
- transformToTreeExpanded: function(oLLMRes) {
147
- return [
148
- {
149
- title: "",
150
- fields: [],
151
- children: [{
152
- title: "",
153
- fields: Object.keys(oLLMRes),
154
- id: this.generateId("", Object.keys(oLLMRes))
155
- }]
156
- }
157
- ];
158
- },
159
-
160
-
161
- transformToTree: function (data, oEntityType) {
162
- const rootMap = {};
163
- const seen = new Set();
164
- const that = this;
165
-
166
- data.forEach(({ title, property }) => {
167
- if (seen.has(property)) {
168
- return;
169
- }
170
- seen.add(property);
171
-
172
- let currentMap = rootMap;
173
- let sTitlePath = "";
174
-
175
- title.forEach((level, index) => {
176
- const isLast = index === title.length - 1;
177
-
178
- // Build cumulative title path: "Header_Header", "GeneralInformation_SalesOrdertotalamount"
179
- sTitlePath = sTitlePath ? `${sTitlePath}_${level}` : level;
180
-
181
- if (!currentMap[level]) {
182
- currentMap[level] = {
183
- title: level,
184
- titlePath: sTitlePath, // ✅ Store full path for ID generation later
185
- fields: [],
186
- _childrenMap: {}
187
- };
188
- }
189
-
190
- if (isLast) {
191
- currentMap[level].fields.push(property);
192
- } else {
193
- currentMap = currentMap[level]._childrenMap;
194
- }
195
- });
196
- });
197
-
198
- // ID is generated here - after all fields are collected
199
- function convertToArray(oMap) {
200
- return Object.values(oMap).map((oNode) => ({
201
- title: oNode.title,
202
- id: that.generateId(oNode.titlePath, oNode.fields), // ✅ title path + fields combined
203
- fields: oNode.fields,
204
- children: oNode._childrenMap ? convertToArray(oNode._childrenMap) : []
205
- }));
206
- }
207
-
208
- return convertToArray(rootMap);
209
- },
210
-
211
- generateId: function(sTitlePath, aFields) {
212
- const sSanitizedTitle = sTitlePath
213
- .replace(/\s+/g, "_")
214
- .replace(/[^a-zA-Z0-9_]/g, "")
215
- .toLowerCase();
216
-
217
- // Join fields to make it unique per section content
218
- const sFieldsPart = aFields
219
- .join("_")
220
- .replace(/[^a-zA-Z0-9_]/g, "")
221
- .toLowerCase();
222
-
223
- return "EasyFillSmartForm_" + sSanitizedTitle + (sFieldsPart ? "_" + sFieldsPart : "");
224
- },
225
-
226
- filterTreeByLLMResult: function(aTree, oLLMResult) {
227
- const aRequestedKeys = Object.keys(oLLMResult);
228
- const aMatchedKeys = new Set();
229
-
230
- function generateId(sTitlePath, aFields) {
231
- const sSanitizedTitle = sTitlePath
232
- .replace(/\s+/g, "_")
233
- .replace(/[^a-zA-Z0-9_]/g, "")
234
- .toLowerCase();
235
- const sFieldsPart = aFields
236
- .join("_")
237
- .replace(/[^a-zA-Z0-9_]/g, "")
238
- .toLowerCase();
239
- return "EasyFillSmartForm_" + sSanitizedTitle + (sFieldsPart ? "_" + sFieldsPart : "");
240
- }
241
-
242
- function filterNode(oNode, sParentPath) {
243
- const sTitlePath = sParentPath ? `${sParentPath}_${oNode.title}` : oNode.title;
244
-
245
- const aFilteredFields = oNode.fields.filter((sField) => {
246
- if (aRequestedKeys.includes(sField)) {
247
- aMatchedKeys.add(sField);
248
- return true;
249
- }
250
- return false;
251
- });
252
-
253
- const aFilteredChildren = oNode.children
254
- .map((oChild) => filterNode(oChild, sTitlePath))
255
- .filter((oChild) => oChild.fields.length > 0 || oChild.children.length > 0);
256
-
257
- return {
258
- title: oNode.title,
259
- id: generateId(sTitlePath, aFilteredFields), // ✅ Regenerate ID with filtered fields
260
- fields: aFilteredFields,
261
- children: aFilteredChildren
262
- };
263
- }
264
-
265
- const aFilteredTree = aTree
266
- .map((oNode) => filterNode(oNode, ""))
267
- .filter((oNode) => oNode.fields.length > 0 || oNode.children.length > 0);
268
-
269
- const aUnmatchedKeys = aRequestedKeys.filter((sKey) => !aMatchedKeys.has(sKey));
270
- if (aUnmatchedKeys.length > 0) {
271
- aFilteredTree.push({
272
- title: "unableToFill",
273
- id: generateId("unableToFill", aUnmatchedKeys),
274
- fields: aUnmatchedKeys,
275
- children: []
276
- });
277
- }
278
-
279
- return aFilteredTree;
280
- }
281
- };
282
- });
@@ -1,18 +0,0 @@
1
- <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:sfo="sap.ui.comp.smartform" xmlns:smartField="sap.ui.comp.smartfield"
2
- xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
3
- template:require="{AH: 'sap/suite/ui/generic/template/js/AnnotationHelper'}">
4
- <Title text="{i18n>EASY_FILL_UNABLE_FILL}" class="sapSmartTemplatesObjectPageEasyFillReviewAreaSmartFormNonUpdatableTitle"/>
5
- <MessageStrip
6
- text="{i18n>EASY_FILL_WARNING_MESSAGE}"
7
- showIcon="true"
8
- type="Warning">
9
- </MessageStrip>
10
- <sfo:SmartForm
11
- id="EasyFillNonUpdatebleForm"
12
- class = "sapSmartTemplatesObjectPageEasyFillReviewAreaSmartForm sapSmartTemplatesObjectPageEasyFillReviewAreaSmartFormNonUpdatable"
13
- editable="false">
14
- <sfo:layout>
15
- <sfo:ColumnLayout columnsM="2" columnsL="3" columnsXL="4"/>
16
- </sfo:layout>
17
- </sfo:SmartForm>
18
- </core:FragmentDefinition>
@@ -1,15 +0,0 @@
1
- <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:sfo="sap.ui.comp.smartform" xmlns:smartField="sap.ui.comp.smartfield"
2
- xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
3
- template:require="{AH: 'sap/suite/ui/generic/template/js/AnnotationHelper'}">
4
-
5
- <Title class="sapSmartTemplatesObjectPageEasyFillReviewAreaTitleUpdatable" text="{i18n>EASY_FILL_FILLED_FIELDS}"></Title>
6
- <sfo:SmartForm
7
- id="EasyFillUpdatebleForm"
8
- validationMode = "Async"
9
- class="sapSmartTemplatesObjectPageEasyFillReviewAreaSmartForm"
10
- editable="true">
11
- <sfo:layout>
12
- <sfo:ColumnLayout columnsM="2" columnsL="3" columnsXL="4"/>
13
- </sfo:layout>
14
- </sfo:SmartForm>
15
- </core:FragmentDefinition>