Skip to content

Commit

Permalink
fix: use correct prop name for D2Shim (#1202)
Browse files Browse the repository at this point in the history
Use correct prop name to provide d2 config info to the D2Shim
  • Loading branch information
jenniferarnesen committed Oct 21, 2020
1 parent 737baa6 commit b8ebdd6
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/AppWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,22 @@ import './locales'

const muiTheme = () => createMuiTheme(dhis2theme)

const schemas = [
'chart',
'map',
'report',
'reportTable',
'eventChart',
'eventReport',
'dashboard',
'organisationUnit',
'userGroup',
]

const appConfig = {
schemas,
const d2Config = {
schemas: ['dashboard'],
}

const authorization = process.env.REACT_APP_DHIS2_AUTHORIZATION || null

// TODO: ER and EV plugins require the auth header in development mode.
// Remove this when these plugins are rewritten
const authorization = process.env.REACT_APP_DHIS2_AUTHORIZATION || null
if (authorization) {
appConfig.headers = { Authorization: authorization }
d2Config.headers = { Authorization: authorization }
}

const AppWrapper = () => {
return (
<ReduxProvider store={configureStore()}>
<MuiThemeProvider theme={muiTheme()}>
<D2Shim appConfig={appConfig} i18nRoot="./i18n">
<D2Shim d2Config={d2Config} i18nRoot="./i18n">
{({ d2 }) => {
if (!d2) {
// TODO: Handle errors in d2 initialization
Expand Down

0 comments on commit b8ebdd6

Please sign in to comment.