Skip to content

Commit 838ee31

Browse files
authored
Fix vuln carousel (#2854)
Fix vuln carousel ### What's done: * Fix vuln carousel
1 parent 0db5656 commit 838ee31

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

save-frontend/src/main/kotlin/com/saveourtool/save/frontend/components/views/vuln/VulnerabilityInfoTab.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import com.saveourtool.save.frontend.externals.i18next.TranslationFunction
2323
import com.saveourtool.save.frontend.externals.i18next.useTranslation
2424
import com.saveourtool.save.frontend.utils.*
2525
import com.saveourtool.save.info.UserInfo
26+
import com.saveourtool.save.utils.ELLIPSIS
2627
import com.saveourtool.save.utils.asTimelineEntry
2728
import com.saveourtool.save.utils.getTimeline
2829
import com.saveourtool.save.utils.listToShortString
@@ -299,6 +300,7 @@ val vulnerabilityInfoTab: FC<VulnerabilityInfoTabProps> = FC { props ->
299300
@Suppress("COMPLEX_EXPRESSION")
300301
renderProjects(
301302
"Affected projects".t(),
303+
"affectedCarousel",
302304
VulnerabilityProjectType.PROJECT,
303305
vulnerabilityProjects,
304306
projectTable,
@@ -312,6 +314,7 @@ val vulnerabilityInfoTab: FC<VulnerabilityInfoTabProps> = FC { props ->
312314
@Suppress("COMPLEX_EXPRESSION")
313315
renderProjects(
314316
"Commits with fix".t(),
317+
"commitsCarousel",
315318
VulnerabilityProjectType.COMMIT,
316319
vulnerabilityProjects,
317320
commitFixTable,
@@ -389,6 +392,7 @@ external interface VulnerabilityInfoTabProps : Props {
389392
)
390393
private fun ChildrenBuilder.renderProjects(
391394
sectionName: String,
395+
carouselBodyId: String,
392396
projectType: VulnerabilityProjectType,
393397
projects: List<CosvAffected>,
394398
table: FC<AffectedProjectTableProps>,
@@ -416,7 +420,7 @@ private fun ChildrenBuilder.renderProjects(
416420
} else {
417421
carousel(
418422
projects.toList(),
419-
"carousel",
423+
carouselBodyId,
420424
outerClasses = "border border-secondary",
421425
) {
422426
renderProjectCard(it, projectType, t)
@@ -467,7 +471,7 @@ private fun ChildrenBuilder.renderVersions(versions: List<String?>) {
467471
forEach { span { +it } }
468472
} else {
469473
span { +first() }
470-
+" ... "
474+
+" $ELLIPSIS "
471475
span { +last() }
472476
}
473477
}

0 commit comments

Comments
 (0)