Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check authorities in app adapter [LIBS-370] #757

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: clean up verifyLatestUser
  • Loading branch information
KaiVandivier committed Oct 17, 2022
commit 7f97ca5b28e5c8b8712865caa4ce655077790ac0
14 changes: 6 additions & 8 deletions adapter/src/components/AppWrapper.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import PropTypes from 'prop-types'
import React from 'react'
import { useCurrentUserLocale } from '../utils/useLocale.js'
import { useVerifyLatestUser } from '../utils/useVerifyLatestUser.js'
import { Alerts } from './Alerts.js'
import { AuthBoundary } from './AuthBoundary.js'
import { ConnectedHeaderBar } from './ConnectedHeaderBar.js'
Expand All @@ -11,25 +10,24 @@ import { styles } from './styles/AppWrapper.style.js'

export const AppWrapper = ({ children }) => {
const { loading: localeLoading } = useCurrentUserLocale()
const { loading: latestUserLoading } = useVerifyLatestUser()
KaiVandivier marked this conversation as resolved.
Show resolved Hide resolved

if (localeLoading || latestUserLoading) {
if (localeLoading) {
return <LoadingMask />
}

return (
<div className="app-shell-adapter">
<style jsx>{styles}</style>
<AuthBoundary>
<AuthBoundary>
<div className="app-shell-adapter">
<style jsx>{styles}</style>
<ConnectedHeaderBar />
<div className="app-shell-app">
<ErrorBoundary onRetry={() => window.location.reload()}>
{children}
</ErrorBoundary>
</div>
<Alerts />
</AuthBoundary>
</div>
</div>
</AuthBoundary>
)
}

Expand Down
2 changes: 0 additions & 2 deletions adapter/src/components/AuthBoundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import i18n from '../locales'
import { LoadingMask } from './LoadingMask'
import styles from './styles/ErrorBoundary.style.js'

// TODO: Remove useVerifyLatestUser.js (and in app wrapper)

const LATEST_USER_KEY = 'dhis2.latestUser'
const IS_PRODUCTION_ENV = process.env.NODE_ENV === 'production'

Expand Down
47 changes: 0 additions & 47 deletions adapter/src/utils/useVerifyLatestUser.js

This file was deleted.