diff --git a/.gitignore b/.gitignore index 3a568a5..a2090e1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/** !**/src/test/** +work/ ### STS ### .apt_generated diff --git a/pom.xml b/pom.xml index 49139ec..ed880d6 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ org.jenkins-ci.plugins plugin - 3.57 + 4.9 @@ -33,7 +33,7 @@ org.jenkins-ci.plugins.workflow workflow-multibranch - 2.21 + 2.9.2 diff --git a/src/main/java/org/jenkinsci/plugins/environmentdashboard/DeploymentView.java b/src/main/java/org/jenkinsci/plugins/environmentdashboard/DeploymentView.java index 7a26624..4859925 100644 --- a/src/main/java/org/jenkinsci/plugins/environmentdashboard/DeploymentView.java +++ b/src/main/java/org/jenkinsci/plugins/environmentdashboard/DeploymentView.java @@ -48,7 +48,8 @@ private List getEnvs(TopLevelItem item) { return runs .stream() - .map(run -> run.getAction(DeploymentAction.class)) + .map(run -> run.getActions(DeploymentAction.class)) + .flatMap(List::stream) .filter(Objects::nonNull) .collect(Collectors.groupingBy(DeploymentAction::getEnv)) .entrySet() diff --git a/src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly b/src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly index 01b762b..1a763f1 100644 --- a/src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly +++ b/src/main/resources/org/jenkinsci/plugins/environmentdashboard/DeploymentView/main.jelly @@ -18,7 +18,7 @@
- + - + + + + + + + + + - - - - - - - + + + + + + + - - + +
@@ -46,35 +46,49 @@
+ ${unit.getJob().name} + +
+ +
+
- - ${unit.getJob().name} - - - - ${environment.getName()} - - - - ${environment.getCurrentAction().buildNumber} - - - - - ${environment.getCurrentAction().run.timestampString} -
+ + + ${environment.getName()} + + + + ${environment.getCurrentAction().buildNumber} + + + + + ${environment.getCurrentAction().run.timestampString} +
@@ -155,6 +169,17 @@ window.addEventListener('click', windowClose); span.addEventListener('click', close); } + + const apps = document.querySelectorAll(".toggle button"); + + apps.forEach((apps) => + apps.addEventListener("click", (event) => { + event.currentTarget + .closest(".apps") + .nextElementSibling.classList.toggle("hideRows"); + event.currentTarget.querySelector(".toggle img").classList.toggle("expand"); + }) + ); diff --git a/src/main/webapp/chevron.svg b/src/main/webapp/chevron.svg new file mode 100644 index 0000000..693795b --- /dev/null +++ b/src/main/webapp/chevron.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/main/webapp/css/blink.css b/src/main/webapp/css/blink.css index 525e917..b7542e5 100644 --- a/src/main/webapp/css/blink.css +++ b/src/main/webapp/css/blink.css @@ -86,4 +86,32 @@ .modal-body tbody tr:first-child th:first-child { padding: .7em !important; +} + +.hideRows { + display: none; +} + +.toggle { + float: right !important; +} + +.toggle button { + border: 0; + padding: 0 !important; + background-color: transparent; +} + +.toggle img { + height: 20px; + vertical-align: middle; + transition: transform 0.2s, -webkit-transform 0.2s; +} + +.toggle img.expand { + transform: rotate(180deg); +} + +.toggle span { + vertical-align: middle !important; } \ No newline at end of file