@soleil-se/app-util 1.1.7 → 1.2.0
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/README.md +1 -1
- package/dist/index.js +3 -8
- package/package.json +1 -1
- package/src/index.js +5 -10
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropertyUtil from 'PropertyUtil';
|
|
2
1
|
import PortletContextUtil from 'PortletContextUtil';
|
|
3
2
|
import VersionUtil from 'VersionUtil';
|
|
4
3
|
import app from 'app';
|
|
@@ -73,13 +72,9 @@ export function renderApp(name, data, ref) {
|
|
|
73
72
|
* @returns {String} URI for route.
|
|
74
73
|
*/
|
|
75
74
|
export function getRouteUri(route) {
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var currentPageUri = PropertyUtil.getString(PortletContextUtil.getCurrentPage(), 'URI');
|
|
80
|
-
return (currentPageUri + "?sv." + currentPortletId + ".route=" + (encodeURI(route)) + "&sv.target=" + currentPortletId);
|
|
81
|
-
}
|
|
82
|
-
return '';
|
|
75
|
+
var currentPageId = PortletContextUtil.getCurrentPage().getIdentifier();
|
|
76
|
+
var currentPortletId = PortletContextUtil.getCurrentPortlet().getIdentifier();
|
|
77
|
+
return ("/appresource/" + currentPageId + "/" + currentPortletId + "/" + route).replace(/\/\//g, '/');
|
|
83
78
|
}
|
|
84
79
|
|
|
85
80
|
export default {
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropertyUtil from 'PropertyUtil';
|
|
2
1
|
import PortletContextUtil from 'PortletContextUtil';
|
|
3
2
|
import VersionUtil from 'VersionUtil';
|
|
4
3
|
import app from 'app';
|
|
@@ -60,7 +59,7 @@ export function renderApp(name, data, {
|
|
|
60
59
|
|
|
61
60
|
if (isOffline) {
|
|
62
61
|
return `
|
|
63
|
-
<!-- Generated by WebappUtil
|
|
62
|
+
<!-- Generated by WebappUtil.renderApp() -->
|
|
64
63
|
<div data-portlet-id="${portletId}">${noScript}</div>
|
|
65
64
|
<script src="${clientUri}"></script>
|
|
66
65
|
<script>
|
|
@@ -69,7 +68,7 @@ export function renderApp(name, data, {
|
|
|
69
68
|
`;
|
|
70
69
|
}
|
|
71
70
|
return `
|
|
72
|
-
<!-- Generated by WebappUtil
|
|
71
|
+
<!-- Generated by WebappUtil.renderApp() -->
|
|
73
72
|
<div data-portlet-id="${portletId}">${noScript}</div>
|
|
74
73
|
<script>
|
|
75
74
|
function renderApp${portletId}() {
|
|
@@ -86,13 +85,9 @@ export function renderApp(name, data, {
|
|
|
86
85
|
* @returns {String} URI for route.
|
|
87
86
|
*/
|
|
88
87
|
export function getRouteUri(route) {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const currentPageUri = PropertyUtil.getString(PortletContextUtil.getCurrentPage(), 'URI');
|
|
93
|
-
return `${currentPageUri}?sv.${currentPortletId}.route=${encodeURI(route)}&sv.target=${currentPortletId}`;
|
|
94
|
-
}
|
|
95
|
-
return '';
|
|
88
|
+
const currentPageId = PortletContextUtil.getCurrentPage().getIdentifier();
|
|
89
|
+
const currentPortletId = PortletContextUtil.getCurrentPortlet().getIdentifier();
|
|
90
|
+
return `/appresource/${currentPageId}/${currentPortletId}/${route}`.replace(/\/\//g, '/');
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
export default {
|