-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #767 from BIBSYSDEV/master2
Update master
- Loading branch information
Showing
20 changed files
with
684 additions
and
251 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { FC } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Link } from 'react-router-dom'; | ||
import { Link as MuiLink } from '@material-ui/core'; | ||
import styled from 'styled-components'; | ||
|
||
import Heading from '../../components/Heading'; | ||
import NormalText from '../../components/NormalText'; | ||
|
||
const StyledLinkText = styled(NormalText)` | ||
margin-top: 1rem; | ||
`; | ||
|
||
const Forbidden: FC = () => { | ||
const { t } = useTranslation('authorization'); | ||
|
||
return ( | ||
<section> | ||
<Heading>{t('forbidden')}</Heading> | ||
<NormalText>{t('forbidden_description')}</NormalText> | ||
<MuiLink component={Link} to="/"> | ||
<StyledLinkText>{t('back_to_home')}</StyledLinkText> | ||
</MuiLink> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Forbidden; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import React, { FC } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { useSelector } from 'react-redux'; | ||
import { Button } from '@material-ui/core'; | ||
import styled from 'styled-components'; | ||
|
||
import { Authority } from '../../../types/authority.types'; | ||
import { RootStore } from '../../../redux/reducers/rootReducer'; | ||
import AuthorityCard from './AuthorityCard'; | ||
import { ConnectAuthority } from './ConnectAuthority'; | ||
import Modal from '../../../components/Modal'; | ||
|
||
const StyledButtonContainer = styled.div` | ||
display: flex; | ||
justify-content: flex-end; | ||
margin-top: 2rem; | ||
`; | ||
|
||
const StyledNormalText = styled.div` | ||
margin-top: 1rem; | ||
`; | ||
|
||
interface AuthorityModalProps { | ||
authority: Authority | null; | ||
closeModal: () => void; | ||
handleNextClick: () => void; | ||
} | ||
|
||
const AuthorityModal: FC<AuthorityModalProps> = ({ closeModal, handleNextClick }) => { | ||
const { t } = useTranslation('common'); | ||
const { authority } = useSelector((store: RootStore) => store.user); | ||
const noOrcid = !authority || !authority.orcids || authority.orcids.length === 0; | ||
|
||
return ( | ||
<Modal | ||
dataTestId="connect-author-modal" | ||
ariaLabelledBy="connect-author-modal" | ||
disableEscape={!authority} | ||
openModal={true} | ||
onClose={closeModal} | ||
headingText={t('profile:authority.connect_authority')} | ||
maxWidth="lg"> | ||
<> | ||
{authority ? ( | ||
<> | ||
<AuthorityCard authority={authority} isConnected /> | ||
<StyledNormalText>{t('profile:authority.connected_authority')}</StyledNormalText> | ||
</> | ||
) : ( | ||
<ConnectAuthority /> | ||
)} | ||
{noOrcid && ( | ||
<StyledButtonContainer> | ||
<Button | ||
color="primary" | ||
variant="contained" | ||
data-testid="modal_next" | ||
onClick={handleNextClick} | ||
disabled={!authority}> | ||
{t('next')} | ||
</Button> | ||
</StyledButtonContainer> | ||
)} | ||
</> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default AuthorityModal; |
Oops, something went wrong.