@sapui5/sap.suite.ui.generic.template 1.127.4 → 1.127.6

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.127.4",
3
+ "version": "1.127.6",
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.127.4</version>
10
+ <version>1.127.6</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.127.4"
11
+ "version": "1.127.6"
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.127.4"
11
+ "version": "1.127.6"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.127.4"
11
+ "version": "1.127.6"
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.127.4"
9
+ "version": "1.127.6"
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.127.4"
9
+ "version": "1.127.6"
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.127.4"
9
+ "version": "1.127.6"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -2,50 +2,59 @@
2
2
  sap.ui.define([], function() {
3
3
  "use strict";
4
4
 
5
- // If images are included in the UI app they need to specify the path relatively (e.g. images/image.jpg) to support
6
- // different platforms like ABAP and HCP. The relative path has to be used because the absolute paths differ from platform
7
- // to platform. The rule is if the image url doesn't start with a / or sap-icon:// or http(s):// then it's a relative url and the absolute
8
- // path has to be added by the framework. This path can be retrieved with sap.ui.require.toUrl and the component name.
9
- function fnAdjustImageUrlPath(sImageUrl, sAppComponentName, bSuppressIcons) {
10
- if (!sImageUrl) {
11
- return "";
12
- }
13
- var bIsIcon = sImageUrl.startsWith("sap-icon://");
14
- if (bSuppressIcons && bIsIcon) {
15
- return "";
16
- }
17
- if (bIsIcon || sImageUrl.startsWith("/") || sImageUrl.startsWith("http://") || sImageUrl.startsWith("https://")) {
18
- return sImageUrl; // Absolute URL, nothing has to be changed
19
- }
20
- // Relative URL, has to be adjusted
21
- return sap.ui.require.toUrl(sAppComponentName.replace(/\./g, "/")) + "/" + sImageUrl; //replacing dots by slashes before calling sap.ui.require.toUrl method. com.xyz.abc to com/xyz/abc
5
+ // If images are included in the UI app they need to specify the path relatively (e.g. images/image.jpg) to support
6
+ // different platforms like ABAP and HCP. The relative path has to be used because the absolute paths differ from platform
7
+ // to platform. The rule is if the image url doesn't start with a / or sap-icon:// or http(s):// then it's a relative url and the absolute
8
+ // path has to be added by the framework. This path can be retrieved with sap.ui.require.toUrl and the component name.
9
+ function fnAdjustImageUrlPath(sImageUrl, sAppComponentName, bSuppressIcons) {
10
+ if (!sImageUrl) {
11
+ return "";
22
12
  }
13
+ var bIsIcon = sImageUrl.startsWith("sap-icon://");
14
+ if (bSuppressIcons && bIsIcon) {
15
+ return "";
16
+ }
17
+ if (bIsIcon || sImageUrl.startsWith("/") || sImageUrl.startsWith("http://") || sImageUrl.startsWith("https://")) {
18
+ return sImageUrl; // Absolute URL, nothing has to be changed
19
+ }
20
+ // Relative URL, has to be adjusted
21
+ return sap.ui.require.toUrl(sAppComponentName.replace(/\./g, "/")) + "/" + sImageUrl; //replacing dots by slashes before calling sap.ui.require.toUrl method. com.xyz.abc to com/xyz/abc
22
+ }
23
23
 
24
- // Function check is B array values is a subset of A array values.
25
- // A = [], B = ["1", "2", "3"] -> true
26
- // A = ["4"], B = ["1", "2", "3"] -> false
27
- // A = ["1"], B = ["1", "2", "3"] -> true
28
- // A = ["1", "3"], B = ["1", "2", "3"] -> true
29
- // A = ["3", "2", "1"], B = ["1", "2", "3"] -> true
30
- // A = ["1", "4"], B = ["1", "2", "3"] -> false
31
- // A = ["1", "2", "3", "4"], B = ["1", "2", "3"] -> false
32
- function fnIsASubsetOfB(a, b) {
33
- if (a === b) {
34
- return true;
35
- }
36
- if (!a || !b) {
37
- return false;
38
- }
39
- if (a.length > b.length) {
40
- return false;
41
- }
42
- return a.every(function(entry) {
43
- return b.includes(entry);
44
- });
24
+ // Function check is B array values is a subset of A array values.
25
+ // A = [], B = ["1", "2", "3"] -> true
26
+ // A = ["4"], B = ["1", "2", "3"] -> false
27
+ // A = ["1"], B = ["1", "2", "3"] -> true
28
+ // A = ["1", "3"], B = ["1", "2", "3"] -> true
29
+ // A = ["3", "2", "1"], B = ["1", "2", "3"] -> true
30
+ // A = ["1", "4"], B = ["1", "2", "3"] -> false
31
+ // A = ["1", "2", "3", "4"], B = ["1", "2", "3"] -> false
32
+ function fnIsASubsetOfB(a, b) {
33
+ if (a === b) {
34
+ return true;
35
+ }
36
+ if (!a || !b) {
37
+ return false;
45
38
  }
39
+ if (a.length > b.length) {
40
+ return false;
41
+ }
42
+ return a.every(function(entry) {
43
+ return b.includes(entry);
44
+ });
45
+ }
46
+
47
+ // Function to check if a string contains only ASCII characters only. Regular expression
48
+ // used consider [SPACE] to ~ (ASCII 32 to 126) printable ASCII characters. Control characters
49
+ // (ASCII 0 to 31) and DEL character (ASCII 127) are not considered as they could not be part
50
+ // of the string. Method returns true if the string contains only ASCII characters else false.
51
+ function fnIsASCII(sString) {
52
+ return /^[\x20-\x7E]*$/.test(sString);
53
+ }
46
54
 
47
55
  return {
48
56
  adjustImageUrlPath: fnAdjustImageUrlPath,
49
- isASubsetOfB: fnIsASubsetOfB
57
+ isASubsetOfB: fnIsASubsetOfB,
58
+ isASCII: fnIsASCII
50
59
  };
51
60
  });
@@ -943,7 +943,7 @@ sap.ui.define([
943
943
  * @public
944
944
  * @extends sap.ui.core.UIComponent
945
945
  * @author SAP SE
946
- * @version 1.127.4
946
+ * @version 1.127.6
947
947
  * @name sap.suite.ui.generic.template.lib.AppComponent
948
948
  */
949
949
  var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -27,9 +27,38 @@ sap.ui.define(["sap/ui/base/Object",
27
27
  'sap/ui/performance/trace/FESRHelper',
28
28
  "sap/ui/core/CustomData",
29
29
  "sap/m/VBox",
30
- "sap/m/HBox"
31
- ], function(BaseObject, Event, MessageBox, Sorter, controlHelper, expressionHelper, testableHelper, oDataModelHelper, JSONModel, AnnotationHelper,
32
- Controller, FeLogger, MessageUtils, SideEffectUtil, extend, isEmptyObject, deepExtend, CRUDHelper, XMLView, FormatUtil, FileUploaderParameter, IconPool, ServiceContainer, ContactCardDetailHelper, mLibrary, Button, FESRHelper, CustomData, VBox, HBox) {
30
+ "sap/suite/ui/generic/template/genericUtilities/utils"
31
+ ], function(
32
+ BaseObject,
33
+ Event,
34
+ MessageBox,
35
+ Sorter,
36
+ controlHelper,
37
+ expressionHelper,
38
+ testableHelper,
39
+ oDataModelHelper,
40
+ JSONModel,
41
+ AnnotationHelper,
42
+ Controller,
43
+ FeLogger,
44
+ MessageUtils,
45
+ SideEffectUtil,
46
+ extend,
47
+ isEmptyObject,
48
+ deepExtend,
49
+ CRUDHelper,
50
+ XMLView,
51
+ FormatUtil,
52
+ FileUploaderParameter,
53
+ IconPool,
54
+ ServiceContainer,
55
+ ContactCardDetailHelper,
56
+ mLibrary,
57
+ Button,
58
+ FESRHelper,
59
+ CustomData,
60
+ VBox,
61
+ genericUtils) {
33
62
  "use strict";
34
63
 
35
64
  var oLogger = new FeLogger("lib.CommonEventHandlers").getLogger();
@@ -1927,7 +1956,11 @@ sap.ui.define(["sap/ui/base/Object",
1927
1956
  }
1928
1957
  if (oFileUploader.FUEl.files[0].name){
1929
1958
  var headerParameterContentDispositionToken = new FileUploaderParameter();
1930
- var fileName = "filename=" + oFileUploader.FUEl.files[0].name;
1959
+ var sUploadedFileName = oFileUploader.FUEl.files[0].name;
1960
+ if (!genericUtils.isASCII(sUploadedFileName)) {
1961
+ sUploadedFileName = encodeURIComponent(sUploadedFileName);
1962
+ }
1963
+ var fileName = "filename=" + sUploadedFileName;
1931
1964
  headerParameterContentDispositionToken.setName("Content-Disposition");
1932
1965
  headerParameterContentDispositionToken.setValue(fileName);
1933
1966
  oFileUploader.addHeaderParameter(headerParameterContentDispositionToken);
@@ -1987,11 +2020,15 @@ sap.ui.define(["sap/ui/base/Object",
1987
2020
  oPrivModel.setProperty("/generic/controlProperties/" + "fileUploader/" + sEntitySet, oFileUploaderSettings);
1988
2021
  }
1989
2022
 
1990
- oFileUploaderSettings.fileName = oEvent.mParameters.fileName;
2023
+ // URLEncoded filenames are decoded by Chrome, Firefox browsers but Safari doesn't do this automatically.
2024
+ // Therefore, FE decodes it on our side & ensure actual file name is used for further processing.
2025
+ oFileUploaderSettings.fileName = decodeURIComponent(oEvent.mParameters.fileName);
1991
2026
  var fileType = oEvent.mParameters.requestHeaders.find(function(requestHeader) {
1992
2027
  if (requestHeader.name === "Content-Type") {
1993
2028
  return requestHeader;
1994
2029
  }
2030
+
2031
+ return undefined;
1995
2032
  });
1996
2033
  oFileUploaderSettings.fileType = fileType.value;
1997
2034
  var bIcon = IconPool.getIconForMimeType(fileType.value);
@@ -25,9 +25,9 @@ ST_SUCCESS=Con \u00E9xito
25
25
 
26
26
  ST_CHANGES_APPLIED=Se han aplicado las modificaciones
27
27
 
28
- DATA_LOSS_MESSAGE=Si sale se per.entr.
28
+ DATA_LOSS_MESSAGE=Sus entradas se perder\u00E1n al abandonar esta p\u00E1gina.
29
29
 
30
- DATA_LOSS_GENERAL_MESSAGE=Si cont.se per.entr.
30
+ DATA_LOSS_GENERAL_MESSAGE=Si contin\u00FAa se perder\u00E1n sus entradas.
31
31
 
32
32
  PROCEED=Continuar
33
33
 
@@ -3149,7 +3149,7 @@ sap.ui.define(["sap/ui/base/Object",
3149
3149
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
3150
3150
  * @public
3151
3151
  * @extends sap.ui.base.Object
3152
- * @version 1.127.4
3152
+ * @version 1.127.6
3153
3153
  * @since 1.30.0
3154
3154
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3155
3155
  */
@@ -62,7 +62,7 @@ sap.ui.define([
62
62
  interfaces: [],
63
63
  controls: [],
64
64
  elements: [],
65
- version: "1.127.4",
65
+ version: "1.127.6",
66
66
  extensions: {
67
67
  //Configuration used for rule loading of Support Assistant
68
68
  "sap.ui.support": {