@dhis2/analytics 23.7.8 → 23.7.9

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 CHANGED
@@ -1,3 +1,10 @@
1
+ ## [23.7.9](https://github.com/dhis2/analytics/compare/v23.7.8...v23.7.9) (2022-04-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * simplify code and fix double path issue DHIS2-12940 ([#1206](https://github.com/dhis2/analytics/issues/1206)) ([2097119](https://github.com/dhis2/analytics/commit/2097119c858790cb6f40e43abaeab1c2867ad578))
7
+
1
8
  ## [23.7.8](https://github.com/dhis2/analytics/compare/v23.7.7...v23.7.8) (2022-04-22)
2
9
 
3
10
 
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.GetLinkDialog = void 0;
7
7
 
8
- var _appRuntime = require("@dhis2/app-runtime");
9
-
10
8
  var _ui = require("@dhis2/ui");
11
9
 
12
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -24,11 +22,8 @@ const GetLinkDialog = ({
24
22
  id,
25
23
  onClose
26
24
  }) => {
27
- const {
28
- baseUrl
29
- } = (0, _appRuntime.useConfig)(); // TODO simply use href from the visualization object?
30
-
31
- const appUrl = new URL("".concat(baseUrl, "/").concat((0, _utils.appPathFor)(type, id)), "".concat(window.location.origin).concat(window.location.pathname));
25
+ // TODO simply use href from the visualization object?
26
+ const appUrl = new URL((0, _utils.appPathFor)(type, id), "".concat(window.location.origin).concat(window.location.pathname));
32
27
  return /*#__PURE__*/_react.default.createElement(_ui.Modal, {
33
28
  onClose: onClose
34
29
  }, /*#__PURE__*/_react.default.createElement(_ui.ModalContent, null, /*#__PURE__*/_react.default.createElement("p", null, _index.default.t('Open in this app')), /*#__PURE__*/_react.default.createElement("a", {
@@ -54,8 +54,7 @@ const appPathFor = (fileType, id) => {
54
54
  return "dhis-web-maps/index.html?id=".concat(id);
55
55
 
56
56
  default:
57
- // strip origin and the first /
58
- return "".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash).substring(1);
57
+ return "".concat(window.location.search).concat(window.location.hash);
59
58
  }
60
59
  };
61
60
 
@@ -1,4 +1,3 @@
1
- import { useConfig } from '@dhis2/app-runtime';
2
1
  import { Modal, ModalContent, ModalActions, ButtonStrip, Button } from '@dhis2/ui';
3
2
  import PropTypes from 'prop-types';
4
3
  import React from 'react';
@@ -9,11 +8,8 @@ export const GetLinkDialog = ({
9
8
  id,
10
9
  onClose
11
10
  }) => {
12
- const {
13
- baseUrl
14
- } = useConfig(); // TODO simply use href from the visualization object?
15
-
16
- const appUrl = new URL("".concat(baseUrl, "/").concat(appPathFor(type, id)), "".concat(window.location.origin).concat(window.location.pathname));
11
+ // TODO simply use href from the visualization object?
12
+ const appUrl = new URL(appPathFor(type, id), "".concat(window.location.origin).concat(window.location.pathname));
17
13
  return /*#__PURE__*/React.createElement(Modal, {
18
14
  onClose: onClose
19
15
  }, /*#__PURE__*/React.createElement(ModalContent, null, /*#__PURE__*/React.createElement("p", null, i18n.t('Open in this app')), /*#__PURE__*/React.createElement("a", {
@@ -32,7 +32,6 @@ export const appPathFor = (fileType, id) => {
32
32
  return "dhis-web-maps/index.html?id=".concat(id);
33
33
 
34
34
  default:
35
- // strip origin and the first /
36
- return "".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash).substring(1);
35
+ return "".concat(window.location.search).concat(window.location.hash);
37
36
  }
38
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "23.7.8",
3
+ "version": "23.7.9",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {
@@ -33,7 +33,7 @@
33
33
  "devDependencies": {
34
34
  "@dhis2/app-runtime": "^2.11.0",
35
35
  "@dhis2/cli-app-scripts": "^6.2.0",
36
- "@dhis2/cli-style": "^10.1.1",
36
+ "@dhis2/cli-style": "^10.4.0",
37
37
  "@dhis2/d2-i18n": "^1.1.0",
38
38
  "@dhis2/ui": "^7.16.1",
39
39
  "@sambego/storybook-state": "^2.0.1",