From 9a0652f0b2e1d56e1187a9442e7f053dad453703 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Tue, 9 May 2023 22:39:16 +0300 Subject: [PATCH] Attach a tooltip to the action status icon (#24614) To clearly communicate the current state of the action ![image](https://github.com/go-gitea/gitea/assets/20454870/5d6de6b9-f34f-417d-b08e-fcd1b99b3079) ![image](https://github.com/go-gitea/gitea/assets/20454870/b976676a-4525-43e7-866f-8933be1a5dfd) ![image](https://github.com/go-gitea/gitea/assets/20454870/2e0a55fe-658f-4242-83de-b857a8b55f31) ![image](https://github.com/go-gitea/gitea/assets/20454870/6b42bcd1-c499-41ac-8419-1c4e60085d47) ![image](https://github.com/go-gitea/gitea/assets/20454870/363fcff8-fe61-4363-a04b-2db93cfc4fa3) ![image](https://github.com/go-gitea/gitea/assets/20454870/f8f59b68-93de-4f31-b9b0-24d94990d1d0) --------- Signed-off-by: Yarden Shoham --- templates/repo/actions/runs_list.tmpl | 2 +- templates/repo/actions/status.tmpl | 2 ++ templates/repo/actions/view.tmpl | 8 ++++++++ web_src/js/components/ActionRunStatus.vue | 18 ++++++++++++------ web_src/js/components/RepoActionView.vue | 14 ++++++++++++-- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/templates/repo/actions/runs_list.tmpl b/templates/repo/actions/runs_list.tmpl index 709bfaaced..caa14b3390 100644 --- a/templates/repo/actions/runs_list.tmpl +++ b/templates/repo/actions/runs_list.tmpl @@ -2,7 +2,7 @@ {{range .Runs}}
  • - {{template "repo/actions/status" (dict "status" .Status.String)}} + {{template "repo/actions/status" (dict "status" .Status.String "locale" $.locale)}}
    diff --git a/templates/repo/actions/status.tmpl b/templates/repo/actions/status.tmpl index 794f7811ee..ab2ee8482c 100644 --- a/templates/repo/actions/status.tmpl +++ b/templates/repo/actions/status.tmpl @@ -11,6 +11,7 @@ {{- $className = .className -}} {{- end -}} + {{if eq .status "success"}} {{svg "octicon-check-circle-fill" $size (printf "text green %s" $className)}} {{else if eq .status "skipped"}} @@ -24,3 +25,4 @@ {{else}} {{svg "octicon-x-circle-fill" $size (printf "text red %s" $className)}} {{end}} + diff --git a/templates/repo/actions/view.tmpl b/templates/repo/actions/view.tmpl index 85e6f736d8..4a4418af17 100644 --- a/templates/repo/actions/view.tmpl +++ b/templates/repo/actions/view.tmpl @@ -9,6 +9,14 @@ data-locale-approve="{{.locale.Tr "repo.diff.review.approve"}}" data-locale-cancel="{{.locale.Tr "cancel"}}" data-locale-rerun="{{.locale.Tr "rerun"}}" + data-locale-status-unknown="{{.locale.Tr "actions.status.unknown"}}" + data-locale-status-waiting="{{.locale.Tr "actions.status.waiting"}}" + data-locale-status-running="{{.locale.Tr "actions.status.running"}}" + data-locale-status-success="{{.locale.Tr "actions.status.success"}}" + data-locale-status-failure="{{.locale.Tr "actions.status.failure"}}" + data-locale-status-cancelled="{{.locale.Tr "actions.status.cancelled"}}" + data-locale-status-skipped="{{.locale.Tr "actions.status.skipped"}}" + data-locale-status-blocked="{{.locale.Tr "actions.status.blocked"}}" >
    diff --git a/web_src/js/components/ActionRunStatus.vue b/web_src/js/components/ActionRunStatus.vue index 8a96eb5f01..8852931891 100644 --- a/web_src/js/components/ActionRunStatus.vue +++ b/web_src/js/components/ActionRunStatus.vue @@ -2,12 +2,14 @@ Please also update the template file above if this vue is modified. -->