@sapui5/sap.suite.ui.generic.template 1.150.1 → 1.151.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.
- package/package.json +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/SmartVisualFilterBar.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_US_sappsd.properties +17 -9
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_US_saptrc.properties +113 -105
- 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/controller/ControllerImplementation.js +0 -6
- package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +9 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_sappsd.properties +8 -5
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_saptrc.properties +61 -58
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +10 -7
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_de.properties +4 -4
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_sappsd.properties +53 -9
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_saprigi.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_saptrc.properties +143 -95
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_fr.properties +3 -3
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_no.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ro.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ru.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sl.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sv.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_uk.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/i18n/i18n_en_US_saptrc.properties +14 -14
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/i18n/i18n_en_US_saptrc.properties +2 -2
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/detailTemplates/i18n/i18n_en_US_saptrc.properties +6 -6
- package/src/sap/suite/ui/generic/template/fragments/AnalyticalTableColumns.fragment.xml +0 -10
- package/src/sap/suite/ui/generic/template/fragments/EasyFilter.fragment.xml +0 -2
- package/src/sap/suite/ui/generic/template/fragments/GridTableColumns.fragment.xml +5 -2
- package/src/sap/suite/ui/generic/template/fragments/TreeTableColumns.fragment.xml +5 -2
- package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +10 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +40 -28
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +8 -1
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +5 -24
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +10 -2
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +0 -1
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +48 -48
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_sappsd.properties +275 -14
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saptrc.properties +392 -163
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +6 -6
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartTableHandler.js +13 -13
- package/src/sap/suite/ui/generic/template/library.js +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/controller/IappStateHandler.js +12 -3
- package/src/sap/suite/ui/generic/template/listTemplates/i18n/i18n_en_US_saptrc.properties +1 -1
|
@@ -28,6 +28,12 @@ sap.ui.define([
|
|
|
28
28
|
var oSmartFilterBar = oControl;
|
|
29
29
|
var oEasyFilterCallbacks = null;
|
|
30
30
|
var oPendingEasyFilterState = null;
|
|
31
|
+
// Holds SVM callbacks once setSVMWrapperCallbacks is called. The afterVariantLoad handler
|
|
32
|
+
// is attached eagerly (in fnInitialize) so it fires even when setSVMWrapperCallbacks has
|
|
33
|
+
// not yet been called (race condition on second navigation: bAllControlsInitialized=true
|
|
34
|
+
// causes fnApplyVariantState to run synchronously, triggering afterVariantLoad before the
|
|
35
|
+
// Promise.all in SmartVariantManagementWrapper resolves and calls setSVMWrapperCallbacks).
|
|
36
|
+
var oSVMWrapperCallbacks = null;
|
|
31
37
|
|
|
32
38
|
var oVariantManagementInitializedPromise;
|
|
33
39
|
|
|
@@ -42,34 +48,11 @@ sap.ui.define([
|
|
|
42
48
|
|
|
43
49
|
// Initialize variant management promise
|
|
44
50
|
oVariantManagementInitializedPromise = oSmartFilterBar.getInitializedPromise();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Attach to variantFetch and variantLoad events to be able to store and restore also custom filters and state of other controls (in case of page VM) with variant.
|
|
48
|
-
// Events for storing/restoring are provided by SFB, data to be stored/restored can come from 3 sources:
|
|
49
|
-
// - standard filters: handled directly by SFB
|
|
50
|
-
// - extension filters: provided from mParams.oCustomFiltersWrapper
|
|
51
|
-
// - other controls being part of VM: provided by oSVMWrapperCallbacks (controls with direct connection to VM are skipped in SVM wrapper)
|
|
52
|
-
function setSVMWrapperCallbacks(oSVMWrapperCallbacks){
|
|
53
|
-
// Before saving the current state as a new variant, we need to provide all state data of controls controlled by VM, but not known to it with setCustomFilterData. From a
|
|
54
|
-
// logical point of view, the event (beforeVariantFetch) as well as the method to store the extension data (setCustomFilterData) belong to SVM, but both are implemented
|
|
55
|
-
// in SFB. Additionally, beforeVariantSave would actually be the name more logical to the consumer, however that name had been used earlier and was deprecated and
|
|
56
|
-
// replaced by the given one. Fetch actually does not mean to fetch variant content from the place variants are stored, but to get the current state from the controls!
|
|
57
|
-
oSmartFilterBar.attachBeforeVariantFetch(function(){
|
|
58
|
-
var oCustomData = Object.create(null);
|
|
59
|
-
oCustomData[dataPropertyNameGeneric] = oSVMWrapperCallbacks.getManagedControlStates();
|
|
60
|
-
oCustomData[dataPropertyNameGeneric].customFilters = mParams.oCustomFiltersWrapper.getState();
|
|
61
|
-
if (oEasyFilterCallbacks) {
|
|
62
|
-
var oEFState = oEasyFilterCallbacks.getState();
|
|
63
|
-
oCustomData[dataPropertyNameGeneric].filterMode = oEFState.filterMode;
|
|
64
|
-
oCustomData[dataPropertyNameGeneric].easyFilter = oEFState.easyFilter;
|
|
65
|
-
}
|
|
66
|
-
oSmartFilterBar.setCustomFilterData(oCustomData);
|
|
67
|
-
});
|
|
68
51
|
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
52
|
+
// Attach afterVariantLoad eagerly so custom filter state is restored regardless of
|
|
53
|
+
// when setSVMWrapperCallbacks is called. setManagedControlStates is only called if
|
|
54
|
+
// SVM callbacks are already available; otherwise those controls are restored via the
|
|
55
|
+
// iAppState path (SmartVariantManagementWrapper.fnSetManagedControlStates).
|
|
73
56
|
oSmartFilterBar.attachAfterVariantLoad(function(){
|
|
74
57
|
var oCustomData = oSmartFilterBar.getCustomFilterData();
|
|
75
58
|
var oGenericData;
|
|
@@ -102,7 +85,9 @@ sap.ui.define([
|
|
|
102
85
|
};
|
|
103
86
|
aBasicFilters = oSmartFilterBar.getAllFilterItems(true);
|
|
104
87
|
mParams.oCustomFiltersWrapper.setState(oCustomFiltersState);
|
|
105
|
-
oSVMWrapperCallbacks
|
|
88
|
+
if (oSVMWrapperCallbacks) {
|
|
89
|
+
oSVMWrapperCallbacks.setManagedControlStates(oGenericData);
|
|
90
|
+
}
|
|
106
91
|
if (oEasyFilterCallbacks) {
|
|
107
92
|
oEasyFilterCallbacks.setState({
|
|
108
93
|
filterMode: oGenericData.filterMode,
|
|
@@ -115,7 +100,34 @@ sap.ui.define([
|
|
|
115
100
|
};
|
|
116
101
|
}
|
|
117
102
|
});
|
|
103
|
+
}
|
|
118
104
|
|
|
105
|
+
// When a variant is loaded, correspondingly we have to get the customData and apply the states to the controls not known to SVM. Again, event and method are implemented
|
|
106
|
+
// in SFB instead of SVM where it would make more sense.
|
|
107
|
+
// Here the event is afterVariantLoad, as the variant content known to SVM/SFB has first to be applied to the SFB, which will also pass the custom data accordingly. Only
|
|
108
|
+
// after this has happened, we can get the custom data from SFB.
|
|
109
|
+
// Attach to variantFetch and variantLoad events to be able to store and restore also custom filters and state of other controls (in case of page VM) with variant.
|
|
110
|
+
// Events for storing/restoring are provided by SFB, data to be stored/restored can come from 3 sources:
|
|
111
|
+
// - standard filters: handled directly by SFB
|
|
112
|
+
// - extension filters: provided from mParams.oCustomFiltersWrapper
|
|
113
|
+
// - other controls being part of VM: provided by oSVMWrapperCallbacks (controls with direct connection to VM are skipped in SVM wrapper)
|
|
114
|
+
function setSVMWrapperCallbacks(oCallbacks){
|
|
115
|
+
oSVMWrapperCallbacks = oCallbacks;
|
|
116
|
+
// Before saving the current state as a new variant, we need to provide all state data of controls controlled by VM, but not known to it with setCustomFilterData. From a
|
|
117
|
+
// logical point of view, the event (beforeVariantFetch) as well as the method to store the extension data (setCustomFilterData) belong to SVM, but both are implemented
|
|
118
|
+
// in SFB. Additionally, beforeVariantSave would actually be the name more logical to the consumer, however that name had been used earlier and was deprecated and
|
|
119
|
+
// replaced by the given one. Fetch actually does not mean to fetch variant content from the place variants are stored, but to get the current state from the controls!
|
|
120
|
+
oSmartFilterBar.attachBeforeVariantFetch(function(){
|
|
121
|
+
var oCustomData = Object.create(null);
|
|
122
|
+
oCustomData[dataPropertyNameGeneric] = oSVMWrapperCallbacks.getManagedControlStates();
|
|
123
|
+
oCustomData[dataPropertyNameGeneric].customFilters = mParams.oCustomFiltersWrapper.getState();
|
|
124
|
+
if (oEasyFilterCallbacks) {
|
|
125
|
+
var oEFState = oEasyFilterCallbacks.getState();
|
|
126
|
+
oCustomData[dataPropertyNameGeneric].filterMode = oEFState.filterMode;
|
|
127
|
+
oCustomData[dataPropertyNameGeneric].easyFilter = oEFState.easyFilter;
|
|
128
|
+
}
|
|
129
|
+
oSmartFilterBar.setCustomFilterData(oCustomData);
|
|
130
|
+
});
|
|
119
131
|
}
|
|
120
132
|
|
|
121
133
|
function fnGetState() {
|
|
@@ -85,7 +85,14 @@ sap.ui.define([
|
|
|
85
85
|
setManagedControlStates: function(oState){
|
|
86
86
|
aWrapperInfo.forEach(function(oInfo){
|
|
87
87
|
if (!oInfo.bVMConnection) {
|
|
88
|
-
|
|
88
|
+
// Defer setState until the control is ready (oReadyPromise resolves after the
|
|
89
|
+
// control fires its initialise event and its inner table/chart is created).
|
|
90
|
+
// Without this guard, afterVariantLoad can call setState before SmartTable._oTable
|
|
91
|
+
// exists, causing getUiState() to crash with a null-dereference on getTable().
|
|
92
|
+
var oReady = oInfo.wrapper.oReadyPromise || Promise.resolve();
|
|
93
|
+
oReady.then(function() {
|
|
94
|
+
oInfo.wrapper.setState(oState[oInfo.wrapper.getLocalId()]);
|
|
95
|
+
});
|
|
89
96
|
}
|
|
90
97
|
});
|
|
91
98
|
}
|
|
@@ -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.
|
|
962
|
+
* @version 1.151.0
|
|
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
|
-
|
|
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.
|
|
@@ -570,23 +564,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
570
564
|
var aMessagesAfterSave = CRUDHelper.fnGetMessagesFromContextFilter(oContextFilter, oMessageManager, true);
|
|
571
565
|
var aAllMessages = aMessagesAfterSave.map(function(oMessage){
|
|
572
566
|
if (!mMessagesBeforeSave[oMessage.getId()]) { // if this is a new message
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
var oNewMessage = new Message({
|
|
578
|
-
message: oMessage.getMessage(),
|
|
579
|
-
type: oMessage.getType(),
|
|
580
|
-
target: oMessage.getTargets ? oMessage.getTargets() : [oMessage.getTarget()],
|
|
581
|
-
processor: oMessage.getMessageProcessor(),
|
|
582
|
-
persistent: false,
|
|
583
|
-
technical: false,
|
|
584
|
-
code: oMessage.getCode(),
|
|
585
|
-
description: oMessage.getDescription(),
|
|
586
|
-
technicalDetails: oMessage.getTechnicalDetails()
|
|
587
|
-
});
|
|
588
|
-
bWarningOccured = bWarningOccured || oNewMessage.technicalDetails.statusCode === "412" && oNewMessage.technicalDetails.headers["preference-applied"] === "handling=strict";
|
|
589
|
-
aNewMessages.push(oNewMessage);
|
|
567
|
+
oMessage.persistent = false;
|
|
568
|
+
oMessage.technical = false;
|
|
569
|
+
bWarningOccured = bWarningOccured || oMessage.technicalDetails.statusCode === "412" && oMessage.technicalDetails.headers["preference-applied"] === "handling=strict";
|
|
570
|
+
aNewMessages.push(oMessage);
|
|
590
571
|
}
|
|
591
572
|
return oMessage;
|
|
592
573
|
});
|
|
@@ -1020,7 +1020,6 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1020
1020
|
var oSelectionVariant, sSelectionVariantPrepared, sParameter, sSemanticObject, aSelVariantPropertyNames, aSelOptionPropertyNames, aParameterNames;
|
|
1021
1021
|
var oEventParameters = oEvent.getParameters();
|
|
1022
1022
|
var oNavigationHandler = oServices.oApplication.getNavigationHandler();
|
|
1023
|
-
var SuppressionBehavior = FENavLibrary.SuppressionBehavior;
|
|
1024
1023
|
// fill oSelectionVariant with the selectOptions from sSelectionVariant
|
|
1025
1024
|
oSelectionVariant = oNavigationHandler.mixAttributesAndSelectionVariant({}, sSelectionVariant);
|
|
1026
1025
|
//Invoke the "beforeSmartLinkPopoverOpensExtension" method to determine whether FE can process the event.
|
|
@@ -1068,7 +1067,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1068
1067
|
}
|
|
1069
1068
|
});
|
|
1070
1069
|
// add the resulting selectOptions and parameters (if any!) in oSelectionVariant with the ones of the semanticObject in oEventParameters as selectOptions to oSelectionVariant
|
|
1071
|
-
|
|
1070
|
+
// Only suppress empty-string properties that are not present in the empty-string semantic object bucket.
|
|
1071
|
+
// Properties in oSemObjEmpty are genuine entity key fields (e.g. MaintenanceOrderSubOperation:"") and must be kept.
|
|
1072
|
+
// Properties absent from oSemObjEmpty but present with "" in the event semantic object are spurious cache-inflated values and must be dropped.
|
|
1073
|
+
var mSemanticAttrsFiltered = Object.assign({}, mSemanticAttributesOfEventSemanticObject);
|
|
1074
|
+
Object.keys(mSemanticAttrsFiltered).forEach(function(sKey) {
|
|
1075
|
+
if (mSemanticAttrsFiltered[sKey] === "" && !(sKey in oSemObjEmpty)) {
|
|
1076
|
+
delete mSemanticAttrsFiltered[sKey];
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
oSelectionVariant = oNavigationHandler.mixAttributesAndSelectionVariant(mSemanticAttrsFiltered, oSelectionVariant.toJSONString());
|
|
1072
1080
|
// Remove sensitive data from the context
|
|
1073
1081
|
oSelectionVariant = fnRemovePropertiesFromNavigationContext(oSelectionVariant, oEvent.getSource(), oState);
|
|
1074
1082
|
var oObjectInfo = {
|
|
@@ -132,6 +132,10 @@ sap.ui.define([
|
|
|
132
132
|
sFilterRestriction = oExtension.value;
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
+
// sap:hidden-filter extension may be absent when only the vocabulary annotation is set
|
|
136
|
+
if (!bIsHiddenFilter && oProperty["com.sap.vocabularies.UI.v1.HiddenFilter"]) {
|
|
137
|
+
bIsHiddenFilter = oProperty["com.sap.vocabularies.UI.v1.HiddenFilter"].Bool === "true";
|
|
138
|
+
}
|
|
135
139
|
if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
|
|
136
140
|
(oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
|
|
137
141
|
sTokenType = "Calendar";
|
|
@@ -577,6 +581,17 @@ sap.ui.define([
|
|
|
577
581
|
setState: fnApplyEasyFilterVariantState
|
|
578
582
|
});
|
|
579
583
|
|
|
584
|
+
// Sync sLoadedVariantFilterMode on afterSave (Save As path)
|
|
585
|
+
// so layout switches after saving correctly show the dirty indicator.
|
|
586
|
+
var oSVM = oState.oSmartFilterbar.getSmartVariant();
|
|
587
|
+
if (oSVM && oSVM.attachAfterSave) {
|
|
588
|
+
oSVM.attachAfterSave(function() {
|
|
589
|
+
var oTMModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
|
|
590
|
+
var sCurrentFilterMode = oTMModel.getProperty("/listReport/filterMode");
|
|
591
|
+
sLoadedVariantFilterMode = sCurrentFilterMode;
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
|
|
580
595
|
// Handle INIT timing gap: the "INIT" afterVariantLoad fires before this handler
|
|
581
596
|
// is created. Read whatever the variant already loaded into customFilterData now.
|
|
582
597
|
var oCustomData = oState.oSmartFilterbar.getCustomFilterData();
|
|
@@ -695,6 +710,18 @@ sap.ui.define([
|
|
|
695
710
|
// currentVariantSetModified intentionally omitted — pressing Go with the same
|
|
696
711
|
// query must not mark the variant as dirty.
|
|
697
712
|
// oSmartFilterbar.getSmartVariant() && oSmartFilterbar.getSmartVariant().currentVariantSetModified(true);
|
|
713
|
+
|
|
714
|
+
// Apply sorters/groupLevels bundled with tokens after SFB state is set but
|
|
715
|
+
// before triggering search, to prevent a premature rebind with incomplete filters.
|
|
716
|
+
var aBundledSorters = oEvent.getParameter("sorters");
|
|
717
|
+
var aBundledGroupLevels = oEvent.getParameter("groupLevels");
|
|
718
|
+
if (aBundledSorters !== undefined) {
|
|
719
|
+
fnApplySortersToTable(aBundledSorters);
|
|
720
|
+
}
|
|
721
|
+
if (aBundledGroupLevels !== undefined) {
|
|
722
|
+
fnApplyGroupLevelsToTable(aBundledGroupLevels);
|
|
723
|
+
}
|
|
724
|
+
|
|
698
725
|
oSmartFilterbar.search();
|
|
699
726
|
}
|
|
700
727
|
|
|
@@ -708,42 +735,30 @@ sap.ui.define([
|
|
|
708
735
|
fnSetCreationAllowed(false);
|
|
709
736
|
}
|
|
710
737
|
|
|
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) {
|
|
738
|
+
function fnApplySortersToTable(aSorters) {
|
|
720
739
|
try {
|
|
721
|
-
var aSorters = oEvent.getParameter("sorters");
|
|
722
|
-
|
|
723
740
|
var oPresentationControlHandler = oState.oPresentationControlHandler;
|
|
724
741
|
if (!oPresentationControlHandler) {
|
|
725
|
-
oLogger.error("EasyFilterBarHandler
|
|
742
|
+
oLogger.error("EasyFilterBarHandler: PresentationControlHandler not found.");
|
|
726
743
|
return;
|
|
727
744
|
}
|
|
728
|
-
|
|
745
|
+
|
|
729
746
|
var oControl = oPresentationControlHandler.getControl();
|
|
730
747
|
if (!oControl) {
|
|
731
|
-
oLogger.error("EasyFilterBarHandler
|
|
748
|
+
oLogger.error("EasyFilterBarHandler: Presentation control not found.");
|
|
732
749
|
return;
|
|
733
750
|
}
|
|
734
751
|
|
|
735
752
|
if (!controlHelper.isSmartTable(oControl)) {
|
|
736
|
-
oLogger.warning("EasyFilterBarHandler
|
|
753
|
+
oLogger.warning("EasyFilterBarHandler: Sorting is only supported for SmartTable.");
|
|
737
754
|
return;
|
|
738
755
|
}
|
|
739
|
-
|
|
756
|
+
|
|
740
757
|
var oUiState = oControl.getUiState();
|
|
741
758
|
var oPresentationVariant = oUiState.getPresentationVariant();
|
|
742
|
-
|
|
743
|
-
oPresentationVariant.SortOrder = undefined; // Clear existing sort order before applying new one
|
|
744
759
|
|
|
745
|
-
|
|
746
|
-
|
|
760
|
+
oPresentationVariant.SortOrder = undefined;
|
|
761
|
+
var aSortersMapped = (aSorters && aSorters.length) ? aSorters.map(function(oSorter) {
|
|
747
762
|
return {
|
|
748
763
|
Property: oSorter.key,
|
|
749
764
|
Descending: !!oSorter.descending
|
|
@@ -757,51 +772,38 @@ sap.ui.define([
|
|
|
757
772
|
} finally {
|
|
758
773
|
bApplyingSorting = false;
|
|
759
774
|
}
|
|
760
|
-
|
|
761
775
|
} catch (error) {
|
|
762
776
|
bApplyingSorting = false;
|
|
763
777
|
oLogger.warning("EasyFilterBar: unexpected error while handling sortersChanged", String(error));
|
|
764
778
|
}
|
|
765
|
-
|
|
779
|
+
}
|
|
766
780
|
|
|
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) {
|
|
781
|
+
function fnApplyGroupLevelsToTable(aGroupLevels) {
|
|
775
782
|
try {
|
|
776
|
-
var aGroupLevels = oEvent.getParameter("groupLevels");
|
|
777
|
-
|
|
778
783
|
var oPresentationControlHandler = oState.oPresentationControlHandler;
|
|
779
784
|
if (!oPresentationControlHandler) {
|
|
780
|
-
oLogger.error("EasyFilterBarHandler
|
|
785
|
+
oLogger.error("EasyFilterBarHandler: PresentationControlHandler not found.");
|
|
781
786
|
return;
|
|
782
787
|
}
|
|
783
|
-
|
|
788
|
+
|
|
784
789
|
var oControl = oPresentationControlHandler.getControl();
|
|
785
790
|
if (!oControl) {
|
|
786
|
-
oLogger.error("EasyFilterBarHandler
|
|
791
|
+
oLogger.error("EasyFilterBarHandler: Presentation control not found.");
|
|
787
792
|
return;
|
|
788
793
|
}
|
|
789
794
|
|
|
790
795
|
if (!controlHelper.isSmartTable(oControl)) {
|
|
791
|
-
oLogger.warning("EasyFilterBarHandler
|
|
796
|
+
oLogger.warning("EasyFilterBarHandler: Grouping is only supported for SmartTable.");
|
|
792
797
|
return;
|
|
793
798
|
}
|
|
794
|
-
|
|
799
|
+
|
|
795
800
|
var oUiState = oControl.getUiState();
|
|
796
801
|
var oPresentationVariant = oUiState.getPresentationVariant();
|
|
797
|
-
|
|
798
|
-
oPresentationVariant.GroupBy = undefined;
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
oPresentationVariant.GroupBy = (aGroupLevels && aGroupLevels.length) ?
|
|
803
|
-
aGroupLevels?.flatMap(aGroup => Object.values(aGroup)) : undefined;
|
|
804
|
-
|
|
802
|
+
|
|
803
|
+
oPresentationVariant.GroupBy = undefined;
|
|
804
|
+
oPresentationVariant.GroupBy = (aGroupLevels && aGroupLevels.length) ?
|
|
805
|
+
aGroupLevels.flatMap(function(aGroup) { return Object.values(aGroup); }) : undefined;
|
|
806
|
+
|
|
805
807
|
bApplyingGrouplevels = true;
|
|
806
808
|
try {
|
|
807
809
|
oControl.setUiState(oUiState);
|
|
@@ -812,7 +814,7 @@ sap.ui.define([
|
|
|
812
814
|
bApplyingGrouplevels = false;
|
|
813
815
|
oLogger.warning("EasyFilterBar: unexpected error while handling groupLevelsChanged", String(error));
|
|
814
816
|
}
|
|
815
|
-
|
|
817
|
+
}
|
|
816
818
|
|
|
817
819
|
/**
|
|
818
820
|
* Event handler for the EasyFilter control's showValueHelp event.
|
|
@@ -1030,8 +1032,6 @@ sap.ui.define([
|
|
|
1030
1032
|
onQueryChanged : fnQueryChanged,
|
|
1031
1033
|
onTokensChanged: fnTokensChanged,
|
|
1032
1034
|
onTokensChangedByUser: fnTokensChangedByUser,
|
|
1033
|
-
onSortersChanged: fnSortersChanged,
|
|
1034
|
-
onGroupLevelsChanged: fnGroupLevelsChanged,
|
|
1035
1035
|
onShowValueHelp: fnShowValueHelp,
|
|
1036
1036
|
onFilterChange : fnOnFilterChange,
|
|
1037
1037
|
handleVariantLoad : fnHandleVariantLoad,
|