Attach a tooltip to the action status icon (#24614)

To clearly communicate the current state of the action

![image](5d6de6b9-f34f-417d-b08e-fcd1b99b3079)
![image](b976676a-4525-43e7-866f-8933be1a5dfd)
![image](2e0a55fe-658f-4242-83de-b857a8b55f31)
![image](6b42bcd1-c499-41ac-8419-1c4e60085d47)
![image](363fcff8-fe61-4363-a04b-2db93cfc4fa3)
![image](f8f59b68-93de-4f31-b9b0-24d94990d1d0)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
This commit is contained in:
Yarden Shoham 2023-05-09 22:39:16 +03:00 committed by GitHub
parent 4f1065030f
commit 9a0652f0b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 9 deletions

View file

@ -2,12 +2,14 @@
Please also update the template file above if this vue is modified.
-->
<template>
<SvgIcon name="octicon-check-circle-fill" class="text green" :size="size" :class-name="className" v-if="status === 'success'"/>
<SvgIcon name="octicon-skip" class="text grey" :size="size" :class-name="className" v-else-if="status === 'skipped'"/>
<SvgIcon name="octicon-clock" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'waiting'"/>
<SvgIcon name="octicon-blocked" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'blocked'"/>
<SvgIcon name="octicon-meter" class="text yellow" :size="size" :class-name="'job-status-rotate ' + className" v-else-if="status === 'running'"/>
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else/>
<span :data-tooltip-content="localeStatus">
<SvgIcon name="octicon-check-circle-fill" class="text green" :size="size" :class-name="className" v-if="status === 'success'"/>
<SvgIcon name="octicon-skip" class="text grey" :size="size" :class-name="className" v-else-if="status === 'skipped'"/>
<SvgIcon name="octicon-clock" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'waiting'"/>
<SvgIcon name="octicon-blocked" class="text yellow" :size="size" :class-name="className" v-else-if="status === 'blocked'"/>
<SvgIcon name="octicon-meter" class="text yellow" :size="size" :class-name="'job-status-rotate ' + className" v-else-if="status === 'running'"/>
<SvgIcon name="octicon-x-circle-fill" class="text red" :size="size" v-else/>
</span>
</template>
<script>
@ -27,6 +29,10 @@ export default {
className: {
type: String,
default: ''
},
localeStatus: {
type: String,
default: ''
}
},
};

View file

@ -2,7 +2,7 @@
<div class="action-view-container">
<div class="action-view-header">
<div class="action-info-summary gt-ac">
<ActionRunStatus :status="run.status" :size="20"/>
<ActionRunStatus :locale-status="locale.status[run.status]" :status="run.status" :size="20"/>
<div class="action-title">
{{ run.title }}
</div>
@ -32,7 +32,7 @@
<div class="job-brief-list">
<div class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id">
<a class="job-brief-link" :href="run.link+'/jobs/'+index">
<ActionRunStatus :status="job.status"/>
<ActionRunStatus :locale-status="locale.status[job.status]" :status="job.status"/>
<span class="ui text gt-mx-3">{{ job.name }}</span>
</a>
<span class="step-summary-duration">{{ job.duration }}</span>
@ -319,6 +319,16 @@ export function initRepositoryActionView() {
approve: el.getAttribute('data-locale-approve'),
cancel: el.getAttribute('data-locale-cancel'),
rerun: el.getAttribute('data-locale-rerun'),
status: {
unknown: el.getAttribute('data-locale-status-unknown'),
waiting: el.getAttribute('data-locale-status-waiting'),
running: el.getAttribute('data-locale-status-running'),
success: el.getAttribute('data-locale-status-success'),
failure: el.getAttribute('data-locale-status-failure'),
cancelled: el.getAttribute('data-locale-status-cancelled'),
skipped: el.getAttribute('data-locale-status-skipped'),
blocked: el.getAttribute('data-locale-status-blocked'),
}
}
});
view.mount(el);