Skip to content

Commit 5bd0773

Browse files
silverwindGiteaBot
andauthored
Dont show expansion for empty actions steps (#29977)
This hides the chevron icon and makes the step header unclickable for skipped steps because there is no content to expand on those. Before: <img width="272" alt="Screenshot 2024-03-21 at 20 06 47" src="https://github.com/go-gitea/gitea/assets/115237/9bb328d1-6f74-48a9-af19-de9b351e3707"> After: <img width="295" alt="Screenshot 2024-03-21 at 20 03 07" src="https://github.com/go-gitea/gitea/assets/115237/72a26e14-5a28-4606-8c3c-184b405872c8"> --------- Co-authored-by: Giteabot <[email protected]>
1 parent f22fe4e commit 5bd0773

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

web_src/js/components/RepoActionView.vue

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ const sfc = {
268268
return ['success', 'skipped', 'failure', 'cancelled'].includes(status);
269269
},
270270
271+
isExpandable(status) {
272+
return ['success', 'running', 'failure', 'cancelled'].includes(status);
273+
},
274+
271275
closeDropdown() {
272276
if (this.menuVisible) this.menuVisible = false;
273277
},
@@ -459,12 +463,12 @@ export function initRepositoryActionView() {
459463
</div>
460464
<div class="job-step-container" ref="steps" v-if="currentJob.steps.length">
461465
<div class="job-step-section" v-for="(jobStep, i) in currentJob.steps" :key="i">
462-
<div class="job-step-summary" @click.stop="toggleStepLogs(i)" :class="currentJobStepsStates[i].expanded ? 'selected' : ''">
466+
<div class="job-step-summary" @click.stop="jobStep.status !== 'skipped' && toggleStepLogs(i)" :class="[currentJobStepsStates[i].expanded ? 'selected' : '', isExpandable(jobStep.status) && 'step-expandable']">
463467
<!-- If the job is done and the job step log is loaded for the first time, show the loading icon
464468
currentJobStepsStates[i].cursor === null means the log is loaded for the first time
465469
-->
466470
<SvgIcon v-if="isDone(run.status) && currentJobStepsStates[i].expanded && currentJobStepsStates[i].cursor === null" name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
467-
<SvgIcon v-else :name="currentJobStepsStates[i].expanded ? 'octicon-chevron-down': 'octicon-chevron-right'" class="gt-mr-3"/>
471+
<SvgIcon v-else :name="currentJobStepsStates[i].expanded ? 'octicon-chevron-down': 'octicon-chevron-right'" :class="['gt-mr-3', !isExpandable(jobStep.status) && 'tw-invisible']"/>
468472
<ActionRunStatus :status="jobStep.status" class="gt-mr-3"/>
469473
470474
<span class="step-summary-msg gt-ellipsis">{{ jobStep.summary }}</span>
@@ -715,13 +719,21 @@ export function initRepositoryActionView() {
715719
}
716720
717721
.job-step-container .job-step-summary {
718-
cursor: pointer;
719722
padding: 5px 10px;
720723
display: flex;
721724
align-items: center;
722725
border-radius: var(--border-radius);
723726
}
724727
728+
.job-step-container .job-step-summary.step-expandable {
729+
cursor: pointer;
730+
}
731+
732+
.job-step-container .job-step-summary.step-expandable:hover {
733+
color: var(--color-console-fg);
734+
background-color: var(--color-console-hover-bg);
735+
}
736+
725737
.job-step-container .job-step-summary .step-summary-msg {
726738
flex: 1;
727739
}
@@ -730,12 +742,6 @@ export function initRepositoryActionView() {
730742
margin-left: 16px;
731743
}
732744
733-
.job-step-container .job-step-summary:hover {
734-
color: var(--color-console-fg);
735-
background-color: var(--color-console-hover-bg);
736-
737-
}
738-
739745
.job-step-container .job-step-summary.selected {
740746
color: var(--color-console-fg);
741747
background-color: var(--color-console-active-bg);

0 commit comments

Comments
 (0)