aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2022-09-13 17:10:26 +0200
committersonartech <sonartech@sonarsource.com>2022-09-16 20:03:14 +0000
commit227f5d3bfc797c8ecc7ebe7e283af3b68522c1ad (patch)
tree4034b980dd5be42cbd58ea8a3a7c508f0c60d953 /server/sonar-web/src/main/js/api
parent6f2881c71996715ba3a9a7b2451f008c2239d7eb (diff)
downloadsonarqube-227f5d3bfc797c8ecc7ebe7e283af3b68522c1ad.tar.gz
sonarqube-227f5d3bfc797c8ecc7ebe7e283af3b68522c1ad.zip
SONAR-17285 Display new data and execution type flows for issues
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r--server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts93
-rw-r--r--server/sonar-web/src/main/js/api/webhooks.ts3
2 files changed, 95 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts
index cca51bbd35f..243c522293a 100644
--- a/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts
+++ b/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts
@@ -44,6 +44,7 @@ import {
import { Standards } from '../../types/security';
import {
Dict,
+ FlowType,
RuleActivation,
RuleDetails,
SnippetsByComponent,
@@ -97,6 +98,98 @@ export default class IssuesServiceMock {
this.list = [
{
issue: mockRawIssue(false, {
+ key: 'issue11',
+ component: 'project:file.foo',
+ message: 'FlowIssue',
+ rule: 'simpleRuleId',
+ textRange: {
+ startLine: 10,
+ endLine: 10,
+ startOffset: 0,
+ endOffset: 2
+ },
+ flows: [
+ {
+ type: FlowType.DATA,
+ description: 'Backtracking 1',
+ locations: [
+ {
+ component: 'project:file.foo',
+ msg: 'Data location 1',
+ textRange: {
+ startLine: 20,
+ endLine: 20,
+ startOffset: 0,
+ endOffset: 1
+ }
+ },
+ {
+ component: 'project:file.foo',
+ msg: 'Data location 2',
+ textRange: {
+ startLine: 21,
+ endLine: 21,
+ startOffset: 0,
+ endOffset: 1
+ }
+ }
+ ]
+ },
+ {
+ type: FlowType.EXECUTION,
+ locations: [
+ {
+ component: 'project:file.bar',
+ msg: 'Execution location 1',
+ textRange: {
+ startLine: 20,
+ endLine: 20,
+ startOffset: 0,
+ endOffset: 1
+ }
+ },
+ {
+ component: 'project:file.bar',
+ msg: 'Execution location 2',
+ textRange: {
+ startLine: 22,
+ endLine: 22,
+ startOffset: 0,
+ endOffset: 1
+ }
+ },
+ {
+ component: 'project:file.bar',
+ msg: 'Execution location 3',
+ textRange: {
+ startLine: 5,
+ endLine: 5,
+ startOffset: 0,
+ endOffset: 1
+ }
+ }
+ ]
+ }
+ ]
+ }),
+ snippets: keyBy(
+ [
+ mockSnippetsByComponent(
+ 'file.foo',
+ 'project',
+ times(40, i => i + 1)
+ ),
+ mockSnippetsByComponent(
+ 'file.bar',
+ 'project',
+ times(40, i => i + 1)
+ )
+ ],
+ 'component.key'
+ )
+ },
+ {
+ issue: mockRawIssue(false, {
key: 'issue0',
component: 'project:file.foo',
message: 'Issue on file',
diff --git a/server/sonar-web/src/main/js/api/webhooks.ts b/server/sonar-web/src/main/js/api/webhooks.ts
index 3c9fe1300ef..b61b549b526 100644
--- a/server/sonar-web/src/main/js/api/webhooks.ts
+++ b/server/sonar-web/src/main/js/api/webhooks.ts
@@ -19,7 +19,8 @@
*/
import { throwGlobalError } from '../helpers/error';
import { getJSON, post, postJSON } from '../helpers/request';
-import { Paging, Webhook, WebhookDelivery } from '../types/types';
+import { Paging } from '../types/types';
+import { Webhook, WebhookDelivery } from '../types/webhook';
export function createWebhook(data: {
name: string;