Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions webapp/src/components/user_attribute/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function mapStateToProps(state, ownProps) {
return {
id,
username: user.username,
enterpriseURL: state['plugins-github'].enterpriseURL,
};
}

Expand Down
7 changes: 6 additions & 1 deletion webapp/src/components/user_attribute/user_attribute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default class UserAttribute extends React.PureComponent {
static propTypes = {
id: PropTypes.string.isRequired,
username: PropTypes.string,
enterpriseURL: PropTypes.string,
actions: PropTypes.shape({
getGitHubUser: PropTypes.func.isRequired,
}).isRequired,
Expand All @@ -17,6 +18,10 @@ export default class UserAttribute extends React.PureComponent {

render() {
const username = this.props.username;
let baseURL = 'https://github.com';
if (this.props.enterpriseURL) {
baseURL = this.props.enterpriseURL;
}

if (!username) {
return null;
Expand All @@ -25,7 +30,7 @@ export default class UserAttribute extends React.PureComponent {
return (
<div style={style.container}>
<a
href={'https://github.com/' + username}
href={baseURL + '/' + username}
target='_blank'
rel='noopener noreferrer'
>
Expand Down