@soleil-se/app-util 5.7.0 → 5.7.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.
- package/CHANGELOG.md +5 -0
- package/client/fetch-json/index.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ All notable changes to this project will be documented in this file.
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [5.7.1] - 2024-08-07
|
|
11
|
+
|
|
12
|
+
- Change widget detection to use `window.sv.PageContext.dashboardId`.
|
|
13
|
+
- Options in `fetchJson` is now optional.
|
|
14
|
+
|
|
10
15
|
## [5.7.0] - 2024-05-23
|
|
11
16
|
|
|
12
17
|
- Add widget support for `fetchJson`.
|
|
@@ -38,7 +38,7 @@ async function handleResponse(response) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function isWidget() {
|
|
41
|
-
return window
|
|
41
|
+
return !!window?.sv?.PageContext?.dashboardId;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function getWidgetOptions(options) {
|
|
@@ -71,7 +71,7 @@ function getWidgetOptions(options) {
|
|
|
71
71
|
* @returns {Promise<object>} A promise that resolves to the JSON response.
|
|
72
72
|
* @throws {Error} If the response is not successful or cannot be parsed as JSON.
|
|
73
73
|
*/
|
|
74
|
-
export default function fetchJson(uri, options) {
|
|
74
|
+
export default function fetchJson(uri, options = {}) {
|
|
75
75
|
const { params = {}, retries = 0, ...rest } = isWidget() ? getWidgetOptions(options) : options;
|
|
76
76
|
|
|
77
77
|
return fetch(getUrl(uri, params), rest)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soleil-se/app-util",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.1",
|
|
4
4
|
"description": "Utility and rendering functions for WebApps.",
|
|
5
5
|
"main": "./common/index.js",
|
|
6
6
|
"author": "Soleil AB",
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@sitevision/api": "*"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "c16a10d52ce59fe1cfa51fb270549c1655f81db3",
|
|
18
18
|
"dependencies": {}
|
|
19
19
|
}
|