@sapui5/sap.suite.ui.generic.template 1.148.5 → 1.148.7
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 +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/AnnotationHelperSmartList.js +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +29 -4
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +38 -3
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -108,7 +108,7 @@ sap.ui.define([
|
|
|
108
108
|
aCollection.sort(function (oFirstData, oSecondData) {
|
|
109
109
|
var iFirstDataImportance = getImportance(oFirstData);
|
|
110
110
|
var iSecondDataImportance = getImportance(oSecondData);
|
|
111
|
-
return iFirstDataImportance < iSecondDataImportance ? -1 : 1;
|
|
111
|
+
return iFirstDataImportance < iSecondDataImportance ? -1 : iFirstDataImportance > iSecondDataImportance ? 1 : 0;
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -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
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
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.
|
|
962
|
+
* @version 1.148.7
|
|
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", {
|
|
@@ -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
|
-
|
|
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();
|
|
@@ -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.
|
|
3225
|
+
* @version 1.148.7
|
|
3226
3226
|
* @since 1.30.0
|
|
3227
3227
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3228
3228
|
*/
|