@sapui5/sap.suite.ui.generic.template 1.150.1 → 1.152.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 +4 -3
- 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/Component.js +4 -2
- 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/i18n/i18n_sv.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/FullscreenPage.fragment.xml +3 -0
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +3 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +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 +45 -32
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +10 -0
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +21 -17
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +3 -1
- package/src/sap/suite/ui/generic/template/lib/Application.js +15 -2
- package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +5 -24
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +30 -8
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +13 -5
- package/src/sap/suite/ui/generic/template/lib/PageLeaveHandler.js +19 -14
- package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillAIOrchestrator.js +1 -6
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillApplyHandler.js +25 -44
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillDialogController.js +80 -64
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFieldCollector.js +442 -259
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFormRenderer.js +125 -161
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +134 -160
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillTableRenderer.js +55 -189
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +67 -86
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +175 -54
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterDataFetcherHelper.js +1 -1
- 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_fi.properties +4 -4
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +7 -7
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +16 -4
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +3 -2
- 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
- package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +1 -1
|
@@ -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;
|
|
@@ -132,6 +156,10 @@ sap.ui.define([
|
|
|
132
156
|
sFilterRestriction = oExtension.value;
|
|
133
157
|
}
|
|
134
158
|
});
|
|
159
|
+
// sap:hidden-filter extension may be absent when only the vocabulary annotation is set
|
|
160
|
+
if (!bIsHiddenFilter && oProperty["com.sap.vocabularies.UI.v1.HiddenFilter"]) {
|
|
161
|
+
bIsHiddenFilter = oProperty["com.sap.vocabularies.UI.v1.HiddenFilter"].Bool === "true";
|
|
162
|
+
}
|
|
135
163
|
if ((oProperty.type === "Edm.DateTime" && oProperty["sap:display-format"] === "Date") ||
|
|
136
164
|
(oProperty.type === "Edm.String" && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"] && oProperty["com.sap.vocabularies.Common.v1.IsCalendarDate"].Bool === "true")) {
|
|
137
165
|
sTokenType = "Calendar";
|
|
@@ -163,7 +191,7 @@ sap.ui.define([
|
|
|
163
191
|
}
|
|
164
192
|
|
|
165
193
|
// Add direct properties
|
|
166
|
-
addPropertiesFromEntityType(oEntityType, "");
|
|
194
|
+
addPropertiesFromEntityType(oEntityType, "", undefined, undefined, oEntitySetMeta);
|
|
167
195
|
|
|
168
196
|
// Add 1:1 navigation properties' properties
|
|
169
197
|
if (oEntityType.navigationProperty) {
|
|
@@ -210,7 +238,7 @@ sap.ui.define([
|
|
|
210
238
|
}
|
|
211
239
|
}
|
|
212
240
|
}
|
|
213
|
-
addPropertiesFromEntityType(oTargetEntityType, navProp.name, bNavSortable, mNavNonSortable);
|
|
241
|
+
addPropertiesFromEntityType(oTargetEntityType, navProp.name, bNavSortable, mNavNonSortable, oNavEntitySetMeta);
|
|
214
242
|
}
|
|
215
243
|
}
|
|
216
244
|
}
|
|
@@ -577,6 +605,17 @@ sap.ui.define([
|
|
|
577
605
|
setState: fnApplyEasyFilterVariantState
|
|
578
606
|
});
|
|
579
607
|
|
|
608
|
+
// Sync sLoadedVariantFilterMode on afterSave (Save As path)
|
|
609
|
+
// so layout switches after saving correctly show the dirty indicator.
|
|
610
|
+
var oSVM = oState.oSmartFilterbar.getSmartVariant();
|
|
611
|
+
if (oSVM && oSVM.attachAfterSave) {
|
|
612
|
+
oSVM.attachAfterSave(function() {
|
|
613
|
+
var oTMModel = oTemplateUtils.oComponentUtils.getTemplatePrivateModel();
|
|
614
|
+
var sCurrentFilterMode = oTMModel.getProperty("/listReport/filterMode");
|
|
615
|
+
sLoadedVariantFilterMode = sCurrentFilterMode;
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
|
|
580
619
|
// Handle INIT timing gap: the "INIT" afterVariantLoad fires before this handler
|
|
581
620
|
// is created. Read whatever the variant already loaded into customFilterData now.
|
|
582
621
|
var oCustomData = oState.oSmartFilterbar.getCustomFilterData();
|
|
@@ -694,10 +733,119 @@ sap.ui.define([
|
|
|
694
733
|
oSmartFilterBarWrapper.setState(oSmartFilterBarVariant);
|
|
695
734
|
// currentVariantSetModified intentionally omitted — pressing Go with the same
|
|
696
735
|
// query must not mark the variant as dirty.
|
|
697
|
-
|
|
736
|
+
|
|
737
|
+
var aSelectOptionsNeedingInjection = fnGetCustomFieldsNeedingInjection(oSmartFilterbar, oVariantDataFromAI.aSelectOptions);
|
|
738
|
+
fnInjectCustomFiltersOnRebind(aSelectOptionsNeedingInjection);
|
|
739
|
+
fnSyncCustomFieldInputValues(aSelectOptionsNeedingInjection, oSmartFilterbar);
|
|
740
|
+
|
|
741
|
+
// Apply sorters/groupLevels bundled with tokens after SFB state is set but
|
|
742
|
+
// before triggering search, to prevent a premature rebind with incomplete filters.
|
|
743
|
+
var aBundledSorters = oEvent.getParameter("sorters");
|
|
744
|
+
var aBundledGroupLevels = oEvent.getParameter("groupLevels");
|
|
745
|
+
if (aBundledSorters !== undefined) {
|
|
746
|
+
fnApplySortersToTable(aBundledSorters);
|
|
747
|
+
}
|
|
748
|
+
if (aBundledGroupLevels !== undefined) {
|
|
749
|
+
fnApplyGroupLevelsToTable(aBundledGroupLevels);
|
|
750
|
+
}
|
|
751
|
+
|
|
698
752
|
oSmartFilterbar.search();
|
|
699
753
|
}
|
|
700
754
|
|
|
755
|
+
/**
|
|
756
|
+
* Returns the subset of aSelectOptions whose property names landed in SFB's _CUSTOM
|
|
757
|
+
* bucket after setState — meaning SFB could not route them through its standard filter
|
|
758
|
+
* pipeline (plain Input fields with no value-list annotation).
|
|
759
|
+
* @param {object} oSmartFilterbar - The SmartFilterBar control instance
|
|
760
|
+
* @param {Array} aSelectOptions - Select options built from AI tokens
|
|
761
|
+
* @returns {Array} Select options that require direct filter injection
|
|
762
|
+
*/
|
|
763
|
+
function fnGetCustomFieldsNeedingInjection(oSmartFilterbar, aSelectOptions) {
|
|
764
|
+
var oFilterData = oSmartFilterbar.getFilterData();
|
|
765
|
+
var oCustomData = oFilterData && oFilterData._CUSTOM;
|
|
766
|
+
return aSelectOptions.filter(function(oSelectOption) {
|
|
767
|
+
return oCustomData && oCustomData.hasOwnProperty(oSelectOption.PropertyName);
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Builds UI5 Filter objects for each _CUSTOM select option and registers a one-shot
|
|
773
|
+
* beforeRebindTable handler on the SmartTable that injects them into bindingParams.filters
|
|
774
|
+
* just before the OData request is built — bypassing SFB's filter pipeline entirely.
|
|
775
|
+
* EQ is remapped to Contains to match Classic SFB substringof behaviour on plain Input fields.
|
|
776
|
+
* @param {Array} aSelectOptionsNeedingInjection - Select options that require direct filter injection
|
|
777
|
+
* @returns {void}
|
|
778
|
+
*/
|
|
779
|
+
function fnInjectCustomFiltersOnRebind(aSelectOptionsNeedingInjection) {
|
|
780
|
+
if (aSelectOptionsNeedingInjection.length === 0 || !oState.oPresentationControlHandler) {
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
var oSmartTable = oState.oPresentationControlHandler.getControl();
|
|
784
|
+
if (!oSmartTable || typeof oSmartTable.attachBeforeRebindTable !== 'function') {
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
var aInjectFilters = [];
|
|
788
|
+
aSelectOptionsNeedingInjection.forEach(function(oSelectOption) {
|
|
789
|
+
oSelectOption.Ranges.forEach(function(oRange) {
|
|
790
|
+
var sOp = oRange.Option;
|
|
791
|
+
var sVal = oRange.Low;
|
|
792
|
+
if (sOp === 'CP') {
|
|
793
|
+
aInjectFilters.push(new Filter(oSelectOption.PropertyName, FilterOperator.Contains, sVal.replace(/^\*|\*$/g, '')));
|
|
794
|
+
} else if (sOp === 'EQ') {
|
|
795
|
+
aInjectFilters.push(new Filter(oSelectOption.PropertyName, FilterOperator.Contains, sVal));
|
|
796
|
+
} else if (sOp === 'BT') {
|
|
797
|
+
aInjectFilters.push(new Filter(oSelectOption.PropertyName, FilterOperator.BT, oRange.Low, oRange.High));
|
|
798
|
+
} else if (sOp === 'NB') {
|
|
799
|
+
aInjectFilters.push(new Filter({path: oSelectOption.PropertyName, operator: FilterOperator.BT, value1: oRange.Low, value2: oRange.High, bExclude: true}));
|
|
800
|
+
} else {
|
|
801
|
+
var sMappedOp = FilterOperator[sOp];
|
|
802
|
+
if (!sMappedOp) {
|
|
803
|
+
oLogger.warning("EasyFilterBarHandler: unsupported select-option operator '" + sOp + "' for property '" + oSelectOption.PropertyName + "' — skipping filter injection");
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
aInjectFilters.push(new Filter(oSelectOption.PropertyName, sMappedOp, sVal));
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
var fnOnBeforeRebind = function(oRebindEvent) {
|
|
811
|
+
oSmartTable.detachBeforeRebindTable(fnOnBeforeRebind);
|
|
812
|
+
var oBindingParams = oRebindEvent.getParameter('bindingParams');
|
|
813
|
+
oBindingParams.filters = oBindingParams.filters || [];
|
|
814
|
+
var aBindingFilters = oBindingParams.filters;
|
|
815
|
+
// Remove prior easy-filter entries for the same properties to avoid stacking.
|
|
816
|
+
aInjectFilters.forEach(function(oF) {
|
|
817
|
+
for (var i = aBindingFilters.length - 1; i >= 0; i--) {
|
|
818
|
+
if (aBindingFilters[i] && aBindingFilters[i].sPath === oF.sPath) {
|
|
819
|
+
aBindingFilters.splice(i, 1);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
aBindingFilters.push(oF);
|
|
823
|
+
});
|
|
824
|
+
};
|
|
825
|
+
oSmartTable.attachBeforeRebindTable(fnOnBeforeRebind);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Sets the visible value on the SFB Input control for each _CUSTOM field so the Classic
|
|
830
|
+
* filter tab shows the correct value when the user switches filter modes.
|
|
831
|
+
* Uses setValue only — no fireChange — to avoid triggering SFB's async filter rebuild.
|
|
832
|
+
* @param {Array} aSelectOptionsNeedingInjection - Select options that require direct filter injection
|
|
833
|
+
* @param {object} oSmartFilterbar - The SmartFilterBar control instance
|
|
834
|
+
* @returns {void}
|
|
835
|
+
*/
|
|
836
|
+
function fnSyncCustomFieldInputValues(aSelectOptionsNeedingInjection, oSmartFilterbar) {
|
|
837
|
+
aSelectOptionsNeedingInjection.forEach(function(oSelectOption) {
|
|
838
|
+
if (oSelectOption.Ranges.length > 0) {
|
|
839
|
+
var aItems = oSmartFilterbar.getAllFilterItems(true) || [];
|
|
840
|
+
var oItem = aItems.find(function(i) { return i.getName && i.getName() === oSelectOption.PropertyName; });
|
|
841
|
+
var oCtrl = oItem && oItem.getControl && oItem.getControl();
|
|
842
|
+
if (oCtrl && oCtrl.setValue) {
|
|
843
|
+
oCtrl.setValue(oSelectOption.Ranges[0].Low);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
|
|
701
849
|
/**
|
|
702
850
|
* Event handler for the EasyFilterBarContainer's tokensChangedByUser event.
|
|
703
851
|
* Fired when the user manually deletes or modifies a token (distinct from AI-resolved tokens).
|
|
@@ -708,42 +856,30 @@ sap.ui.define([
|
|
|
708
856
|
fnSetCreationAllowed(false);
|
|
709
857
|
}
|
|
710
858
|
|
|
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) {
|
|
859
|
+
function fnApplySortersToTable(aSorters) {
|
|
720
860
|
try {
|
|
721
|
-
var aSorters = oEvent.getParameter("sorters");
|
|
722
|
-
|
|
723
861
|
var oPresentationControlHandler = oState.oPresentationControlHandler;
|
|
724
862
|
if (!oPresentationControlHandler) {
|
|
725
|
-
oLogger.error("EasyFilterBarHandler
|
|
863
|
+
oLogger.error("EasyFilterBarHandler: PresentationControlHandler not found.");
|
|
726
864
|
return;
|
|
727
865
|
}
|
|
728
|
-
|
|
866
|
+
|
|
729
867
|
var oControl = oPresentationControlHandler.getControl();
|
|
730
868
|
if (!oControl) {
|
|
731
|
-
oLogger.error("EasyFilterBarHandler
|
|
869
|
+
oLogger.error("EasyFilterBarHandler: Presentation control not found.");
|
|
732
870
|
return;
|
|
733
871
|
}
|
|
734
872
|
|
|
735
873
|
if (!controlHelper.isSmartTable(oControl)) {
|
|
736
|
-
oLogger.warning("EasyFilterBarHandler
|
|
874
|
+
oLogger.warning("EasyFilterBarHandler: Sorting is only supported for SmartTable.");
|
|
737
875
|
return;
|
|
738
876
|
}
|
|
739
|
-
|
|
877
|
+
|
|
740
878
|
var oUiState = oControl.getUiState();
|
|
741
879
|
var oPresentationVariant = oUiState.getPresentationVariant();
|
|
742
|
-
|
|
743
|
-
oPresentationVariant.SortOrder = undefined; // Clear existing sort order before applying new one
|
|
744
880
|
|
|
745
|
-
|
|
746
|
-
|
|
881
|
+
oPresentationVariant.SortOrder = undefined;
|
|
882
|
+
var aSortersMapped = (aSorters && aSorters.length) ? aSorters.map(function(oSorter) {
|
|
747
883
|
return {
|
|
748
884
|
Property: oSorter.key,
|
|
749
885
|
Descending: !!oSorter.descending
|
|
@@ -757,51 +893,38 @@ sap.ui.define([
|
|
|
757
893
|
} finally {
|
|
758
894
|
bApplyingSorting = false;
|
|
759
895
|
}
|
|
760
|
-
|
|
761
896
|
} catch (error) {
|
|
762
897
|
bApplyingSorting = false;
|
|
763
898
|
oLogger.warning("EasyFilterBar: unexpected error while handling sortersChanged", String(error));
|
|
764
899
|
}
|
|
765
|
-
|
|
900
|
+
}
|
|
766
901
|
|
|
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) {
|
|
902
|
+
function fnApplyGroupLevelsToTable(aGroupLevels) {
|
|
775
903
|
try {
|
|
776
|
-
var aGroupLevels = oEvent.getParameter("groupLevels");
|
|
777
|
-
|
|
778
904
|
var oPresentationControlHandler = oState.oPresentationControlHandler;
|
|
779
905
|
if (!oPresentationControlHandler) {
|
|
780
|
-
oLogger.error("EasyFilterBarHandler
|
|
906
|
+
oLogger.error("EasyFilterBarHandler: PresentationControlHandler not found.");
|
|
781
907
|
return;
|
|
782
908
|
}
|
|
783
|
-
|
|
909
|
+
|
|
784
910
|
var oControl = oPresentationControlHandler.getControl();
|
|
785
911
|
if (!oControl) {
|
|
786
|
-
oLogger.error("EasyFilterBarHandler
|
|
912
|
+
oLogger.error("EasyFilterBarHandler: Presentation control not found.");
|
|
787
913
|
return;
|
|
788
914
|
}
|
|
789
915
|
|
|
790
916
|
if (!controlHelper.isSmartTable(oControl)) {
|
|
791
|
-
oLogger.warning("EasyFilterBarHandler
|
|
917
|
+
oLogger.warning("EasyFilterBarHandler: Grouping is only supported for SmartTable.");
|
|
792
918
|
return;
|
|
793
919
|
}
|
|
794
|
-
|
|
920
|
+
|
|
795
921
|
var oUiState = oControl.getUiState();
|
|
796
922
|
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
|
-
|
|
923
|
+
|
|
924
|
+
oPresentationVariant.GroupBy = undefined;
|
|
925
|
+
oPresentationVariant.GroupBy = (aGroupLevels && aGroupLevels.length) ?
|
|
926
|
+
aGroupLevels.flatMap(function(aGroup) { return Object.values(aGroup); }) : undefined;
|
|
927
|
+
|
|
805
928
|
bApplyingGrouplevels = true;
|
|
806
929
|
try {
|
|
807
930
|
oControl.setUiState(oUiState);
|
|
@@ -812,13 +935,13 @@ sap.ui.define([
|
|
|
812
935
|
bApplyingGrouplevels = false;
|
|
813
936
|
oLogger.warning("EasyFilterBar: unexpected error while handling groupLevelsChanged", String(error));
|
|
814
937
|
}
|
|
815
|
-
|
|
938
|
+
}
|
|
816
939
|
|
|
817
940
|
/**
|
|
818
941
|
* Event handler for the EasyFilter control's showValueHelp event.
|
|
819
942
|
* Identifies the input field for which the value help is requested and triggers the value help opening from SFB.
|
|
820
|
-
* @param {
|
|
821
|
-
* @param {
|
|
943
|
+
* @param {sap.ui.base.Event} oEvent - The showValueHelp event fired by the EasyFilter control
|
|
944
|
+
* @param {object} oState - The current controller state object
|
|
822
945
|
*/
|
|
823
946
|
function fnShowValueHelp(oEvent) {
|
|
824
947
|
var oSmartFilterbar = oState.oSmartFilterbar;
|
|
@@ -1030,8 +1153,6 @@ sap.ui.define([
|
|
|
1030
1153
|
onQueryChanged : fnQueryChanged,
|
|
1031
1154
|
onTokensChanged: fnTokensChanged,
|
|
1032
1155
|
onTokensChangedByUser: fnTokensChangedByUser,
|
|
1033
|
-
onSortersChanged: fnSortersChanged,
|
|
1034
|
-
onGroupLevelsChanged: fnGroupLevelsChanged,
|
|
1035
1156
|
onShowValueHelp: fnShowValueHelp,
|
|
1036
1157
|
onFilterChange : fnOnFilterChange,
|
|
1037
1158
|
handleVariantLoad : fnHandleVariantLoad,
|
|
@@ -287,7 +287,7 @@ sap.ui.define([
|
|
|
287
287
|
if (!isValueHelpTableAvailable) {
|
|
288
288
|
// When there is no valueList associate, just return the original value in CodeList type
|
|
289
289
|
aFilters.forEach(oFilter => aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter)));
|
|
290
|
-
resolve(aFinalResponse);
|
|
290
|
+
return resolve(aFinalResponse);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
// Get value help lists from metadata
|