From fefe7a2a194bdd5ed401de54b552bfc99bf278a6 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Fri, 8 Nov 2024 11:58:13 +0100 Subject: [PATCH] SONAR-23363 fix naming issue with set_severity endpoint --- server/sonar-web/src/main/js/api/issues.ts | 2 +- server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts | 6 +++--- .../src/main/js/apps/issues/components/IssueHeader.tsx | 2 +- .../src/main/js/components/issue/components/IssueView.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/sonar-web/src/main/js/api/issues.ts b/server/sonar-web/src/main/js/api/issues.ts index 68dc4421299..050acb32f53 100644 --- a/server/sonar-web/src/main/js/api/issues.ts +++ b/server/sonar-web/src/main/js/api/issues.ts @@ -106,7 +106,7 @@ export function setIssueAssignee(data: { } export function setIssueSeverity(data: { - impacts?: string; + impact?: string; issue: string; severity?: IssueSeverity; }): Promise { 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 69b1c2281c9..aa20fa13185 100644 --- a/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts @@ -520,17 +520,17 @@ export default class IssuesServiceMock { return this.getActionsResponse({ type: data.type }, data.issue); }; - handleSetIssueSeverity = (data: { impacts?: string; issue: string; severity?: string }) => { + handleSetIssueSeverity = (data: { impact?: string; issue: string; severity?: string }) => { const issueDataSelected = this.list.find((l) => l.issue.key === data.issue); if (!issueDataSelected) { throw new Error(`Coulnd't find issue for key ${data.issue}`); } - const parsedImpact = data.impacts?.split('='); + const parsedImpact = data.impact?.split('='); return this.getActionsResponse( - data.impacts + data.impact ? { impacts: issueDataSelected.issue.impacts.map((impact) => impact.softwareQuality === parsedImpact?.[0] diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx index 99b65666e91..99d2cccca84 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx @@ -108,7 +108,7 @@ export default class IssueHeader extends React.PureComponent { const { issue } = this.props; const data = quality - ? { issue: issue.key, impacts: `${quality}=${severity}` } + ? { issue: issue.key, impact: `${quality}=${severity}` } : { issue: issue.key, severity: severity as IssueSeverity }; const severityBefore = quality diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueView.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueView.tsx index 7304d6f5455..8dd3ddf5468 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueView.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueView.tsx @@ -94,7 +94,7 @@ export default function IssueView(props: Readonly) { const { issue } = props; const data = quality - ? { issue: issue.key, impacts: `${quality}=${severity}` } + ? { issue: issue.key, impact: `${quality}=${severity}` } : { issue: issue.key, severity: severity as IssueSeverity }; const severityBefore = quality -- 2.39.5