Skip to content

Commit

Permalink
feat: use new headerbar with online status indicator (#626)
Browse files Browse the repository at this point in the history
* chore(deps): use latest UI

* feat: add pwaEnabled to app config for headerbar
  • Loading branch information
KaiVandivier authored Aug 30, 2021
1 parent c087f09 commit 3bd7d37
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 389 deletions.
3 changes: 3 additions & 0 deletions adapter/src/components/ServerVersionProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const ServerVersionProvider = ({
url,
apiVersion,
offlineInterface,
pwaEnabled,
children,
}) => {
const [{ loading, error, systemInfo }, setState] = useState({
Expand Down Expand Up @@ -55,6 +56,7 @@ export const ServerVersionProvider = ({
apiVersion: apiVersion || realApiVersion,
serverVersion,
systemInfo,
pwaEnabled,
}}
offlineInterface={offlineInterface}
>
Expand All @@ -67,5 +69,6 @@ ServerVersionProvider.propTypes = {
apiVersion: PropTypes.number,
children: PropTypes.element,
offlineInterface: PropTypes.shape({}),
pwaEnabled: PropTypes.bool,
url: PropTypes.string,
}
4 changes: 3 additions & 1 deletion adapter/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import { ServerVersionProvider } from './components/ServerVersionProvider'

const offlineInterface = new OfflineInterface()

const AppAdapter = ({ url, apiVersion, appName, children }) => (
const AppAdapter = ({ url, apiVersion, appName, pwaEnabled, children }) => (
<ErrorBoundary fullscreen onRetry={checkForSWUpdateAndReload}>
<ServerVersionProvider
url={url}
apiVersion={apiVersion}
pwaEnabled={pwaEnabled}
offlineInterface={offlineInterface}
>
<AppWrapper appName={appName}>{children}</AppWrapper>
Expand All @@ -23,6 +24,7 @@ AppAdapter.propTypes = {
appName: PropTypes.string.isRequired,
apiVersion: PropTypes.number,
children: PropTypes.element,
pwaEnabled: PropTypes.bool,
url: PropTypes.string,
}

Expand Down
4 changes: 2 additions & 2 deletions shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"dependencies": {
"@dhis2/app-adapter": "7.3.0-alpha.3",
"@dhis2/app-runtime": "^2.10.0-pwa.3",
"@dhis2/pwa": "7.3.0-alpha.3",
"@dhis2/d2-i18n": "^1.1.0",
"@dhis2/ui": "^6.10.5",
"@dhis2/pwa": "7.3.0-alpha.3",
"@dhis2/ui": "^6.19.0",
"classnames": "^2.2.6",
"moment": "^2.29.1",
"prop-types": "^15.7.2",
Expand Down
1 change: 1 addition & 0 deletions shell/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const appConfig = {
window.localStorage.DHIS2_BASE_URL,
appName: process.env.REACT_APP_DHIS2_APP_NAME || '',
apiVersion: parseInt(process.env.REACT_APP_DHIS2_API_VERSION),
pwaEnabled: process.env.REACT_APP_DHIS2_APP_PWA_ENABLED === 'true',
}

const App = () => (
Expand Down
Loading

0 comments on commit 3bd7d37

Please sign in to comment.