import { LightLabel, Note, SeparatorCircleIcon } from 'design-system';
import React from 'react';
import DateFromNow from '../../../components/intl/DateFromNow';
+import IssuePrioritized from '../../../components/issue/components/IssuePrioritized';
import IssueSeverity from '../../../components/issue/components/IssueSeverity';
import IssueType from '../../../components/issue/components/IssueType';
import { translate } from '../../../helpers/l10n';
<IssueType issue={issue} />
<SeparatorCircleIcon data-guiding-id="issue-4" />
<IssueSeverity issue={issue} />
+ {issue.prioritizedRule && (
+ <>
+ <SeparatorCircleIcon />
+ <IssuePrioritized />
+ </>
+ )}
</Note>
);
}
"key": "AWaqVGl3tut9VbnJvk6M",
"line": 62,
"message": "Make sure this file handling is safe here.",
+ "prioritizedRule": false,
"project": "org.sonarsource.java:java",
"projectEnabled": true,
"projectKey": "org.sonarsource.java:java",
"key": "AWaqVGl3tut9VbnJvk6M",
"line": 62,
"message": "Make sure this file handling is safe here.",
+ "prioritizedRule": false,
"project": "org.sonarsource.java:java",
"projectEnabled": true,
"projectKey": "org.sonarsource.java:java",
import Tooltip from '../../controls/Tooltip';
import DateFromNow from '../../intl/DateFromNow';
import { WorkspaceContext } from '../../workspace/context';
+import IssuePrioritized from './IssuePrioritized';
import IssueSeverity from './IssueSeverity';
import IssueType from './IssueType';
import SonarLintBadge from './SonarLintBadge';
<SeparatorCircleIcon data-guiding-id="issue-4" aria-hidden as="li" />
<IssueSeverity issue={issue} height={12} width={12} />
+
+ {issue.prioritizedRule && (
+ <>
+ <SeparatorCircleIcon aria-hidden as="li" />
+
+ <IssueMetaListItem className={issueMetaListItemClassNames}>
+ <IssuePrioritized />
+ </IssueMetaListItem>
+ </>
+ )}
</ul>
);
}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+import { TextSubdued, Tooltip } from 'design-system';
+import * as React from 'react';
+import { translate } from '../../../helpers/l10n';
+
+export default function IssuePrioritized() {
+ return (
+ <Tooltip overlay={translate('issue.prioritized_rule.description')}>
+ <TextSubdued>{translate('prioritized')}</TextSubdued>
+ </Tooltip>
+ );
+}
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+import { IssueType } from '../../types/issues';
import { parseIssueFromResponse, sortByType } from '../issues';
import { mockIssue } from '../testMocks';
it('should sort issues correctly by type', () => {
- const bug1 = mockIssue(false, { type: 'BUG', key: 'bug1' });
- const bug2 = mockIssue(false, { type: 'BUG', key: 'bug2' });
- const codeSmell = mockIssue(false, { type: 'CODE_SMELL', key: 'code_smell' });
- const vulnerability1 = mockIssue(false, { type: 'VULNERABILITY', key: 'vulnerability1' });
- const vulnerability2 = mockIssue(false, { type: 'VULNERABILITY', key: 'vulnerability2' });
- const securityHotspot = mockIssue(false, { type: 'SECURITY_HOTSPOT', key: 'security_hotspot' });
+ const bug1 = mockIssue(false, { type: IssueType.Bug, key: 'bug1' });
+ const bug2 = mockIssue(false, { type: IssueType.Bug, key: 'bug2' });
+ const codeSmell = mockIssue(false, { type: IssueType.CodeSmell, key: 'code_smell' });
+ const vulnerability1 = mockIssue(false, { type: IssueType.Vulnerability, key: 'vulnerability1' });
+ const vulnerability2 = mockIssue(false, { type: IssueType.Vulnerability, key: 'vulnerability2' });
+ const securityHotspot = mockIssue(false, {
+ type: IssueType.SecurityHotspot,
+ key: 'security_hotspot',
+ });
expect(
sortByType([bug1, codeSmell, bug2, securityHotspot, vulnerability1, vulnerability2]),
impacts: [
{ softwareQuality: SoftwareQuality.Maintainability, severity: SoftwareImpactSeverity.Medium },
],
+ prioritizedRule: false,
...overrides,
};
issueStatus: IssueStatus.Open,
textRange: { startLine: 25, endLine: 26, startOffset: 0, endOffset: 15 },
transitions: [],
- type: 'BUG',
+ type: IssueType.Bug,
cleanCodeAttributeCategory: CleanCodeAttributeCategory.Responsible,
cleanCodeAttribute: CleanCodeAttribute.Respectful,
impacts: [
key: string;
line?: number;
messageFormattings?: MessageFormatting[];
+ prioritizedRule?: boolean;
project: string;
rule: string;
resolution?: string;
CleanCodeAttributeCategory,
SoftwareImpact,
} from './clean-code-taxonomy';
-import { IssueStatus, IssueTransition, MessageFormatting } from './issues';
+import { MessageFormatting, RawIssue } from './issues';
import { NewCodeDefinitionType } from './new-code-definition';
import { UserActive, UserBase } from './users';
manage?: boolean;
}
-export interface Issue {
- actions: string[];
- assignee?: string;
+export interface Issue extends Omit<RawIssue, 'flows' | 'comments'> {
assigneeActive?: boolean;
assigneeAvatar?: string;
assigneeLogin?: string;
assigneeName?: string;
- author?: string;
branch?: string;
- cleanCodeAttributeCategory: CleanCodeAttributeCategory;
- cleanCodeAttribute: CleanCodeAttribute;
- impacts: SoftwareImpact[];
- codeVariants?: string[];
comments?: IssueComment[];
- component: string;
componentEnabled?: boolean;
componentLongName: string;
componentQualifier: string;
componentUuid: string;
- creationDate: string;
effort?: string;
externalRuleEngine?: string;
fromExternalRule?: boolean;
- quickFixAvailable?: boolean;
- key: string;
flows: FlowLocation[][];
flowsWithType: Flow[];
- line?: number;
message: string;
- messageFormattings?: MessageFormatting[];
- project: string;
projectName: string;
projectKey: string;
pullRequest?: string;
- resolution?: string;
- rule: string;
- ruleDescriptionContextKey?: string;
ruleName: string;
- ruleStatus?: string;
- scope: string;
secondaryLocations: FlowLocation[];
- severity: string;
- status: string;
- issueStatus: IssueStatus;
- tags?: string[];
- textRange?: TextRange;
- transitions: IssueTransition[];
- type: IssueType;
}
export interface IssueChangelog {
previous=Previous
previous_=previous
previous_month_x=previous month {month}
+prioritized=Prioritized
profile_name=Profile name
project=Project
project_x=Project: {0}
issue.closed.file_level=This issue is {status}. It was detected in the file below and is no longer being detected.
issue.closed.project_level=This issue is {status}. It was detected in the project below and is no longer being detected.
issues.assignee.change_user=Click to change assignee
+issue.prioritized_rule.description=The associated rule has been designated as a priority in the Quality Profile, indicating that all corresponding issues in Overall Code should be fixed.
issues.action_select=Select issue
issues.action_select.label=Select issue {0}