-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
44 changed files
with
4,721 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...c/main/kotlin/com/saveourtool/save/cosv/frontend/components/basic/CosvOrganizationType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.saveourtool.save.cosv.frontend.components.basic | ||
|
||
import com.saveourtool.save.frontend.common.components.views.organization.OrganizationMenuBar | ||
import com.saveourtool.save.frontend.common.components.views.organization.OrganizationType | ||
|
||
object CosvOrganizationType : OrganizationType { | ||
override val listTab: Array<OrganizationMenuBar> = arrayOf( | ||
OrganizationMenuBar.INFO, | ||
OrganizationMenuBar.VULNERABILITIES, | ||
OrganizationMenuBar.SETTINGS | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
.../main/kotlin/com/saveourtool/save/frontend/common/components/basic/TestSuitesDisplayer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
@file:Suppress( | ||
"FILE_NAME_MATCH_CLASS", | ||
"FILE_WILDCARD_IMPORTS", | ||
"WildcardImport", | ||
"HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE", | ||
) | ||
|
||
package com.saveourtool.save.frontend.common.components.basic | ||
|
||
import com.saveourtool.save.frontend.common.components.basic.testsuiteselector.TestSuiteSelectorMode | ||
import com.saveourtool.save.testsuite.TestSuiteVersioned | ||
|
||
import react.ChildrenBuilder | ||
import react.dom.html.ReactHTML.a | ||
import react.dom.html.ReactHTML.div | ||
import react.dom.html.ReactHTML.h5 | ||
import react.dom.html.ReactHTML.p | ||
import react.dom.html.ReactHTML.small | ||
import web.cssom.ClassName | ||
|
||
/** | ||
* @param testSuites | ||
* @param selectedTestSuites | ||
* @param displayMode if used not inside TestSuiteSelector, should be null, otherwise should be mode of TestSuiteSelector | ||
* @param onTestSuiteClick | ||
*/ | ||
@Suppress("TOO_LONG_FUNCTION", "LongMethod") | ||
fun ChildrenBuilder.showAvailableTestSuites( | ||
testSuites: List<TestSuiteVersioned>, | ||
selectedTestSuites: List<TestSuiteVersioned>, | ||
displayMode: TestSuiteSelectorMode?, | ||
onTestSuiteClick: (TestSuiteVersioned) -> Unit, | ||
) { | ||
div { | ||
className = ClassName("list-group") | ||
testSuites.forEach { testSuite -> | ||
val active = if (testSuite in selectedTestSuites) { | ||
"active" | ||
} else { | ||
"" | ||
} | ||
a { | ||
className = ClassName("btn list-group-item list-group-item-action $active") | ||
onClick = { | ||
onTestSuiteClick(testSuite) | ||
} | ||
div { | ||
className = ClassName("d-flex w-100 justify-content-between") | ||
h5 { | ||
className = ClassName("mb-1") | ||
+(testSuite.name) | ||
} | ||
small { | ||
+testSuite.language | ||
} | ||
} | ||
div { | ||
className = ClassName("clearfix mb-1") | ||
div { | ||
className = ClassName("float-left") | ||
p { | ||
+testSuite.description | ||
} | ||
} | ||
div { | ||
className = ClassName("float-right") | ||
if (displayMode.shouldDisplayVersion()) { | ||
small { | ||
asDynamic()["data-toggle"] = "tooltip" | ||
asDynamic()["data-placement"] = "bottom" | ||
title = "Hash of commit/branch name/tag name" | ||
+testSuite.version | ||
} | ||
} | ||
} | ||
} | ||
div { | ||
className = ClassName("clearfix") | ||
small { | ||
className = ClassName("float-left") | ||
asDynamic()["data-toggle"] = "tooltip" | ||
asDynamic()["data-placement"] = "bottom" | ||
title = "Test suite tags" | ||
+testSuite.tags | ||
} | ||
|
||
small { | ||
className = ClassName("float-right") | ||
asDynamic()["data-toggle"] = "tooltip" | ||
asDynamic()["data-placement"] = "bottom" | ||
title = "Plugin type" | ||
+testSuite.plugins | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
private fun TestSuiteSelectorMode?.shouldDisplayVersion() = this != null && this != TestSuiteSelectorMode.BROWSER |
Oops, something went wrong.