aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/rules
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2022-07-08 11:23:32 +0200
committersonartech <sonartech@sonarsource.com>2022-07-11 20:13:11 +0000
commit6f6c31272190acb041d97a9fc8b6193c5f7d82da (patch)
tree57cf45da71315212de5a02a2c6fcad177833578e /server/sonar-web/src/main/js/components/rules
parent12b488c80a45f27b5176557a9c7e1a24dcab83d4 (diff)
downloadsonarqube-6f6c31272190acb041d97a9fc8b6193c5f7d82da.tar.gz
sonarqube-6f6c31272190acb041d97a9fc8b6193c5f7d82da.zip
SONAR-16598 Rename generic concept to education principles
Diffstat (limited to 'server/sonar-web/src/main/js/components/rules')
-rw-r--r--server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx23
-rw-r--r--server/sonar-web/src/main/js/components/rules/educationPrinciples/DefenseInDepth.tsx (renamed from server/sonar-web/src/main/js/components/rules/genericConcepts/DefenseInDepth.tsx)0
-rw-r--r--server/sonar-web/src/main/js/components/rules/educationPrinciples/LeastTrustPrinciple.tsx (renamed from server/sonar-web/src/main/js/components/rules/genericConcepts/LeastTrustPrinciple.tsx)0
-rw-r--r--server/sonar-web/src/main/js/components/rules/style.css4
4 files changed, 15 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx b/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx
index 7e51817a4f4..d083f47d3a4 100644
--- a/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx
+++ b/server/sonar-web/src/main/js/components/rules/MoreInfoRuleDescription.tsx
@@ -21,22 +21,25 @@ import * as React from 'react';
import { RuleDescriptionSection } from '../../apps/coding-rules/rule';
import { translate } from '../../helpers/l10n';
import { Dict } from '../../types/types';
-import DefenseInDepth from './genericConcepts/DefenseInDepth';
-import LeastTrustPrinciple from './genericConcepts/LeastTrustPrinciple';
+import DefenseInDepth from './educationPrinciples/DefenseInDepth';
+import LeastTrustPrinciple from './educationPrinciples/LeastTrustPrinciple';
import RuleDescription from './RuleDescription';
import './style.css';
interface Props {
sections?: RuleDescriptionSection[];
- genericConcepts?: string[];
+ educationPrinciples?: string[];
}
-const GENERIC_CONCPET_MAP: Dict<React.ComponentType> = {
+const EDUCATION_PRINCIPLES_MAP: Dict<React.ComponentType> = {
defense_in_depth: DefenseInDepth,
least_trust_principle: LeastTrustPrinciple
};
-export default function MoreInfoRuleDescription({ sections = [], genericConcepts = [] }: Props) {
+export default function MoreInfoRuleDescription({
+ sections = [],
+ educationPrinciples = []
+}: Props) {
return (
<>
{sections.length > 0 && (
@@ -50,20 +53,20 @@ export default function MoreInfoRuleDescription({ sections = [], genericConcepts
</>
)}
- {genericConcepts.length > 0 && (
+ {educationPrinciples.length > 0 && (
<>
<div className="big-padded-left big-padded-right rule-desc">
<h2 className="null-spacer-top">
- {translate('coding_rules.more_info.generic_concept.title')}
+ {translate('coding_rules.more_info.education_principles.title')}
</h2>
</div>
- {genericConcepts.map(key => {
- const Concept = GENERIC_CONCPET_MAP[key];
+ {educationPrinciples.map(key => {
+ const Concept = EDUCATION_PRINCIPLES_MAP[key];
if (Concept === undefined) {
return null;
}
return (
- <div key={key} className="generic-concept rule-desc">
+ <div key={key} className="education-principles rule-desc">
<Concept />
</div>
);
diff --git a/server/sonar-web/src/main/js/components/rules/genericConcepts/DefenseInDepth.tsx b/server/sonar-web/src/main/js/components/rules/educationPrinciples/DefenseInDepth.tsx
index e338d15b045..e338d15b045 100644
--- a/server/sonar-web/src/main/js/components/rules/genericConcepts/DefenseInDepth.tsx
+++ b/server/sonar-web/src/main/js/components/rules/educationPrinciples/DefenseInDepth.tsx
diff --git a/server/sonar-web/src/main/js/components/rules/genericConcepts/LeastTrustPrinciple.tsx b/server/sonar-web/src/main/js/components/rules/educationPrinciples/LeastTrustPrinciple.tsx
index 5c2f8fb132c..5c2f8fb132c 100644
--- a/server/sonar-web/src/main/js/components/rules/genericConcepts/LeastTrustPrinciple.tsx
+++ b/server/sonar-web/src/main/js/components/rules/educationPrinciples/LeastTrustPrinciple.tsx
diff --git a/server/sonar-web/src/main/js/components/rules/style.css b/server/sonar-web/src/main/js/components/rules/style.css
index de8c16594e0..e0c36bff985 100644
--- a/server/sonar-web/src/main/js/components/rules/style.css
+++ b/server/sonar-web/src/main/js/components/rules/style.css
@@ -18,8 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-.generic-concept {
- background-color: var(--genericConceptBgColor);
+.education-principles {
+ background-color: var(--educationPrinciplesBgColor);
border-radius: 2px;
display: inline-block;
margin-left: 16px;