@sapui5/sap.suite.ui.generic.template 1.140.0 → 1.141.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.
Files changed (30) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +1 -1
  3. package/src/sap/suite/ui/generic/template/AnalyticalListPage/extensionAPI/ExtensionAPI.js +4 -1
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  5. package/src/sap/suite/ui/generic/template/Canvas/extensionAPI/ExtensionAPI.js +4 -1
  6. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  7. package/src/sap/suite/ui/generic/template/ListReport/extensionAPI/ExtensionAPI.js +4 -1
  8. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  9. package/src/sap/suite/ui/generic/template/ObjectPage/annotationHelpers/AnnotationHelperActionButtons.js +24 -4
  10. package/src/sap/suite/ui/generic/template/ObjectPage/annotationHelpers/AnnotationHelperActionButtons.qunit.js +27 -0
  11. package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +2 -0
  12. package/src/sap/suite/ui/generic/template/ObjectPage/controller/SectionTitleHandler.js +1 -1
  13. package/src/sap/suite/ui/generic/template/ObjectPage/controllerFrameworkExtensions.js +285 -270
  14. package/src/sap/suite/ui/generic/template/ObjectPage/extensionAPI/ExtensionAPI.js +4 -1
  15. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  16. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/CRUDActionButtons.fragment.xml +31 -24
  17. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartForm.fragment.xml +1 -1
  18. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  19. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  20. package/src/sap/suite/ui/generic/template/fragments/ToolbarButton.fragment.xml +1 -0
  21. package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +60 -1
  22. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
  23. package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +97 -14
  24. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +4 -2
  25. package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +21 -12
  26. package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +5 -5
  27. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  28. package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartTableHandler.js +1 -1
  29. package/src/sap/suite/ui/generic/template/library.js +1 -1
  30. package/src/sap/suite/ui/generic/template/listTemplates/controller/SmartChartController.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.140.0",
3
+ "version": "1.141.1",
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.140.0</version>
10
+ <version>1.141.1</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -145,8 +145,11 @@ sap.ui.define(["sap/ui/base/Object",
145
145
  * @param {map} [mUrlParameters] The URL parameters (name-value pairs) for the function or action. Only needed in special cases.
146
146
  * @param {object} [oSettings] Additional settings
147
147
  * @param {boolean} [oSettings.bInvocationGroupingChangeSet=false] Determines whether the common or unique changeset gets sent in batch
148
+ * @param {string} [oSettings.sLabel=""] Optional label for the Function Import.
149
+ * * This label is only used when action is invoked in strict mode and HTTP 412 (Precondition Failed) handling is required.
150
+ * * If not provided, the Function Import name is used as the default label.
151
+ * @param {boolean} [oSettings.bStrict=false] Optional flag to indicate whether the action should be invoked in strict mode. Defaults to <code>false</code>.
148
152
  * @returns {Promise} A <code>Promise</code> for asynchronous execution of the action, resolving to the same result as the <code>Promise</code>
149
- * returned from {@link sap.ui.generic.app.ApplicationController#invokeActions}
150
153
  * @throws {Error} Throws an error if the OData function import does not exist or the action input parameters are invalid
151
154
  * @public
152
155
  */
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.140.0"
11
+ "version": "1.141.1"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -40,8 +40,11 @@ sap.ui.define(
40
40
  * @param {map} [mUrlParameters] The URL parameters (name-value pairs) for the function or action. Only needed in special cases.
41
41
  * @param {object} [oSettings] Additional settings
42
42
  * @param {boolean} [oSettings.bInvocationGroupingChangeSet=false] Determines whether the common or unique changeset gets sent in batch
43
+ * @param {string} [oSettings.sLabel=""] Optional label for the Function Import.
44
+ * * This label is only used when action is invoked in strict mode and HTTP 412 (Precondition Failed) handling is required.
45
+ * * If not provided, the Function Import name is used as the default label.
46
+ * @param {boolean} [oSettings.bStrict=false] Optional flag to indicate whether the action should be invoked in strict mode. Defaults to <code>false</code>.
43
47
  * @returns {Promise} A <code>Promise</code> for asynchronous execution of the action, resolving to the same result as the <code>Promise</code>
44
- * returned from {@link sap.ui.generic.app.ApplicationController#invokeActions}
45
48
  * @throws {Error} Throws an error if the OData function import does not exist or the action input parameters are invalid
46
49
  * @public
47
50
  */
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.140.0"
11
+ "version": "1.141.1"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -95,8 +95,11 @@ sap.ui.define(["sap/ui/base/Object",
95
95
  * @param {map} [mUrlParameters] The URL parameters (name-value pairs) for the function or action. Only needed in special cases.
96
96
  * @param {object} [oSettings] Additional settings
97
97
  * @param {boolean} [oSettings.bInvocationGroupingChangeSet=false] Determines whether the common or unique changeset gets sent in batch
98
+ * @param {string} [oSettings.sLabel=""] Optional label for the Function Import.
99
+ * * This label is only used when action is invoked in strict mode and HTTP 412 (Precondition Failed) handling is required.
100
+ * * If not provided, the Function Import name is used as the default label.
101
+ * @param {boolean} [oSettings.bStrict=false] Optional flag to indicate whether the action should be invoked in strict mode. Defaults to <code>false</code>.
98
102
  * @returns {Promise} A <code>Promise</code> for asynchronous execution of the action, resolving to the same result as the <code>Promise</code>
99
- * returned from {@link sap.ui.generic.app.ApplicationController#invokeActions}
100
103
  * @throws {Error} Throws an error if the OData function import does not exist or the action input parameters are invalid
101
104
  * @public
102
105
  */
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.140.0"
11
+ "version": "1.141.1"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -105,9 +105,8 @@ sap.ui.define([
105
105
  isEditButtonRequired.requiresIContext = true;
106
106
 
107
107
  // Returns the visibility for the EDIT button on the object page
108
- function getEditActionButtonVisibility(oInterface, mRestrictions, oEntitySet, oAppComponent, oTreeNode, aAncestortreeNodes) {
109
- var sGeneralExpression = "!${ui>/editable}"; // logical condition for the edit button
110
-
108
+ function getEditActionButtonVisibility(oInterface, mRestrictions, oEntitySet, oAppComponent, oTreeNode, aAncestortreeNodes,sEasyFillButton) {
109
+ var sGeneralExpression = (sEasyFillButton === "true") ? "{_templPrivGlobal>/generic/fioriAI/isEasyFillEnabled}" : "!${ui>/editable}"; // logical condition for the edit button
111
110
  //oTreeNode.isDraft is use to show "Hide Draft Values" or "Show Draft Values" button in List Report table toolbar and "Display Saved version/Return to Draft" button in Object page header for a draft application.
112
111
  var sToggleExpression = "";
113
112
  if (oTreeNode.isDraft && oTreeNode.level === 1){ // Exclude the situation that there is already a draft for this user (in this case the CONTINUE_EDITING-button would be shown).
@@ -160,6 +159,27 @@ sap.ui.define([
160
159
 
161
160
  // Returns the visibility for the DELETE button on main object page
162
161
  function getDeleteActionButtonVisibility(oInterface, mRestrictions, oEntitySet, oAppComponent, oTreeNode){
162
+ var sNavigationPath = "";
163
+ if (oTreeNode.level > 1) {
164
+ var oModel = oInterface.getInterface(0).getModel();
165
+ var oParentEntitySet = oModel.getODataEntitySet(oTreeNode.parent);
166
+ var oNavigationRestrictions = oParentEntitySet["Org.OData.Capabilities.V1.NavigationRestrictions"];
167
+ if (oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties) {
168
+ var aRestrictedProperties = oNavigationRestrictions.RestrictedProperties;
169
+ for (var i in aRestrictedProperties) {
170
+ var oNavigationProperty = aRestrictedProperties[i];
171
+ var sNavigationPropertyPath = oNavigationProperty.NavigationProperty.NavigationPropertyPath;
172
+ if (sNavigationPropertyPath === oTreeNode.navigationProperty) {
173
+ if (oNavigationProperty?.DeleteRestrictions?.Deletable?.Bool === "false") {
174
+ return false;
175
+ }
176
+ if (oNavigationProperty?.DeleteRestrictions?.Deletable?.Path) {
177
+ sNavigationPath = "${" + oNavigationProperty?.DeleteRestrictions?.Deletable?.Path + "}";
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
163
183
  var sGeneralExpression; // logical condition for the delete button
164
184
  if (oTreeNode.isDraft){ // on main object page the delete button is shown in display mode on subobject pages in edit mode
165
185
  sGeneralExpression = oTreeNode.level === 1 ? "!${ui>/editable}" : "{ui>/editable}";
@@ -168,7 +188,7 @@ sap.ui.define([
168
188
  }
169
189
  var sFCLExpression = getFCLPathExpression(oAppComponent, oTreeNode, "Delete");
170
190
  var sPathExpression = getPathExpression(oInterface, oEntitySet, mRestrictions, "Deletable"); // if there is a deletable path, add it to the condition
171
- return fnCombineByAnd(sGeneralExpression, sFCLExpression, sPathExpression);
191
+ return fnCombineByAnd(sGeneralExpression, sFCLExpression, sPathExpression, sNavigationPath);
172
192
  }
173
193
  getDeleteActionButtonVisibility.requiresIContext = true;
174
194
 
@@ -0,0 +1,27 @@
1
+ /* QUnit tests for getDeleteActionButtonVisibility */
2
+
3
+ sap.ui.define([
4
+ "sap/suite/ui/generic/template/ObjectPage/annotationHelpers/AnnotationHelperActionButtons"
5
+ ], function(AnnotationHelperActionButtons) {
6
+ "use strict";
7
+
8
+ QUnit.module("getDeleteActionButtonVisibility");
9
+
10
+ QUnit.test("should return true when delete action is visible", function(assert) {
11
+ var oContext = {/* mock context for visible case */};
12
+ var result = AnnotationHelperActionButtons.getDeleteActionButtonVisibility(oContext);
13
+ assert.strictEqual(result, true, "Delete button should be visible");
14
+ });
15
+
16
+ QUnit.test("should return false when delete action is not visible", function(assert) {
17
+ var oContext = {/* mock context for not visible case */};
18
+ var result = AnnotationHelperActionButtons.getDeleteActionButtonVisibility(oContext);
19
+ assert.strictEqual(result, false, "Delete button should not be visible");
20
+ });
21
+
22
+ QUnit.test("should handle edge cases gracefully", function(assert) {
23
+ var oContext = null;
24
+ var result = AnnotationHelperActionButtons.getDeleteActionButtonVisibility(oContext);
25
+ assert.strictEqual(result, false, "Delete button should not be visible for null context");
26
+ });
27
+ });
@@ -100,6 +100,8 @@ sap.ui.define([
100
100
  //Get all semantic object from manifest setting
101
101
  var oSettings = oTemplateUtils.oComponentUtils.getSettings();
102
102
  var oRelatedAppsSettings = oSettings.relatedAppsSettings;
103
+ // Extension to modify the related app settings.
104
+ oRelatedAppsSettings = oController.modifyRelatedAppsSettings(oRelatedAppsSettings, sCurrentSemObj);
103
105
  var bHasRelatedAppSettings = oRelatedAppsSettings && Object.keys(oRelatedAppsSettings).length > 0;
104
106
 
105
107
  if (bHasRelatedAppSettings) {
@@ -190,7 +190,7 @@ sap.ui.define(["sap/ui/base/Object", "sap/base/util/extend", "sap/suite/ui/gener
190
190
  return accBlock;
191
191
  }, [])
192
192
  .forEach(function(entry) {
193
- if (!oSubSectionInfoObject) {
193
+ if (!oSubSectionInfoObject || (entry.getGroups().length === 1 && entry.getGroups()[0].getTitle && !entry.getGroups()[0].getTitle())) {
194
194
  // Case: header is editable. manifest.json, editableHeaderContent=true
195
195
  var sInvisibleTextID = `${entry.getId()}-ariaLabelBy-InvisibleText`,
196
196
  oInvisibleText = Element.getElementById(sInvisibleTextID);