Skip to content

Commit

Permalink
feat(admin-ui): loading in the client list page
Browse files Browse the repository at this point in the history
  • Loading branch information
harryandriyan committed Aug 4, 2022
1 parent b6a185b commit 82c47e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function ClientListPage({ clients, permissions, scopes, loading, dispatch }) {
const bgThemeColor = { background: themeColors.background }
const [scopeClients, setScopeClients] = useState()
const [haveScopeINUMParam] = useState(search.indexOf('?scopeInum=') > -1)
const [isPageLoading, setIsPageLoading] = useState(loading)

SetTitle(t('titles.oidc_clients'))

Expand Down Expand Up @@ -141,12 +142,17 @@ function ClientListPage({ clients, permissions, scopes, loading, dispatch }) {
setScopeClients(clientsScope)
}
} else {
setIsPageLoading(true)
makeOptions()
buildPayload(userAction, FETCHING_OIDC_CLIENTS, options)
dispatch(getOpenidClients(userAction))

buildPayload(userAction, '', options)
dispatch(getScopes(userAction))

setTimeout(() => {
setIsPageLoading(false)
}, 3000);
}
}, [haveScopeINUMParam])

Expand Down Expand Up @@ -284,7 +290,7 @@ function ClientListPage({ clients, permissions, scopes, loading, dispatch }) {
}}
columns={tableColumns}
data={haveScopeINUMParam ? scopeClients : clients}
isLoading={loading}
isLoading={isPageLoading}
title=""
actions={myActions}
options={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function ClientShowScopes({ handler, data, isOpen }) {
</div>
)
}) : (
<div>{t('message.no_scope_in_client')}</div>
<div>{t('messages.no_scope_in_client')}</div>
)}
</ModalBody>
<ModalFooter>
Expand Down

0 comments on commit 82c47e1

Please sign in to comment.