aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2020-01-09 11:55:55 +0100
committerSonarTech <sonartech@sonarsource.com>2020-01-13 20:46:38 +0100
commit85a0a1ce997c7203a290e200aebef1492a615a8d (patch)
treed74ffbd5fda9209cb4b42d90dcb4f6aaca018140 /server/sonar-web/src
parente12b4607189729f0b78a05bd53c42f41e6893d05 (diff)
downloadsonarqube-85a0a1ce997c7203a290e200aebef1492a615a8d.tar.gz
sonarqube-85a0a1ce997c7203a290e200aebef1492a615a8d.zip
SONAR-12718 UI Fixes for the code snippet
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx6
-rw-r--r--server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx10
-rw-r--r--server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/SnippetViewer-test.tsx.snap213
-rw-r--r--server/sonar-web/src/main/js/apps/securityHotspots/components/HotspotSnippetContainerRenderer.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/securityHotspots/components/__tests__/__snapshots__/HotspotSnippetContainerRenderer-test.tsx.snap3
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx26
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx1
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap79
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx25
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/Line-test.tsx1
-rw-r--r--server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/Line-test.tsx.snap129
11 files changed, 481 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx
index ad13be5f4b8..a40025118cd 100644
--- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/SnippetViewer.tsx
@@ -37,6 +37,7 @@ import { inSnippet, LINES_BELOW_ISSUE } from './utils';
interface Props {
branchLike: BranchLike | undefined;
component: T.SourceViewerFile;
+ displaySCM?: boolean;
duplications?: T.Duplication[];
duplicationsByLine?: { [line: number]: number[] };
expandBlock: (snippetIndex: number, direction: T.ExpandDirection) => Promise<void>;
@@ -110,6 +111,7 @@ export default class SnippetViewer extends React.PureComponent<Props> {
renderLine({
displayDuplications,
+ displaySCM,
index,
issuesForLine,
issueLocations,
@@ -119,6 +121,7 @@ export default class SnippetViewer extends React.PureComponent<Props> {
verticalBuffer
}: {
displayDuplications: boolean;
+ displaySCM?: boolean;
index: number;
issuesForLine: T.Issue[];
issueLocations: T.LinearIssueLocation[];
@@ -144,6 +147,7 @@ export default class SnippetViewer extends React.PureComponent<Props> {
displayDuplications={displayDuplications}
displayIssues={!isSinkLine || issuesForLine.length > 1}
displayLocationMarkers={true}
+ displaySCM={displaySCM}
duplications={lineDuplications}
duplicationsCount={duplicationsCount}
highlighted={false}
@@ -183,6 +187,7 @@ export default class SnippetViewer extends React.PureComponent<Props> {
render() {
const {
component,
+ displaySCM,
issue,
issuesByLine = {},
last,
@@ -230,6 +235,7 @@ export default class SnippetViewer extends React.PureComponent<Props> {
{snippet.map((line, index) =>
this.renderLine({
displayDuplications,
+ displaySCM,
index,
issuesForLine: issuesByLine[line.line] || [],
issueLocations: locationsByLine[line.line] || [],
diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx
index 845fbf3d611..ce0160db6e4 100644
--- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/SnippetViewer-test.tsx
@@ -42,6 +42,16 @@ it('should render correctly', () => {
expect(wrapper).toMatchSnapshot();
});
+it('should render correctly with no SCM', () => {
+ const snippet = range(5, 8).map(line => mockSourceLine({ line }));
+ const wrapper = shallowRender({
+ displaySCM: false,
+ snippet
+ });
+
+ expect(wrapper).toMatchSnapshot();
+});
+
it('should render correctly when at the top of the file', () => {
const snippet = range(1, 8).map(line => mockSourceLine({ line }));
const wrapper = shallowRender({
diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/SnippetViewer-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/SnippetViewer-test.tsx.snap
index 2a36a69cd18..f77a840ba37 100644
--- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/SnippetViewer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/SnippetViewer-test.tsx.snap
@@ -928,3 +928,216 @@ exports[`should render correctly when at the top of the file 1`] = `
</div>
</div>
`;
+
+exports[`should render correctly with no SCM 1`] = `
+<div
+ className="source-viewer-code snippet"
+>
+ <div>
+ <div
+ className="expand-block expand-block-above"
+ >
+ <button
+ aria-label="source_viewer.expand_above"
+ onClick={[Function]}
+ type="button"
+ >
+ <ExpandSnippetIcon />
+ </button>
+ </div>
+ <table
+ className="source-table expand-up expand-down"
+ >
+ <tbody>
+ <Line
+ branchLike={
+ Object {
+ "analysisDate": "2018-01-01",
+ "excludedFromPurge": true,
+ "isMain": true,
+ "name": "master",
+ }
+ }
+ displayAllIssues={false}
+ displayCoverage={true}
+ displayDuplications={false}
+ displayIssues={true}
+ displayLocationMarkers={true}
+ displaySCM={false}
+ duplications={Array []}
+ duplicationsCount={0}
+ highlighted={false}
+ issueLocations={Array []}
+ issues={Array []}
+ key="5"
+ last={false}
+ line={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 5,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ loadDuplications={[MockFunction]}
+ onIssueChange={[MockFunction]}
+ onIssuePopupToggle={[MockFunction]}
+ onIssueSelect={[Function]}
+ onIssueUnselect={[Function]}
+ onIssuesClose={[MockFunction]}
+ onIssuesOpen={[MockFunction]}
+ onLinePopupToggle={[MockFunction]}
+ onLocationSelect={[MockFunction]}
+ onSymbolClick={[MockFunction]}
+ renderDuplicationPopup={[MockFunction]}
+ scroll={[Function]}
+ secondaryIssueLocations={Array []}
+ verticalBuffer={0}
+ />
+ <Line
+ branchLike={
+ Object {
+ "analysisDate": "2018-01-01",
+ "excludedFromPurge": true,
+ "isMain": true,
+ "name": "master",
+ }
+ }
+ displayAllIssues={false}
+ displayCoverage={true}
+ displayDuplications={false}
+ displayIssues={true}
+ displayLocationMarkers={true}
+ displaySCM={false}
+ duplications={Array []}
+ duplicationsCount={0}
+ highlighted={false}
+ issueLocations={Array []}
+ issues={Array []}
+ key="6"
+ last={false}
+ line={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 6,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ loadDuplications={[MockFunction]}
+ onIssueChange={[MockFunction]}
+ onIssuePopupToggle={[MockFunction]}
+ onIssueSelect={[Function]}
+ onIssueUnselect={[Function]}
+ onIssuesClose={[MockFunction]}
+ onIssuesOpen={[MockFunction]}
+ onLinePopupToggle={[MockFunction]}
+ onLocationSelect={[MockFunction]}
+ onSymbolClick={[MockFunction]}
+ previousLine={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 5,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ renderDuplicationPopup={[MockFunction]}
+ scroll={[Function]}
+ secondaryIssueLocations={Array []}
+ verticalBuffer={0}
+ />
+ <Line
+ branchLike={
+ Object {
+ "analysisDate": "2018-01-01",
+ "excludedFromPurge": true,
+ "isMain": true,
+ "name": "master",
+ }
+ }
+ displayAllIssues={false}
+ displayCoverage={true}
+ displayDuplications={false}
+ displayIssues={true}
+ displayLocationMarkers={true}
+ displaySCM={false}
+ duplications={Array []}
+ duplicationsCount={0}
+ highlighted={false}
+ issueLocations={Array []}
+ issues={Array []}
+ key="7"
+ last={false}
+ line={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 7,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ loadDuplications={[MockFunction]}
+ onIssueChange={[MockFunction]}
+ onIssuePopupToggle={[MockFunction]}
+ onIssueSelect={[Function]}
+ onIssueUnselect={[Function]}
+ onIssuesClose={[MockFunction]}
+ onIssuesOpen={[MockFunction]}
+ onLinePopupToggle={[MockFunction]}
+ onLocationSelect={[MockFunction]}
+ onSymbolClick={[MockFunction]}
+ previousLine={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 6,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ renderDuplicationPopup={[MockFunction]}
+ scroll={[Function]}
+ secondaryIssueLocations={Array []}
+ verticalBuffer={0}
+ />
+ </tbody>
+ </table>
+ <div
+ className="expand-block expand-block-below"
+ >
+ <button
+ aria-label="source_viewer.expand_below"
+ onClick={[Function]}
+ type="button"
+ >
+ <ExpandSnippetIcon />
+ </button>
+ </div>
+ </div>
+</div>
+`;
diff --git a/server/sonar-web/src/main/js/apps/securityHotspots/components/HotspotSnippetContainerRenderer.tsx b/server/sonar-web/src/main/js/apps/securityHotspots/components/HotspotSnippetContainerRenderer.tsx
index 03f708f70ac..f743bef4d05 100644
--- a/server/sonar-web/src/main/js/apps/securityHotspots/components/HotspotSnippetContainerRenderer.tsx
+++ b/server/sonar-web/src/main/js/apps/securityHotspots/components/HotspotSnippetContainerRenderer.tsx
@@ -61,6 +61,7 @@ export default function HotspotSnippetContainerRenderer(
<SourceViewerHeaderSlim
branchLike={branchLike}
expandable={false}
+ linkToProject={false}
loading={loading}
onExpand={noop}
sourceViewerFile={sourceViewerFile}
@@ -72,6 +73,7 @@ export default function HotspotSnippetContainerRenderer(
<SnippetViewer
branchLike={branchLike}
component={sourceViewerFile}
+ displaySCM={false}
expandBlock={(_i, direction) => props.onExpandBlock(direction)}
handleCloseIssues={noop}
handleLinePopupToggle={props.onLinePopupToggle}
diff --git a/server/sonar-web/src/main/js/apps/securityHotspots/components/__tests__/__snapshots__/HotspotSnippetContainerRenderer-test.tsx.snap b/server/sonar-web/src/main/js/apps/securityHotspots/components/__tests__/__snapshots__/HotspotSnippetContainerRenderer-test.tsx.snap
index a04c877efa8..08bcc2a1b2d 100644
--- a/server/sonar-web/src/main/js/apps/securityHotspots/components/__tests__/__snapshots__/HotspotSnippetContainerRenderer-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/securityHotspots/components/__tests__/__snapshots__/HotspotSnippetContainerRenderer-test.tsx.snap
@@ -14,6 +14,7 @@ exports[`should render correctly 1`] = `
}
}
expandable={false}
+ linkToProject={false}
loading={false}
onExpand={[Function]}
sourceViewerFile={
@@ -54,6 +55,7 @@ exports[`should render correctly: with sourcelines 1`] = `
}
}
expandable={false}
+ linkToProject={false}
loading={false}
onExpand={[Function]}
sourceViewerFile={
@@ -128,6 +130,7 @@ exports[`should render correctly: with sourcelines 1`] = `
"uuid": "foo-bar",
}
}
+ displaySCM={false}
expandBlock={[Function]}
handleCloseIssues={[Function]}
handleLinePopupToggle={[MockFunction]}
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx
index af43dbb1a5a..6a2fdb3240a 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx
@@ -31,12 +31,14 @@ import { getPathUrlAsString } from 'sonar-ui-common/helpers/urls';
import { getBranchLikeQuery, isMainBranch } from '../../helpers/branch-like';
import { getBranchLikeUrl, getComponentIssuesUrl } from '../../helpers/urls';
import { BranchLike } from '../../types/branch-like';
+import { ComponentQualifier } from '../../types/component';
import Favorite from '../controls/Favorite';
import './SourceViewerHeaderSlim.css';
export interface Props {
branchLike: BranchLike | undefined;
expandable?: boolean;
+ linkToProject?: boolean;
loading?: boolean;
onExpand?: () => void;
sourceViewerFile: T.SourceViewerFile;
@@ -45,6 +47,7 @@ export interface Props {
export default function SourceViewerHeaderSlim({
branchLike,
expandable,
+ linkToProject = true,
loading,
onExpand,
sourceViewerFile
@@ -60,20 +63,31 @@ export default function SourceViewerHeaderSlim({
subProjectName
} = sourceViewerFile;
+ const projectNameLabel = (
+ <>
+ <QualifierIcon qualifier={ComponentQualifier.Project} /> <span>{projectName}</span>
+ </>
+ );
+
return (
<div className="source-viewer-header-slim display-flex-row display-flex-space-between">
<div className="display-flex-center flex-1">
<div>
- <a
- className="link-with-icon"
- href={getPathUrlAsString(getBranchLikeUrl(project, branchLike))}>
- <QualifierIcon qualifier="TRK" /> <span>{projectName}</span>
- </a>
+ {linkToProject ? (
+ <a
+ className="link-with-icon"
+ href={getPathUrlAsString(getBranchLikeUrl(project, branchLike))}>
+ {projectNameLabel}
+ </a>
+ ) : (
+ projectNameLabel
+ )}
</div>
{subProject !== undefined && (
<>
- <QualifierIcon qualifier="BRC" /> <span>{subProjectName}</span>
+ <QualifierIcon qualifier={ComponentQualifier.SubProject} />{' '}
+ <span>{subProjectName}</span>
</>
)}
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx
index 5c0034bde2e..33b9f28e187 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx
@@ -25,6 +25,7 @@ import SourceViewerHeaderSlim, { Props } from '../SourceViewerHeaderSlim';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ linkToProject: false })).toMatchSnapshot('no link to project');
});
it('should allow to mark as favorite', () => {
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap
index 29201d1a3fd..562bad0d91b 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap
@@ -174,3 +174,82 @@ exports[`should render correctly for subproject 1`] = `
</DeferredSpinner>
</div>
`;
+
+exports[`should render correctly: no link to project 1`] = `
+<div
+ className="source-viewer-header-slim display-flex-row display-flex-space-between"
+>
+ <div
+ className="display-flex-center flex-1"
+ >
+ <div>
+ <QualifierIcon
+ qualifier="TRK"
+ />
+
+ <span>
+ MyProject
+ </span>
+ </div>
+ <div
+ className="spacer-left"
+ >
+ <QualifierIcon
+ qualifier="FIL"
+ />
+
+ <span>
+ foo/
+ </span>
+ <span
+ className="component-name-file"
+ >
+ bar.ts
+ </span>
+ </div>
+ <div
+ className="spacer-left"
+ >
+ <ClipboardIconButton
+ className="button-link link-no-underline"
+ copyValue="foo/bar.ts"
+ />
+ </div>
+ </div>
+ <div
+ className="flex-0 big-spacer-left"
+ >
+ <Link
+ onlyActiveOnIndex={false}
+ style={Object {}}
+ to={
+ Object {
+ "pathname": "/project/issues",
+ "query": Object {
+ "fileUuids": "foo-bar",
+ "id": "my-project",
+ "resolved": "false",
+ },
+ }
+ }
+ >
+ source_viewer.view_all_issues
+ </Link>
+ </div>
+ <DeferredSpinner
+ className="little-spacer-right"
+ timeout={100}
+ >
+ <div
+ className="flex-0 big-spacer-left"
+ >
+ <ButtonIcon
+ className="js-actions"
+ onClick={[MockFunction]}
+ >
+ <ExpandSnippetIcon />
+ </ButtonIcon>
+ </div>
+ </DeferredSpinner>
+</div>
+`;
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx
index 2c43c1d30fc..203321d80a3 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx
@@ -39,6 +39,7 @@ interface Props {
displayIssueLocationsLink?: boolean;
displayIssues: boolean;
displayLocationMarkers?: boolean;
+ displaySCM?: boolean;
duplications: number[];
duplicationsCount: number;
highlighted: boolean;
@@ -97,7 +98,14 @@ export default class Line extends React.PureComponent<Props> {
};
render() {
- const { displayCoverage, duplications, duplicationsCount, issuePopup, line } = this.props;
+ const {
+ displayCoverage,
+ displaySCM = true,
+ duplications,
+ duplicationsCount,
+ issuePopup,
+ line
+ } = this.props;
const className = classNames('source-line', {
'source-line-highlighted': this.props.highlighted,
'source-line-filtered': line.isNew,
@@ -119,13 +127,14 @@ export default class Line extends React.PureComponent<Props> {
popupOpen={this.isPopupOpen('line-number')}
/>
- <LineSCM
- line={line}
- onPopupToggle={this.props.onLinePopupToggle}
- popupOpen={this.isPopupOpen('scm')}
- previousLine={this.props.previousLine}
- />
-
+ {displaySCM && (
+ <LineSCM
+ line={line}
+ onPopupToggle={this.props.onLinePopupToggle}
+ popupOpen={this.isPopupOpen('scm')}
+ previousLine={this.props.previousLine}
+ />
+ )}
{this.props.displayIssues && !this.props.displayAllIssues ? (
<LineIssuesIndicator
issues={this.props.issues}
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/Line-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/Line-test.tsx
index 123f53a6596..4bff33578fc 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/Line-test.tsx
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/Line-test.tsx
@@ -25,6 +25,7 @@ import Line from '../Line';
it('should render correctly', () => {
expect(shallowRender()).toMatchSnapshot();
+ expect(shallowRender({ displaySCM: false })).toMatchSnapshot('no SCM');
});
it('should render correctly for last, new, and highlighted lines', () => {
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/Line-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/Line-test.tsx.snap
index fee4f4dd800..931708c4071 100644
--- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/Line-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/Line-test.tsx.snap
@@ -902,3 +902,132 @@ exports[`should render correctly with issues info 1`] = `
/>
</tr>
`;
+
+exports[`should render correctly: no SCM 1`] = `
+<tr
+ className="source-line source-line-filtered"
+ data-line-number={16}
+>
+ <LineNumber
+ line={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 16,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ onPopupToggle={[MockFunction]}
+ popupOpen={false}
+ />
+ <td
+ className="source-meta source-line-issues"
+ />
+ <LineCode
+ branchLike={
+ Object {
+ "analysisDate": "2018-01-01",
+ "base": "master",
+ "branch": "feature/foo/bar",
+ "key": "1001",
+ "target": "master",
+ "title": "Foo Bar feature",
+ }
+ }
+ displayLocationMarkers={false}
+ issueLocations={Array []}
+ issues={
+ Array [
+ Object {
+ "actions": Array [],
+ "component": "main.js",
+ "componentLongName": "main.js",
+ "componentQualifier": "FIL",
+ "componentUuid": "foo1234",
+ "creationDate": "2017-03-01T09:36:01+0100",
+ "flows": Array [],
+ "fromHotspot": false,
+ "key": "AVsae-CQS-9G3txfbFN2",
+ "line": 25,
+ "message": "Reduce the number of conditional operators (4) used in the expression",
+ "organization": "myorg",
+ "project": "myproject",
+ "projectKey": "foo",
+ "projectName": "Foo",
+ "projectOrganization": "org",
+ "rule": "javascript:S1067",
+ "ruleName": "foo",
+ "secondaryLocations": Array [],
+ "severity": "MAJOR",
+ "status": "OPEN",
+ "textRange": Object {
+ "endLine": 26,
+ "endOffset": 15,
+ "startLine": 25,
+ "startOffset": 0,
+ },
+ "transitions": Array [],
+ "type": "BUG",
+ },
+ Object {
+ "actions": Array [],
+ "component": "main.js",
+ "componentLongName": "main.js",
+ "componentQualifier": "FIL",
+ "componentUuid": "foo1234",
+ "creationDate": "2017-03-01T09:36:01+0100",
+ "flows": Array [],
+ "fromHotspot": false,
+ "key": "AVsae-CQS-9G3txfbFN2",
+ "line": 25,
+ "message": "Reduce the number of conditional operators (4) used in the expression",
+ "organization": "myorg",
+ "project": "myproject",
+ "projectKey": "foo",
+ "projectName": "Foo",
+ "projectOrganization": "org",
+ "rule": "javascript:S1067",
+ "ruleName": "foo",
+ "secondaryLocations": Array [],
+ "severity": "MAJOR",
+ "status": "OPEN",
+ "textRange": Object {
+ "endLine": 26,
+ "endOffset": 15,
+ "startLine": 25,
+ "startOffset": 0,
+ },
+ "transitions": Array [],
+ "type": "VULNERABILITY",
+ },
+ ]
+ }
+ line={
+ Object {
+ "code": "<span class=\\"k\\">import</span> java.util.<span class=\\"sym-9 sym\\">ArrayList</span>;",
+ "coverageStatus": "covered",
+ "coveredConditions": 2,
+ "duplicated": false,
+ "isNew": true,
+ "line": 16,
+ "scmAuthor": "simon.brandhof@sonarsource.com",
+ "scmDate": "2018-12-11T10:48:39+0100",
+ "scmRevision": "80f564becc0c0a1c9abaa006eca83a4fd278c3f0",
+ }
+ }
+ onIssueChange={[MockFunction]}
+ onIssuePopupToggle={[MockFunction]}
+ onIssueSelect={[MockFunction]}
+ onLocationSelect={[MockFunction]}
+ onSymbolClick={[MockFunction]}
+ scroll={[MockFunction]}
+ secondaryIssueLocations={Array []}
+ showIssues={false}
+ />
+</tr>
+`;