@sapui5/sap.suite.ui.generic.template 1.126.0 → 1.127.1
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/SmartKpiTag.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/FilterItemMicroChart.js +2 -2
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/SmartVisualFilterBar.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/VisualFilterProvider.js +17 -15
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/ControllerImplementation.js +0 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/DropDownController.js +8 -13
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/DynamicDateRangeController.js +4 -5
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/VisualFilterDialogController.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controllerFrameworkExtensions.js +12 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_de.properties +2 -2
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/util/AnnotationHelper.js +11 -11
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/util/FilterUtil.js +6 -6
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/Component.js +9 -1
- package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +65 -40
- package/src/sap/suite/ui/generic/template/ListReport/controllerFrameworkExtensions.js +12 -1
- package/src/sap/suite/ui/generic/template/ListReport/extensionAPI/ExtensionAPI.js +3 -3
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n.properties +16 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ar.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_bg.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ca.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cnr.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cs.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_cy.properties +13 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_da.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_de.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_el.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_GB.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_saprigi.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es_MX.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_et.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fi.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr_CA.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hi.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hr.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hu.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_id.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_it.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_iw.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ja.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_kk.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ko.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_lt.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_lv.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_mk.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ms.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_nl.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_no.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pl.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt_PT.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ro.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ru.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sh.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sk.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sl.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sr.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sv.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_th.properties +13 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_tr.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_uk.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_vi.properties +13 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_CN.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_zh_TW.properties +12 -0
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/DefaultVariant.fragment.xml +18 -3
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/FullscreenPage.fragment.xml +6 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartTable.fragment.xml +1 -3
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +26 -19
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/MessageStripHelper.js +3 -4
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/PasteHandler.js +12 -15
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +5 -6
- package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +12 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_de.properties +4 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Actions.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/CRUDActionButtons.fragment.xml +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/HeaderContainer.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +2 -5
- 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/designtime/utils/DesigntimeHandler.js +4 -2
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeHelper.js +27 -10
- package/src/sap/suite/ui/generic/template/fragments/ContactDetails.fragment.xml +0 -2
- package/src/sap/suite/ui/generic/template/fragments/ContactDetailsQuickViewGroupReplica.fragment.xml +0 -1
- package/src/sap/suite/ui/generic/template/fragments/EasyFilter.fragment.xml +24 -0
- package/src/sap/suite/ui/generic/template/fragments/GridTableCells.fragment.xml +2 -2
- package/src/sap/suite/ui/generic/template/fragments/HeaderDataPointContent.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/fragments/HeaderFormDataField.fragment.xml +2 -2
- package/src/sap/suite/ui/generic/template/fragments/MessageDialog.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/fragments/MessageInfluencingCRUDAction.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/fragments/QuickViewSmartForm.fragment.xml +0 -1
- package/src/sap/suite/ui/generic/template/fragments/SmartFormDataField.fragment.xml +3 -3
- package/src/sap/suite/ui/generic/template/fragments/TableCell.fragment.xml +2 -2
- package/src/sap/suite/ui/generic/template/fragments/TreeTableColumns.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/AjaxHelper.js +57 -47
- package/src/sap/suite/ui/generic/template/genericUtilities/ControlStateWrapperFactory.js +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/FeLogger.js +0 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +12 -11
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +26 -20
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +3 -3
- package/src/sap/suite/ui/generic/template/genericUtilities/filterHelper.js +6 -6
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +59 -51
- package/src/sap/suite/ui/generic/template/js/RuntimeFormatters.js +3 -3
- package/src/sap/suite/ui/generic/template/js/formatters/formatDisplayValueForProgressIndicator.js +3 -3
- package/src/sap/suite/ui/generic/template/lib/AdaptiveCardHelper.js +39 -33
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +79 -53
- package/src/sap/suite/ui/generic/template/lib/Application.js +1 -4
- package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +21 -21
- package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +34 -19
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +63 -11
- package/src/sap/suite/ui/generic/template/lib/ContactCardDetailHelper.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/ContextMenuHandler.js +11 -12
- package/src/sap/suite/ui/generic/template/lib/CreateWithDialogHandler.js +2 -2
- package/src/sap/suite/ui/generic/template/lib/PageLeaveHandler.js +6 -6
- package/src/sap/suite/ui/generic/template/lib/SideEffectUtil.js +5 -7
- package/src/sap/suite/ui/generic/template/lib/TemplateAssembler.js +1 -0
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +323 -0
- package/src/sap/suite/ui/generic/template/lib/ai/FioriAIHandler.js +77 -0
- package/src/sap/suite/ui/generic/template/lib/ai/JouleContextProvider.js +56 -0
- package/src/sap/suite/ui/generic/template/lib/filterHelper.js +38 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +16 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +13 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +10 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +13 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +9 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +8 -0
- package/src/sap/suite/ui/generic/template/lib/info/SmartTableInfo.js +26 -2
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +10 -29
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsHandler.js +3 -3
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartTableHandler.js +2 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/filterSettingsPreparationHelper.js +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/fragments/DetailSmartTable.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/semanticDateRangeTypeHelper.js +1 -1
- package/src/sap/suite/ui/generic/template/themes/base/base.less +4 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/ALPConstants.less +47 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/base.less +7 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/base_AnalyticalListPage.less +475 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/base_ListReport.less +33 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/base_ObjectPage.less +391 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/base_QuickCreate.less +96 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/base_QuickView.less +108 -0
- package/src/sap/suite/ui/generic/template/themes/sap_hcb/library.source.less +24 -7
- package/ui5.yaml +1 -1
|
@@ -1322,16 +1322,19 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1322
1322
|
var oSmartTableHandler = oServices.oPresentationControlHandlerFactory.getPresentationControlHandler(oSmartTable);
|
|
1323
1323
|
var oTable = oSmartTable.getTable();
|
|
1324
1324
|
var aItems = oTable.getRows ? oTable.getRows() : oTable.getItems();
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1325
|
+
var oColumn = oSmartTableHandler.getColumnByKey(sColumnKey);
|
|
1326
|
+
//if the column is visible in the table, then only we bind the visible property of the cell
|
|
1327
|
+
if (oColumn && oColumn.getVisible()){
|
|
1328
|
+
aItems.forEach(function(oItem) {
|
|
1329
|
+
var oCell = oItem.getCells()[oTable.indexOfColumn(oColumn)];
|
|
1330
|
+
oCell && oCell.bindProperty("visible", {
|
|
1331
|
+
path: sPath,
|
|
1332
|
+
formatter: function (bIsHidden) {
|
|
1333
|
+
return !bIsHidden;
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1333
1336
|
});
|
|
1334
|
-
}
|
|
1337
|
+
}
|
|
1335
1338
|
}
|
|
1336
1339
|
|
|
1337
1340
|
// callback for the onBeforeRebindTable event of a smart table
|
|
@@ -1350,6 +1353,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1350
1353
|
var oSmartTable = oEvent.getSource();
|
|
1351
1354
|
var oTable = oSmartTable.getTable();
|
|
1352
1355
|
var bIsMTable = controlHelper.isMTable(oTable);
|
|
1356
|
+
var bIsTreeTable = controlHelper.isTreeTable(oTable);
|
|
1353
1357
|
var oColumns = oTable.getColumns();
|
|
1354
1358
|
|
|
1355
1359
|
if (!oCallbacks || (oCallbacks && oCallbacks.isPopinWithoutHeader) && bIsMTable) { //Setting popin display without header
|
|
@@ -1374,6 +1378,12 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1374
1378
|
};
|
|
1375
1379
|
}
|
|
1376
1380
|
|
|
1381
|
+
//For tree table, set the parameters "rootLevel" and "numberOfExpandedLevels"
|
|
1382
|
+
if (bIsTreeTable) {
|
|
1383
|
+
oBindingParams.parameters.rootLevel = oBindingParams.parameters.rootLevel || 0;
|
|
1384
|
+
oBindingParams.parameters.numberOfExpandedLevels = oBindingParams.parameters.numberOfExpandedLevels || oCallbacks.numberOfExpandedLevels || 0;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1377
1387
|
//Get all the CustomData associated with Smarttable and create an object which is a key value pair of each custom data
|
|
1378
1388
|
var aCustomData = oSmartTable.getCustomData();
|
|
1379
1389
|
var oCustomData = {};
|
|
@@ -1505,7 +1515,6 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1505
1515
|
var oLineItems = oEntityType[sLineItemAnnotation] || []; // some tests in safety net run without any lineitem annotation - seems to work somehow at least for tree table;
|
|
1506
1516
|
for (var index = 0; index < oLineItems.length; index++) {
|
|
1507
1517
|
switch (oLineItems[index].RecordType) {
|
|
1508
|
-
default: break;
|
|
1509
1518
|
case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation":
|
|
1510
1519
|
case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath":
|
|
1511
1520
|
var aDataFieldsWithNavigation = fnGetDataFieldsWithNavigation(oLineItems[index], oMetaModel, oEntityType);
|
|
@@ -1540,6 +1549,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1540
1549
|
}
|
|
1541
1550
|
}
|
|
1542
1551
|
break;
|
|
1552
|
+
default: break;
|
|
1543
1553
|
}
|
|
1544
1554
|
}
|
|
1545
1555
|
|
|
@@ -2645,6 +2655,47 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2645
2655
|
oController.onBeforeExportTableExtension(oExportParams);
|
|
2646
2656
|
}
|
|
2647
2657
|
|
|
2658
|
+
/**
|
|
2659
|
+
* This method is called when the user interacts with EasyFilter field (Enter on the input field or Go button press).
|
|
2660
|
+
* The AI easy filter is triggered and the result filters are applied to the SmartFilterBar.
|
|
2661
|
+
* @param {object} oEasyFilterInputField - The EasyFilter input field which has the value entered by the user
|
|
2662
|
+
* @param {object} oState - oState of the component
|
|
2663
|
+
*/
|
|
2664
|
+
function fnHandleEasyFilterChange(oEasyFilterInputField, oState) {
|
|
2665
|
+
|
|
2666
|
+
var oSmartFilterbar = oState.oSmartFilterbar;
|
|
2667
|
+
FESRHelper.setSemanticStepname(oEasyFilterInputField, "press", "fe2:ai:search");
|
|
2668
|
+
var oAIFilterQueryHandlerPromise = oState.oEasyFilterBarHandler.triggerEasyFilterQuery(oEasyFilterInputField, oSmartFilterbar);
|
|
2669
|
+
|
|
2670
|
+
oAIFilterQueryHandlerPromise.then(function(oFiltersFromAI) {
|
|
2671
|
+
|
|
2672
|
+
var sSmartFilterBarId = oSmartFilterbar.getId();
|
|
2673
|
+
var oSmartFilterBarWrapper = oCommonUtils.getControlStateWrapperById(sSmartFilterBarId, "SmartFilterBar");
|
|
2674
|
+
var oSmartFilterBarVariant = oSmartFilterBarWrapper.getState();
|
|
2675
|
+
var oVariantDataFromAI = oState.oEasyFilterBarHandler.getSFBVariantData(oFiltersFromAI);
|
|
2676
|
+
|
|
2677
|
+
// restore the custom filters to the initial state for now
|
|
2678
|
+
// To check if other objects in oSmartFilterBarVariant needs to be modified
|
|
2679
|
+
var aAppExtension = Object.keys(oSmartFilterBarVariant.customFilters.appExtension);
|
|
2680
|
+
if ( aAppExtension.length > 0 ) {
|
|
2681
|
+
aAppExtension.forEach(function(sKey) {
|
|
2682
|
+
oSmartFilterBarVariant.customFilters.appExtension[sKey] = "";
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
oSmartFilterBarVariant.selectOptions = oVariantDataFromAI.aSelectOptions;
|
|
2686
|
+
if (oComponentUtils.isDraftEnabled()) {
|
|
2687
|
+
oSmartFilterBarVariant.customFilters.editState = oVariantDataFromAI.oEditStateFilter;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
oSmartFilterBarWrapper.setState(oSmartFilterBarVariant);
|
|
2691
|
+
oSmartFilterbar.getSmartVariant() && oSmartFilterbar.getSmartVariant().currentVariantSetModified(true);
|
|
2692
|
+
oSmartFilterbar.search();
|
|
2693
|
+
}, function(oError) {
|
|
2694
|
+
oLogger.error("Error occurred while applying the AI filters", oError);
|
|
2695
|
+
});
|
|
2696
|
+
oComponentUtils.getBusyHelper().setBusy(oAIFilterQueryHandlerPromise);
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2648
2699
|
/* eslint-disable */
|
|
2649
2700
|
var fnBuildSelectionVariantForNavigation = testableHelper.testable(fnBuildSelectionVariantForNavigation, "fnBuildSelectionVariantForNavigation");
|
|
2650
2701
|
var fnEvaluateParameters = testableHelper.testable(fnEvaluateParameters, "fnEvaluateParameters");
|
|
@@ -2695,7 +2746,8 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2695
2746
|
handleSideEffectForField: fnHandleSideEffectForField,
|
|
2696
2747
|
onSmartFieldModeToggled: onSmartFieldModeToggled,
|
|
2697
2748
|
onRenderTeamsContactCollabOptions: fnRenderTeamsContactCollabOptions,
|
|
2698
|
-
hideTableCells: fnHideTableCells
|
|
2749
|
+
hideTableCells: fnHideTableCells,
|
|
2750
|
+
onEasyFilterChange: fnHandleEasyFilterChange
|
|
2699
2751
|
};
|
|
2700
2752
|
}
|
|
2701
2753
|
|
|
@@ -55,7 +55,7 @@ sap.ui.define([
|
|
|
55
55
|
},
|
|
56
56
|
afterOpen: function (oEvent) {
|
|
57
57
|
var oPopover = oEvent.getSource();
|
|
58
|
-
var oToolbar = oPopover.getContent()[0].getItems()[1].getItems()[
|
|
58
|
+
var oToolbar = oPopover.getContent()[0].getItems()[1].getItems()[0];
|
|
59
59
|
oToolbar.getContent().forEach(function(oItem){
|
|
60
60
|
if (controlHelper.isButton(oItem)) {
|
|
61
61
|
var sType = oItem.data("type");
|
|
@@ -28,14 +28,14 @@ sap.ui.define([
|
|
|
28
28
|
//Type definitions
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* @typedef {
|
|
31
|
+
* @typedef {object} sap.suite.ui.generic.template.lib.ContextMenuHandler.FocusInfo Information about the applicable records for the context menu
|
|
32
32
|
* @property {sap.ui.model.Context} focussedBindingContext - Binding context of the currently focussed row
|
|
33
33
|
* @property {Array<sap.ui.model.Context>} applicableContexts - Array of contexts applicable to the context menu
|
|
34
34
|
* @property {boolean} doesApplicableEqualSelected - If the focussed row is part of selected rows
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* @typedef {
|
|
38
|
+
* @typedef {object} sap.suite.ui.generic.template.lib.ContextMenuHandler.ContextMenuEntry Context menu entry
|
|
39
39
|
* @property {string} text - Text
|
|
40
40
|
* @property {string} icon - Icon
|
|
41
41
|
* @property {string} key - Uniquely identifiable key
|
|
@@ -79,12 +79,12 @@ sap.ui.define([
|
|
|
79
79
|
* Note: When the current entry has children, please pass "oHandlerPromise" as null.
|
|
80
80
|
*
|
|
81
81
|
* @param {string} sPathToItems Binding path for the items
|
|
82
|
-
* @param {Array<ContextMenuEntry>} aItems Array which stores all context menu entries
|
|
82
|
+
* @param {Array<sap.suite.ui.generic.template.lib.ContextMenuHandler.ContextMenuEntry>} aItems Array which stores all context menu entries
|
|
83
83
|
* @param {string} sText Text of the context menu item
|
|
84
84
|
* @param {string} sIcon Icon for the context menu item
|
|
85
85
|
* @param {boolean} bStartsSection Defines whether a visual separator should be rendered before the item
|
|
86
86
|
* @param {Promise<Function|boolean>} oHandlerPromise Optional parameter. A promise which resolves the press handler method to the current menu item
|
|
87
|
-
* @param {Array<ContextMenuEntry>} aChildren Child entries for the current menu item
|
|
87
|
+
* @param {Array<sap.suite.ui.generic.template.lib.ContextMenuHandler.ContextMenuEntry>} aChildren Child entries for the current menu item
|
|
88
88
|
*/
|
|
89
89
|
function fnAddMenuItem(sPathToItems, aItems, sText, sIcon, bStartsSection, oHandlerPromise, aChildren){
|
|
90
90
|
iCreatedMenuItemsCounter++;
|
|
@@ -261,8 +261,8 @@ sap.ui.define([
|
|
|
261
261
|
|
|
262
262
|
/**
|
|
263
263
|
* Adds the toolbar buttons and menu buttons to the context menu
|
|
264
|
-
* @param {FocusInfo} oFocusInfo Focus info
|
|
265
|
-
* @param {Array<ContextMenuEntry>} aItems Array of context menu items
|
|
264
|
+
* @param {sap.suite.ui.generic.template.lib.ContextMenuHandler.FocusInfo} oFocusInfo Focus info
|
|
265
|
+
* @param {Array<sap.suite.ui.generic.template.lib.ContextMenuHandler.ContextMenuEntry>} aItems Array of context menu items
|
|
266
266
|
*/
|
|
267
267
|
function fnAddToolbarButtonsToContextMenu(oFocusInfo, aItems){
|
|
268
268
|
var aStandardActions = oCommonUtils.getToolbarCustomData(oSourceControl);
|
|
@@ -356,9 +356,8 @@ sap.ui.define([
|
|
|
356
356
|
/**
|
|
357
357
|
* Opens all the eligible contexts in new tab.
|
|
358
358
|
* Also, validates the maximum allowed number of records to be opened.
|
|
359
|
-
* @param {FocusInfo} oFocusInfo
|
|
359
|
+
* @param {sap.suite.ui.generic.template.lib.ContextMenuHandler.FocusInfo} oFocusInfo
|
|
360
360
|
* @param {Array<sap.ui.model.Context>} aNavigableContexts
|
|
361
|
-
* @returns
|
|
362
361
|
*/
|
|
363
362
|
function fnOpenNavigableContextsInNewTab (oFocusInfo, aNavigableContexts) {
|
|
364
363
|
if (oFocusInfo.applicableContexts.length > MAX_RECORDS_OPEN_IN_NEW_TAB) {
|
|
@@ -396,7 +395,7 @@ sap.ui.define([
|
|
|
396
395
|
* c. The controller is configured with onListNavigationExtension (i.e custom navigation logic written by app).
|
|
397
396
|
* //TODO: These negative scenarios need to be revisited
|
|
398
397
|
*
|
|
399
|
-
* @param {FocusInfo} oFocusInfo
|
|
398
|
+
* @param {sap.suite.ui.generic.template.lib.ContextMenuHandler.FocusInfo} oFocusInfo
|
|
400
399
|
* @returns {Promise<Function|undefined>} Promise which resolves the handler method
|
|
401
400
|
*/
|
|
402
401
|
function getHandlePromiseForOpenInNewTab (oFocusInfo) {
|
|
@@ -419,8 +418,8 @@ sap.ui.define([
|
|
|
419
418
|
|
|
420
419
|
/**
|
|
421
420
|
* Adds "Open in wew tab/window" entry to context menu
|
|
422
|
-
* @param {FocusInfo} oFocusInfo
|
|
423
|
-
* @param {Array<ContextMenuEntry>} aItems
|
|
421
|
+
* @param {sap.suite.ui.generic.template.lib.ContextMenuHandler.FocusInfo} oFocusInfo
|
|
422
|
+
* @param {Array<sap.suite.ui.generic.template.lib.ContextMenuHandler.ContextMenuEntry>} aItems
|
|
424
423
|
*/
|
|
425
424
|
function fnAddOpenInNewTabToContextMenu(oFocusInfo, aItems) {
|
|
426
425
|
var oHandlePromise = getHandlePromiseForOpenInNewTab(oFocusInfo);
|
|
@@ -450,7 +449,7 @@ sap.ui.define([
|
|
|
450
449
|
oTemplatePrivateModel.setProperty(sModelPath + "/items", aContextMenuItems);
|
|
451
450
|
if (aContextMenuItems.length === 0) {
|
|
452
451
|
oEvent.preventDefault();
|
|
453
|
-
}
|
|
452
|
+
}
|
|
454
453
|
}
|
|
455
454
|
|
|
456
455
|
function onContextMenu(oEvent){
|
|
@@ -172,8 +172,8 @@ sap.ui.define([
|
|
|
172
172
|
if (!oPredefinedValues) {
|
|
173
173
|
var oGetDefaultValuesPromise = oTemplateUtils.oServices.oCRUDManager.getDefaultValues(oEventSource, oPredefinedValues);
|
|
174
174
|
if (oGetDefaultValuesPromise instanceof Promise) {
|
|
175
|
-
var fnGetPredefinedValues = function (
|
|
176
|
-
openDialog(oCreateWithDialog, oEventSource,
|
|
175
|
+
var fnGetPredefinedValues = function (mDefaultValues) {
|
|
176
|
+
openDialog(oCreateWithDialog, oEventSource, mDefaultValues, oTable, oParentContext);
|
|
177
177
|
};
|
|
178
178
|
oGetDefaultValuesPromise.then(fnGetPredefinedValues, fnGetPredefinedValues);
|
|
179
179
|
} else {
|
|
@@ -37,23 +37,23 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
37
37
|
onDraftPopupOk: function () {
|
|
38
38
|
var selectedItem = getSelectedKey(oDraftPopup);
|
|
39
39
|
switch (selectedItem) {
|
|
40
|
-
case "draftPopupOptionSave":
|
|
40
|
+
case "draftPopupOptionSave":
|
|
41
41
|
var oBeforeSavePromise = Promise.resolve(getComponent().oController.beforeSaveExtension());
|
|
42
42
|
oBeforeSavePromise.then(fnSaveDraft.bind(null, oTemplateContract, sMode), Function.prototype);
|
|
43
43
|
oDraftPopup.close();
|
|
44
|
-
|
|
45
|
-
case "draftPopupOptionKeep":
|
|
44
|
+
break;
|
|
45
|
+
case "draftPopupOptionKeep":
|
|
46
46
|
oTemplateContract.oAppComponent.getApplicationController().synchronizeDraftAsync().then(function() {
|
|
47
47
|
fnOnDiscardOrKeepDraftConfirmed();
|
|
48
48
|
}).finally(function() {
|
|
49
49
|
oDraftPopup.close();
|
|
50
50
|
});
|
|
51
|
-
|
|
52
|
-
case "draftPopupOptionDiscard":
|
|
51
|
+
break;
|
|
52
|
+
case "draftPopupOptionDiscard":
|
|
53
53
|
var discardDraftPromise = fnDiscardDraft(sMode).then(fnOnDiscardOrKeepDraftConfirmed);
|
|
54
54
|
discardDraftPromise.catch(fnOnDiscardOrKeepDraftCancel);
|
|
55
55
|
oDraftPopup.close();
|
|
56
|
-
|
|
56
|
+
break;
|
|
57
57
|
default:
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
@@ -12,9 +12,9 @@ sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper",
|
|
|
12
12
|
|
|
13
13
|
/***
|
|
14
14
|
* To trigger side effect on value change , only the fieldGroup Ids of single source property is required
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {sap.ui.comp.smartfield.SmartField} oSmartField
|
|
16
16
|
* @param {*} oComputedMetaData
|
|
17
|
-
* @returns
|
|
17
|
+
* @returns {string[]|null} array of fieldGroupID assigned for a property (oComputedMetaData.path)
|
|
18
18
|
*/
|
|
19
19
|
function fnGetFieldGroupIdOnlyForSingleSource(oSmartField, oComputedMetaData) {
|
|
20
20
|
var oSideEffect;
|
|
@@ -88,12 +88,10 @@ sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper",
|
|
|
88
88
|
* Triggers side effect from generic template layer for a field. This method gets triggerd from two sources
|
|
89
89
|
* 1. changeModelValue (SmartField)
|
|
90
90
|
* 2. fieldChange (SmartTable) - in this case get the source smart field from 'changeEvent'
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {sap.ui.base.Event} oEvent
|
|
92
92
|
* @param {*} oComponentUtils
|
|
93
|
-
* @param {
|
|
94
|
-
* @returns
|
|
93
|
+
* @param {boolean} bIsSideEffectTypeComputed
|
|
95
94
|
*/
|
|
96
|
-
|
|
97
95
|
function fnHandleSideEffectForField(oEvent, oComponentUtils, bIsSideEffectTypeComputed) {
|
|
98
96
|
|
|
99
97
|
if (!oComponentUtils.isDraftEnabled()) {
|
|
@@ -114,7 +112,7 @@ sap.ui.define(["sap/suite/ui/generic/template/js/AnnotationHelper",
|
|
|
114
112
|
|
|
115
113
|
/**
|
|
116
114
|
* Calculate and assign fieldGroup Id(s) for a smart Field
|
|
117
|
-
* @param {
|
|
115
|
+
* @param {sap.ui.comp.smartfield.SmartField} oSmartField
|
|
118
116
|
* @param {*} oMetaModel
|
|
119
117
|
* @param {*} sEntitySet
|
|
120
118
|
*/
|
|
@@ -274,6 +274,7 @@ sap.ui.define(["sap/ui/core/mvc/ControllerExtension",
|
|
|
274
274
|
oTemplateUtils.oServices.oApplicationController.registerView(oView);
|
|
275
275
|
oTemplateUtils.oServices.oDataLossHandler = oAppRegistryEntry.oTemplateContract.oDataLossHandler;
|
|
276
276
|
oTemplateUtils.oServices.oInsightsFECardProvider = oAppRegistryEntry.oTemplateContract.oInsightsFECardProvider;
|
|
277
|
+
oTemplateUtils.oServices.oFioriAIHandler = oAppRegistryEntry.oTemplateContract.oFioriAIHandler;
|
|
277
278
|
oTemplateUtils.oCommonUtils = new CommonUtils(oRet, oTemplateUtils.oServices, oTemplateUtils.oComponentUtils);
|
|
278
279
|
oTemplateUtils.oInfoObjectHandler = new InfoObjectHandler(oRet, oTemplateUtils);
|
|
279
280
|
oTemplateUtils.oServices.oCRUDManager = new CRUDManager(oRet,
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/base/Object",
|
|
3
|
+
"sap/base/util/extend",
|
|
4
|
+
"sap/suite/ui/generic/template/lib/filterHelper",
|
|
5
|
+
"sap/ui/core/library"
|
|
6
|
+
], function(BaseObject, extend, filterHelper, SapCoreLibrary) {
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* This is a handler class for EasyFilterBar.
|
|
11
|
+
* It gets initialized when the Fiori AI is enabled and provides the EasyFilterBar capabilities to the floorplan.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
var oEasyFilterMetadata;
|
|
15
|
+
|
|
16
|
+
function getMethods(oState, oController, oTemplateUtils) {
|
|
17
|
+
var ValueState = SapCoreLibrary.ValueState;
|
|
18
|
+
var mCodeList = {};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This method prepares the metadata calculation after the smart filter bar is initialized
|
|
22
|
+
* @returns A promise which returns the prepared metadata
|
|
23
|
+
*/
|
|
24
|
+
function fnGetEasyFilterSearchMetadata() {
|
|
25
|
+
if (oEasyFilterMetadata) {
|
|
26
|
+
return Promise.resolve(oEasyFilterMetadata);
|
|
27
|
+
} else {
|
|
28
|
+
return new Promise(function(fnResolve) {
|
|
29
|
+
// In case the smart filter bar is already initialized then do not use "attachInitialized" as this event will never get triggered again
|
|
30
|
+
if (oState.oSmartFilterbar.isInitialised()) {
|
|
31
|
+
fnPrepareSearchMetadata().then(function(oMetadata){
|
|
32
|
+
fnResolve(oMetadata);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
} else {
|
|
36
|
+
oState.oSmartFilterbar.attachInitialized(function() {
|
|
37
|
+
fnPrepareSearchMetadata().then(function(oMetadata) {
|
|
38
|
+
fnResolve(oMetadata);
|
|
39
|
+
});
|
|
40
|
+
},this);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* This method prepares the metadata for each filterable field from the smart filter bar
|
|
47
|
+
*
|
|
48
|
+
* @returns Filterbar metadata which is required for the EasyFilter search
|
|
49
|
+
*/
|
|
50
|
+
function fnPrepareSearchMetadata() {
|
|
51
|
+
|
|
52
|
+
var aPromise = [];
|
|
53
|
+
var oOwnerFilterControl = oState.oSmartFilterbar;
|
|
54
|
+
var oSFBModel = oOwnerFilterControl.getModel();
|
|
55
|
+
var oSFBMetaModel = oSFBModel.getMetaModel();
|
|
56
|
+
var oEditStateFilterItem;
|
|
57
|
+
var sEntitySet = oController.getOwnerComponent().getEntitySet();
|
|
58
|
+
|
|
59
|
+
var mFilterProperties = {}; // todo : Add the properties from navigation entites
|
|
60
|
+
var oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sEntitySet);
|
|
61
|
+
oEntityType.property.map(function (oProperty) {
|
|
62
|
+
if (filterHelper.isPropertyFilterable(oProperty)) {
|
|
63
|
+
var bIsCodeListRequired = "";
|
|
64
|
+
oProperty.extensions && oProperty.extensions.forEach(function(oExtension) {
|
|
65
|
+
if (oExtension.name === "value-list" && oExtension.value === "fixed-values") {
|
|
66
|
+
bIsCodeListRequired = true;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
mFilterProperties[oProperty.name] = {
|
|
70
|
+
name: oProperty.name,
|
|
71
|
+
//label: oProperty.label, Name is added from the filter item control
|
|
72
|
+
dataType: oProperty.type,
|
|
73
|
+
filterable: true,
|
|
74
|
+
sortable: false,
|
|
75
|
+
codeList : bIsCodeListRequired
|
|
76
|
+
//,required: oProperty.required (TO-DO)
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
oEasyFilterMetadata = {
|
|
82
|
+
version: 1,
|
|
83
|
+
entitySet: sEntitySet,
|
|
84
|
+
fields : []
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
oOwnerFilterControl.getAllFilterItems().forEach(function (oFilterItem) {
|
|
88
|
+
//check if the filter item from the filter control is a property of the entity type , if then push it to the easy filter metadata
|
|
89
|
+
// todo : Add the properties from navigation entites
|
|
90
|
+
var oFilterItemForQuery = mFilterProperties[oFilterItem.getName()];
|
|
91
|
+
if (oFilterItemForQuery) {
|
|
92
|
+
oFilterItemForQuery.label = oFilterItem.getLabel();
|
|
93
|
+
// codeList is set to true for fixed value list and codelist is fetched
|
|
94
|
+
if (oFilterItemForQuery.codeList) {
|
|
95
|
+
var oProperty = oSFBMetaModel.getODataProperty(oEntityType, oFilterItemForQuery.name , true);
|
|
96
|
+
var oPropertyContext = oSFBMetaModel.createBindingContext(oProperty);
|
|
97
|
+
var oVHPromise = oSFBMetaModel.getODataValueLists(oPropertyContext);
|
|
98
|
+
aPromise.push(oVHPromise);
|
|
99
|
+
oVHPromise.then(function(oValueList) {
|
|
100
|
+
if (mCodeList[oFilterItemForQuery.name]) {
|
|
101
|
+
oFilterItemForQuery.codeList = mCodeList[oFilterItemForQuery.name];
|
|
102
|
+
} else {
|
|
103
|
+
oFilterItemForQuery.codeList = function() {
|
|
104
|
+
return fnGetValueListValues(oFilterItemForQuery, oValueList, oSFBModel);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
oEasyFilterMetadata.fields.push(oFilterItemForQuery);
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
oEasyFilterMetadata.fields.push(oFilterItemForQuery);
|
|
111
|
+
}
|
|
112
|
+
} else if (oFilterItem.getName() === "EditState") {// For draft scenarios
|
|
113
|
+
oEditStateFilterItem = oFilterItem;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Adding Editing status filter
|
|
118
|
+
if (oTemplateUtils.oComponentUtils.isDraftEnabled()) {
|
|
119
|
+
var oEditStateControl = oController.byId("editStateFilter");
|
|
120
|
+
if (oEditStateControl) {
|
|
121
|
+
var oEditingStatusCodeList = oEditStateControl.getItems().map(function(oItem) {
|
|
122
|
+
return {
|
|
123
|
+
value : oItem.getKey(),
|
|
124
|
+
description : oItem.getText()
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
var oEditStateFilterMetadata = {
|
|
128
|
+
name: oEditStateFilterItem.getName(),
|
|
129
|
+
label: oEditStateFilterItem.getLabel(),
|
|
130
|
+
dataType: "Edm.String",
|
|
131
|
+
filterable: true,
|
|
132
|
+
required: false,
|
|
133
|
+
sortable: false,
|
|
134
|
+
codeList : oEditingStatusCodeList
|
|
135
|
+
};
|
|
136
|
+
oEasyFilterMetadata.fields.push(oEditStateFilterMetadata);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return Promise.allSettled(aPromise).then(function() {
|
|
141
|
+
return oEasyFilterMetadata;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* This method is used to trigger the EasyFilter search of the fiori AI reuse library
|
|
147
|
+
* @param {*} oEasyFilterControl EasyFilter control of the floorplan
|
|
148
|
+
* @returns Promise which resolves to AI filters
|
|
149
|
+
*/
|
|
150
|
+
function fnTriggerEasyFilterQuery(oEasyFilterControl) {
|
|
151
|
+
|
|
152
|
+
var sEasyFilterQuery = oEasyFilterControl.getValue();
|
|
153
|
+
if (sEasyFilterQuery.length === 0) {
|
|
154
|
+
// Resolving with an empty array will reset the SFB filters and trigger a fresh GET call
|
|
155
|
+
return Promise.resolve([]);
|
|
156
|
+
} else {
|
|
157
|
+
var oEasyFilterMetadataPromise = fnGetEasyFilterSearchMetadata();
|
|
158
|
+
var oResultPromise = new Promise(function(fnResolve, fnReject) {
|
|
159
|
+
oEasyFilterMetadataPromise.then(function(oEasyFilterMetadata) {
|
|
160
|
+
var oFioriAIFilterQueryPromise = oTemplateUtils.oServices.oFioriAIHandler.fioriaiLib.EasyFilter.easyFilter(sEasyFilterQuery, oEasyFilterMetadata);
|
|
161
|
+
oFioriAIFilterQueryPromise.then(function(oResponse) {
|
|
162
|
+
if (oResponse.success) {
|
|
163
|
+
if (oResponse.data.version === 1) {
|
|
164
|
+
// In cases where user filters with some random string and the no valuable filter is availabel then simply reject
|
|
165
|
+
if (oResponse.data.unclear || !oResponse.data.filter) {
|
|
166
|
+
var sUnclearInputMessage = oResponse.data.unclear ? "Unclear input: " + oResponse.data.unclear : "Unclear input";
|
|
167
|
+
oEasyFilterControl.setValueStateText(sUnclearInputMessage);
|
|
168
|
+
oEasyFilterControl.setValueState(ValueState.Warning);
|
|
169
|
+
fnReject(oResponse);
|
|
170
|
+
} else if (oResponse.data.filter) {
|
|
171
|
+
// Commenting out for v4 parity
|
|
172
|
+
//oEasyFilterControl.setValueState(ValueState.Success);
|
|
173
|
+
fnResolve(oResponse.data.filter);
|
|
174
|
+
}
|
|
175
|
+
} else if (oResponse.data.version === 2) {
|
|
176
|
+
// to-do for version 2
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
oEasyFilterControl.setValueStateText(oResponse.message);
|
|
180
|
+
oEasyFilterControl.setValueState(ValueState.Warning);
|
|
181
|
+
fnReject(oResponse);
|
|
182
|
+
}
|
|
183
|
+
},fnReject);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
return oResultPromise;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* This method reads the values of the valuehelp entity from the backend and fills the code list of each property.
|
|
192
|
+
* Once the values are filled then the fioriAI uses it for getting the ID of the user entered description in the search field
|
|
193
|
+
* Later the key field is set in the SFB and table is filtered with the same. Description cannot be used for filtering.
|
|
194
|
+
* @param {*} oFilterItemForQuery A Property from the easy filter metadata
|
|
195
|
+
* @param {*} oValueList Value list object of the filter item
|
|
196
|
+
* @returns
|
|
197
|
+
*/
|
|
198
|
+
function fnGetValueListValues(oFilterItemForQuery, oValueList, oSFBModel) {
|
|
199
|
+
|
|
200
|
+
if (mCodeList[oFilterItemForQuery.name]) {
|
|
201
|
+
return mCodeList[oFilterItemForQuery.name];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return new Promise(function(fnResolve, fnReject) {
|
|
205
|
+
|
|
206
|
+
var oValueListDefaultBinding = oValueList[""];
|
|
207
|
+
// Cases where the default binding is not available ignore for now
|
|
208
|
+
if (oValueListDefaultBinding) {
|
|
209
|
+
var sSelect = oValueListDefaultBinding.Parameters && oValueListDefaultBinding.Parameters.map(function(oParam) {
|
|
210
|
+
return oParam.ValueListProperty.String;
|
|
211
|
+
}).join(",");
|
|
212
|
+
|
|
213
|
+
var fnSuccess = function(oResponse) {
|
|
214
|
+
var mValueListData = [];
|
|
215
|
+
oResponse.results && oResponse.results.forEach(function(oItem) {
|
|
216
|
+
mValueListData.push({
|
|
217
|
+
value : oItem[sValueProperty],
|
|
218
|
+
description : sDescriptionProperty ? oItem[sDescriptionProperty] : undefined
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
mCodeList[oFilterItemForQuery.name] = mValueListData;
|
|
222
|
+
oEasyFilterMetadata.fields.forEach(function (oField) {
|
|
223
|
+
if (oField.name === oFilterItemForQuery.name) {
|
|
224
|
+
oField.codeList = mValueListData;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
fnResolve(mValueListData);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
oSFBModel.read("/" + oValueListDefaultBinding.CollectionPath.String, {
|
|
231
|
+
$select : sSelect,
|
|
232
|
+
success : fnSuccess,
|
|
233
|
+
error : fnReject
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
var sValueProperty;
|
|
237
|
+
var sDescriptionProperty;
|
|
238
|
+
|
|
239
|
+
oValueListDefaultBinding.Parameters && oValueListDefaultBinding.Parameters.forEach(function(oParam) {
|
|
240
|
+
if (oParam.LocalDataProperty && (oParam.LocalDataProperty.PropertyPath === oFilterItemForQuery.name)) {
|
|
241
|
+
sValueProperty = oParam.ValueListProperty.String;
|
|
242
|
+
} else {
|
|
243
|
+
sDescriptionProperty = oParam.ValueListProperty.String;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* This method is used to convert the AI filters to the selectOptions for the SmartFilterBar
|
|
252
|
+
* It also identifies the values of edit state filter in case of draft
|
|
253
|
+
* @param {*} oAIFilters
|
|
254
|
+
* @returns array of selectOptions
|
|
255
|
+
*/
|
|
256
|
+
function fnGetSFBVariantData(oAIFilters) {
|
|
257
|
+
|
|
258
|
+
// Each filter from AI will be converted to a selectOption and added to the SmartVariantManagement state
|
|
259
|
+
// Case 1 : AI Query "Show P1 = a"
|
|
260
|
+
// ------- AI response "P1 = Ranges [a]" .
|
|
261
|
+
// ------- Converted to selectOptions [ {Property = P1, Ranges = [ a ] } ].
|
|
262
|
+
// ------- Filtered as P1 = a.
|
|
263
|
+
// Case 1.a : AI Query "Show P1 = a , b"
|
|
264
|
+
// ------- AI response "P1 = Ranges [a, b]" .
|
|
265
|
+
// ------- Converted to selectOptions [ {Property = P1, Ranges = [ a, b ] } ] .
|
|
266
|
+
// ------- FE filters as "a or b".
|
|
267
|
+
// Case 1.b : AI Query "Show P1 between a and b"
|
|
268
|
+
// ------- AI response " [P1 = Ranges [a] , P1 = Ranges [b]]".
|
|
269
|
+
// ------- Converted to selectOptions [ {Property = P1, Ranges = [ a ] } , {Property = P2, Ranges = [ b ] } ] .
|
|
270
|
+
// ------- FE filters as "a and b" but (todo) currently it is "a or b".
|
|
271
|
+
// Case 2 : AI Query "Show P1 = a and P2 = b"
|
|
272
|
+
// ------- AI response "[P1 = Ranges [a] , P2 = Ranges [b]]"
|
|
273
|
+
// ------- Convert to selectOptions [ {Property = P1, Ranges = [ a ] } , {Property = P2, Ranges = [ b ] } ].
|
|
274
|
+
// ------- FE filters as "a and b".
|
|
275
|
+
|
|
276
|
+
var aSelectOptions = [];
|
|
277
|
+
var oEditStateFilter = 0;
|
|
278
|
+
oAIFilters.forEach(function(oFilterItem) {
|
|
279
|
+
|
|
280
|
+
if ( oFilterItem.name === "EditState") {
|
|
281
|
+
oEditStateFilter = oFilterItem.values[0]; // Edit state generally should not have more than one filter value
|
|
282
|
+
} else {
|
|
283
|
+
var oFilter = {
|
|
284
|
+
PropertyName : oFilterItem.name,
|
|
285
|
+
Ranges : []
|
|
286
|
+
};
|
|
287
|
+
oFilterItem.values.forEach(function (oValue) {
|
|
288
|
+
var oRange = {
|
|
289
|
+
Sign : "I", // currently not considering "E"
|
|
290
|
+
High : "" // Usually for "BT" High is required, but AI provides two separate filters (LT and GT) and FE converts it to two separate selectOptions
|
|
291
|
+
// But this results in OR condition
|
|
292
|
+
// todo : check if AI can provide BT filter or FE should handle it
|
|
293
|
+
};
|
|
294
|
+
if (oFilterItem.operator === "Contains") { // need to check for other operators if special handling is required
|
|
295
|
+
oRange.Option = "CP";
|
|
296
|
+
} else {
|
|
297
|
+
oRange.Option = oFilterItem.operator;
|
|
298
|
+
}
|
|
299
|
+
oRange.Low = oValue;
|
|
300
|
+
oFilter.Ranges.push(oRange);
|
|
301
|
+
});
|
|
302
|
+
aSelectOptions.push(oFilter);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
return {
|
|
306
|
+
aSelectOptions: aSelectOptions,
|
|
307
|
+
oEditStateFilter : oEditStateFilter
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
triggerEasyFilterQuery : fnTriggerEasyFilterQuery,
|
|
312
|
+
getSFBVariantData : fnGetSFBVariantData,
|
|
313
|
+
getEasyFilterSearchMetadata : fnGetEasyFilterSearchMetadata
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return BaseObject.extend("sap.suite.ui.generic.template.lib.ai.EasyFilterBarHandler", {
|
|
318
|
+
constructor: function (oState, oController, oTemplateUtils) {
|
|
319
|
+
extend(this, getMethods(oState, oController, oTemplateUtils));
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
});
|