diff --git a/models/migrations/v1_25/v323.go b/models/migrations/v1_25/v323.go deleted file mode 100644 index 41adbf8802..0000000000 --- a/models/migrations/v1_25/v323.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2026 Moko Consulting. All rights reserved. -// SPDX-License-Identifier: MIT - -package v1_25 - -import "xorm.io/xorm" - -func AddCustomFieldTables(x *xorm.Engine) error { - type CustomFieldDefinition struct { - ID int64 `xorm:"pk autoincr"` - RepoID int64 `xorm:"INDEX NOT NULL"` - Name string `xorm:"NOT NULL"` - FieldType string `xorm:"NOT NULL"` // text, number, date, dropdown, checkbox - Description string - Required bool `xorm:"NOT NULL DEFAULT false"` - Position int `xorm:"NOT NULL DEFAULT 0"` - Options string `xorm:"TEXT"` // JSON array for dropdown options - DefaultVal string - CreatedUnix int64 `xorm:"INDEX created"` - UpdatedUnix int64 `xorm:"INDEX updated"` - } - - type CustomFieldValue struct { - ID int64 `xorm:"pk autoincr"` - IssueID int64 `xorm:"INDEX NOT NULL"` - FieldID int64 `xorm:"INDEX NOT NULL"` - Value string `xorm:"TEXT"` - CreatedUnix int64 `xorm:"INDEX created"` - UpdatedUnix int64 `xorm:"INDEX updated"` - } - - return x.Sync(new(CustomFieldDefinition), new(CustomFieldValue)) -} diff --git a/modules/structs/custom_field.go b/modules/structs/custom_field.go deleted file mode 100644 index 1fbfc1d3a3..0000000000 --- a/modules/structs/custom_field.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2026 Moko Consulting. All rights reserved. -// SPDX-License-Identifier: MIT - -package structs - -import "time" - -// CustomFieldDefinition represents a custom field definition for a repository -// swagger:model -type CustomFieldDefinition struct { - ID int64 `json:"id"` - RepoID int64 `json:"repo_id"` - Name string `json:"name"` - FieldType string `json:"field_type"` - Description string `json:"description"` - Required bool `json:"required"` - Position int `json:"position"` - Options string `json:"options"` - DefaultValue string `json:"default_value"` - // swagger:strfmt date-time - Created time.Time `json:"created_at"` - // swagger:strfmt date-time - Updated time.Time `json:"updated_at"` -} - -// CreateCustomFieldOption options for creating a custom field -// swagger:model -type CreateCustomFieldOption struct { - // required: true - Name string `json:"name" binding:"Required"` - // required: true - FieldType string `json:"field_type" binding:"Required"` // text, number, date, dropdown, checkbox - Description string `json:"description"` - Required bool `json:"required"` - Position int `json:"position"` - Options string `json:"options"` // JSON array for dropdown - DefaultValue string `json:"default_value"` -} - -// EditCustomFieldOption options for editing a custom field -// swagger:model -type EditCustomFieldOption struct { - Name *string `json:"name"` - Description *string `json:"description"` - Required *bool `json:"required"` - Position *int `json:"position"` - Options *string `json:"options"` - DefaultValue *string `json:"default_value"` -} - -// CustomFieldValue represents a custom field value for an issue -// swagger:model -type CustomFieldValue struct { - ID int64 `json:"id"` - IssueID int64 `json:"issue_id"` - FieldID int64 `json:"field_id"` - Value string `json:"value"` -} - -// SetCustomFieldValueOption options for setting a custom field value -// swagger:model -type SetCustomFieldValueOption struct { - // required: true - Value string `json:"value" binding:"Required"` -} diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index b35889db6f..2dbd9e841b 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -1655,22 +1655,9 @@ func Routes() *web.Router { // }) // }) // }) - m.Group("/custom-fields", func() { - m.Combo("").Get(repo.ListCustomFields). - Post(reqToken(), reqRepoWriter(unit.TypeIssues), bind(api.CreateCustomFieldOption{}), repo.CreateCustomField) - m.Group("/{fieldId}", func() { - m.Combo("").Get(repo.GetCustomField). - Patch(reqToken(), reqRepoWriter(unit.TypeIssues), bind(api.EditCustomFieldOption{}), repo.EditCustomField). - Delete(reqToken(), reqRepoWriter(unit.TypeIssues), repo.DeleteCustomField) - }) - }) - m.Group("/issues/{index}/custom-fields", func() { - m.Get("", repo.GetIssueCustomFields) - m.Group("/{fieldId}", func() { - m.Put("", reqToken(), reqRepoWriter(unit.TypeIssues), bind(api.SetCustomFieldValueOption{}), repo.SetIssueCustomField) - m.Delete("", reqToken(), reqRepoWriter(unit.TypeIssues), repo.DeleteIssueCustomField) - }) - }) + // TODO: custom-fields API routes — handler not yet implemented + // m.Group("/custom-fields", func() { ... }) + // m.Group("/issues/{index}/custom-fields", func() { ... }) }, repoAssignment(), checkTokenPublicOnly()) }, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryIssue)) diff --git a/updates.xml b/updates.xml index df6396cb65..c910e7d8b8 100644 --- a/updates.xml +++ b/updates.xml @@ -1,7 +1,7 @@ @@ -87,13 +87,13 @@ mokogitea application site - 05.20.00 + 05.21.00 2026-06-04 https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/releases/tag/stable - https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/releases/download/stable/mokogitea-05.20.00.zip + https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/releases/download/stable/mokogitea-05.21.00.zip - 611a70dc0c394266e598598adc254fa50130310ffe21b966f820536e1714eb07 + 6c5772549d9f20dd888a0f6eae24d2645a1c5042578c370a9bba93650db62abd stable https://git.mokoconsulting.tech/MokoConsulting/MokoGitea/raw/branch/main/CHANGELOG.md Moko Consulting