@sapui5/sap.suite.ui.generic.template 1.139.0 → 1.139.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +1 -0
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +2 -0
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/SectionTitleHandler.js +17 -13
- package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +285 -270
- 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 +2 -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 +81 -0
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +16 -2
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +44 -198
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterDataFetcherHelper.js +334 -0
- 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
|
@@ -4523,6 +4523,86 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
4523
4523
|
break;
|
|
4524
4524
|
}
|
|
4525
4525
|
return sPriority;
|
|
4526
|
+
},
|
|
4527
|
+
|
|
4528
|
+
getModelData: function(oInterface, sBaseAnnotationPath, sEntitySetName) {
|
|
4529
|
+
var oModel = oInterface.getModel() ? oInterface.getModel() : oInterface.getInterface(0).getModel(),
|
|
4530
|
+
oBaseEntityType = oModel.getODataEntityType(oModel.getODataEntitySet(sEntitySetName).entityType);
|
|
4531
|
+
|
|
4532
|
+
if (sBaseAnnotationPath.indexOf("/") > -1) {
|
|
4533
|
+
var oRelevantData = oAnnotationHelper.getRelevantDataForAnnotationRecord(oModel, sBaseAnnotationPath, oBaseEntityType);
|
|
4534
|
+
return {
|
|
4535
|
+
sAnnotationPath: oRelevantData.dataFieldValuePath[0] === '@' ? oRelevantData.dataFieldValuePath.substring(1) : oRelevantData.dataFieldValuePath,
|
|
4536
|
+
oEntityType: oRelevantData.entityType
|
|
4537
|
+
};
|
|
4538
|
+
}
|
|
4539
|
+
return {
|
|
4540
|
+
sAnnotationPath: sBaseAnnotationPath[0] === '@' ? sBaseAnnotationPath.substring(1) : sBaseAnnotationPath,
|
|
4541
|
+
oEntityType: oBaseEntityType
|
|
4542
|
+
};
|
|
4543
|
+
},
|
|
4544
|
+
|
|
4545
|
+
getSmartFormTitle: function(oInterface, oFacet, sEntitySetName, oBlock, oSubSectionData) {
|
|
4546
|
+
if (!oFacet) {
|
|
4547
|
+
return oAnnotationHelper.getTitleForSectionsForms(oBlock, oSubSectionData);
|
|
4548
|
+
}
|
|
4549
|
+
return oAnnotationHelper.getTitleForHeaderForm(oInterface, oFacet, sEntitySetName);
|
|
4550
|
+
},
|
|
4551
|
+
|
|
4552
|
+
getTitleForSectionsForms: function(oBlock, oSubSectionData) {
|
|
4553
|
+
if (oSubSectionData?.annotations?.Facet?.annotation?.Facets?.length > 1
|
|
4554
|
+
|| oSubSectionData?.annotations?.Facet?.annotation?.Label?.String !== oBlock?.aggregations?.groups[0]?.annotations?.Facet?.annotation?.Label?.String
|
|
4555
|
+
) {
|
|
4556
|
+
// In case Section -> SubSection have more than one form, SmartForm will have it's titles visible
|
|
4557
|
+
// or
|
|
4558
|
+
// SubSectin title !== SmartForm title, SmartForm title will also be visible
|
|
4559
|
+
return;
|
|
4560
|
+
}
|
|
4561
|
+
if (oBlock?.aggregations?.groups[0]?.annotations?.Facet?.annotation?.Label?.String !== oBlock?.aggregations?.groups[0]?.targetAnnotation?.Label?.String) {
|
|
4562
|
+
// Compare SmartForm title !== FiledGroup title
|
|
4563
|
+
// if they differs -> use FiledGoup title
|
|
4564
|
+
return oBlock?.aggregations?.groups[0]?.targetAnnotation?.Label?.String;
|
|
4565
|
+
}
|
|
4566
|
+
return;
|
|
4567
|
+
},
|
|
4568
|
+
|
|
4569
|
+
getTitleForHeaderForm: function(oInterface, oFacet, sEntitySetName) {
|
|
4570
|
+
if (oFacet.Target && oFacet.Target.AnnotationPath && oFacet.Target.AnnotationPath.indexOf("com.sap.vocabularies.UI.v1.DataPoint") > -1) {
|
|
4571
|
+
// Process DataPoint case
|
|
4572
|
+
var { sAnnotationPath, oEntityType } = oAnnotationHelper.getModelData(oInterface, oFacet.Target.AnnotationPath, sEntitySetName);
|
|
4573
|
+
if (oEntityType[sAnnotationPath] && oEntityType[sAnnotationPath].Title && oEntityType[sAnnotationPath].Title.String) {
|
|
4574
|
+
return oEntityType[sAnnotationPath].Title.String;
|
|
4575
|
+
}
|
|
4576
|
+
// As DataPoint don't have title -> try to get property name as SmartForm title
|
|
4577
|
+
if (!oEntityType[sAnnotationPath] || !oEntityType[sAnnotationPath].Value || !oEntityType[sAnnotationPath].Value.Path || !oEntityType.property) {
|
|
4578
|
+
return;
|
|
4579
|
+
}
|
|
4580
|
+
var aProperty = oEntityType.property.filter(function(entry) {
|
|
4581
|
+
return entry.name === oEntityType[sAnnotationPath].Value.Path;
|
|
4582
|
+
});
|
|
4583
|
+
if (aProperty.length && aProperty[0]['sap:label']) {
|
|
4584
|
+
// Property name found
|
|
4585
|
+
return aProperty[0]['sap:label'];
|
|
4586
|
+
}
|
|
4587
|
+
return;
|
|
4588
|
+
}
|
|
4589
|
+
// It's Identification or FieldGroup case
|
|
4590
|
+
if (oFacet.Label && oFacet.Label.String) {
|
|
4591
|
+
return oFacet.Label.String;
|
|
4592
|
+
}
|
|
4593
|
+
if (!oFacet.Target || !oFacet.Target.AnnotationPath) {
|
|
4594
|
+
return;
|
|
4595
|
+
}
|
|
4596
|
+
if (oFacet.Target.AnnotationPath.indexOf("com.sap.vocabularies.UI.v1.Identification") > -1) {
|
|
4597
|
+
// Identification entry don't have any data which we can use as SmartForm title.
|
|
4598
|
+
return;
|
|
4599
|
+
}
|
|
4600
|
+
var { sAnnotationPath, oEntityType } = oAnnotationHelper.getModelData(oInterface, oFacet.Target.AnnotationPath, sEntitySetName);
|
|
4601
|
+
if (oEntityType[sAnnotationPath] && oEntityType[sAnnotationPath].Label && oEntityType[sAnnotationPath].Label.String) {
|
|
4602
|
+
// Use FieldGroup.Label.String as SmartForm title
|
|
4603
|
+
return oEntityType[sAnnotationPath].Label.String;
|
|
4604
|
+
}
|
|
4605
|
+
return;
|
|
4526
4606
|
}
|
|
4527
4607
|
};
|
|
4528
4608
|
oAnnotationHelper.getBlockForEditableHeaderFacet.requiresIContext = true;
|
|
@@ -4593,6 +4673,7 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
4593
4673
|
oAnnotationHelper.getTextArrangementPath.requiresIContext = true;
|
|
4594
4674
|
oAnnotationHelper.isValueHelpTableAvailable.requiresIContext = true;
|
|
4595
4675
|
oAnnotationHelper.getTextArrangementFinalString.requiresIContext = true;
|
|
4676
|
+
oAnnotationHelper.getSmartFormTitle.requiresIContext = true;
|
|
4596
4677
|
|
|
4597
4678
|
return oAnnotationHelper;
|
|
4598
4679
|
}, /* bExport= */ true);
|
|
@@ -367,6 +367,20 @@ sap.ui.define([
|
|
|
367
367
|
oComponentData.feEnvironment.getShareControlVisibility();
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
+
// If the FE app is embedded within the Inbox app, the Inbox injects a dummy object named "feEnvironment"
|
|
371
|
+
// into the "componentData". In this case, we obtain the (mocked) shell service from "feEnvironment"
|
|
372
|
+
// instead of the standard ShellUIService.
|
|
373
|
+
// The mocked shell service exposes few methods like "setTitle" and "setHierarchy".
|
|
374
|
+
// They are invoked by NavigationController.
|
|
375
|
+
//
|
|
376
|
+
// Otherwise, we return the actual "ShellUIService" from the app component.
|
|
377
|
+
function fnGetShellUIServicePromise () {
|
|
378
|
+
var oComponentData = oAppComponent.getComponentData();
|
|
379
|
+
return oComponentData?.feEnvironment?.getShellService ?
|
|
380
|
+
Promise.resolve( oComponentData.feEnvironment.getShellService() ) :
|
|
381
|
+
oAppComponent.getService("ShellUIService");
|
|
382
|
+
}
|
|
383
|
+
|
|
370
384
|
function attachToApplicationController() {
|
|
371
385
|
oTemplateContract.fnAddSideEffectPromise = function(oPromise){
|
|
372
386
|
var i = 0;
|
|
@@ -426,7 +440,7 @@ sap.ui.define([
|
|
|
426
440
|
oViewDependencyHelper: new ViewDependencyHelper(oTemplateContract)
|
|
427
441
|
};
|
|
428
442
|
oTemplateContract.oViewDependencyHelper = oAppRegistryEntry.oViewDependencyHelper;
|
|
429
|
-
oTemplateContract.oShellServicePromise =
|
|
443
|
+
oTemplateContract.oShellServicePromise = fnGetShellUIServicePromise();
|
|
430
444
|
oTemplateContract.oShellServicePromise.catch(function(){
|
|
431
445
|
oLogger.warning("No ShellService available");
|
|
432
446
|
});
|
|
@@ -944,7 +958,7 @@ sap.ui.define([
|
|
|
944
958
|
* @public
|
|
945
959
|
* @extends sap.ui.core.UIComponent
|
|
946
960
|
* @author SAP SE
|
|
947
|
-
* @version 1.139.
|
|
961
|
+
* @version 1.139.2
|
|
948
962
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
949
963
|
*/
|
|
950
964
|
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
|
/*
|
|
@@ -315,24 +316,28 @@ sap.ui.define([
|
|
|
315
316
|
// keySpecificSelectedValues will have one selectedValues object for each operator
|
|
316
317
|
// ex : [{operator: "EQ", selectedValues: ["HT-1010","HT-10001","1097"]}, {operator: "Contains", selectedValues: ["HT-100"]}]
|
|
317
318
|
oFilterItem.keySpecificSelectedValues.forEach(function (oSelectedValues) {
|
|
318
|
-
var oRange = {
|
|
319
|
-
Sign: "I", // currently not considering "E"
|
|
320
|
-
High: ""
|
|
321
|
-
};
|
|
322
|
-
|
|
323
319
|
if ((oSelectedValues.operator === "BT" || oSelectedValues.operator === "NB")) {
|
|
320
|
+
var oRange = {
|
|
321
|
+
Sign: oSelectedValues.operator === "NB" ? "E" : "I",
|
|
322
|
+
High: ""
|
|
323
|
+
};
|
|
324
324
|
oRange.Low = oSelectedValues.selectedValues[0];
|
|
325
325
|
oRange.High = oSelectedValues.selectedValues[1];
|
|
326
|
-
oRange.Option =
|
|
326
|
+
oRange.Option = "BT";
|
|
327
327
|
oFilter.Ranges.push(oRange);
|
|
328
328
|
} else {
|
|
329
|
-
oSelectedValues.selectedValues.forEach(function (
|
|
330
|
-
|
|
329
|
+
oSelectedValues.selectedValues.forEach(function (sValue) {
|
|
330
|
+
var oRange = {
|
|
331
|
+
Sign: EasyFilterDataFetcherHelper.isNegationOperator(oSelectedValues.operator) ? "E" : "I",
|
|
332
|
+
High: ""
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
if (isCPOperator(oSelectedValues.operator)) {
|
|
331
336
|
oRange.Option = "CP";
|
|
332
|
-
oRange.Low =
|
|
337
|
+
oRange.Low = getValueForCPOperator(sValue,oSelectedValues.operator);
|
|
333
338
|
} else {
|
|
334
|
-
oRange.Option = oSelectedValues.operator;
|
|
335
|
-
oRange.Low =
|
|
339
|
+
oRange.Option = EasyFilterDataFetcherHelper.isNegationOperator(oSelectedValues.operator) ? EasyFilterDataFetcherHelper.getReverseOperator(oSelectedValues.operator) : oSelectedValues.operator;
|
|
340
|
+
oRange.Low = sValue;
|
|
336
341
|
}
|
|
337
342
|
oFilter.Ranges.push(oRange);
|
|
338
343
|
});
|
|
@@ -348,6 +353,29 @@ sap.ui.define([
|
|
|
348
353
|
};
|
|
349
354
|
}
|
|
350
355
|
|
|
356
|
+
function getValueForCPOperator(sValue,sOperator) {
|
|
357
|
+
sOperator = EasyFilterDataFetcherHelper.isNegationOperator(sOperator) ? EasyFilterDataFetcherHelper.getReverseOperator(sOperator) : sOperator;
|
|
358
|
+
switch (sOperator) {
|
|
359
|
+
case FilterOperator.Contains:
|
|
360
|
+
sValue = `*${sValue}*`;
|
|
361
|
+
break;
|
|
362
|
+
case FilterOperator.EndsWith:
|
|
363
|
+
sValue = `*${sValue}`;
|
|
364
|
+
break;
|
|
365
|
+
case FilterOperator.StartsWith:
|
|
366
|
+
sValue = `${sValue}*`;
|
|
367
|
+
break;
|
|
368
|
+
default:
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
return sValue;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function isCPOperator(sOperator) {
|
|
375
|
+
return sOperator === FilterOperator.Contains || sOperator === FilterOperator.EndsWith || sOperator === FilterOperator.NotContains || sOperator === FilterOperator.NotEndsWith
|
|
376
|
+
|| sOperator === FilterOperator.NotStartsWith || sOperator === FilterOperator.StartsWith;
|
|
377
|
+
}
|
|
378
|
+
|
|
351
379
|
/**
|
|
352
380
|
* This method is used to get the EasyFilter control from the floorplan
|
|
353
381
|
* @returns EasyFilter control
|
|
@@ -506,191 +534,10 @@ sap.ui.define([
|
|
|
506
534
|
}
|
|
507
535
|
}
|
|
508
536
|
|
|
509
|
-
function getFiltersForDataFetching(key,keySpecificSelectedResult) {
|
|
510
|
-
const aFilters = [];
|
|
511
|
-
|
|
512
|
-
for (var i = 0; i < keySpecificSelectedResult.length;++i) {
|
|
513
|
-
const result = keySpecificSelectedResult[i];
|
|
514
|
-
if (result.operator === FilterOperator.BT || result.operator === FilterOperator.NB) {
|
|
515
|
-
aFilters.push(new Filter({
|
|
516
|
-
path: key,
|
|
517
|
-
operator: result.operator,
|
|
518
|
-
value1: result.selectedValues[0],
|
|
519
|
-
value2: result.selectedValues[1]
|
|
520
|
-
}));
|
|
521
|
-
} else {
|
|
522
|
-
for (var j = 0; j < result.selectedValues.length; ++j) {
|
|
523
|
-
aFilters.push(new Filter({
|
|
524
|
-
path: key,
|
|
525
|
-
operator: result.operator,
|
|
526
|
-
value1: result.selectedValues[j]
|
|
527
|
-
}));
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
return aFilters;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
537
|
function onDataFetcher(key,keySpecificSelectedResult,totalAIResponse) {
|
|
535
|
-
return
|
|
536
|
-
|
|
537
|
-
var aFinalResponse = [];
|
|
538
|
-
var oOwnerFilterControl = oState.oSmartFilterbar;
|
|
539
|
-
var sKey = key;
|
|
540
|
-
var sEntitySet = oController.getOwnerComponent().getEntitySet();
|
|
541
|
-
var oEntityType = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sEntitySet);
|
|
542
|
-
var oSFBModel = oOwnerFilterControl.getModel();
|
|
543
|
-
var oSFBMetaModel = oSFBModel.getMetaModel();
|
|
544
|
-
var aFilters = getFiltersForDataFetching(key,keySpecificSelectedResult);
|
|
545
|
-
var oProperty = oSFBMetaModel.getODataProperty(oEntityType, key);
|
|
546
|
-
var sPropertyPath = oSFBMetaModel.getODataProperty(oEntityType, key,true);
|
|
547
|
-
var isValueHelpTableAvailable = AnnotationHelper.isValueHelpTableAvailable(oProperty);
|
|
548
|
-
|
|
549
|
-
if (isValueHelpTableAvailable) {
|
|
550
|
-
var oPropertyContext = oSFBMetaModel.createBindingContext(sPropertyPath);
|
|
551
|
-
var oVHPromise = oSFBMetaModel.getODataValueLists(oPropertyContext);
|
|
552
|
-
var filtersLength = aFilters.length;
|
|
553
|
-
// //Every Search on a value, create a seperate call to backend,but they are grouped into one batch
|
|
554
|
-
// //We need to ensure that once all calls are completed inside the batch to resolve the promise, else the system would be waiting indefenitely
|
|
555
|
-
var ctr = 0;
|
|
556
|
-
let fnForDescription = (oResponse,aMatchedFilterResults,sTextArrangementPath,sTextArrangement) => {
|
|
557
|
-
++ctr;
|
|
558
|
-
var aResults = oResponse.results;
|
|
559
|
-
|
|
560
|
-
//Check the description is present and follow the textArrangement annotation as well
|
|
561
|
-
//If the value is not present ,make the ID and Description same
|
|
562
|
-
aMatchedFilterResults.forEach((oFilter)=>{
|
|
563
|
-
var result = aResults.find((res)=>res[key] === oFilter.getValue1());
|
|
564
|
-
if (result) {
|
|
565
|
-
aFinalResponse.push({
|
|
566
|
-
operator: FilterOperator.EQ,
|
|
567
|
-
selectedValues: [{
|
|
568
|
-
value: result[key],
|
|
569
|
-
description: AnnotationHelper.getTextArrangementFinalString(result,key,sTextArrangementPath.split("/")[1],sTextArrangement)
|
|
570
|
-
}]
|
|
571
|
-
});
|
|
572
|
-
} else {
|
|
573
|
-
//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
|
|
574
|
-
aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter));
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
|
|
578
|
-
if (ctr === filtersLength) {
|
|
579
|
-
resolve(aFinalResponse);
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
let fnSuccessForValueList = (oResponse,oFilter,sValueListEntity) => {
|
|
586
|
-
var oValueHelpEntity = oTemplateUtils.oCommonUtils.getMetaModelEntityType(sValueListEntity);
|
|
587
|
-
var oValueHelpProperty = oSFBMetaModel.getODataProperty(oValueHelpEntity, key);
|
|
588
|
-
var aResults = oResponse.results;
|
|
589
|
-
var sTextArrangementPath = AnnotationHelper.getTextArrangementPath(oValueHelpProperty);
|
|
590
|
-
var sTextArrangement = AnnotationHelper.getTextArrangementForEasyFilter(oValueHelpEntity,oValueHelpProperty);
|
|
591
|
-
var navigationProperty = null;
|
|
592
|
-
var sEntityForTextDescription = null;
|
|
593
|
-
|
|
594
|
-
if (sTextArrangementPath && sTextArrangementPath.split("/").length > 1) {
|
|
595
|
-
navigationProperty = sTextArrangementPath.split("/")[0];
|
|
596
|
-
sEntityForTextDescription = oSFBMetaModel.getODataAssociationSetEnd(oValueHelpEntity,navigationProperty).entitySet;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
//We are triggering the below call, only for fetching of the TextDescription.If its a different entity than ValueList only then trigger it
|
|
600
|
-
if (aResults.length === 0) {
|
|
601
|
-
++ctr;
|
|
602
|
-
aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter));
|
|
603
|
-
} else if (aResults.length !== 0 && sEntityForTextDescription && sValueListEntity !== sEntityForTextDescription) {
|
|
604
|
-
var aAllMatchedResults = aResults.map((result)=>{
|
|
605
|
-
return result[key];
|
|
606
|
-
});
|
|
607
|
-
var aMatchedFilterResults = aAllMatchedResults.map((matchedResult)=>{
|
|
608
|
-
return new Filter({
|
|
609
|
-
path: key,
|
|
610
|
-
operator: FilterOperator.EQ,
|
|
611
|
-
value1:matchedResult
|
|
612
|
-
});
|
|
613
|
-
});
|
|
614
|
-
// The below code only be executed when the textDescription and ValueList entities are different
|
|
615
|
-
oSFBModel.read("/" + sEntityForTextDescription, {
|
|
616
|
-
filters: aMatchedFilterResults,
|
|
617
|
-
success : function(response) {
|
|
618
|
-
fnForDescription(response,aMatchedFilterResults);
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
} else {
|
|
622
|
-
//The below condition is when valueList entity and navigation property entity are same
|
|
623
|
-
++ctr;
|
|
624
|
-
aResults.forEach((result)=>{
|
|
625
|
-
aFinalResponse.push({
|
|
626
|
-
operator: FilterOperator.EQ,
|
|
627
|
-
selectedValues: [{
|
|
628
|
-
value: result[key],
|
|
629
|
-
description: AnnotationHelper.getTextArrangementFinalString(result,key,
|
|
630
|
-
sTextArrangementPath,sTextArrangement)
|
|
631
|
-
}]
|
|
632
|
-
});
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
if (ctr === filtersLength) {
|
|
637
|
-
resolve(aFinalResponse);
|
|
638
|
-
}
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
oVHPromise.then((oValueList)=>{
|
|
642
|
-
var oValueListDefaultBinding = oValueList[""];
|
|
643
|
-
var sValueListEntity = oValueListDefaultBinding.CollectionPath.String;
|
|
644
|
-
if (Array.isArray(oValueListDefaultBinding.Parameters)) {
|
|
645
|
-
var oParameter = oValueListDefaultBinding.Parameters.find(oParam => (oParam.RecordType === "com.sap.vocabularies.Common.v1.ValueListParameterInOut" && oParam.LocalDataProperty.PropertyPath === sKey));
|
|
646
|
-
if (oParameter) {
|
|
647
|
-
key = oParameter.ValueListProperty.String;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
//Get All Records using $search
|
|
651
|
-
aFilters.forEach((oFilter)=>{
|
|
652
|
-
oSFBModel.read("/" + sValueListEntity, {
|
|
653
|
-
urlParameters : {
|
|
654
|
-
search: oFilter.getValue1()
|
|
655
|
-
},
|
|
656
|
-
success : function(response) {
|
|
657
|
-
fnSuccessForValueList(response,oFilter,sValueListEntity);
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
});
|
|
662
|
-
|
|
663
|
-
} else {
|
|
664
|
-
//When there is no valueList associate, just return the original value in CodeList type
|
|
665
|
-
aFilters.forEach((oFilter)=>aFinalResponse.push(getkeySpecifiedResultFromFilters(oFilter)));
|
|
666
|
-
resolve(aFinalResponse);
|
|
667
|
-
}
|
|
668
|
-
});
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
function getkeySpecifiedResultFromFilters(oFilter) {
|
|
672
|
-
var values = [];
|
|
673
|
-
if (oFilter.getOperator() === FilterOperator.BT || oFilter.getOperator() === FilterOperator.NB) {
|
|
674
|
-
var values = [{
|
|
675
|
-
value: oFilter.getValue1(),
|
|
676
|
-
description: oFilter.getValue1()
|
|
677
|
-
},{
|
|
678
|
-
value: oFilter.getValue2(),
|
|
679
|
-
description: oFilter.getValue2()
|
|
680
|
-
}];
|
|
681
|
-
} else {
|
|
682
|
-
values.push({
|
|
683
|
-
value: oFilter.getValue1(),
|
|
684
|
-
description: oFilter.getValue1()
|
|
685
|
-
});
|
|
686
|
-
}
|
|
687
|
-
return {
|
|
688
|
-
operator: oFilter.getOperator(),
|
|
689
|
-
selectedValues: values
|
|
690
|
-
};
|
|
538
|
+
return EasyFilterDataFetcherHelper.fetchDataForKey(key, keySpecificSelectedResult, oState, oController, oTemplateUtils);
|
|
691
539
|
}
|
|
692
540
|
|
|
693
|
-
|
|
694
541
|
return {
|
|
695
542
|
getEasyFilterBar : fnGetEasyFilterBar,
|
|
696
543
|
initialiseEasyFilterBar : fnInitialiseEasyFilterBar,
|
|
@@ -704,8 +551,7 @@ sap.ui.define([
|
|
|
704
551
|
onShowValueHelp: fnShowValueHelp,
|
|
705
552
|
onFilterChange : fnOnFilterChange,
|
|
706
553
|
handleVariantLoad : fnHandleVariantLoad,
|
|
707
|
-
onDataFetcher
|
|
708
|
-
getkeySpecifiedResultFromFilters
|
|
554
|
+
onDataFetcher
|
|
709
555
|
};
|
|
710
556
|
}
|
|
711
557
|
|
|
@@ -714,5 +560,5 @@ sap.ui.define([
|
|
|
714
560
|
extend(this, getMethods(oState, oController, oTemplateUtils));
|
|
715
561
|
}
|
|
716
562
|
});
|
|
717
|
-
|
|
563
|
+
|
|
718
564
|
});
|