@sapui5/sap.suite.ui.generic.template 1.148.4 → 1.148.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.148.4",
3
+ "version": "1.148.6",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "keywords": [
6
6
  "sapui5",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.148.4</version>
10
+ <version>1.148.6</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.148.4"
11
+ "version": "1.148.6"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.148.4"
11
+ "version": "1.148.6"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -919,12 +919,6 @@ sap.ui.define([
919
919
  onEasyFilterTokensChangedByUser: function(oEvent) {
920
920
  oState.oEasyFilterBarHandler.onTokensChangedByUser(oEvent);
921
921
  },
922
- onEasyFilterSortersChanged: function(oEvent) {
923
- oState.oEasyFilterBarHandler.onSortersChanged(oEvent);
924
- },
925
- onEasyFilterGroupLevelsChanged: function(oEvent) {
926
- oState.oEasyFilterBarHandler.onGroupLevelsChanged(oEvent);
927
- },
928
922
  onEasyFilterQueryChanged: function(oEvent) {
929
923
  oState.oEasyFilterBarHandler.onQueryChanged(oEvent);
930
924
  },
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.148.4"
11
+ "version": "1.148.6"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.148.4"
9
+ "version": "1.148.6"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.148.4"
9
+ "version": "1.148.6"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.148.4"
9
+ "version": "1.148.6"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,8 +6,6 @@
6
6
  queryChanged="._templateEventHandlers.onEasyFilterQueryChanged"
7
7
  tokensChanged="._templateEventHandlers.onEasyFilterTokensChanged"
8
8
  tokensChangedByUser="._templateEventHandlers.onEasyFilterTokensChangedByUser"
9
- sortersChanged="._templateEventHandlers.onEasyFilterSortersChanged"
10
- groupLevelsChanged="._templateEventHandlers.onEasyFilterGroupLevelsChanged"
11
9
  beforeQueryProcessing="._templateEventHandlers.onEasyFilterBeforeQueryProcessing"
12
10
  afterQueryProcessing="._templateEventHandlers.onEasyFilterAfterQueryProcessing"
13
11
  clearFilters="._templateEventHandlers.onEasyFilterClearFilters"
@@ -38,6 +38,30 @@ sap.ui.define([
38
38
  // (which would harm performance). Can only be retrieved in initialized event.
39
39
  oSmartFilterBar.getInitializedPromise().then(function () {
40
40
  aBasicFilters = oSmartFilterBar.getAllFilterItems(true);
41
+
42
+ // Cold-start recovery: setSVMWrapperCallbacks registers attachAfterVariantLoad
43
+ // after SVM has already fired afterVariantLoad("INIT"), so the _CUSTOM restore
44
+ // handler in setSVMWrapperCallbacks is never reached on first page load.
45
+ // By this point getInitializedPromise has resolved, setSVMWrapperCallbacks has
46
+ // run, and the variant is active — apply the _CUSTOM fallback now if
47
+ // getCustomFilterData() is still null (i.e. no beforeVariantFetch has run yet).
48
+ if (!oSmartFilterBar.getCustomFilterData()) {
49
+ try {
50
+ var oSVM = oSmartFilterBar.getSmartVariant();
51
+ var sVariantKey = oSVM && (oSVM.getCurrentVariantKey ? oSVM.getCurrentVariantKey() : oSVM.getStandardVariantKey());
52
+ var oVariantContent = oSVM && oSVM.getVariantContent(oSmartFilterBar, sVariantKey);
53
+ var oFilterBarVariant = oVariantContent && oVariantContent.filterBarVariant && JSON.parse(oVariantContent.filterBarVariant);
54
+ var oCustomSection = oFilterBarVariant && oFilterBarVariant._CUSTOM;
55
+ var oGenericData = (oCustomSection && oCustomSection[dataPropertyNameGeneric]) || Object.create(null);
56
+ var oCustomFiltersState = oGenericData.customFilters || {
57
+ editState: oGenericData.editStateFilter,
58
+ appExtension: oGenericData.appExtension
59
+ };
60
+ mParams.oCustomFiltersWrapper.setState(oCustomFiltersState);
61
+ } catch (e) {
62
+ // Silently skip — absence of _CUSTOM data is a valid state for new variants
63
+ }
64
+ }
41
65
  });
42
66
 
43
67
  // Initialize variant management promise
@@ -76,10 +100,11 @@ sap.ui.define([
76
100
  if (oCustomData && oCustomData[dataPropertyNameGeneric]) {
77
101
  oGenericData = oCustomData[dataPropertyNameGeneric];
78
102
  } else {
79
- // getCustomFilterData() returns null on cold start (no prior sap-iapp-state) because
80
- // setCustomFilterData() is only called from beforeVariantFetch (variant save path),
81
- // never during the initial LREP variant load. The _CUSTOM section is present in the
82
- // variant content — fall back to reading it via getVariantContent().
103
+ // getCustomFilterData() returns null when no beforeVariantFetch has run yet for this
104
+ // variant (e.g. a named variant being switched to for the first time in the session).
105
+ // The _CUSTOM section is present in the variant content — fall back to reading it via getVariantContent().
106
+ // Note: the cold-start case (INIT event) is handled separately in fnInitialize via
107
+ // getInitializedPromise().then(), because this listener is registered after INIT fires.
83
108
  try {
84
109
  var oSVM = oSmartFilterBar.getSmartVariant();
85
110
  // getCurrentVariantId() converts STANDARDVARIANTKEY to "" which _getVariantById can't look up.
@@ -959,7 +959,7 @@ sap.ui.define([
959
959
  * @public
960
960
  * @extends sap.ui.core.UIComponent
961
961
  * @author SAP SE
962
- * @version 1.148.4
962
+ * @version 1.148.6
963
963
  * @name sap.suite.ui.generic.template.lib.AppComponent
964
964
  */
965
965
  var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -541,13 +541,7 @@ sap.ui.define(["sap/ui/base/Object",
541
541
  var aMessagesBeforeSave = CRUDHelper.fnGetMessagesFromContextFilter(oContextFilter, oMessageManager, true);
542
542
  var mMessagesBeforeSave = Object.create(null);
543
543
  aMessagesBeforeSave.forEach(function(oMessage){
544
- // Exclude transition messages (persistent === false) left over from a prior 412 response.
545
- // Including them causes false-positive deduplication on retry: the new 412 produces
546
- // the same message IDs, they are filtered out of aNewMessages, and fnHandleWarning
547
- // is never called.
548
- if (oMessage.persistent !== false) {
549
- mMessagesBeforeSave[oMessage.getId()] = oMessage;
550
- }
544
+ mMessagesBeforeSave[oMessage.getId()] = oMessage;
551
545
  });
552
546
 
553
547
  // Handles the 412 Warning case.
@@ -107,12 +107,36 @@ sap.ui.define([
107
107
  // Helper to add properties to mFilterProperties, with optional prefix.
108
108
  // bOverrideSortable and mOverrideNonSortable allow callers (e.g. nav property processing)
109
109
  // to pass entity-set-specific sort restrictions instead of the root entity set's.
110
- function addPropertiesFromEntityType(entityType, prefix, bOverrideSortable, mOverrideNonSortable) {
110
+ // oEffectiveEntitySetMeta allows callers to pass the entity-set metadata for
111
+ // Capabilities.FilterRestrictions lookup; falls back to the root entity set's metadata.
112
+ function addPropertiesFromEntityType(entityType, prefix, bOverrideSortable, mOverrideNonSortable, oEffectiveEntitySetMeta) {
111
113
  var bEffectiveSortable = (bOverrideSortable !== undefined) ? bOverrideSortable : bEntitySetSortable;
112
114
  var mEffectiveNonSortable = mOverrideNonSortable || mNonSortableProperties;
115
+
116
+ // Capabilities.FilterRestrictions takes priority over sap:filterable (matches SFB behaviour).
117
+ var oCapFilterRestrictions = oEffectiveEntitySetMeta &&
118
+ oEffectiveEntitySetMeta["Org.OData.Capabilities.V1.FilterRestrictions"];
119
+ var bEntityNonFilterable = !!oCapFilterRestrictions &&
120
+ oCapFilterRestrictions.Filterable === "false";
121
+ var mCapNonFilterable = {};
122
+ if (oCapFilterRestrictions && oCapFilterRestrictions.NonFilterableProperties) {
123
+ oCapFilterRestrictions.NonFilterableProperties.forEach(function(oEntry) {
124
+ if (oEntry.PropertyPath) {
125
+ mCapNonFilterable[oEntry.PropertyPath] = true;
126
+ }
127
+ });
128
+ }
129
+
113
130
  entityType.property.forEach(function (oProperty) {
114
131
  var sTokenType = "ValueHelp";
115
132
  var bFilterable = filterHelper.isPropertyFilterable(oProperty);
133
+
134
+ // When Capabilities.FilterRestrictions is present, its answer is authoritative.
135
+ // A property absent from NonFilterableProperties is filterable even if sap:filterable="false".
136
+ if (oCapFilterRestrictions) {
137
+ bFilterable = !bEntityNonFilterable && !mCapNonFilterable[oProperty.name];
138
+ }
139
+
116
140
  var bIsCodeListRequired;
117
141
  var bIsHidden = false;
118
142
  var bIsHiddenFilter = false;
@@ -163,7 +187,7 @@ sap.ui.define([
163
187
  }
164
188
 
165
189
  // Add direct properties
166
- addPropertiesFromEntityType(oEntityType, "");
190
+ addPropertiesFromEntityType(oEntityType, "", undefined, undefined, oEntitySetMeta);
167
191
 
168
192
  // Add 1:1 navigation properties' properties
169
193
  if (oEntityType.navigationProperty) {
@@ -210,7 +234,7 @@ sap.ui.define([
210
234
  }
211
235
  }
212
236
  }
213
- addPropertiesFromEntityType(oTargetEntityType, navProp.name, bNavSortable, mNavNonSortable);
237
+ addPropertiesFromEntityType(oTargetEntityType, navProp.name, bNavSortable, mNavNonSortable, oNavEntitySetMeta);
214
238
  }
215
239
  }
216
240
  }
@@ -577,6 +601,17 @@ sap.ui.define([
577
601
  setState: fnApplyEasyFilterVariantState
578
602
  });
579
603
 
604
+ // Sync sLoadedVariantFilterMode on afterSave (Save As path)
605
+ // so layout switches after saving correctly show the dirty indicator.
606
+ var oSVM = oState.oSmartFilterbar.getSmartVariant();
607
+ if (oSVM && oSVM.attachAfterSave) {
608
+ oSVM.attachAfterSave(function() {
609
+ var oTMModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
610
+ var sCurrentFilterMode = oTMModel.getProperty("/listReport/filterMode");
611
+ sLoadedVariantFilterMode = sCurrentFilterMode;
612
+ });
613
+ }
614
+
580
615
  // Handle INIT timing gap: the "INIT" afterVariantLoad fires before this handler
581
616
  // is created. Read whatever the variant already loaded into customFilterData now.
582
617
  var oCustomData = oState.oSmartFilterbar.getCustomFilterData();
@@ -695,6 +730,18 @@ sap.ui.define([
695
730
  // currentVariantSetModified intentionally omitted — pressing Go with the same
696
731
  // query must not mark the variant as dirty.
697
732
  // oSmartFilterbar.getSmartVariant() && oSmartFilterbar.getSmartVariant().currentVariantSetModified(true);
733
+
734
+ // Apply sorters/groupLevels bundled with tokens after SFB state is set but
735
+ // before triggering search, to prevent a premature rebind with incomplete filters.
736
+ var aBundledSorters = oEvent.getParameter("sorters");
737
+ var aBundledGroupLevels = oEvent.getParameter("groupLevels");
738
+ if (aBundledSorters !== undefined) {
739
+ fnApplySortersToTable(aBundledSorters);
740
+ }
741
+ if (aBundledGroupLevels !== undefined) {
742
+ fnApplyGroupLevelsToTable(aBundledGroupLevels);
743
+ }
744
+
698
745
  oSmartFilterbar.search();
699
746
  }
700
747
 
@@ -708,42 +755,30 @@ sap.ui.define([
708
755
  fnSetCreationAllowed(false);
709
756
  }
710
757
 
711
- /**
712
- /**
713
- * Event handler for the EasyFilter control's sortersChanged event.
714
- * Applies the AI-determined sort order to the SmartTable via setUiState,
715
- * which updates the data binding, column sort indicators, and P13n state
716
- * through the PersonalizationController.
717
- * @param {sap.ui.base.Event} oEvent The sortersChanged event containing sort definitions
718
- */
719
- function fnSortersChanged(oEvent) {
758
+ function fnApplySortersToTable(aSorters) {
720
759
  try {
721
- var aSorters = oEvent.getParameter("sorters");
722
-
723
760
  var oPresentationControlHandler = oState.oPresentationControlHandler;
724
761
  if (!oPresentationControlHandler) {
725
- oLogger.error("EasyFilterBarHandler.onSortersChanged: PresentationControlHandler not found.");
762
+ oLogger.error("EasyFilterBarHandler: PresentationControlHandler not found.");
726
763
  return;
727
764
  }
728
-
765
+
729
766
  var oControl = oPresentationControlHandler.getControl();
730
767
  if (!oControl) {
731
- oLogger.error("EasyFilterBarHandler.onSortersChanged: Presentation control not found.");
768
+ oLogger.error("EasyFilterBarHandler: Presentation control not found.");
732
769
  return;
733
770
  }
734
771
 
735
772
  if (!controlHelper.isSmartTable(oControl)) {
736
- oLogger.warning("EasyFilterBarHandler.onSortersChanged: Sorting is only supported for SmartTable.");
773
+ oLogger.warning("EasyFilterBarHandler: Sorting is only supported for SmartTable.");
737
774
  return;
738
775
  }
739
-
776
+
740
777
  var oUiState = oControl.getUiState();
741
778
  var oPresentationVariant = oUiState.getPresentationVariant();
742
-
743
- oPresentationVariant.SortOrder = undefined; // Clear existing sort order before applying new one
744
779
 
745
- // Set new sort order (empty array clears sorting)
746
- const aSortersMapped = (aSorters && aSorters.length ) ? aSorters.map(function (oSorter) {
780
+ oPresentationVariant.SortOrder = undefined;
781
+ var aSortersMapped = (aSorters && aSorters.length) ? aSorters.map(function(oSorter) {
747
782
  return {
748
783
  Property: oSorter.key,
749
784
  Descending: !!oSorter.descending
@@ -757,51 +792,38 @@ sap.ui.define([
757
792
  } finally {
758
793
  bApplyingSorting = false;
759
794
  }
760
-
761
795
  } catch (error) {
762
796
  bApplyingSorting = false;
763
797
  oLogger.warning("EasyFilterBar: unexpected error while handling sortersChanged", String(error));
764
798
  }
765
- }
799
+ }
766
800
 
767
- /**
768
- * Event handler for the EasyFilter control's groupLevelsChanged event.
769
- * Applies the AI-determined group levels to the SmartTable via setUiState,
770
- * which updates the data binding and table grouping state
771
- * through the PersonalizationController.
772
- * @param {sap.ui.base.Event} oEvent The groupLevelsChanged event containing group level definitions
773
- */
774
- function fnGroupLevelsChanged(oEvent) {
801
+ function fnApplyGroupLevelsToTable(aGroupLevels) {
775
802
  try {
776
- var aGroupLevels = oEvent.getParameter("groupLevels");
777
-
778
803
  var oPresentationControlHandler = oState.oPresentationControlHandler;
779
804
  if (!oPresentationControlHandler) {
780
- oLogger.error("EasyFilterBarHandler.onGroupLevelsChanged: PresentationControlHandler not found.");
805
+ oLogger.error("EasyFilterBarHandler: PresentationControlHandler not found.");
781
806
  return;
782
807
  }
783
-
808
+
784
809
  var oControl = oPresentationControlHandler.getControl();
785
810
  if (!oControl) {
786
- oLogger.error("EasyFilterBarHandler.onGroupLevelsChanged: Presentation control not found.");
811
+ oLogger.error("EasyFilterBarHandler: Presentation control not found.");
787
812
  return;
788
813
  }
789
814
 
790
815
  if (!controlHelper.isSmartTable(oControl)) {
791
- oLogger.warning("EasyFilterBarHandler.onGroupLevelsChanged: Grouping is only supported for SmartTable.");
816
+ oLogger.warning("EasyFilterBarHandler: Grouping is only supported for SmartTable.");
792
817
  return;
793
818
  }
794
-
819
+
795
820
  var oUiState = oControl.getUiState();
796
821
  var oPresentationVariant = oUiState.getPresentationVariant();
797
-
798
- oPresentationVariant.GroupBy = undefined; // Clear existing group levels before applying new ones
799
-
800
- // SmartTable supports grouping by only one column at a time,
801
- // so we take only the first group level even if multiple are provided.
802
- oPresentationVariant.GroupBy = (aGroupLevels && aGroupLevels.length) ?
803
- aGroupLevels?.flatMap(aGroup => Object.values(aGroup)) : undefined;
804
-
822
+
823
+ oPresentationVariant.GroupBy = undefined;
824
+ oPresentationVariant.GroupBy = (aGroupLevels && aGroupLevels.length) ?
825
+ aGroupLevels.flatMap(function(aGroup) { return Object.values(aGroup); }) : undefined;
826
+
805
827
  bApplyingGrouplevels = true;
806
828
  try {
807
829
  oControl.setUiState(oUiState);
@@ -812,7 +834,7 @@ sap.ui.define([
812
834
  bApplyingGrouplevels = false;
813
835
  oLogger.warning("EasyFilterBar: unexpected error while handling groupLevelsChanged", String(error));
814
836
  }
815
- }
837
+ }
816
838
 
817
839
  /**
818
840
  * Event handler for the EasyFilter control's showValueHelp event.
@@ -1030,8 +1052,6 @@ sap.ui.define([
1030
1052
  onQueryChanged : fnQueryChanged,
1031
1053
  onTokensChanged: fnTokensChanged,
1032
1054
  onTokensChangedByUser: fnTokensChangedByUser,
1033
- onSortersChanged: fnSortersChanged,
1034
- onGroupLevelsChanged: fnGroupLevelsChanged,
1035
1055
  onShowValueHelp: fnShowValueHelp,
1036
1056
  onFilterChange : fnOnFilterChange,
1037
1057
  handleVariantLoad : fnHandleVariantLoad,
@@ -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.4
3225
+ * @version 1.148.6
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.4",
71
+ version: "1.148.6",
72
72
  extensions: {
73
73
  //Configuration used for rule loading of Support Assistant
74
74
  "sap.ui.support": {