mirror of
https://github.com/go-gitea/gitea.git
synced 2026-06-30 14:01:54 +02:00
adjustment
This commit is contained in:
parent
c59f0f9167
commit
ac3dc5953f
@ -3788,7 +3788,6 @@
|
||||
"projects.workflows.update_workflow_failed": "Failed to update workflow status",
|
||||
"projects.workflows.delete_workflow_failed": "Failed to delete workflow",
|
||||
"projects.workflows.at_least_one_action_required": "At least one action must be configured",
|
||||
"projects.workflows.error.at_least_one_action": "At least one action must be configured",
|
||||
"git.filemode.changed_filemode": "%[1]s → %[2]s",
|
||||
"git.filemode.directory": "Directory",
|
||||
"git.filemode.normal_file": "Regular",
|
||||
|
||||
@ -416,7 +416,7 @@ func WorkflowsPost(ctx *context.Context) {
|
||||
|
||||
// Validate: at least one action must be configured
|
||||
if len(actions) == 0 {
|
||||
ctx.JSONError(ctx.Tr("projects.workflows.error.at_least_one_action"))
|
||||
ctx.JSONError(ctx.Tr("projects.workflows.at_least_one_action_required"))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ type WorkflowStoreState = {
|
||||
const createDefaultFilters = (): WorkflowFilters => ({issue_type: '', source_column: '', target_column: '', labels: []});
|
||||
const createDefaultActions = (): WorkflowActions => ({column: '', add_labels: [], remove_labels: [], issue_state: ''});
|
||||
|
||||
function convertFilters(workflow: any): WorkflowFilters {
|
||||
function convertFilters(workflow?: WorkflowEvent | null): WorkflowFilters {
|
||||
const filters = createDefaultFilters();
|
||||
if (workflow?.filters && Array.isArray(workflow.filters)) {
|
||||
for (const filter of workflow.filters) {
|
||||
@ -101,7 +101,7 @@ function convertFilters(workflow: any): WorkflowFilters {
|
||||
return filters;
|
||||
}
|
||||
|
||||
function convertActions(workflow: any): WorkflowActions {
|
||||
function convertActions(workflow?: WorkflowEvent | null): WorkflowActions {
|
||||
const actions = createDefaultActions();
|
||||
|
||||
if (workflow?.actions && Array.isArray(workflow.actions)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user