Skip to content

Commit 175c2cb

Browse files
committed
Attach a tooltip to the action control button
The first time I saw the big red X button I thought something failed but apparently, it was just a "Cancel" button Signed-off-by: Yarden Shoham <git@yardenshoham.com>
1 parent 3d266dd commit 175c2cb

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -3389,6 +3389,7 @@ management = Secrets Management
33893389
33903390
[actions]
33913391
actions = Actions
3392+
rerun = Rerun
33923393
33933394
unit.desc = Manage actions
33943395

templates/repo/actions/view.tmpl

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22

33
<div class="page-content repository">
44
{{template "repo/header" .}}
5-
<div id="repo-action-view" data-run-index="{{.RunIndex}}" data-job-index="{{.JobIndex}}" data-actions-url="{{.ActionsURL}}"></div>
5+
<div id="repo-action-view"
6+
data-run-index="{{.RunIndex}}"
7+
data-job-index="{{.JobIndex}}"
8+
data-actions-url="{{.ActionsURL}}"
9+
data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}"
10+
data-locale-cancel="{{.locale.Tr "cancel"}}"
11+
data-locale-rerun="{{.locale.Tr "actions.rerun"}}"
12+
>
13+
</div>
614
</div>
715

816
{{template "base/footer" .}}

web_src/js/components/RepoActionView.vue

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
<div class="action-title">
77
{{ run.title }}
88
</div>
9-
<button class="action-control-button text green" @click="approveRun()" v-if="run.canApprove">
9+
<button :data-tooltip-content="locale.approve" class="action-control-button text green" @click="approveRun()" v-if="run.canApprove">
1010
<SvgIcon name="octicon-play" :size="20"/>
1111
</button>
12-
<button class="action-control-button text red" @click="cancelRun()" v-else-if="run.canCancel">
12+
<button :data-tooltip-content="locale.cancel" class="action-control-button text red" @click="cancelRun()" v-else-if="run.canCancel">
1313
<SvgIcon name="octicon-x-circle-fill" :size="20"/>
1414
</button>
15-
<button class="action-control-button text green" @click="rerun()" v-else-if="run.canRerun">
15+
<button :data-tooltip-content="locale.rerun" class="action-control-button text green" @click="rerun()" v-else-if="run.canRerun">
1616
<SvgIcon name="octicon-sync" :size="20"/>
1717
</button>
1818
</div>
@@ -93,6 +93,7 @@ const sfc = {
9393
runIndex: String,
9494
jobIndex: String,
9595
actionsURL: String,
96+
locale: Object,
9697
},
9798
9899
data() {
@@ -314,6 +315,11 @@ export function initRepositoryActionView() {
314315
runIndex: el.getAttribute('data-run-index'),
315316
jobIndex: el.getAttribute('data-job-index'),
316317
actionsURL: el.getAttribute('data-actions-url'),
318+
locale: {
319+
approve: el.getAttribute('data-locale-approve'),
320+
cancel: el.getAttribute('data-locale-cancel'),
321+
rerun: el.getAttribute('data-locale-rerun'),
322+
}
317323
});
318324
view.mount(el);
319325
}

0 commit comments

Comments
 (0)