From 0fcd0ed255614bdb5e15b849af07753ce274df4f Mon Sep 17 00:00:00 2001 From: sandeep Date: Fri, 22 Feb 2019 13:46:24 +0530 Subject: [PATCH 1/2] Fixed profile hover url when enterprise url is set Url shown in profile hover always points to github.com/ instead of / This fixes the url to point to correct address Fixes #42 --- webapp/src/components/user_attribute/index.js | 1 + webapp/src/components/user_attribute/user_attribute.jsx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/user_attribute/index.js b/webapp/src/components/user_attribute/index.js index e8286b615..c89858d44 100644 --- a/webapp/src/components/user_attribute/index.js +++ b/webapp/src/components/user_attribute/index.js @@ -12,6 +12,7 @@ function mapStateToProps(state, ownProps) { return { id, username: user.username, + enterpriseURL: state['plugins-github'].enterpriseURL, }; } diff --git a/webapp/src/components/user_attribute/user_attribute.jsx b/webapp/src/components/user_attribute/user_attribute.jsx index 057f3b1a3..6fae72d6f 100644 --- a/webapp/src/components/user_attribute/user_attribute.jsx +++ b/webapp/src/components/user_attribute/user_attribute.jsx @@ -17,6 +17,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; @@ -25,7 +29,7 @@ export default class UserAttribute extends React.PureComponent { return (
From 9ba961da978714e43388bd48949e98ef5f3b926d Mon Sep 17 00:00:00 2001 From: sandeep Date: Fri, 22 Feb 2019 16:15:38 +0530 Subject: [PATCH 2/2] Fixed style check error in props validation --- webapp/src/components/user_attribute/user_attribute.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/src/components/user_attribute/user_attribute.jsx b/webapp/src/components/user_attribute/user_attribute.jsx index 6fae72d6f..90e896a68 100644 --- a/webapp/src/components/user_attribute/user_attribute.jsx +++ b/webapp/src/components/user_attribute/user_attribute.jsx @@ -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,