diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-08-24 11:53:47 +0200 |
---|---|---|
committer | Janos Gyerik <janos.gyerik@sonarsource.com> | 2017-09-12 11:34:49 +0200 |
commit | 404d315b077c84da3c31b0c0f4dde852d918c8d1 (patch) | |
tree | 176840ffdfb472a469848539dfbb803372c94b93 /server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js | |
parent | 9f5272cac177f024354dd72da2cda2160c5440af (diff) | |
download | sonarqube-404d315b077c84da3c31b0c0f4dde852d918c8d1.tar.gz sonarqube-404d315b077c84da3c31b0c0f4dde852d918c8d1.zip |
SONAR-9736 Build UI for long-living branches (#2390)
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js')
-rw-r--r-- | server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js index 8c72221dd3c..9f41c7a8a8e 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.js @@ -419,7 +419,7 @@ export default class SourceViewerBase extends React.PureComponent { }; loadDuplications = (line /*: SourceLine */) => { - getDuplications(this.props.component).then(r => { + getDuplications(this.props.component, this.props.branch).then(r => { if (this.mounted) { this.setState( { @@ -440,13 +440,22 @@ export default class SourceViewerBase extends React.PureComponent { }; showMeasures = () => { - const measuresOverlay = new MeasuresOverlay({ component: this.state.component, large: true }); + const measuresOverlay = new MeasuresOverlay({ + branch: this.props.branch, + component: this.state.component, + large: true + }); measuresOverlay.render(); }; handleCoverageClick = (line /*: SourceLine */, element /*: HTMLElement */) => { - getTests(this.props.component, line.line).then(tests => { - const popup = new CoveragePopupView({ line, tests, triggerEl: element }); + getTests(this.props.component, line.line, this.props.branch).then(tests => { + const popup = new CoveragePopupView({ + line, + tests, + triggerEl: element, + branch: this.props.branch + }); popup.render(); }); }; @@ -477,7 +486,8 @@ export default class SourceViewerBase extends React.PureComponent { inRemovedComponent, component: this.state.component, files: this.state.duplicatedFiles, - triggerEl: element + triggerEl: element, + branch: this.props.branch }); popup.render(); } @@ -500,7 +510,8 @@ export default class SourceViewerBase extends React.PureComponent { const popup = new LineActionsPopupView({ line, triggerEl: element, - component: this.state.component + component: this.state.component, + branch: this.props.branch }); popup.render(); } @@ -637,7 +648,11 @@ export default class SourceViewerBase extends React.PureComponent { return ( <div className={className} ref={node => (this.node = node)}> - <SourceViewerHeader component={this.state.component} showMeasures={this.showMeasures} /> + <SourceViewerHeader + branch={this.props.branch} + component={this.state.component} + showMeasures={this.showMeasures} + /> {notAccessible && <div className="alert alert-warning spacer-top"> {translate('code_viewer.no_source_code_displayed_due_to_security')} |