mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-30 07:10:15 +00:00
enhance(actions): add pending job status and align job statuses with GitHub (#39376)
This commit is contained in:
@@ -228,11 +228,13 @@ const splitRoutedEdges = computed(() => {
|
||||
const nodesWithIncomingEdge = computed(() => new Set(graphModel.value.adjacency.incomingByNodeId.keys()));
|
||||
const nodesWithOutgoingEdge = computed(() => new Set(graphModel.value.adjacency.outgoingByNodeId.keys()));
|
||||
|
||||
function isJobLinked(job: ActionsJob) {
|
||||
return !job.isReusableCaller && job.status !== 'pending'; // callers have no detail page, pending jobs have nothing to show yet
|
||||
}
|
||||
|
||||
function onNodeClick(job: GraphNode | ActionsJob, event: MouseEvent) {
|
||||
const target = 'jobs' in job ? job.jobs[0]! : job;
|
||||
// Reusable callers have no per-job detail page; clicking them is a no-op so the graph
|
||||
// doesn't lead users to a dead destination.
|
||||
if (target.isReusableCaller) return;
|
||||
if (!isJobLinked(target)) return;
|
||||
const link = `${props.runLink}/jobs/${target.id}`;
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
window.open(link, '_blank');
|
||||
@@ -342,6 +344,7 @@ function onNodeClick(job: GraphNode | ActionsJob, event: MouseEvent) {
|
||||
v-for="ch in job.jobs"
|
||||
:key="ch.id"
|
||||
class="graph-list-row"
|
||||
:class="{ 'unlinked-node': !isJobLinked(ch) }"
|
||||
@mouseenter="handleNodeMouseEnter(job.id)"
|
||||
@click.stop="onNodeClick(ch, $event)"
|
||||
>
|
||||
@@ -373,6 +376,7 @@ function onNodeClick(job: GraphNode | ActionsJob, event: MouseEvent) {
|
||||
v-for="ch in job.jobs"
|
||||
:key="ch.id"
|
||||
class="graph-list-row"
|
||||
:class="{ 'unlinked-node': !isJobLinked(ch) }"
|
||||
@mouseenter="handleNodeMouseEnter(job.id)"
|
||||
@click="onNodeClick(ch, $event)"
|
||||
>
|
||||
@@ -391,7 +395,7 @@ function onNodeClick(job: GraphNode | ActionsJob, event: MouseEvent) {
|
||||
<g
|
||||
v-else
|
||||
class="job-node-group"
|
||||
:class="{ 'related-node': isNodeHighlighted(job.id), 'caller-node': job.jobs[0]!.isReusableCaller }"
|
||||
:class="{ 'related-node': isNodeHighlighted(job.id), 'unlinked-node': !isJobLinked(job.jobs[0]!) }"
|
||||
@click="onNodeClick(job, $event)"
|
||||
@mouseenter="handleNodeMouseEnter(job.id)"
|
||||
@mouseleave="handleNodeMouseLeave"
|
||||
@@ -523,10 +527,15 @@ function onNodeClick(job: GraphNode | ActionsJob, event: MouseEvent) {
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.job-node-group.caller-node {
|
||||
.job-node-group.unlinked-node,
|
||||
.graph-list-row.unlinked-node {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.graph-list-row.unlinked-node:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.job-node-group:hover .job-rect,
|
||||
.job-node-group.related-node .job-rect {
|
||||
stroke: var(--color-primary);
|
||||
|
||||
Reference in New Issue
Block a user