-
Notifications
You must be signed in to change notification settings - Fork 12
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
e24090a
commit 85a47da
Showing
11 changed files
with
419 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { Button } from '@material-ui/core'; | ||
import { LocalOffer as LocalOfferIcon } from '@material-ui/icons'; | ||
import { BLUE, WHITE } from '../../common/constants'; | ||
|
||
const ConceptButton = ({label, onClick}) => { | ||
return ( | ||
<Button | ||
variant='contained' | ||
startIcon={<LocalOfferIcon />} | ||
onClick={onClick} | ||
style={{background: BLUE, color: WHITE, boxShadow: 'none'}}> | ||
{label} | ||
</Button> | ||
) | ||
} | ||
|
||
export default ConceptButton; |
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,34 @@ | ||
import React from 'react'; | ||
import { ArrowForward as ForwardIcon } from '@material-ui/icons'; | ||
|
||
const STYLES = { | ||
medium: { | ||
icon: {width: '9pt', marginTop: '2px', marginRight: '4px', height: '9pt'}, | ||
fontSize: '9pt', | ||
}, | ||
small: { | ||
icon: {width: '8pt', marginTop: '2px', marginRight: '4px', height: '8pt'}, | ||
fontSize: '8pt', | ||
} | ||
} | ||
|
||
const ExternalIdLabel = props => { | ||
const styles = STYLES[props.iconSize || 'small'] | ||
return ( | ||
<div className='resource-metadata' style={{fontSize: styles.fontSize}}> | ||
<span> | ||
<ForwardIcon style={{ | ||
...styles.icon, | ||
background: 'gray', | ||
color: 'white', | ||
border: '1px solid', | ||
borderRadius: '10px', | ||
}} | ||
/> | ||
</span> | ||
<span>External ID: {props.externalId}</span> | ||
</div> | ||
) | ||
} | ||
|
||
export default ExternalIdLabel; |
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,18 @@ | ||
import React from 'react'; | ||
import { Button } from '@material-ui/core'; | ||
import { Home as HomeIcon } from '@material-ui/icons'; | ||
import { ORANGE, WHITE } from '../../common/constants'; | ||
|
||
const OrgButton = ({label, onClick}) => { | ||
return ( | ||
<Button | ||
variant='contained' | ||
startIcon={<HomeIcon />} | ||
onClick={onClick} | ||
style={{background: ORANGE, color: WHITE, boxShadow: 'none'}}> | ||
{label} | ||
</Button> | ||
) | ||
} | ||
|
||
export default OrgButton; |
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,23 @@ | ||
import React from 'react'; | ||
import OrgButton from './OrgButton'; | ||
import UserButton from './UserButton'; | ||
import { get } from 'lodash'; | ||
|
||
const OwnerButton = props => { | ||
const ownerType = ( | ||
get(props, 'ownerType', '') || | ||
get(props, 'owner_type', '') | ||
).toLowerCase(); | ||
|
||
return ( | ||
<span> | ||
{ | ||
ownerType === 'user' ? | ||
<UserButton label={props.owner} onClick={props.onClick} /> : | ||
<OrgButton label={props.owner} onClick={props.onClick} /> | ||
} | ||
</span> | ||
); | ||
} | ||
|
||
export default OwnerButton; |
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,18 @@ | ||
import React from 'react'; | ||
import { Button } from '@material-ui/core'; | ||
import { List as ListIcon } from '@material-ui/icons'; | ||
import { GREEN, WHITE } from '../../common/constants'; | ||
|
||
const SourceButton = ({label, onClick}) => { | ||
return ( | ||
<Button | ||
variant='contained' | ||
startIcon={<ListIcon />} | ||
onClick={onClick} | ||
style={{background: GREEN, color: WHITE, boxShadow: 'none'}}> | ||
{label} | ||
</Button> | ||
) | ||
} | ||
|
||
export default SourceButton; |
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,18 @@ | ||
import React from 'react'; | ||
import { Button } from '@material-ui/core'; | ||
import { Person as PersonIcon } from '@material-ui/icons'; | ||
import { ORANGE, WHITE } from '../../common/constants'; | ||
|
||
const UserButton = ({label, onClick}) => { | ||
return ( | ||
<Button | ||
variant='contained' | ||
startIcon={<PersonIcon />} | ||
onClick={onClick} | ||
style={{background: ORANGE, color: WHITE, boxShadow: 'none'}}> | ||
{label} | ||
</Button> | ||
) | ||
} | ||
|
||
export default UserButton; |
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 from 'react'; | ||
import { CircularProgress, Tabs, Tab } from '@material-ui/core'; | ||
import APIService from '../../services/APIService'; | ||
import ConceptHomeHeader from './ConceptHomeHeader'; | ||
|
||
class ConceptHome extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
isLoading: true, | ||
concept: {}, | ||
tab: 0, | ||
} | ||
} | ||
|
||
componentDidMount() { | ||
this.refreshDataByURL() | ||
} | ||
|
||
componentDidUpdate(prevProps) { | ||
if(prevProps.location.pathname !== this.props.location.pathname) | ||
this.refreshDataByURL() | ||
} | ||
|
||
refreshDataByURL() { | ||
this.setState({isLoading: true}, () => { | ||
APIService.new() | ||
.overrideURL(this.props.location.pathname) | ||
.get() | ||
.then(response => { | ||
this.setState({isLoading: false, concept: response.data}) | ||
}) | ||
|
||
}) | ||
} | ||
|
||
onTabChange = (event, value) => { | ||
this.setState({tab: value}) | ||
} | ||
|
||
render() { | ||
const { concept, isLoading, tab } = this.state; | ||
return ( | ||
<div style={isLoading ? {textAlign: 'center', marginTop: '40px'} : {}}> | ||
{ | ||
isLoading ? | ||
<CircularProgress color='primary' /> : | ||
<div className='col-md-12 home-container no-side-padding'> | ||
<ConceptHomeHeader concept={concept} /> | ||
<div className='col-md-12 sub-tab'> | ||
<Tabs indicatorColor='none' className='sub-tab-header' value={tab} onChange={this.onTabChange} aria-label="concept-home-tabs"> | ||
<Tab label="Details" /> | ||
<Tab label="Mappings" /> | ||
<Tab label="History" /> | ||
</Tabs> | ||
<div className='sub-tab-container'> | ||
{tab === 0 && <span>Details</span>} | ||
{tab === 1 && <span>Mappings</span>} | ||
{tab === 2 && <span>History</span>} | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default ConceptHome; |
Oops, something went wrong.