-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36eb4b2
commit ce2f20c
Showing
11 changed files
with
144 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
admin-ui/plugins/auth-server/components/Clients/ClientShowSpontaneousScopes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React, { useContext } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap' | ||
import { Badge } from 'Components' | ||
import { useSelector } from 'react-redux' | ||
import { ThemeContext } from 'Context/theme/themeContext' | ||
|
||
function ClientShowSpontaneousScopes({ handler, isOpen }) { | ||
const { t } = useTranslation() | ||
const scopesByCreator = useSelector( | ||
(state) => state.scopeReducer.scopesByCreator, | ||
) | ||
const theme = useContext(ThemeContext) | ||
const selectedTheme = theme.state.theme | ||
|
||
return ( | ||
<Modal isOpen={isOpen} toggle={handler} className="modal-outline-primary"> | ||
<ModalHeader>{t('fields.spontaneousScopes')}</ModalHeader> | ||
<ModalBody> | ||
{scopesByCreator.length > 0 ? ( | ||
scopesByCreator?.map((scope, key) => { | ||
return ( | ||
<div key={key}> | ||
<Badge color={`primary-${selectedTheme}`}> | ||
{scope?.attributes?.spontaneousClientScopes[0]} | ||
</Badge> | ||
</div> | ||
) | ||
}) | ||
) : ( | ||
<div>{t('messages.no_scope_in_spontaneous_client')}</div> | ||
)} | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button color={`primary-${selectedTheme}`} onClick={handler}> | ||
Close | ||
</Button> | ||
</ModalFooter> | ||
</Modal> | ||
) | ||
} | ||
export default ClientShowSpontaneousScopes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters