@sapui5/sap.suite.ui.generic.template 1.114.11 → 1.114.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.114.11",
3
+ "version": "1.114.12",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "keywords": [
6
6
  "sapui5",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.114.11</version>
10
+ <version>1.114.12</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.114.11"
11
+ "version": "1.114.12"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.114.11"
11
+ "version": "1.114.12"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -62,8 +62,8 @@ sap.ui.define(["sap/ui/core/mvc/OverrideExecution",
62
62
  adaptToChildContext: function(sCurrentChildContext) {
63
63
  oViewProxy.adaptToChildContext(sCurrentChildContext);
64
64
  },
65
- refreshBinding: function(bUnconditional, mRefreshInfos) {
66
- oViewProxy.refreshBinding(bUnconditional, mRefreshInfos);
65
+ refreshBinding: function(bUnconditional, mRefreshInfos,bWithoutAssociationsRefresh,fnRefreshCallback) {
66
+ oViewProxy.refreshBinding(bUnconditional, mRefreshInfos,fnRefreshCallback);
67
67
  },
68
68
  getItems: function(){
69
69
  return oViewProxy.getItems();
@@ -527,14 +527,14 @@ sap.ui.define([
527
527
  });
528
528
  };
529
529
 
530
- oViewProxy.refreshBinding = function (bUnconditional, mEntitySets) {
530
+ oViewProxy.refreshBinding = function (bUnconditional, mEntitySets,fnRefreshCallback) {
531
531
  if (oState.oIappStateHandler.areDataShownInTable()) { // only if data are currently shown a refresh needs to be triggered
532
532
  if (oState.oMultipleViewsHandler.refreshOperation(2, null, !bUnconditional && mEntitySets)) {
533
533
  return; // multiple views handler has done the job
534
534
  }
535
535
  if (bUnconditional || mEntitySets[oController.getOwnerComponent().getEntitySet()]) {
536
536
  oTemplateUtils.oCommonUtils.refreshModel(oController.getOwnerComponent().getEntitySet());
537
- oState.oPresentationControlHandler.refresh();
537
+ oState.oPresentationControlHandler.refresh(undefined,undefined,fnRefreshCallback);
538
538
  }
539
539
  }
540
540
  };
@@ -597,6 +597,18 @@ sap.ui.define([
597
597
  return deepEqual(aFirstComparate.map(JSON.stringify).sort(), aSecondComparate.map(JSON.stringify).sort());
598
598
  }
599
599
 
600
+ //Startup semantic date will be priortised in case of collision
601
+ function fnMergeSemanticDates(aSFBSemanticDate, aStartupSemanticDate){
602
+ var oSemanticDateMap = {};
603
+ aSFBSemanticDate.forEach(function(oVal) {
604
+ oSemanticDateMap[oVal.PropertyName] = oVal;
605
+ });
606
+ aStartupSemanticDate.forEach(function(oVal) {
607
+ oSemanticDateMap[oVal.PropertyName] = oVal;
608
+ });
609
+ return Object.values(oSemanticDateMap);
610
+ }
611
+
600
612
  function fnAdaptToAppStateStartUpWithParameters(oAppData, oURLParameters, sPreferredQuickVariantSelectionKey){
601
613
  handleVariantIdPassedViaURLParams(oURLParameters);
602
614
 
@@ -611,7 +623,7 @@ sap.ui.define([
611
623
  // In case semantic date field is present, parseNavigation returns semanticDates in stringified format and otherwise an empty object.
612
624
  // Moreover, if there is no semanticDates retrieved from NavigationHandler, then the existing values of semantic
613
625
  // dates properties considered by smartfilterbar (from annotation, change handler etc) should be taken into consideration.
614
- semanticDates: (typeof oAppData.semanticDates === "string" ? JSON.parse(oAppData.semanticDates) : oAppData.semanticDates) || oSFBSemanticDates || {}
626
+ semanticDates: (typeof oAppData.semanticDates === "string" ? JSON.parse(oAppData.semanticDates) : oAppData.semanticDates) || {}
615
627
  };
616
628
  //Apply sort order coming from the XAppState to the smart table.
617
629
  if (oAppData.presentationVariant !== undefined) {
@@ -637,9 +649,26 @@ sap.ui.define([
637
649
  oController.modifyStartupExtension(oStartupObject);
638
650
 
639
651
  oStartupObject.semanticDates = semanticDateRangeTypeHelper.addSemanticDateRangeDefaultValue(oSettings, oState.oSmartFilterbar, oStartupObject.semanticDates, oStartupObject.urlParameters, oStartupObject.selectionVariant);
652
+ var bSemanticDateEqual = deepEqual(oStartupObject.semanticDates, oSFBSemanticDates);
653
+ //Now we can merge the dates based on properties
654
+ if (oSFBSemanticDates && oSFBSemanticDates.Dates) {
655
+ oStartupObject.semanticDates.Dates = fnMergeSemanticDates(oSFBSemanticDates.Dates, oStartupObject.semanticDates.Dates);
656
+ }
640
657
  // Smart filter bar all the filters will be replaced by the one which are coming from oUiState build base of oSelectionVariant where the Semantic Date Default Values
641
658
  // is missing and because of that the values are replaced. Hence adding the semantic Dates to oSelectionVariant as mentioned by the Smart Control Colleague in the mentioned BCP
642
- oStartupObject.semanticDates.Dates.forEach(function(oSelectDateOption){
659
+ oStartupObject.semanticDates.Dates.forEach(function(oSelectDateOption) {
660
+ var oSelectionDateOption = oStartupObject.selectionVariant.getSelectOption(oSelectDateOption.PropertyName);
661
+ var oSFBSelectionOption = oSFBSelectionVariant.getSelectOption(oSelectDateOption.PropertyName);
662
+ //If startup object contains date range with the oSelectionDateOption PropertyName no need to override
663
+ if (oSelectionDateOption && oSelectionDateOption.length != 0) {
664
+ return;
665
+ }
666
+ //If SmartFilterBar has the property for that in that case add it to selectOption
667
+ if (oSFBSelectionOption && oSFBSelectionOption.length != 0) {
668
+ oStartupObject.selectionVariant.massAddSelectOption(oSelectDateOption.PropertyName,oSFBSelectionOption);
669
+ return;
670
+ }
671
+ //If none has in that case we will add the selectOption with empty value
643
672
  oStartupObject.selectionVariant.addSelectOption(oSelectDateOption.PropertyName, "I", "EQ", "");
644
673
  });
645
674
 
@@ -660,14 +689,15 @@ sap.ui.define([
660
689
  var fnParameterExists = function (oParameter) {
661
690
  return aParameterNames.includes(oParameter.PropertyName);
662
691
  };
663
-
692
+ //Get variant merged will prioritize oStartupObject.selection variant
664
693
  var oTargetSelectionVariant = listUtils.getMergedVariants([oSFBSelectionVariant, oStartupObject.selectionVariant]);
665
694
  var aTargetSelectionVariantJSON = oTargetSelectionVariant.toJSONObject();
666
695
 
667
696
  var oSFBSelectionVariantJSON = oSFBSelectionVariant.toJSONObject();
668
697
  if (
669
698
  !fnArrayContainsSameEnteries(oSFBSelectionVariantJSON.SelectOptions.filter(fnFilterItemExists), aTargetSelectionVariantJSON.SelectOptions.filter(fnFilterItemExists)) ||
670
- !fnArrayContainsSameEnteries(oSFBSelectionVariantJSON.Parameters.filter(fnParameterExists), aTargetSelectionVariantJSON.Parameters.filter(fnParameterExists))
699
+ !fnArrayContainsSameEnteries(oSFBSelectionVariantJSON.Parameters.filter(fnParameterExists), aTargetSelectionVariantJSON.Parameters.filter(fnParameterExists)) ||
700
+ !bSemanticDateEqual
671
701
  ) {
672
702
  fnApplySelectionVariantToSFB(oTargetSelectionVariant, oAppData.selectionVariant, true, oStartupObject.semanticDates, false);
673
703
  oSmartVariantManagement.currentVariantSetModified(true);
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.114.11"
11
+ "version": "1.114.12"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.114.11"
9
+ "version": "1.114.12"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.114.11"
9
+ "version": "1.114.12"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.114.11"
9
+ "version": "1.114.12"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -854,7 +854,7 @@ sap.ui.define([
854
854
  * @extends sap.ui.core.UIComponent
855
855
  * @abstract
856
856
  * @author SAP SE
857
- * @version 1.114.11
857
+ * @version 1.114.12
858
858
  * @name sap.suite.ui.generic.template.lib.AppComponent
859
859
  */
860
860
  return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -2108,7 +2108,22 @@ sap.ui.define(["sap/ui/base/Object",
2108
2108
  */
2109
2109
  function CRUDManagerCallAction(mParams, oState, sEntitySet) {
2110
2110
  var oResponse;
2111
-
2111
+ /*
2112
+ After receiving the responses from the functionImport, we will refresh the table to retrieve the latest changes made in the backend.
2113
+ However, the UI table can only refresh a fixed number of rows. If the user has selected the "selectAll" button or has chosen rows beyond the refresh limit, those rows will not be fetched, but the selections will still be present on those rows.
2114
+ This can lead to a user experience issue. To resolve this problem, we are removing the selections for all the rows.
2115
+ */
2116
+ var oControl = mParams.sourceControl;
2117
+ var fnRefreshCallback = function() {
2118
+ if (oControl && oControl.isA("sap.ui.table.Table")) {
2119
+ var oSelectionPlugin = controlHelper.getSelectionPluginForUITable(oControl);
2120
+ if (oSelectionPlugin) {
2121
+ oSelectionPlugin.clearSelection();
2122
+ } else {
2123
+ oControl.clearSelection();
2124
+ }
2125
+ }
2126
+ };
2112
2127
  // only for oCustomData.Type === "com.sap.vocabularies.UI.v1.DataFieldForAction"
2113
2128
  // DataFieldForIntentBasedNavigation separated within ToolbarButton.fragment, uses other event handler
2114
2129
  // NO ITEM SELECTED: supported - if selection is required then button will be disabled via applicable-path otherwise the button will always be enabled
@@ -2120,7 +2135,7 @@ sap.ui.define(["sap/ui/base/Object",
2120
2135
  oServices.oCRUDManager.callAction({
2121
2136
  functionImportPath: mParams.functionImportPath,
2122
2137
  contexts: mParams.contexts,
2123
- sourceControlHandler: oServices.oPresentationControlHandlerFactory.getPresentationControlHandler(oCommonUtils.getOwnerPresentationControl(mParams.sourceControl)),
2138
+ sourceControlHandler: oServices.oPresentationControlHandlerFactory.getPresentationControlHandler(oCommonUtils.getOwnerPresentationControl(oControl)),
2124
2139
  label: mParams.label,
2125
2140
  operationGrouping: mParams.operationGrouping,
2126
2141
  skipProperties: mParams.skipProperties
@@ -2131,7 +2146,7 @@ sap.ui.define(["sap/ui/base/Object",
2131
2146
  if (oResponse.response && oResponse.context && (!oResponse.actionContext || oResponse.actionContext && oResponse.context.getPath() !== oResponse.actionContext.getPath())) {
2132
2147
  //Delaying the content call of the component that triggered the action as it is not needed immediately as we have already navigated to the other component.
2133
2148
  //We set the calling component to dirty which will trigger the refresh of the content once it is activated again.
2134
- oServices.oApplication.getBusyHelper().getUnbusy().then(oServices.oViewDependencyHelper.setMeToDirty.bind(null, oController.getOwnerComponent(), sEntitySet));
2149
+ oServices.oApplication.getBusyHelper().getUnbusy().then(oServices.oViewDependencyHelper.setMeToDirty.bind(null, oController.getOwnerComponent(), sEntitySet,fnRefreshCallback));
2135
2150
  break;
2136
2151
  }
2137
2152
  }
@@ -613,10 +613,10 @@ sap.ui.define(["sap/ui/base/Object",
613
613
  }
614
614
  }
615
615
 
616
- function fnRefreshBinding(bUnconditional) {
616
+ function fnRefreshBinding(bUnconditional,fnRefreshCallback) {
617
617
  bUnconditional = bUnconditional || oComponent.getIsRefreshRequired();
618
618
  if (bUnconditional || !isEmptyObject(oComponentRegistryEntry.mRefreshInfos) || oComponentRegistryEntry.bWithoutAssociationsRefresh) {
619
- (oComponentRegistryEntry.methods.refreshBinding || Function.prototype)(bUnconditional, oComponentRegistryEntry.mRefreshInfos, oComponentRegistryEntry.bWithoutAssociationsRefresh);
619
+ (oComponentRegistryEntry.methods.refreshBinding || Function.prototype)(bUnconditional, oComponentRegistryEntry.mRefreshInfos, oComponentRegistryEntry.bWithoutAssociationsRefresh,fnRefreshCallback);
620
620
  oComponent.setIsRefreshRequired(false);
621
621
  oComponentRegistryEntry.mRefreshInfos = Object.create(null);
622
622
  }
@@ -759,8 +759,9 @@ sap.ui.define(["sap/ui/base/Object", "sap/base/util/each", "sap/base/util/extend
759
759
  aKeysFromIdentity = oNewIdentity && oNewIdentity.keys;
760
760
  var oNewIdentityContext = oModel.getContext(sCanonicalPath2) || oModel.createBindingContext(sCanonicalPath2);
761
761
  var oNewIdentityContextInfo = oNewIdentityContext && fnCreateDraftInfo(oNewIdentityContext);
762
- // if both oContextData1 and oContextData2 are active object then they are not identical as their canonicalPath didn't match
763
- if (oNewIdentityContext && !oNewIdentityContextInfo.bIsDraft) {
762
+ // if both oContextData1 and oContextData2 are active object then they are not identical as their canonicalPath didn't match
763
+ // If oContextData2 is a create draft they cannot be detected to be identical via the siblings as well, since create drafts do not possess siblings. Therefore, we resolve to false as well.
764
+ if (oNewIdentityContext && (!oNewIdentityContextInfo.bIsDraft || oNewIdentityContextInfo.bIsCreate)) {
764
765
  fnResolve(false);
765
766
  } else { // check whether oContextData1 and sCanonicalPath2 context are siblings
766
767
  var oSiblingPromise = getDraftSiblingPromise(oContextData1.oContext);
@@ -41,19 +41,19 @@ sap.ui.define(["sap/ui/base/Object", "sap/suite/ui/generic/template/js/Annotatio
41
41
  * @param {Object} oComponent - the component that shall be set to dirty
42
42
  * @param {String} sEntitySet - only this navigation property is set to dirty
43
43
  */
44
- function setMeToDirty(oComponent, sEntitySet) {
44
+ function setMeToDirty(oComponent, sEntitySet,fnRefreshCallback) {
45
45
  if (sEntitySet) {
46
46
  var oRegistryEntry = oTemplateContract.componentRegistry[oComponent.getId()];
47
47
  var mRefreshInfos = oRegistryEntry.mRefreshInfos;
48
48
  mRefreshInfos[sEntitySet] = true;
49
49
  if (oRegistryEntry.utils.isComponentActive()){
50
- oRegistryEntry.utils.refreshBinding();
50
+ oRegistryEntry.utils.refreshBinding(undefined,fnRefreshCallback);
51
51
  }
52
52
  } else if (oComponent.setIsRefreshRequired){
53
53
  oComponent.setIsRefreshRequired(true);
54
54
  }
55
55
  }
56
-
56
+
57
57
  function addSuccessorComponents(oTreeNode, aSuccessorComponents){
58
58
  for (var i = 0; i < oTreeNode.children.length; i++){
59
59
  var oChildNode = oTemplateContract.mEntityTree[oTreeNode.children[i]];
@@ -2996,7 +2996,7 @@ sap.ui.define(["sap/ui/base/Object",
2996
2996
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
2997
2997
  * @public
2998
2998
  * @extends sap.ui.base.Object
2999
- * @version 1.114.11
2999
+ * @version 1.114.12
3000
3000
  * @since 1.30.0
3001
3001
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3002
3002
  */
@@ -129,13 +129,16 @@ sap.ui.define([
129
129
 
130
130
  /* @param {string} sBatchGroupId - Batch GroupId Id is used to merge the batch request
131
131
  @param {boolean} bNoMessageRefresh - can be used to surpress the refresh of the header messages in edit mode. Used in lazy loading.*/
132
- function fnRefresh(sBatchGroupId, bNoMessageRefresh) {
132
+ function fnRefresh(sBatchGroupId, bNoMessageRefresh,fnRefreshCallback) {
133
133
  var oBindingInfo = fnGetBindingInfo();
134
134
  if (oBindingInfo && oBindingInfo.binding) {
135
135
  return new Promise(function(fnResolve, fnReject){
136
136
  var fnDataReceived = function(oEvent){
137
137
  oBindingInfo.binding.detachDataReceived(fnDataReceived);
138
138
  fnHandleReceivedEvent(fnResolve, fnReject, oEvent);
139
+ if (typeof fnRefreshCallback === "function") {
140
+ (fnRefreshCallback || Function.prototype)();
141
+ }
139
142
  };
140
143
  oBindingInfo.binding.attachDataReceived(fnDataReceived);
141
144
  // Pass the BatchGroupId only if it is being supplied
@@ -38,7 +38,7 @@ sap.ui.define(['sap/ui/core/Core', 'sap/ui/core/library','sap/fe/placeholder/lib
38
38
  interfaces: [],
39
39
  controls: [],
40
40
  elements: [],
41
- version: "1.114.11",
41
+ version: "1.114.12",
42
42
  extensions: {
43
43
  //Configuration used for rule loading of Support Assistant
44
44
  "sap.ui.support": {