Skip to content

Commit

Permalink
Merge pull request #740 from dhis2/alpha
Browse files Browse the repository at this point in the history
chore: merge alpha to master (cli plugin builds)
  • Loading branch information
KaiVandivier authored Nov 30, 2022
2 parents c47df66 + 0ec89e4 commit ac0350a
Show file tree
Hide file tree
Showing 37 changed files with 2,008 additions and 244 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
},
rules: {
'import/extensions': 'off',
'react/no-unknown-property': ['error', { ignore: ['jsx'] }],
},
overrides: [
{
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# [10.2.0-alpha.3](https://github.com/dhis2/app-platform/compare/v10.2.0-alpha.2...v10.2.0-alpha.3) (2022-11-30)


### Bug Fixes

* **deps:** bump platform deps and unpin ([bd2582f](https://github.com/dhis2/app-platform/commit/bd2582f3faa17e46142210c530584e79d4b5998a))
* **pwa:** only count clients in scope ([#760](https://github.com/dhis2/app-platform/issues/760)) ([41113c0](https://github.com/dhis2/app-platform/commit/41113c04f50f6677844f3248d65fcfdbc67a2b58))

## [10.1.6](https://github.com/dhis2/app-platform/compare/v10.1.5...v10.1.6) (2022-11-24)


Expand Down
6 changes: 3 additions & 3 deletions adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dhis2/app-adapter",
"version": "10.1.6",
"version": "10.2.0-alpha.3",
"repository": {
"type": "git",
"url": "https://github.com/amcgee/dhis2-app-platform",
Expand All @@ -21,11 +21,11 @@
"build"
],
"dependencies": {
"@dhis2/pwa": "10.1.6",
"@dhis2/pwa": "10.2.0-alpha.3",
"moment": "^2.24.0"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "10.1.6",
"@dhis2/cli-app-scripts": "10.2.0-alpha.3",
"@testing-library/react": "^12.0.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
Expand Down
5 changes: 3 additions & 2 deletions adapter/src/components/AppWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ErrorBoundary } from './ErrorBoundary.js'
import { LoadingMask } from './LoadingMask.js'
import { styles } from './styles/AppWrapper.style.js'

export const AppWrapper = ({ children }) => {
export const AppWrapper = ({ children, plugin }) => {
const { loading: localeLoading } = useCurrentUserLocale()
const { loading: latestUserLoading } = useVerifyLatestUser()

Expand All @@ -19,7 +19,7 @@ export const AppWrapper = ({ children }) => {
return (
<div className="app-shell-adapter">
<style jsx>{styles}</style>
<ConnectedHeaderBar />
{!plugin && <ConnectedHeaderBar />}
<div className="app-shell-app">
<ErrorBoundary onRetry={() => window.location.reload()}>
{children}
Expand All @@ -32,4 +32,5 @@ export const AppWrapper = ({ children }) => {

AppWrapper.propTypes = {
children: PropTypes.node,
plugin: PropTypes.bool,
}
2 changes: 2 additions & 0 deletions adapter/src/components/ServerVersionProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export const ServerVersionProvider = ({
setState({ loading: false, systemInfo })
})
.catch((e) => {
// Todo: If this is a network error, the app cannot load -- handle that gracefully here
// if (e === 'Network error') { ... }
setState({ loading: false, error: e })
})

Expand Down
4 changes: 3 additions & 1 deletion adapter/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const AppAdapter = ({
url,
apiVersion,
pwaEnabled,
plugin,
children,
}) => (
<ErrorBoundary fullscreen onRetry={checkForSWUpdateAndReload}>
Expand All @@ -25,7 +26,7 @@ const AppAdapter = ({
apiVersion={apiVersion}
pwaEnabled={pwaEnabled}
>
<AppWrapper>{children}</AppWrapper>
<AppWrapper plugin={plugin}>{children}</AppWrapper>
</ServerVersionProvider>
</PWALoadingBoundary>
</OfflineInterfaceProvider>
Expand All @@ -37,6 +38,7 @@ AppAdapter.propTypes = {
appVersion: PropTypes.string.isRequired,
apiVersion: PropTypes.number,
children: PropTypes.element,
plugin: PropTypes.bool,
pwaEnabled: PropTypes.bool,
url: PropTypes.string,
}
Expand Down
2 changes: 1 addition & 1 deletion adapter/src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const request = (url, options) => {
})
.then((response) => {
if (response.status !== 200) {
reject('Request failed', response.statusText)
reject('Request failed ' + response.statusText)
return
}
try {
Expand Down
Loading

0 comments on commit ac0350a

Please sign in to comment.