Skip to content

Commit 863176d

Browse files
committed
* fix error message
* fix typo * replace Submit with Run Workflow * add actions.workflow.has_no_workflow_dispatch item
1 parent d6459d0 commit 863176d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,6 +3765,7 @@ workflow.not_found = Workflow '%s' not found.
37653765
workflow.run_success = Workflow '%s' run successfully.
37663766
workflow.from_ref = Use workflow from
37673767
workflow.has_workflow_dispatch = This workflow has a workflow_dispatch event trigger.
3768+
workflow.has_no_workflow_dispatch = Workflow '%s' has no workflow_dispatch event trigger.
37683769

37693770
need_approval_desc = Need approval to run workflows for fork pull request.
37703771

templates/repo/actions/workflow_dispatch_inputs.tmpl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{{if not .WorkflowDispatchConfig}}
2-
<div class="ui error message">
3-
{{/* TODO: Technically this error is also shown if no workflow_dispatch is defined. However we need to know if the workflow exist like in #33098 (comment) to render a different error text.
4-
A: does the newly added "CurWorkflowExists" help? */}}
5-
{{ctx.Locale.Tr "actions.workflow.not_found" $.CurWorkflow}}
2+
<div class="ui error message tw-flex tw-justify-between tw-items-center">
3+
{{if not .CurWorkflowExists}}
4+
{{ctx.Locale.Tr "actions.workflow.not_found" $.CurWorkflow}}
5+
{{else}}
6+
{{ctx.Locale.Tr "actions.workflow.has_no_workflow_dispatch" $.CurWorkflow}}
7+
{{end}}
68
</div>
79
{{else}}
810
{{range $item := .WorkflowDispatchConfig.Inputs}}
911
<div class="ui field {{if .Required}}required{{end}}">
1012
{{if eq .Type "choice"}}
1113
<label>{{or .Description .Name}}:</label>
12-
{{/* htmx won't initalize the fomantic dropdown, so it is a standard "select" input */}}
14+
{{/* htmx won't initialize the fomantic dropdown, so it is a standard "select" input */}}
1315
<select class="ui selection dropdown" name="{{.Name}}">
1416
{{range .Options}}
1517
<option value="{{.}}" {{if eq $item.Default .}}selected{{end}}>{{.}}</option>
@@ -31,7 +33,7 @@
3133
</div>
3234
{{end}}
3335
<div class="ui field">
34-
<button class="ui tiny primary button" type="submit">Submit</button>
36+
<button class="ui tiny primary button" type="submit">{{ctx.Locale.Tr "actions.workflow.run"}}</button>
3537
</div>
3638
{{end}}
3739
{{range .workflows}}

0 commit comments

Comments
 (0)