From f9618beb77ff00ab5b8da035178bd04499376ed4 Mon Sep 17 00:00:00 2001 From: Sophio Japharidze Date: Tue, 19 Nov 2024 16:40:37 +0100 Subject: [PATCH] SLVSCODE-891 new icons for standard severity mode --- images/severity/blocker.png | Bin 459 -> 0 bytes images/severity/blocker.svg | 24 +++++++++++++++ images/severity/critical.png | Bin 555 -> 0 bytes images/severity/critical.svg | 24 +++++++++++++++ images/severity/info.png | Bin 460 -> 0 bytes images/severity/info.svg | 24 +++++++++++++++ images/severity/major.png | Bin 579 -> 0 bytes images/severity/major.svg | 24 +++++++++++++++ images/severity/minor.png | Bin 552 -> 0 bytes images/severity/minor.svg | 24 +++++++++++++++ images/standardMode/bug/blocker.svg | 29 ++++++++++++++++++ images/standardMode/bug/critical.svg | 29 ++++++++++++++++++ images/standardMode/bug/info.svg | 29 ++++++++++++++++++ images/standardMode/bug/major.svg | 29 ++++++++++++++++++ images/standardMode/bug/minor.svg | 29 ++++++++++++++++++ images/standardMode/code_smell/blocker.svg | 26 ++++++++++++++++ images/standardMode/code_smell/critical.svg | 26 ++++++++++++++++ images/standardMode/code_smell/info.svg | 26 ++++++++++++++++ images/standardMode/code_smell/major.svg | 26 ++++++++++++++++ images/standardMode/code_smell/minor.svg | 26 ++++++++++++++++ images/standardMode/vulnerability/blocker.svg | 26 ++++++++++++++++ .../standardMode/vulnerability/critical.svg | 26 ++++++++++++++++ images/standardMode/vulnerability/info.svg | 26 ++++++++++++++++ images/standardMode/vulnerability/major.svg | 26 ++++++++++++++++ images/standardMode/vulnerability/minor.svg | 26 ++++++++++++++++ src/rules/rulepanel.ts | 23 ++++++++------ styles/rule.css | 10 +++--- 27 files changed, 543 insertions(+), 15 deletions(-) delete mode 100644 images/severity/blocker.png create mode 100644 images/severity/blocker.svg delete mode 100644 images/severity/critical.png create mode 100644 images/severity/critical.svg delete mode 100644 images/severity/info.png create mode 100644 images/severity/info.svg delete mode 100644 images/severity/major.png create mode 100644 images/severity/major.svg delete mode 100644 images/severity/minor.png create mode 100644 images/severity/minor.svg create mode 100644 images/standardMode/bug/blocker.svg create mode 100644 images/standardMode/bug/critical.svg create mode 100644 images/standardMode/bug/info.svg create mode 100644 images/standardMode/bug/major.svg create mode 100644 images/standardMode/bug/minor.svg create mode 100644 images/standardMode/code_smell/blocker.svg create mode 100644 images/standardMode/code_smell/critical.svg create mode 100644 images/standardMode/code_smell/info.svg create mode 100644 images/standardMode/code_smell/major.svg create mode 100644 images/standardMode/code_smell/minor.svg create mode 100644 images/standardMode/vulnerability/blocker.svg create mode 100644 images/standardMode/vulnerability/critical.svg create mode 100644 images/standardMode/vulnerability/info.svg create mode 100644 images/standardMode/vulnerability/major.svg create mode 100644 images/standardMode/vulnerability/minor.svg diff --git a/images/severity/blocker.png b/images/severity/blocker.png deleted file mode 100644 index 96e52eae70f2ca677765b4ef24a4391d1cf6fb92..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 459 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkEE<$#t2Ur#}JFtYbWpaXL1y1-yeHEyTgM~ zDm%Vc%28WbNv$L!HK&6$>c$F{f2wMBUN3cfSZ_`2SQy&TX|~VGlucT1C)?9wY-sQ{_z9@@^ly<$9}4;+mqTWEsniKWj6&JH)d) zaxcBEzE00Cis9>%$8F~&cnr5}<~(rwonrj^bsH9Z@nT*ioqBz0Y(oF}c6+(Q^8FVd zfBw5BYL1Vg4DU{c!v>f4Pq};U&$4ULdJa=`$}TpjiZk$(GfI49TEgAHAo2CIu)*8j zx_x^-?b-Ek-t83oD(w?y_7@uKnpUbD3=xujk#F3j^_po_-)8=Zdq4DZT^x^!@WnVR z3DH>mW!HE8tZlthPbWY9bS3BZ?DrZWS%0klUo<+keKYszj>(LFWW|<0;>ezS^z`Mv y(;+ + + + diff --git a/images/severity/critical.png b/images/severity/critical.png deleted file mode 100644 index 354276b0d730715ac5f00c85d4af8af5423661c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 555 zcmV+`0@VG9P)0=fSz~k0G7Hn=^$& zj^j?N=mc;)lGj0>wRc33zw@(iMeyAfHjNE+XEkm%-yMKxBRtYhnxsylVi| z9y~;?jZ;-buEr3F+uoPUeT*xMF&w^qlitxH0Ndq&&o^$RA>mJJ2hP2I{@nmLjys(; z_m^f8GeGZXk^a&QVoWUcxW-HYn7y8KGHvb~AL|;vZ+xs1GMNB?V|1A7%P)R!E_%lh z_8riR$cJ0;tZ;v9-9AK=OqV00nTOoXzIi#&DzZmgf5pe7koa_vn!X zpw{xGbcc2rvj5~D&9x1H%@jZvTD2d;pStLmLzU4D}JnO4tU tJm?xTr7$6IB3k#lz(Nl3 + + + diff --git a/images/severity/info.png b/images/severity/info.png deleted file mode 100644 index 6a40eceeeff86e03f22a27cfa26b74b9ec765474..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 460 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_Gz7y~NYkmHit&dp`<}hmbrgv9 ztgJ89?J8P!$+L~2I6-7_Zhe*Vtk~&k*PmXNc3m40RhiDvmaigywqQTo9hG@~K{Cvtj^TsNSEiFY+?X{~uS!07@9YrI zFZ-aj>zDakNk5Ji;$?AD6WI4P8Jg|V>-{0Y>h|sL%QXFMr*?Y1b`VKDFlz~q^6s)d zwdNm%9`x<%us{d4nm?^dg4%UFa0!=1s?)z4*}Q$iB}4#c^3 diff --git a/images/severity/info.svg b/images/severity/info.svg new file mode 100644 index 000000000..7ed433308 --- /dev/null +++ b/images/severity/info.svg @@ -0,0 +1,24 @@ + + + + diff --git a/images/severity/major.png b/images/severity/major.png deleted file mode 100644 index 6984dd022eefd9531ade9b6529488d6d6e274e80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 579 zcmV-J0=)f+P)7*+I_*cgu9x=Ghi9Dse@ z$0^>O0O!0NodIJ;fZL|dq=`nbF@(~oh8Uo0C{8GyLX2sqNC0@9ZUC{C(D)d^!59FQ znOQ0`vj7AKV}!=X5NkbyFo10g#^>YM{X29HL;?7gdr2{qtuI!q1QS;{7`u%4{d`HK z(OONL306A#`x@f)=^U$>Eb1KU9IKfu>(jaV;Rm90^!EX*G!bZStFUx-^UYhnfBZ!0 z!K2+%caGw{3AW2?>^~J@tFQ#{y!|z{f4&uqgd+?2vH|EV%#}nW3Fu$w)u|>U3;A;M z4CtB9Pl?Ddu+c7ARj-|1eD$p5XIeZLJsdD*L?JG4k~-G1K+ca$dddH-egZw)p<7&~ Rm!kjx002ovPDHLkV1jX_0-XQ= diff --git a/images/severity/major.svg b/images/severity/major.svg new file mode 100644 index 000000000..7eb09fd82 --- /dev/null +++ b/images/severity/major.svg @@ -0,0 +1,24 @@ + + + + diff --git a/images/severity/minor.png b/images/severity/minor.png deleted file mode 100644 index 71519d941c57bb4a3a913e7c51d71fdca194100a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 552 zcmV+@0@wYCP)el8&MR7pF4AdQJNVVh%*=iLaU`n6c@U4-G!EvV*Y?@Ep*+zTNl&q{D3AU zD6wvezd>BM(Ygu>O>JQ`i;BsdE+#YiXtHY0>Tt9D696F1)(MTEO2IBuu*;-OD*?Q8KHxri1wbRH(rleXb$hQMS3=0?^$v}o z3Xll;&yAqU>Gcjm2ym4EMAT7)> + + + diff --git a/images/standardMode/bug/blocker.svg b/images/standardMode/bug/blocker.svg new file mode 100644 index 000000000..1fbade914 --- /dev/null +++ b/images/standardMode/bug/blocker.svg @@ -0,0 +1,29 @@ + + + + + diff --git a/images/standardMode/bug/critical.svg b/images/standardMode/bug/critical.svg new file mode 100644 index 000000000..e22d0e6a6 --- /dev/null +++ b/images/standardMode/bug/critical.svg @@ -0,0 +1,29 @@ + + + + + diff --git a/images/standardMode/bug/info.svg b/images/standardMode/bug/info.svg new file mode 100644 index 000000000..d4b19c477 --- /dev/null +++ b/images/standardMode/bug/info.svg @@ -0,0 +1,29 @@ + + + + + diff --git a/images/standardMode/bug/major.svg b/images/standardMode/bug/major.svg new file mode 100644 index 000000000..d023ef45b --- /dev/null +++ b/images/standardMode/bug/major.svg @@ -0,0 +1,29 @@ + + + + + diff --git a/images/standardMode/bug/minor.svg b/images/standardMode/bug/minor.svg new file mode 100644 index 000000000..e13d3e542 --- /dev/null +++ b/images/standardMode/bug/minor.svg @@ -0,0 +1,29 @@ + + + + + diff --git a/images/standardMode/code_smell/blocker.svg b/images/standardMode/code_smell/blocker.svg new file mode 100644 index 000000000..37cc56cc5 --- /dev/null +++ b/images/standardMode/code_smell/blocker.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/code_smell/critical.svg b/images/standardMode/code_smell/critical.svg new file mode 100644 index 000000000..ec50dbc34 --- /dev/null +++ b/images/standardMode/code_smell/critical.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/code_smell/info.svg b/images/standardMode/code_smell/info.svg new file mode 100644 index 000000000..bfc25aa72 --- /dev/null +++ b/images/standardMode/code_smell/info.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/code_smell/major.svg b/images/standardMode/code_smell/major.svg new file mode 100644 index 000000000..a0d9d9895 --- /dev/null +++ b/images/standardMode/code_smell/major.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/code_smell/minor.svg b/images/standardMode/code_smell/minor.svg new file mode 100644 index 000000000..e94281d50 --- /dev/null +++ b/images/standardMode/code_smell/minor.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/vulnerability/blocker.svg b/images/standardMode/vulnerability/blocker.svg new file mode 100644 index 000000000..8c6d21c37 --- /dev/null +++ b/images/standardMode/vulnerability/blocker.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/vulnerability/critical.svg b/images/standardMode/vulnerability/critical.svg new file mode 100644 index 000000000..c5dd6e90d --- /dev/null +++ b/images/standardMode/vulnerability/critical.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/vulnerability/info.svg b/images/standardMode/vulnerability/info.svg new file mode 100644 index 000000000..ad5d069fc --- /dev/null +++ b/images/standardMode/vulnerability/info.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/vulnerability/major.svg b/images/standardMode/vulnerability/major.svg new file mode 100644 index 000000000..6ef9712c3 --- /dev/null +++ b/images/standardMode/vulnerability/major.svg @@ -0,0 +1,26 @@ + + + + diff --git a/images/standardMode/vulnerability/minor.svg b/images/standardMode/vulnerability/minor.svg new file mode 100644 index 000000000..94a1b9b18 --- /dev/null +++ b/images/standardMode/vulnerability/minor.svg @@ -0,0 +1,26 @@ + + + + diff --git a/src/rules/rulepanel.ts b/src/rules/rulepanel.ts index 7460dadf8..1534d84e5 100644 --- a/src/rules/rulepanel.ts +++ b/src/rules/rulepanel.ts @@ -111,6 +111,18 @@ function renderImpact(softwareQuality: string, severity: string, resolver: Resou `; } +function renderStandardModeSeverityDetails(ruleType: string, severity: string, resolver: ResourceResolver) { + const ruleTypeToLowerCase = ruleType.toLocaleLowerCase('en-us'); + const severityToLowerCase = severity.toLocaleLowerCase('en-us'); + const ruleTypeImgSrc = resolver.resolve('images', 'standardMode', ruleTypeToLowerCase, `${severityToLowerCase}.svg`); + const severityImgSrc = resolver.resolve('images', 'severity', `${severityToLowerCase}.svg`); + return `
+ ${clean(ruleType)} +  ${clean(ruleType)}  + ${severityToLowerCase} +
`; +} + function renderTaxonomyInfo(rule: ShowRuleDescriptionParams, resolver: ResourceResolver) { if (rule.severityDetails.impacts && Object.keys(rule.severityDetails.impacts).length > 0) { // Clean Code taxonomy @@ -126,17 +138,8 @@ function renderTaxonomyInfo(rule: ShowRuleDescriptionParams, resolver: ResourceR `; } else { // Old type + severity taxonomy - const severityImgSrc = resolver.resolve('images', 'severity', `${rule.severityDetails.severity.toLowerCase()}.png`); - const typeImgSrc = resolver.resolve('images', 'type', `${rule.severityDetails.type.toLowerCase()}.png`); return `
-
- ${clean(rule.severityDetails.type)} - ${rule.severityDetails.type} -
-
- ${clean(rule.severityDetails.severity)} - ${rule.severityDetails.severity} -
+ ${renderStandardModeSeverityDetails(rule.severityDetails.type, rule.severityDetails.severity, resolver)}
`; } } diff --git a/styles/rule.css b/styles/rule.css index 98585de41..bc337111c 100644 --- a/styles/rule.css +++ b/styles/rule.css @@ -64,31 +64,31 @@ a { border: 1px solid; } -.impact-blocker { +.impact-blocker, .severity-blocker { color: var(--sonarlint-blocker-color); background-color: var(--sonarlint-blocker-background-color); border-color: var(--sonarlint-blocker-border-color); } -.impact-high { +.impact-high, .severity-critical { color: var(--sonarlint-high-color); background-color: var(--sonarlint-high-background-color); border-color: var(--sonarlint-high-border-color); } -.impact-medium { +.impact-medium, .severity-major { color: var(--sonarlint-medium-color); background-color: var(--sonarlint-medium-background-color); border-color: var(--sonarlint-medium-border-color); } -.impact-low { +.impact-low, .severity-minor { color: var(--sonarlint-low-color); background-color: var(--sonarlint-low-background-color); border-color: var(--sonarlint-low-border-color); } -.impact-info { +.impact-info, .severity-info { color: var(--sonarlint-info-color); background-color: var(--sonarlint-info-background-color); border-color: var(--sonarlint-info-border-color);