Skip to content

Commit

Permalink
Merge branch 'master' into login-type-catchup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzemp committed Apr 23, 2024
2 parents 29fea13 + 9c9aa17 commit 9477b8f
Show file tree
Hide file tree
Showing 12 changed files with 522 additions and 478 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## [11.1.1](https://github.com/dhis2/app-platform/compare/v11.1.0...v11.1.1) (2024-04-09)


### Bug Fixes

* **deps:** upgrade @dhis2/app-runtime and @dhis2/ui for peer deps fixes ([#842](https://github.com/dhis2/app-platform/issues/842)) ([2804527](https://github.com/dhis2/app-platform/commit/280452785ab1404e124d7ae6c9b886e241f2e826))

# [11.1.0](https://github.com/dhis2/app-platform/compare/v11.0.0...v11.1.0) (2024-03-25)


### Features

* support core-injected base url ([#836](https://github.com/dhis2/app-platform/issues/836)) ([3f1ca71](https://github.com/dhis2/app-platform/commit/3f1ca71a871037316f130f960108c689c36365ba))

# [11.0.0](https://github.com/dhis2/app-platform/compare/v10.5.0...v11.0.0) (2024-03-05)


### chore

* **deps:** update shell to ui@9 ([#824](https://github.com/dhis2/app-platform/issues/824)) ([b6a12fa](https://github.com/dhis2/app-platform/commit/b6a12faee7e48764a341dfadc36c991fbab37ec2))


### BREAKING CHANGES

* **deps:** Updated major version of UI

# [10.6.0-alpha.3](https://github.com/dhis2/app-platform/compare/v10.6.0-alpha.2...v10.6.0-alpha.3) (2024-03-21)


Expand Down
10 changes: 5 additions & 5 deletions adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-adapter",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"repository": {
"type": "git",
"url": "https://github.com/amcgee/dhis2-app-platform",
Expand All @@ -21,11 +21,11 @@
"build"
],
"dependencies": {
"@dhis2/pwa": "10.6.0-alpha.3",
"@dhis2/pwa": "11.1.1",
"moment": "^2.24.0"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "10.6.0-alpha.3",
"@dhis2/cli-app-scripts": "11.1.1",
"@testing-library/react": "^12.0.0",
"@testing-library/react-hooks": "^8.0.1",
"enzyme": "^3.11.0",
Expand All @@ -38,9 +38,9 @@
"test": "d2-app-scripts test"
},
"peerDependencies": {
"@dhis2/app-runtime": "^3.10.2",
"@dhis2/app-runtime": "^3.10.4",
"@dhis2/d2-i18n": "^1",
"@dhis2/ui": ">=8.5",
"@dhis2/ui": ">=9.4.4",
"classnames": "^2",
"moment": "^2",
"prop-types": "^15",
Expand Down
4 changes: 2 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/cli-app-scripts",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"engines": {
"node": ">=14"
},
Expand Down Expand Up @@ -28,7 +28,7 @@
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.6.0",
"@dhis2/app-shell": "10.6.0-alpha.3",
"@dhis2/app-shell": "11.1.1",
"@dhis2/cli-helpers-engine": "^3.2.0",
"@jest/core": "^27.0.6",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/pwa-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pwa-app",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"description": "",
"license": "BSD-3-Clause",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-app",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"repository": "https://github.com/amcgee/dhis2-app-platform",
"author": "Austin McGee <austin@dhis2.org>",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "root",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"private": true,
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/pwa",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"description": "",
"license": "BSD-3-Clause",
"publishConfig": {
Expand All @@ -13,7 +13,7 @@
"deploy": "d2-app-scripts deploy"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "10.6.0-alpha.3"
"@dhis2/cli-app-scripts": "11.1.1"
},
"dependencies": {
"idb": "^6.0.0",
Expand Down
10 changes: 5 additions & 5 deletions shell/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-shell",
"version": "10.6.0-alpha.3",
"version": "11.1.1",
"engines": {
"node": ">=14"
},
Expand All @@ -15,11 +15,11 @@
"access": "public"
},
"dependencies": {
"@dhis2/app-adapter": "10.6.0-alpha.3",
"@dhis2/app-runtime": "^3.10.2",
"@dhis2/app-adapter": "11.1.1",
"@dhis2/app-runtime": "^3.10.4",
"@dhis2/d2-i18n": "^1.1.1",
"@dhis2/pwa": "10.6.0-alpha.3",
"@dhis2/ui": "^8.12.3",
"@dhis2/pwa": "11.1.1",
"@dhis2/ui": "^9.4.4",
"classnames": "^2.2.6",
"moment": "^2.29.1",
"post-robot": "^10.0.46",
Expand Down
3 changes: 3 additions & 0 deletions shell/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#ffffff" />

<!-- Injection point for base URL from backend -->
<meta name="dhis2-base-url" content="__DHIS2_BASE_URL__" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
2 changes: 2 additions & 0 deletions shell/public/plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- Injection point for base URL from backend -->
<meta name="dhis2-base-url" content="__DHIS2_BASE_URL__" />
<title>Plugin</title>
</head>
<body>
Expand Down
14 changes: 13 additions & 1 deletion shell/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ const D2App = React.lazy(() =>
import(/*webpackChunkName: 'app'*/ './D2App/app')
) // Automatic bundle splitting!

// Injected by backend when serving index or plugin HTML
// https://github.com/dhis2/dhis2-core/pull/16703
const getInjectedBaseUrl = () => {
const baseUrl = document
.querySelector('meta[name="dhis2-base-url"]')
?.getAttribute('content')
if (baseUrl && baseUrl !== '__DHIS2_BASE_URL__') {
return baseUrl
}
return null
}

const parseRequiredProps = (propsEnvVariable) => {
if (!propsEnvVariable || propsEnvVariable === '') {
return []
Expand All @@ -22,7 +34,7 @@ const requiredPluginProps = parseRequiredProps(
)

const appConfig = {
url: process.env.REACT_APP_DHIS2_BASE_URL,
url: getInjectedBaseUrl() || process.env.REACT_APP_DHIS2_BASE_URL,
appName: process.env.REACT_APP_DHIS2_APP_NAME || '',
appVersion: process.env.REACT_APP_DHIS2_APP_VERSION || '',
apiVersion: parseInt(process.env.REACT_APP_DHIS2_API_VERSION),
Expand Down
Loading

0 comments on commit 9477b8f

Please sign in to comment.