@sapui5/sap.suite.ui.generic.template 1.136.7 → 1.136.9
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/i18n/i18n_kk.properties +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_pt.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +3 -0
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/SectionTitleHandler.js +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +285 -270
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ar.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pt.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_vi.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartForm.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +31 -2
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +16 -2
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +44 -199
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterDataFetcherHelper.js +334 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +1 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +8 -8
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +1 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +1 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +6 -1
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartTableHandler.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<core:CustomData key="defaultDropDownDisplayBehaviour" value="descriptionOnly" />
|
|
22
22
|
<core:CustomData key="defaultTextInEditModeSource" value="ValueListNoValidation" />
|
|
23
23
|
<core:CustomData key="dateFormatSettings" value='\{"UTC":true,"style":"medium"\}' />
|
|
24
|
-
<core:CustomData key="smartFormAriaLabel" value="{parts: [{path: 'facet>'}, {path: 'entitySet>name'}], formatter: 'AH.getSmartFormTitle'}" />
|
|
24
|
+
<core:CustomData key="smartFormAriaLabel" value="{parts: [{path: 'facet>'}, {path: 'entitySet>name'}, {path: 'block>'}, {path: 'subSectionData>'}], formatter: 'AH.getSmartFormTitle'}" />
|
|
25
25
|
</sfo:customData>
|
|
26
26
|
<sfo:layout>
|
|
27
27
|
<template:if test="{= ${appSettings>/useColumnLayoutForSmartForm} !== false}">
|
|
@@ -3017,7 +3017,7 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
3017
3017
|
};
|
|
3018
3018
|
}
|
|
3019
3019
|
},
|
|
3020
|
-
|
|
3020
|
+
getTextArrangementFromAnnotations: function (oEntityType, oField) {
|
|
3021
3021
|
var sTextArrangement;
|
|
3022
3022
|
// 1. check TextArrangement definition for property directly - has prio 1
|
|
3023
3023
|
if (oField["com.sap.vocabularies.UI.v1.TextArrangement"] && oField["com.sap.vocabularies.UI.v1.TextArrangement"].EnumMember) {
|
|
@@ -3036,11 +3036,19 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
3036
3036
|
sTextArrangement = oAnnotationHelper._mapTextArrangement4smartControl(oEntityType["com.sap.vocabularies.UI.v1.TextArrangement"].EnumMember);
|
|
3037
3037
|
}
|
|
3038
3038
|
}
|
|
3039
|
+
return sTextArrangement;
|
|
3040
|
+
},
|
|
3041
|
+
getTextArrangement: function(oEntityType, oField) {
|
|
3042
|
+
var sTextArrangement = this.getTextArrangementFromAnnotations(oEntityType, oField);
|
|
3039
3043
|
if (!sTextArrangement) { //coming from the title should get a readable description and underneath is the id - the default
|
|
3040
3044
|
sTextArrangement = "descriptionAndId";
|
|
3041
3045
|
}
|
|
3042
3046
|
return sTextArrangement;
|
|
3043
3047
|
},
|
|
3048
|
+
getTextArrangementForEasyFilter: function (oEntityType, oField) {
|
|
3049
|
+
var sTextArrangement = this.getTextArrangementFromAnnotations(oEntityType, oField) || "idAndDescription";
|
|
3050
|
+
return sTextArrangement;
|
|
3051
|
+
},
|
|
3044
3052
|
getTextArrangementPath: function (oField) {
|
|
3045
3053
|
return oField["com.sap.vocabularies.Common.v1.Text"] && oField["com.sap.vocabularies.Common.v1.Text"].Path;
|
|
3046
3054
|
},
|
|
@@ -4524,10 +4532,31 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
4524
4532
|
};
|
|
4525
4533
|
},
|
|
4526
4534
|
|
|
4527
|
-
getSmartFormTitle: function(oInterface, oFacet, sEntitySetName) {
|
|
4535
|
+
getSmartFormTitle: function(oInterface, oFacet, sEntitySetName, oBlock, oSubSectionData) {
|
|
4528
4536
|
if (!oFacet) {
|
|
4537
|
+
return oAnnotationHelper.getTitleForSectionsForms(oBlock, oSubSectionData);
|
|
4538
|
+
}
|
|
4539
|
+
return oAnnotationHelper.getTitleForHeaderForm(oInterface, oFacet, sEntitySetName);
|
|
4540
|
+
},
|
|
4541
|
+
|
|
4542
|
+
getTitleForSectionsForms: function(oBlock, oSubSectionData) {
|
|
4543
|
+
if (oSubSectionData?.annotations?.Facet?.annotation?.Facets?.length > 1
|
|
4544
|
+
|| oSubSectionData?.annotations?.Facet?.annotation?.Label?.String !== oBlock?.aggregations?.groups[0]?.annotations?.Facet?.annotation?.Label?.String
|
|
4545
|
+
) {
|
|
4546
|
+
// In case Section -> SubSection have more than one form, SmartForm will have it's titles visible
|
|
4547
|
+
// or
|
|
4548
|
+
// SubSectin title !== SmartForm title, SmartForm title will also be visible
|
|
4529
4549
|
return;
|
|
4530
4550
|
}
|
|
4551
|
+
if (oBlock?.aggregations?.groups[0]?.annotations?.Facet?.annotation?.Label?.String !== oBlock?.aggregations?.groups[0]?.targetAnnotation?.Label?.String) {
|
|
4552
|
+
// Compare SmartForm title !== FiledGroup title
|
|
4553
|
+
// if they differs -> use FiledGoup title
|
|
4554
|
+
return oBlock?.aggregations?.groups[0]?.targetAnnotation?.Label?.String;
|
|
4555
|
+
}
|
|
4556
|
+
return;
|
|
4557
|
+
},
|
|
4558
|
+
|
|
4559
|
+
getTitleForHeaderForm: function(oInterface, oFacet, sEntitySetName) {
|
|
4531
4560
|
if (oFacet.Target && oFacet.Target.AnnotationPath && oFacet.Target.AnnotationPath.indexOf("com.sap.vocabularies.UI.v1.DataPoint") > -1) {
|
|
4532
4561
|
// Process DataPoint case
|
|
4533
4562
|
var { sAnnotationPath, oEntityType } = oAnnotationHelper.getModelData(oInterface, oFacet.Target.AnnotationPath, sEntitySetName);
|
|
@@ -369,6 +369,20 @@ sap.ui.define([
|
|
|
369
369
|
oComponentData.feEnvironment.getShareControlVisibility();
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
// If the FE app is embedded within the Inbox app, the Inbox injects a dummy object named "feEnvironment"
|
|
373
|
+
// into the "componentData". In this case, we obtain the (mocked) shell service from "feEnvironment"
|
|
374
|
+
// instead of the standard ShellUIService.
|
|
375
|
+
// The mocked shell service exposes few methods like "setTitle" and "setHierarchy".
|
|
376
|
+
// They are invoked by NavigationController.
|
|
377
|
+
//
|
|
378
|
+
// Otherwise, we return the actual "ShellUIService" from the app component.
|
|
379
|
+
function fnGetShellUIServicePromise () {
|
|
380
|
+
var oComponentData = oAppComponent.getComponentData();
|
|
381
|
+
return oComponentData?.feEnvironment?.getShellService ?
|
|
382
|
+
Promise.resolve( oComponentData.feEnvironment.getShellService() ) :
|
|
383
|
+
oAppComponent.getService("ShellUIService");
|
|
384
|
+
}
|
|
385
|
+
|
|
372
386
|
function attachToApplicationController() {
|
|
373
387
|
oTemplateContract.fnAddSideEffectPromise = function(oPromise){
|
|
374
388
|
var i = 0;
|
|
@@ -432,7 +446,7 @@ sap.ui.define([
|
|
|
432
446
|
oViewDependencyHelper: new ViewDependencyHelper(oTemplateContract)
|
|
433
447
|
};
|
|
434
448
|
oTemplateContract.oViewDependencyHelper = oAppRegistryEntry.oViewDependencyHelper;
|
|
435
|
-
oTemplateContract.oShellServicePromise =
|
|
449
|
+
oTemplateContract.oShellServicePromise = fnGetShellUIServicePromise();
|
|
436
450
|
oTemplateContract.oShellServicePromise.catch(function(){
|
|
437
451
|
oLogger.warning("No ShellService available");
|
|
438
452
|
});
|
|
@@ -950,7 +964,7 @@ sap.ui.define([
|
|
|
950
964
|
* @public
|
|
951
965
|
* @extends sap.ui.core.UIComponent
|
|
952
966
|
* @author SAP SE
|
|
953
|
-
* @version 1.136.
|
|
967
|
+
* @version 1.136.9
|
|
954
968
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
955
969
|
*/
|
|
956
970
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -5,8 +5,9 @@ sap.ui.define([
|
|
|
5
5
|
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
6
6
|
"sap/ui/model/FilterOperator",
|
|
7
7
|
'sap/ui/model/Filter',
|
|
8
|
-
'sap/suite/ui/generic/template/js/AnnotationHelper'
|
|
9
|
-
|
|
8
|
+
'sap/suite/ui/generic/template/js/AnnotationHelper',
|
|
9
|
+
"./EasyFilterDataFetcherHelper"
|
|
10
|
+
], function(BaseObject, extend, filterHelper, FeLogger, FilterOperator,Filter,AnnotationHelper,EasyFilterDataFetcherHelper) {
|
|
10
11
|
'use strict';
|
|
11
12
|
|
|
12
13
|
/*
|
|
@@ -305,24 +306,28 @@ sap.ui.define([
|
|
|
305
306
|
// keySpecificSelectedValues will have one selectedValues object for each operator
|
|
306
307
|
// ex : [{operator: "EQ", selectedValues: ["HT-1010","HT-10001","1097"]}, {operator: "Contains", selectedValues: ["HT-100"]}]
|
|
307
308
|
oFilterItem.keySpecificSelectedValues.forEach(function (oSelectedValues) {
|
|
308
|
-
var oRange = {
|
|
309
|
-
Sign: "I", // currently not considering "E"
|
|
310
|
-
High: ""
|
|
311
|
-
};
|
|
312
|
-
|
|
313
309
|
if ((oSelectedValues.operator === "BT" || oSelectedValues.operator === "NB")) {
|
|
310
|
+
var oRange = {
|
|
311
|
+
Sign: oSelectedValues.operator === "NB" ? "E" : "I",
|
|
312
|
+
High: ""
|
|
313
|
+
};
|
|
314
314
|
oRange.Low = oSelectedValues.selectedValues[0];
|
|
315
315
|
oRange.High = oSelectedValues.selectedValues[1];
|
|
316
|
-
oRange.Option =
|
|
316
|
+
oRange.Option = "BT";
|
|
317
317
|
oFilter.Ranges.push(oRange);
|
|
318
318
|
} else {
|
|
319
|
-
oSelectedValues.selectedValues.forEach(function (
|
|
320
|
-
|
|
319
|
+
oSelectedValues.selectedValues.forEach(function (sValue) {
|
|
320
|
+
var oRange = {
|
|
321
|
+
Sign: EasyFilterDataFetcherHelper.isNegationOperator(oSelectedValues.operator) ? "E" : "I",
|
|
322
|
+
High: ""
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
if (isCPOperator(oSelectedValues.operator)) {
|
|
321
326
|
oRange.Option = "CP";
|
|
322
|
-
oRange.Low =
|
|
327
|
+
oRange.Low = getValueForCPOperator(sValue,oSelectedValues.operator);
|
|
323
328
|
} else {
|
|
324
|
-
oRange.Option = oSelectedValues.operator;
|
|
325
|
-
oRange.Low =
|
|
329
|
+
oRange.Option = EasyFilterDataFetcherHelper.isNegationOperator(oSelectedValues.operator) ? EasyFilterDataFetcherHelper.getReverseOperator(oSelectedValues.operator) : oSelectedValues.operator;
|
|
330
|
+
oRange.Low = sValue;
|
|
326
331
|
}
|
|
327
332
|
oFilter.Ranges.push(oRange);
|
|
328
333
|
});
|
|
@@ -338,6 +343,29 @@ sap.ui.define([
|
|
|
338
343
|
};
|
|
339
344
|
}
|
|
340
345
|
|
|
346
|
+
function getValueForCPOperator(sValue,sOperator) {
|
|
347
|
+
sOperator = EasyFilterDataFetcherHelper.isNegationOperator(sOperator) ? EasyFilterDataFetcherHelper.getReverseOperator(sOperator) : sOperator;
|
|
348
|
+
switch (sOperator) {
|
|
349
|
+
case FilterOperator.Contains:
|
|
350
|
+
sValue = `*${sValue}*`;
|
|
351
|
+
break;
|
|
352
|
+
case FilterOperator.EndsWith:
|
|
353
|
+
sValue = `*${sValue}`;
|
|
354
|
+
break;
|
|
355
|
+
case FilterOperator.StartsWith:
|
|
356
|
+
sValue = `${sValue}*`;
|
|
357
|
+
break;
|
|
358
|
+
default:
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
return sValue;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function isCPOperator(sOperator) {
|
|
365
|
+
return sOperator === FilterOperator.Contains || sOperator === FilterOperator.EndsWith || sOperator === FilterOperator.NotContains || sOperator === FilterOperator.NotEndsWith
|
|
366
|
+
|| sOperator === FilterOperator.NotStartsWith || sOperator === FilterOperator.StartsWith;
|
|
367
|
+
}
|
|
368
|
+
|
|
341
369
|
/**
|
|
342
370
|
* This method is used to get the EasyFilter control from the floorplan
|
|
343
371
|
* @returns EasyFilter control
|
|
@@ -403,7 +431,6 @@ sap.ui.define([
|
|
|
403
431
|
if (oSmartFilterBarVariant.semanticDates) {
|
|
404
432
|
var { Low: value1, High: value2 } = oVariantDataFromAI.aSelectOptions[0].Ranges[0];
|
|
405
433
|
var dateData = oSmartFilterBarVariant.semanticDates.Dates[0].Data;
|
|
406
|
-
|
|
407
434
|
dateData.operation = "DATERANGE";
|
|
408
435
|
dateData.value1 = value1;
|
|
409
436
|
dateData.value2 = value2 || value1;
|
|
@@ -513,191 +540,10 @@ sap.ui.define([
|
|
|
513
540
|
}
|
|
514
541
|
}
|
|
515
542
|
|
|
516
|
-
function getFiltersForDataFetching(key,keySpecificSelectedResult) {
|
|
517
|
-
const aFilters = [];
|
|
518
|
-
|
|
519
|
-
for (var i = 0; i < keySpecificSelectedResult.length;++i) {
|
|
520
|
-
const result = keySpecificSelectedResult[i];
|
|
521
|
-
if (result.operator === FilterOperator.BT || result.operator === FilterOperator.NB) {
|
|
522
|
-
aFilters.push(new Filter({
|
|
523
|
-
path: key,
|
|
524
|
-
operator: result.operator,
|
|
525
|
-
value1: result.selectedValues[0],
|
|
526
|
-
value2: result.selectedValues[1]
|
|
527
|
-
}));
|
|
528
|
-
} else {
|
|
529
|
-
for (var i = 0;i < result.selectedValues.length;++i) {
|
|
530
|
-
aFilters.push(new Filter({
|
|
531
|
-
path: key,
|
|
532
|
-
operator: result.operator,
|
|
533
|
-
value1: result.selectedValues[i]
|
|
534
|
-
}));
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
return aFilters;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
543
|
function onDataFetcher(key,keySpecificSelectedResult,totalAIResponse) {
|
|
542
|
-
return
|
|
543
|
-
|
|
544
|
-
var aFinalResponse = [];
|
|
545
|
-
var oOwnerFilterControl = oState.oSmartFilterbar;
|
|
546
|
-
var sKey = key;
|
|
547
|
-
var sEntitySet = oController.getOwnerComponent().getEntitySet();
|
|
548
|
-
var oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sEntitySet);
|
|
549
|
-
var oSFBModel = oOwnerFilterControl.getModel();
|
|
550
|
-
var oSFBMetaModel = oSFBModel.getMetaModel();
|
|
551
|
-
var aFilters = getFiltersForDataFetching(key,keySpecificSelectedResult);
|
|
552
|
-
var oProperty = oSFBMetaModel.getODataProperty(oEntityType, key);
|
|
553
|
-
var sPropertyPath = oSFBMetaModel.getODataProperty(oEntityType, key,true);
|
|
554
|
-
var isValueHelpTableAvailable = AnnotationHelper.isValueHelpTableAvailable(oProperty);
|
|
555
|
-
|
|
556
|
-
if (isValueHelpTableAvailable) {
|
|
557
|
-
var oPropertyContext = oSFBMetaModel.createBindingContext(sPropertyPath);
|
|
558
|
-
var oVHPromise = oSFBMetaModel.getODataValueLists(oPropertyContext);
|
|
559
|
-
var filtersLength = aFilters.length;
|
|
560
|
-
// //Every Search on a value, create a seperate call to backend,but they are grouped into one batch
|
|
561
|
-
// //We need to ensure that once all calls are completed inside the batch to resolve the promise, else the system would be waiting indefenitely
|
|
562
|
-
var ctr = 0;
|
|
563
|
-
let fnForDescription = (oResponse,aMatchedFilterResults,sTextArrangementPath,sTextArrangement) => {
|
|
564
|
-
++ctr;
|
|
565
|
-
var aResults = oResponse.results;
|
|
566
|
-
|
|
567
|
-
//Check the description is present and follow the textArrangement annotation as well
|
|
568
|
-
//If the value is not present ,make the ID and Description same
|
|
569
|
-
aMatchedFilterResults.forEach((oFilter)=>{
|
|
570
|
-
var result = aResults.find((res)=>res[key] === oFilter.getValue1());
|
|
571
|
-
if (result) {
|
|
572
|
-
aFinalResponse.push({
|
|
573
|
-
operator: FilterOperator.EQ,
|
|
574
|
-
selectedValues: [{
|
|
575
|
-
value: result[key],
|
|
576
|
-
description: AnnotationHelper.getTextArrangementFinalString(result,key,sTextArrangementPath.split("/")[1],sTextArrangement)
|
|
577
|
-
}]
|
|
578
|
-
});
|
|
579
|
-
} else {
|
|
580
|
-
//Ideally description should be present, if in case its not present we will fallback to our default case where value and description would be same
|
|
581
|
-
aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter));
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
|
|
585
|
-
if (ctr === filtersLength) {
|
|
586
|
-
resolve(aFinalResponse);
|
|
587
|
-
}
|
|
588
|
-
};
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
let fnSuccessForValueList = (oResponse,oFilter,sValueListEntity) => {
|
|
593
|
-
var oValueHelpEntity = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sValueListEntity);
|
|
594
|
-
var oValueHelpProperty = oSFBMetaModel.getODataProperty(oValueHelpEntity, key);
|
|
595
|
-
var aResults = oResponse.results;
|
|
596
|
-
var sTextArrangementPath = AnnotationHelper.getTextArrangementPath(oValueHelpProperty);
|
|
597
|
-
var sTextArrangement = AnnotationHelper.getTextArrangement(oValueHelpEntity,oValueHelpProperty) || "idOnly";
|
|
598
|
-
var navigationProperty = null;
|
|
599
|
-
var sEntityForTextDescription = null;
|
|
600
|
-
|
|
601
|
-
if (sTextArrangementPath && sTextArrangementPath.split("/").length > 1) {
|
|
602
|
-
navigationProperty = sTextArrangementPath.split("/")[0];
|
|
603
|
-
sEntityForTextDescription = oSFBMetaModel.getODataAssociationSetEnd(oValueHelpEntity,navigationProperty).entitySet;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
//We are triggering the below call, only for fetching of the TextDescription.If its a different entity than ValueList only then trigger it
|
|
607
|
-
if (aResults.length === 0) {
|
|
608
|
-
++ctr;
|
|
609
|
-
aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter));
|
|
610
|
-
} else if (aResults.length !== 0 && sEntityForTextDescription && sValueListEntity !== sEntityForTextDescription) {
|
|
611
|
-
var aAllMatchedResults = aResults.map((result)=>{
|
|
612
|
-
return result[key];
|
|
613
|
-
});
|
|
614
|
-
var aMatchedFilterResults = aAllMatchedResults.map((matchedResult)=>{
|
|
615
|
-
return new Filter({
|
|
616
|
-
path: key,
|
|
617
|
-
operator: FilterOperator.EQ,
|
|
618
|
-
value1:matchedResult
|
|
619
|
-
});
|
|
620
|
-
});
|
|
621
|
-
// The below code only be executed when the textDescription and ValueList entities are different
|
|
622
|
-
oSFBModel.read("/" + sEntityForTextDescription, {
|
|
623
|
-
filters: aMatchedFilterResults,
|
|
624
|
-
success : function(response) {
|
|
625
|
-
fnForDescription(response,aMatchedFilterResults);
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
} else {
|
|
629
|
-
//The below condition is when valueList entity and navigation property entity are same
|
|
630
|
-
++ctr;
|
|
631
|
-
aResults.forEach((result)=>{
|
|
632
|
-
aFinalResponse.push({
|
|
633
|
-
operator: FilterOperator.EQ,
|
|
634
|
-
selectedValues: [{
|
|
635
|
-
value: result[key],
|
|
636
|
-
description: AnnotationHelper.getTextArrangementFinalString(result,key,
|
|
637
|
-
sTextArrangementPath,sTextArrangement)
|
|
638
|
-
}]
|
|
639
|
-
});
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
if (ctr === filtersLength) {
|
|
644
|
-
resolve(aFinalResponse);
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
|
|
648
|
-
oVHPromise.then((oValueList)=>{
|
|
649
|
-
var oValueListDefaultBinding = oValueList[""];
|
|
650
|
-
var sValueListEntity = oValueListDefaultBinding.CollectionPath.String;
|
|
651
|
-
if (Array.isArray(oValueListDefaultBinding.Parameters)) {
|
|
652
|
-
var oParameter = oValueListDefaultBinding.Parameters.find(oParam => (oParam.RecordType === "com.sap.vocabularies.Common.v1.ValueListParameterInOut" && oParam.LocalDataProperty.PropertyPath === sKey));
|
|
653
|
-
if (oParameter) {
|
|
654
|
-
key = oParameter.ValueListProperty.String;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
//Get All Records using $search
|
|
658
|
-
aFilters.forEach((oFilter)=>{
|
|
659
|
-
oSFBModel.read("/" + sValueListEntity, {
|
|
660
|
-
urlParameters : {
|
|
661
|
-
search: oFilter.getValue1()
|
|
662
|
-
},
|
|
663
|
-
success : function(response) {
|
|
664
|
-
fnSuccessForValueList(response,oFilter,sValueListEntity);
|
|
665
|
-
}
|
|
666
|
-
});
|
|
667
|
-
});
|
|
668
|
-
});
|
|
669
|
-
|
|
670
|
-
} else {
|
|
671
|
-
//When there is no valueList associate, just return the original value in CodeList type
|
|
672
|
-
aFilters.forEach((oFilter)=>aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter)));
|
|
673
|
-
resolve(aFinalResponse);
|
|
674
|
-
}
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
function getkeySpecifiedResultFromFilters(oFilter) {
|
|
679
|
-
var values = [];
|
|
680
|
-
if (oFilter.getOperator() === FilterOperator.BT || oFilter.getOperator() === FilterOperator.NB) {
|
|
681
|
-
var values = [{
|
|
682
|
-
value: oFilter.getValue1(),
|
|
683
|
-
description: oFilter.getValue1()
|
|
684
|
-
},{
|
|
685
|
-
value: oFilter.getValue2(),
|
|
686
|
-
description: oFilter.getValue2()
|
|
687
|
-
}];
|
|
688
|
-
} else {
|
|
689
|
-
values.push({
|
|
690
|
-
value: oFilter.getValue1(),
|
|
691
|
-
description: oFilter.getValue1()
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
return {
|
|
695
|
-
operator: oFilter.getOperator(),
|
|
696
|
-
selectedValues: values
|
|
697
|
-
};
|
|
544
|
+
return EasyFilterDataFetcherHelper.fetchDataForKey(key, keySpecificSelectedResult, oState, oController, oTemplateUtils);
|
|
698
545
|
}
|
|
699
546
|
|
|
700
|
-
|
|
701
547
|
return {
|
|
702
548
|
getEasyFilterBar : fnGetEasyFilterBar,
|
|
703
549
|
initialiseEasyFilterBar : fnInitialiseEasyFilterBar,
|
|
@@ -711,8 +557,7 @@ sap.ui.define([
|
|
|
711
557
|
onShowValueHelp: fnShowValueHelp,
|
|
712
558
|
onFilterChange : fnOnFilterChange,
|
|
713
559
|
handleVariantLoad : fnHandleVariantLoad,
|
|
714
|
-
onDataFetcher
|
|
715
|
-
getkeySpecifiedResultFromFilters
|
|
560
|
+
onDataFetcher
|
|
716
561
|
};
|
|
717
562
|
}
|
|
718
563
|
|
|
@@ -721,5 +566,5 @@ sap.ui.define([
|
|
|
721
566
|
extend(this, getMethods(oState, oController, oTemplateUtils));
|
|
722
567
|
}
|
|
723
568
|
});
|
|
724
|
-
|
|
569
|
+
|
|
725
570
|
});
|