aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/component/components
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component/components')
-rw-r--r--server/sonar-web/src/main/js/apps/component/components/App.tsx14
1 files changed, 2 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/apps/component/components/App.tsx b/server/sonar-web/src/main/js/apps/component/components/App.tsx
index 71fc859ea2f..d70fc1c92e6 100644
--- a/server/sonar-web/src/main/js/apps/component/components/App.tsx
+++ b/server/sonar-web/src/main/js/apps/component/components/App.tsx
@@ -18,8 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import * as React from 'react';
-import { PullRequest, BranchType, ShortLivingBranch } from '../../../app/types';
import SourceViewer from '../../../components/SourceViewer/SourceViewer';
+import { fillBranchLike } from '../../../helpers/branches';
interface Props {
location: {
@@ -54,17 +54,7 @@ export default class App extends React.PureComponent<Props> {
// TODO find a way to avoid creating this fakeBranchLike
// probably the best way would be to drop this page completely
// and redirect to the Code page
- let fakeBranchLike: ShortLivingBranch | PullRequest | undefined = undefined;
- if (branch) {
- fakeBranchLike = {
- isMain: false,
- mergeBranch: '',
- name: branch,
- type: BranchType.SHORT
- } as ShortLivingBranch;
- } else if (pullRequest) {
- fakeBranchLike = { base: '', branch: '', key: pullRequest, title: '' } as PullRequest;
- }
+ const fakeBranchLike = fillBranchLike(branch, pullRequest);
return (
<div className="page page-limited">