@soleil-se/app-util 1.2.1 → 1.2.4
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/dist/index.js +3 -2
- package/package.json +3 -2
- package/src/index.js +3 -2
package/dist/index.js
CHANGED
|
@@ -8,7 +8,8 @@ import _ from 'underscore';
|
|
|
8
8
|
/** If the webapp is running in offline mode or not. */
|
|
9
9
|
export var isOffline = VersionUtil.getCurrentVersion() === VersionUtil.OFFLINE_VERSION;
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var currentPortlet = PortletContextUtil.getCurrentPortlet();
|
|
12
|
+
var portletId = currentPortlet ? currentPortlet.getIdentifier().replace('.', '_') : '';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Get URI for a resource.
|
|
@@ -72,7 +73,7 @@ export function renderApp(name, data, ref) {
|
|
|
72
73
|
* @returns {String} URI for route.
|
|
73
74
|
*/
|
|
74
75
|
export function getRouteUri(route) {
|
|
75
|
-
var currentPageId = PortletContextUtil.getCurrentPage().getIdentifier();
|
|
76
|
+
var currentPageId = PortletContextUtil.getCurrentPage().getIdentifier().replace('_sitePage', '');
|
|
76
77
|
var currentPortletId = PortletContextUtil.getCurrentPortlet().getIdentifier();
|
|
77
78
|
return ("/appresource/" + currentPageId + "/" + currentPortletId + "/" + route).replace(/\/\//g, '/');
|
|
78
79
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/app-util",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Utility functions for Webapps.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"author": "Soleil AB",
|
|
7
7
|
"contributors": [
|
|
8
|
-
"Kimmy Monassar"
|
|
8
|
+
"Kimmy Monassar",
|
|
9
|
+
"Jonas Gällman"
|
|
9
10
|
],
|
|
10
11
|
"license": "UNLICENSED",
|
|
11
12
|
"private": false,
|
package/src/index.js
CHANGED
|
@@ -8,7 +8,8 @@ import _ from 'underscore';
|
|
|
8
8
|
/** If the webapp is running in offline mode or not. */
|
|
9
9
|
export const isOffline = VersionUtil.getCurrentVersion() === VersionUtil.OFFLINE_VERSION;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const currentPortlet = PortletContextUtil.getCurrentPortlet();
|
|
12
|
+
const portletId = currentPortlet ? currentPortlet.getIdentifier().replace('.', '_') : '';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Get URI for a resource.
|
|
@@ -85,7 +86,7 @@ export function renderApp(name, data, {
|
|
|
85
86
|
* @returns {String} URI for route.
|
|
86
87
|
*/
|
|
87
88
|
export function getRouteUri(route) {
|
|
88
|
-
const currentPageId = PortletContextUtil.getCurrentPage().getIdentifier();
|
|
89
|
+
const currentPageId = PortletContextUtil.getCurrentPage().getIdentifier().replace('_sitePage', '');
|
|
89
90
|
const currentPortletId = PortletContextUtil.getCurrentPortlet().getIdentifier();
|
|
90
91
|
return `/appresource/${currentPageId}/${currentPortletId}/${route}`.replace(/\/\//g, '/');
|
|
91
92
|
}
|