@opencitylabs/formio-sdk 1.1.5 → 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.
Files changed (3) hide show
  1. package/BaseUrl.js +2 -2
  2. package/index.js +10 -1
  3. package/package.json +2 -2
package/BaseUrl.js CHANGED
@@ -7,8 +7,8 @@ export const baseUrl = () => {
7
7
  let url = null;
8
8
  if (globalRegex.test(location.hostname)) {
9
9
  url = "https://servizi.comune-qa.bugliano.pi.it/lang";
10
- } else if (window.BASE_URL) {
11
- url = window.BASE_URL;
10
+ } else if (window.OC_BASE_URL || window.BASE_URL) {
11
+ url = window.OC_BASE_URL || window.BASE_URL;
12
12
  } else {
13
13
  const explodedPath = location.pathname.split("/");
14
14
  url = location.origin + "/" + explodedPath[1];
package/index.js CHANGED
@@ -2,6 +2,7 @@ import axios from "axios";
2
2
  import get from "lodash.get";
3
3
  import { baseUrl } from "./BaseUrl.js";
4
4
  import { jwtDecode } from "jwt-decode";
5
+ import Swal from "sweetalert2";
5
6
 
6
7
  class FormIoHelper {
7
8
 
@@ -69,7 +70,7 @@ class FormIoHelper {
69
70
  }
70
71
 
71
72
  getBaseUrl() {
72
- return window.BASE_URL || baseUrl();
73
+ return baseUrl();
73
74
  }
74
75
 
75
76
  async authenticatedCall(endPoint) {
@@ -533,6 +534,14 @@ class FormIoHelper {
533
534
  }
534
535
  }
535
536
 
537
+ showAlert(config = {}) {
538
+ const defaults = {
539
+ icon: "info",
540
+ confirmButtonText: "OK",
541
+ };
542
+ return Swal.fire({ ...defaults, ...config });
543
+ }
544
+
536
545
  isUser() {
537
546
  try {
538
547
  const rawSessionToken = window.sessionStorage.getItem('auth-token');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencitylabs/formio-sdk",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
4
4
  "description": "Node/browser SDK helper for Form.io APIs",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -24,7 +24,7 @@
24
24
  "author": "OpencityLabs",
25
25
  "license": "ISC",
26
26
  "dependencies": {
27
- "axios": "^1.13.6",
27
+ "axios": "^1.16.0",
28
28
  "jwt-decode": "^4.0.0",
29
29
  "lodash.get": "^4.4.2",
30
30
  "sweetalert2": "^11.26.24"