@sap-ux/fiori-elements-writer 0.8.4 → 0.8.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 +8 -8
- package/templates/v2/common/add/webapp/test/changes_loader.js +1 -14
- package/templates/v2/common/add/webapp/test/changes_loader.ts +1 -14
- package/templates/v2/common/add/webapp/test/changes_preview.js +4 -26
- package/templates/v2/common/add/webapp/test/changes_preview.ts +5 -26
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-elements-writer",
|
|
3
3
|
"description": "SAP Fiori elements application writer",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.6",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"!dist/**/*.map"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@sap-ux/odata-service-writer": "0.14.
|
|
24
|
-
"@sap-ux/ui5-application-writer": "0.17.
|
|
25
|
-
"@sap-ux/fe-fpm-writer": "0.18.
|
|
26
|
-
"@sap-ux/ui5-config": "0.16.
|
|
27
|
-
"@sap-ux/ui5-test-writer": "0.1.
|
|
23
|
+
"@sap-ux/odata-service-writer": "0.14.14",
|
|
24
|
+
"@sap-ux/ui5-application-writer": "0.17.14",
|
|
25
|
+
"@sap-ux/fe-fpm-writer": "0.18.1",
|
|
26
|
+
"@sap-ux/ui5-config": "0.16.1",
|
|
27
|
+
"@sap-ux/ui5-test-writer": "0.1.5",
|
|
28
28
|
"ejs": "3.1.7",
|
|
29
29
|
"i18next": "20.3.2",
|
|
30
30
|
"lodash": "4.17.21",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"node": ">= 14.16.0 < 15.0.0 || >=16.1.0 < 17.0.0 || >=18.0.0 < 19.0.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
|
-
"build": "
|
|
51
|
-
"clean": "rimraf dist test/test-output coverage",
|
|
50
|
+
"build": "tsc --build",
|
|
51
|
+
"clean": "rimraf dist test/test-output coverage *.tsbuildinfo",
|
|
52
52
|
"watch": "tsc --watch",
|
|
53
53
|
"lint": "eslint . --ext .ts",
|
|
54
54
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
@@ -9,26 +9,13 @@ const connectorPath =
|
|
|
9
9
|
: 'sap/ui/fl/initial/api/connectors/FileListBaseConnector';
|
|
10
10
|
|
|
11
11
|
sap.ui.define(['sap/base/util/merge', connectorPath], function(merge, FileListBaseConnector) {
|
|
12
|
-
var trustedHosts = [
|
|
13
|
-
/^localhost$/,
|
|
14
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.cloud\.sap$/,
|
|
15
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.sapcloud\.cn$/,
|
|
16
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.vlab-sapcloudplatformdev\.cn$/
|
|
17
|
-
];
|
|
18
|
-
var url = new URL(window.location.toString());
|
|
19
|
-
var isValidHost = trustedHosts.some((host) => {
|
|
20
|
-
return host.test(url.hostname);
|
|
21
|
-
});
|
|
22
12
|
return merge({}, FileListBaseConnector, {
|
|
23
13
|
getFileList: function() {
|
|
24
14
|
return new Promise(function(resolve, reject) {
|
|
25
15
|
// If no changes found, maybe because the app was executed without doing a build.
|
|
26
16
|
// Check for changes folder and load the changes, if any.
|
|
27
|
-
if (!isValidHost) {
|
|
28
|
-
reject('cannot load flex changes: invalid host');
|
|
29
|
-
}
|
|
30
17
|
$.ajax({
|
|
31
|
-
url:
|
|
18
|
+
url: '/changes/',
|
|
32
19
|
type: 'GET',
|
|
33
20
|
cache: false
|
|
34
21
|
})
|
|
@@ -10,26 +10,13 @@ const connectorPath =
|
|
|
10
10
|
: 'sap/ui/fl/initial/api/connectors/FileListBaseConnector';
|
|
11
11
|
|
|
12
12
|
sap.ui.define(['sap/base/util/merge', connectorPath], function(merge, FileListBaseConnector) {
|
|
13
|
-
var trustedHosts = [
|
|
14
|
-
/^localhost$/,
|
|
15
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.cloud\.sap$/,
|
|
16
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.sapcloud\.cn$/,
|
|
17
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.vlab-sapcloudplatformdev\.cn$/
|
|
18
|
-
];
|
|
19
|
-
var url = new URL(window.location.toString());
|
|
20
|
-
var isValidHost = trustedHosts.some((host) => {
|
|
21
|
-
return host.test(url.hostname);
|
|
22
|
-
});
|
|
23
13
|
return merge({}, FileListBaseConnector, {
|
|
24
14
|
getFileList: function() {
|
|
25
15
|
return new Promise(function(resolve, reject) {
|
|
26
16
|
// If no changes found, maybe because the app was executed without doing a build.
|
|
27
17
|
// Check for changes folder and load the changes, if any.
|
|
28
|
-
if (!isValidHost) {
|
|
29
|
-
reject('cannot load flex changes: invalid host');
|
|
30
|
-
}
|
|
31
18
|
$.ajax({
|
|
32
|
-
url:
|
|
19
|
+
url: '/changes/',
|
|
33
20
|
type: 'GET',
|
|
34
21
|
cache: false
|
|
35
22
|
})
|
|
@@ -42,22 +42,9 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
42
42
|
//Get the content of the changes folder.
|
|
43
43
|
var aPromises = [];
|
|
44
44
|
var sCacheBusterFilePath = "/sap-ui-cachebuster-info.json";
|
|
45
|
-
var trustedHosts = [
|
|
46
|
-
/^localhost$/,
|
|
47
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.cloud\.sap$/,
|
|
48
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.sapcloud\.cn$/,
|
|
49
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.vlab-sapcloudplatformdev\.cn$/
|
|
50
|
-
];
|
|
51
|
-
var url = new URL(window.location.toString());
|
|
52
|
-
var isValidHost = trustedHosts.some((host) => {
|
|
53
|
-
return host.test(url.hostname);
|
|
54
|
-
});
|
|
55
45
|
return new Promise(function (resolve, reject) {
|
|
56
|
-
if (!isValidHost) {
|
|
57
|
-
reject("cannot load flex changes: invalid host");
|
|
58
|
-
}
|
|
59
46
|
$.ajax({
|
|
60
|
-
url:
|
|
47
|
+
url: sCacheBusterFilePath,
|
|
61
48
|
type: "GET",
|
|
62
49
|
cache: false
|
|
63
50
|
})
|
|
@@ -75,12 +62,9 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
75
62
|
//<MTA-HTML5-MODULE-NAME>/webapp/changes/<change-file>
|
|
76
63
|
if (sFilePath.indexOf("changes") === 0) {
|
|
77
64
|
/*eslint-disable no-param-reassign*/
|
|
78
|
-
if (!isValidHost) {
|
|
79
|
-
reject("cannot load flex changes: invalid host");
|
|
80
|
-
}
|
|
81
65
|
aPromises.push(
|
|
82
66
|
$.ajax({
|
|
83
|
-
url:
|
|
67
|
+
url: "/" + sFilePath,
|
|
84
68
|
type: "GET",
|
|
85
69
|
cache: false
|
|
86
70
|
}).then(function (sChangeContent) {
|
|
@@ -96,11 +80,8 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
96
80
|
// If no changes found, maybe because the app was executed without doing a build.
|
|
97
81
|
// Check for changes folder and load the changes, if any.
|
|
98
82
|
if (aChanges.length === 0) {
|
|
99
|
-
if (!isValidHost) {
|
|
100
|
-
rejectInner("cannot load flex changes: invalid host");
|
|
101
|
-
}
|
|
102
83
|
$.ajax({
|
|
103
|
-
url:
|
|
84
|
+
url: "/changes/",
|
|
104
85
|
type: "GET",
|
|
105
86
|
cache: false
|
|
106
87
|
})
|
|
@@ -109,12 +90,9 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
109
90
|
var result = regex.exec(sChangesFolderContent);
|
|
110
91
|
|
|
111
92
|
while (result !== null) {
|
|
112
|
-
if (!isValidHost) {
|
|
113
|
-
rejectInner("cannot load flex changes: invalid host");
|
|
114
|
-
}
|
|
115
93
|
aPromises.push(
|
|
116
94
|
$.ajax({
|
|
117
|
-
url:
|
|
95
|
+
url: result[1],
|
|
118
96
|
type: "GET",
|
|
119
97
|
cache: false
|
|
120
98
|
}).then(function (sChangeContent) {
|
|
@@ -43,22 +43,10 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
43
43
|
//Get the content of the changes folder.
|
|
44
44
|
var aPromises = [];
|
|
45
45
|
var sCacheBusterFilePath = "/sap-ui-cachebuster-info.json";
|
|
46
|
-
|
|
47
|
-
/^localhost$/,
|
|
48
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.cloud\.sap$/,
|
|
49
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.sapcloud\.cn$/,
|
|
50
|
-
/^((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.)+applicationstudio\.vlab-sapcloudplatformdev\.cn$/
|
|
51
|
-
];
|
|
52
|
-
var url = new URL(window.location.toString());
|
|
53
|
-
var isValidHost = trustedHosts.some((host) => {
|
|
54
|
-
return host.test(url.hostname);
|
|
55
|
-
});
|
|
46
|
+
|
|
56
47
|
return new Promise(function (resolve, reject) {
|
|
57
|
-
if (!isValidHost) {
|
|
58
|
-
reject("cannot load flex changes: invalid host");
|
|
59
|
-
}
|
|
60
48
|
$.ajax({
|
|
61
|
-
url:
|
|
49
|
+
url: sCacheBusterFilePath,
|
|
62
50
|
type: "GET",
|
|
63
51
|
cache: false
|
|
64
52
|
})
|
|
@@ -76,12 +64,9 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
76
64
|
//<MTA-HTML5-MODULE-NAME>/webapp/changes/<change-file>
|
|
77
65
|
if (sFilePath.indexOf("changes") === 0) {
|
|
78
66
|
/*eslint-disable no-param-reassign*/
|
|
79
|
-
if (!isValidHost) {
|
|
80
|
-
reject("cannot load flex changes: invalid host");
|
|
81
|
-
}
|
|
82
67
|
aPromises.push(
|
|
83
68
|
$.ajax({
|
|
84
|
-
url:
|
|
69
|
+
url: "/" + sFilePath,
|
|
85
70
|
type: "GET",
|
|
86
71
|
cache: false
|
|
87
72
|
}).then(function (sChangeContent) {
|
|
@@ -97,11 +82,8 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
97
82
|
// If no changes found, maybe because the app was executed without doing a build.
|
|
98
83
|
// Check for changes folder and load the changes, if any.
|
|
99
84
|
if (aChanges.length === 0) {
|
|
100
|
-
if (!isValidHost) {
|
|
101
|
-
rejectInner("cannot load flex changes: invalid host");
|
|
102
|
-
}
|
|
103
85
|
$.ajax({
|
|
104
|
-
url:
|
|
86
|
+
url: "/changes/",
|
|
105
87
|
type: "GET",
|
|
106
88
|
cache: false
|
|
107
89
|
})
|
|
@@ -110,12 +92,9 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) {
|
|
|
110
92
|
var result = regex.exec(sChangesFolderContent);
|
|
111
93
|
|
|
112
94
|
while (result !== null) {
|
|
113
|
-
if (!isValidHost) {
|
|
114
|
-
rejectInner("cannot load flex changes: invalid host");
|
|
115
|
-
}
|
|
116
95
|
aPromises.push(
|
|
117
96
|
$.ajax({
|
|
118
|
-
url:
|
|
97
|
+
url: result[1],
|
|
119
98
|
type: "GET",
|
|
120
99
|
cache: false
|
|
121
100
|
}).then(function (sChangeContent) {
|