-
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
diff --git a/src/main/resources/io/jenkins/plugins/pipelinegraphview/consoleview/PipelineConsoleViewAction/widget.jelly b/src/main/resources/io/jenkins/plugins/pipelinegraphview/consoleview/PipelineConsoleViewAction/widget.jelly
new file mode 100644
index 000000000..9295a9db5
--- /dev/null
+++ b/src/main/resources/io/jenkins/plugins/pipelinegraphview/consoleview/PipelineConsoleViewAction/widget.jelly
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/src/main/webapp/js/style.css b/src/main/webapp/js/style.css
index 2710de1de..ffbe4415f 100644
--- a/src/main/webapp/js/style.css
+++ b/src/main/webapp/js/style.css
@@ -23,37 +23,9 @@ h1 {
}
.pgv-details {
- display: flex;
- align-items: center;
- gap: 1rem 1.5rem;
margin-left: 0.25rem;
- margin-bottom: 0.875rem;
- margin-top: -0.25rem;
- flex-wrap: wrap;
-
- @media (width <= 800px) {
- margin-block: 0.75rem 1rem;
- }
-
- & > div {
- display: flex;
- align-items: center;
- gap: 1ch;
- font-size: var(--font-size-sm);
- color: var(--text-color-secondary);
- font-weight: var(--font-bold-weight);
- text-box: trim-both;
-
- a {
- color: inherit;
- }
-
- svg,
- img {
- width: 1.125rem;
- height: 1.125rem;
- }
- }
+ margin-bottom: 0.5rem;
+ margin-top: -0.5rem;
}
.pgv-description {
@@ -61,7 +33,7 @@ h1 {
grid-template-columns: auto 1fr;
gap: 1ch;
align-items: start;
- margin: 0 0 1rem 0.25rem;
+ margin: -0.5rem 0 1rem 0;
& > svg {
width: 1.125rem;
@@ -75,6 +47,10 @@ h1 {
}
}
+.pgv-details + .pgv-description {
+ margin: 0 0 1rem 0.25rem;
+}
+
.pgv-dropdown-item {
display: grid;
grid-template-columns: auto 1fr;
diff --git a/src/test/java/io/jenkins/plugins/pipelinegraphview/cards/items/UpstreamCauseRunDetailsItemTest.java b/src/test/java/io/jenkins/plugins/pipelinegraphview/cards/items/UpstreamCauseRunDetailsItemTest.java
deleted file mode 100644
index a7c622ad1..000000000
--- a/src/test/java/io/jenkins/plugins/pipelinegraphview/cards/items/UpstreamCauseRunDetailsItemTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package io.jenkins.plugins.pipelinegraphview.cards.items;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import hudson.model.Cause;
-import hudson.model.CauseAction;
-import hudson.model.Result;
-import io.jenkins.plugins.pipelinegraphview.Messages;
-import io.jenkins.plugins.pipelinegraphview.cards.RunDetailsItem;
-import io.jenkins.plugins.pipelinegraphview.utils.TestUtils;
-import java.util.Optional;
-import org.jenkinsci.plugins.workflow.job.WorkflowRun;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.jvnet.hudson.test.JenkinsRule;
-import org.jvnet.hudson.test.junit.jupiter.WithJenkins;
-
-@WithJenkins
-class UpstreamCauseRunDetailsItemTest {
-
- private static WorkflowRun run;
- private static String baseUrl;
-
- @BeforeAll
- static void beforeAll(JenkinsRule j) throws Exception {
- run = TestUtils.createAndRunJob(j, "simple", "singleStagePipeline.jenkinsfile", Result.SUCCESS);
- baseUrl = j.getURL().toString();
- }
-
- @BeforeEach
- void setUp() {
- run.removeActions(CauseAction.class);
- }
-
- @Test
- void get_noActionsOfType() {
- Optional
detailsItem = UpstreamCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isEmpty());
- }
-
- @Test
- void get_noUpstreamCause() {
- run.addAction(new CauseAction(new Cause.UserIdCause("User Id")));
-
- Optional detailsItem = UpstreamCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isEmpty());
- }
-
- @Test
- void get() {
- run.addAction(new CauseAction(new Cause.UpstreamCause(run)));
-
- Optional detailsItem = UpstreamCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isPresent());
-
- RunDetailsItem.RunDetail userDetails = (RunDetailsItem.RunDetail) detailsItem.get();
-
- assertEquals(
- new RunDetailsItem.ItemContent.LinkContent(
- baseUrl + run.getUrl() + "pipeline-overview", Messages.cause_upstream("#1")),
- userDetails.content());
- assertEquals("symbol-play-circle-outline plugin-ionicons-api", userDetails.icon());
- }
-}
diff --git a/src/test/java/io/jenkins/plugins/pipelinegraphview/cards/items/UserIdCauseRunDetailsItemTest.java b/src/test/java/io/jenkins/plugins/pipelinegraphview/cards/items/UserIdCauseRunDetailsItemTest.java
deleted file mode 100644
index 891ebc695..000000000
--- a/src/test/java/io/jenkins/plugins/pipelinegraphview/cards/items/UserIdCauseRunDetailsItemTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package io.jenkins.plugins.pipelinegraphview.cards.items;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import hudson.model.Cause;
-import hudson.model.CauseAction;
-import hudson.model.Result;
-import hudson.model.User;
-import io.jenkins.plugins.pipelinegraphview.Messages;
-import io.jenkins.plugins.pipelinegraphview.cards.RunDetailsItem;
-import io.jenkins.plugins.pipelinegraphview.utils.TestUtils;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Optional;
-import org.jenkinsci.plugins.workflow.job.WorkflowRun;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.jvnet.hudson.test.JenkinsRule;
-import org.jvnet.hudson.test.junit.jupiter.WithJenkins;
-
-@WithJenkins
-class UserIdCauseRunDetailsItemTest {
-
- private static WorkflowRun run;
-
- @BeforeAll
- static void beforeAll(JenkinsRule j) throws Exception {
- run = TestUtils.createAndRunJob(j, "simple", "singleStagePipeline.jenkinsfile", Result.SUCCESS);
- }
-
- @BeforeEach
- void setUp() {
- run.removeActions(CauseAction.class);
- User.getAll().forEach(user -> {
- try {
- user.delete();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- });
- }
-
- @Test
- void get_noActionsOfType() {
- Optional detailsItem = UserIdCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isEmpty());
- }
-
- @Test
- void get_noUserIdCause() {
- run.addAction(new CauseAction(new Cause.UpstreamCause(run)));
-
- Optional detailsItem = UserIdCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isEmpty());
- }
-
- @Test
- void get_userNotFound() {
- run.addAction(new CauseAction(new Cause.UserIdCause("User Id")));
-
- Optional detailsItem = UserIdCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isEmpty());
- }
-
- @Test
- void get() {
- run.addAction(new CauseAction(new Cause.UserIdCause("User Id")));
- User.get("User Id", true, new HashMap<>());
-
- Optional detailsItem = UserIdCauseRunDetailsItem.get(run);
-
- assertTrue(detailsItem.isPresent());
-
- RunDetailsItem.RunDetail userDetails = (RunDetailsItem.RunDetail) detailsItem.get();
-
- assertEquals(
- new RunDetailsItem.ItemContent.PlainContent(Messages.cause_user("User Id")), userDetails.content());
- assertEquals("symbol-person-circle", userDetails.icon());
- }
-}