diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.go index 2059e884..aaa52f11 100644 --- a/backend/app/api/static/docs/docs.go +++ b/backend/app/api/static/docs/docs.go @@ -3578,6 +3578,9 @@ const docTemplate = `{ "repo.LabelOut": { "type": "object", "properties": { + "color": { + "type": "string" + }, "createdAt": { "type": "string" }, @@ -3598,6 +3601,9 @@ const docTemplate = `{ "repo.LabelSummary": { "type": "object", "properties": { + "color": { + "type": "string" + }, "createdAt": { "type": "string" }, diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.json index 78260159..1b5e301c 100644 --- a/backend/app/api/static/docs/swagger.json +++ b/backend/app/api/static/docs/swagger.json @@ -3576,6 +3576,9 @@ "repo.LabelOut": { "type": "object", "properties": { + "color": { + "type": "string" + }, "createdAt": { "type": "string" }, @@ -3596,6 +3599,9 @@ "repo.LabelSummary": { "type": "object", "properties": { + "color": { + "type": "string" + }, "createdAt": { "type": "string" }, diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yaml index db182f31..cce02236 100644 --- a/backend/app/api/static/docs/swagger.yaml +++ b/backend/app/api/static/docs/swagger.yaml @@ -997,6 +997,8 @@ definitions: type: object repo.LabelOut: properties: + color: + type: string createdAt: type: string description: @@ -1010,6 +1012,8 @@ definitions: type: object repo.LabelSummary: properties: + color: + type: string createdAt: type: string description: diff --git a/backend/internal/data/repo/repo_labels.go b/backend/internal/data/repo/repo_labels.go index 03e2b4c1..6238a8b3 100644 --- a/backend/internal/data/repo/repo_labels.go +++ b/backend/internal/data/repo/repo_labels.go @@ -35,6 +35,7 @@ type ( ID uuid.UUID `json:"id"` Name string `json:"name"` Description string `json:"description"` + Color string `json:"color"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` } @@ -49,6 +50,7 @@ func mapLabelSummary(label *ent.Label) LabelSummary { ID: label.ID, Name: label.Name, Description: label.Description, + Color: label.Color, CreatedAt: label.CreatedAt, UpdatedAt: label.UpdatedAt, } diff --git a/docs/en/api/openapi-2.0.json b/docs/en/api/openapi-2.0.json index 78260159..1b5e301c 100644 --- a/docs/en/api/openapi-2.0.json +++ b/docs/en/api/openapi-2.0.json @@ -3576,6 +3576,9 @@ "repo.LabelOut": { "type": "object", "properties": { + "color": { + "type": "string" + }, "createdAt": { "type": "string" }, @@ -3596,6 +3599,9 @@ "repo.LabelSummary": { "type": "object", "properties": { + "color": { + "type": "string" + }, "createdAt": { "type": "string" }, diff --git a/docs/en/api/openapi-2.0.yaml b/docs/en/api/openapi-2.0.yaml index db182f31..cce02236 100644 --- a/docs/en/api/openapi-2.0.yaml +++ b/docs/en/api/openapi-2.0.yaml @@ -997,6 +997,8 @@ definitions: type: object repo.LabelOut: properties: + color: + type: string createdAt: type: string description: @@ -1010,6 +1012,8 @@ definitions: type: object repo.LabelSummary: properties: + color: + type: string createdAt: type: string description: diff --git a/frontend/components/Form/ColorSelector.vue b/frontend/components/Form/ColorSelector.vue new file mode 100644 index 00000000..1c6be061 --- /dev/null +++ b/frontend/components/Form/ColorSelector.vue @@ -0,0 +1,155 @@ + + + diff --git a/frontend/components/Label/Chip.vue b/frontend/components/Label/Chip.vue index 364436d7..bcb5ebe3 100644 --- a/frontend/components/Label/Chip.vue +++ b/frontend/components/Label/Chip.vue @@ -2,6 +2,7 @@ import type { LabelOut, LabelSummary } from "~~/lib/api/types/data-contracts"; import MdiArrowUp from "~icons/mdi/arrow-up"; import MdiTagOutline from "~icons/mdi/tag-outline"; + import { getContrastTextColor } from "~/lib/utils"; export type sizes = "sm" | "md" | "lg" | "xl"; defineProps({ @@ -18,12 +19,17 @@