Skip to content

Commit a354636

Browse files
wolfogresilverwindlunny
authored
Fix style of actions rerun button (#22835)
Authored by @a1012112796 at #22798 (comment) Avoid putting `button` in `a`. A patch for #22798 . Now it looks like: <img width="393" alt="image" src="https://user-images.githubusercontent.com/9418365/217791913-b491fc86-ee9b-4672-80ea-7286eef2d11f.png"> <img width="389" alt="image" src="https://user-images.githubusercontent.com/9418365/217791967-d8c09c8b-4cea-4011-b01e-db0d1333e7f6.png"> --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 34399cf commit a354636

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

Diff for: web_src/js/components/RepoActionView.vue

+30-18
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@
1212
<div class="action-view-left">
1313
<div class="job-group-section">
1414
<div class="job-brief-list">
15-
<a class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id" :href="run.link+'/jobs/'+index">
16-
<SvgIcon name="octicon-check-circle-fill" class="green" v-if="job.status === 'success'"/>
17-
<SvgIcon name="octicon-skip" class="ui text grey" v-else-if="job.status === 'skipped'"/>
18-
<SvgIcon name="octicon-clock" class="ui text yellow" v-else-if="job.status === 'waiting'"/>
19-
<SvgIcon name="octicon-blocked" class="ui text yellow" v-else-if="job.status === 'blocked'"/>
20-
<SvgIcon name="octicon-meter" class="ui text yellow" class-name="job-status-rotate" v-else-if="job.status === 'running'"/>
21-
<SvgIcon name="octicon-x-circle-fill" class="red" v-else/>
22-
{{ job.name }}
23-
<!-- TODO: it will be a better idea to move "button" out from "a", and the ".prevent" will not be needed. But it needs some work with CSS -->
24-
<button class="job-brief-rerun" @click.prevent="rerunJob(index)" v-if="job.canRerun">
15+
<div class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id">
16+
<a class="job-brief-link" :href="run.link+'/jobs/'+index">
17+
<SvgIcon name="octicon-check-circle-fill" class="green" v-if="job.status === 'success'"/>
18+
<SvgIcon name="octicon-skip" class="ui text grey" v-else-if="job.status === 'skipped'"/>
19+
<SvgIcon name="octicon-clock" class="ui text yellow" v-else-if="job.status === 'waiting'"/>
20+
<SvgIcon name="octicon-blocked" class="ui text yellow" v-else-if="job.status === 'blocked'"/>
21+
<SvgIcon name="octicon-meter" class="ui text yellow" class-name="job-status-rotate" v-else-if="job.status === 'running'"/>
22+
<SvgIcon name="octicon-x-circle-fill" class="red" v-else/>
23+
<span class="ui text">{{ job.name }}</span>
24+
</a>
25+
<button class="job-brief-rerun" @click="rerunJob(index)" v-if="job.canRerun">
2526
<SvgIcon name="octicon-sync" class="ui text black"/>
2627
</button>
27-
</a>
28+
</div>
2829
</div>
2930
</div>
3031
</div>
@@ -291,15 +292,15 @@ export function initRepositoryActionView() {
291292
292293
.action-view-header {
293294
margin: 0 20px 20px 20px;
294-
button.run_cancel {
295+
.run_cancel {
295296
border: none;
296297
color: var(--color-red);
297298
background-color: transparent;
298299
outline: none;
299300
cursor: pointer;
300301
transition:transform 0.2s;
301302
};
302-
button.run_cancel:hover{
303+
.run_cancel:hover{
303304
transform:scale(130%);
304305
};
305306
}
@@ -327,26 +328,37 @@ export function initRepositoryActionView() {
327328
}
328329
329330
.job-brief-list {
330-
a.job-brief-item {
331-
display: block;
331+
.job-brief-item {
332332
margin: 5px 0;
333333
padding: 10px;
334334
background: var(--color-info-bg);
335335
border-radius: 5px;
336336
text-decoration: none;
337-
button.job-brief-rerun {
337+
display: flex;
338+
justify-items: center;
339+
flex-wrap: nowrap;
340+
.job-brief-rerun {
338341
float: right;
339342
border: none;
340343
background-color: transparent;
341344
outline: none;
342345
cursor: pointer;
343346
transition:transform 0.2s;
344347
};
345-
button.job-brief-rerun:hover{
348+
.job-brief-rerun:hover{
346349
transform:scale(130%);
347350
};
351+
.job-brief-link {
352+
flex-grow: 1;
353+
display: flex;
354+
span {
355+
margin-right: 8px;
356+
display: flex;
357+
align-items: center;
358+
}
359+
}
348360
}
349-
a.job-brief-item:hover {
361+
.job-brief-item:hover {
350362
background-color: var(--color-secondary);
351363
}
352364
}

0 commit comments

Comments
 (0)