]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-23363 fix naming issue with set_severity endpoint
authorstanislavh <stanislav.honcharov@sonarsource.com>
Fri, 8 Nov 2024 10:58:13 +0000 (11:58 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 11 Nov 2024 20:02:44 +0000 (20:02 +0000)
server/sonar-web/src/main/js/api/issues.ts
server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts
server/sonar-web/src/main/js/apps/issues/components/IssueHeader.tsx
server/sonar-web/src/main/js/components/issue/components/IssueView.tsx

index 68dc4421299435f77427cb632d12a706c2f39eb1..050acb32f536bb5264c7af3dee75d4a66608ef8f 100644 (file)
@@ -106,7 +106,7 @@ export function setIssueAssignee(data: {
 }
 
 export function setIssueSeverity(data: {
-  impacts?: string;
+  impact?: string;
   issue: string;
   severity?: IssueSeverity;
 }): Promise<IssueResponse> {
index 69b1c2281c9d57b2656077ba0066061e11df8874..aa20fa13185538fde7482e6431af097305eea940 100644 (file)
@@ -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]
index 99b65666e916d5ea8283456ed6b066187b745d4b..99d2cccca84e0ad1c3067e7fafdf072fbdf6a933 100644 (file)
@@ -108,7 +108,7 @@ export default class IssueHeader extends React.PureComponent<Props, State> {
     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
index 7304d6f54551551d72dc1cf92a1f638f3ac2ac41..8dd3ddf546814707d8ad46cd40c2ac62eaec4416 100644 (file)
@@ -94,7 +94,7 @@ export default function IssueView(props: Readonly<Props>) {
     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