Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: issue label (#11944)

ecmadao39333e49ee21
diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.go
index 990232d5bb..9d4abc5d7f 100644
--- a/backend/api/v1/issue_service.go
+++ b/backend/api/v1/issue_service.go
@@ -1592,10 +1592,14 @@ func (s *IssueService) UpdateIssue(ctx context.Context, request *v1pb.UpdateIssu
},
})
case "labels":
- if patch.PayloadUpsert == nil {
- patch.PayloadUpsert = &storepb.IssuePayload{}
+ if len(request.Issue.Labels) == 0 {
+ patch.RemoveLabels = true
+ } else {
+ if patch.PayloadUpsert == nil {
+ patch.PayloadUpsert = &storepb.IssuePayload{}
+ }
+ patch.PayloadUpsert.Labels = request.Issue.Labels
}
- patch.PayloadUpsert.Labels = request.Issue.Labels
}
}
diff --git a/backend/store/issue.go b/backend/store/issue.go
index 5b24a568f1..f2775ec477 100644
--- a/backend/store/issue.go
+++ b/backend/store/issue.go
@@ -72,6 +72,7 @@ type UpdateIssueMessage struct {
Assignee *UserMessage
// PayloadUpsert upserts the presented top-level keys.
PayloadUpsert *storepb.IssuePayload
+ RemoveLabels bool
Subscribers *[]*UserMessage
PipelineUID *int
@@ -262,7 +263,10 @@ func (s *Store) UpdateIssueV2(ctx context.Context, uid int, patch *UpdateIssueMe
return nil, errors.Wrapf(err, "failed to marshal patch.PayloadUpsert")
}
set, args = append(set, fmt.Sprintf("payload = payload || $%d", len(args)+1)), append(args, p)
+ } else if patch.RemoveLabels {
+ set, args = append(set, fmt.Sprintf("payload = payload || jsonb_build_object('labels', $%d::JSONB)", len(args)+1)), append(args, nil)
}
+
if patch.Title != nil || patch.Description != nil {
title := oldIssue.Title
if patch.Title != nil {
diff --git a/frontend/src/components/IssueV1/components/IssueTableV1.vue b/frontend/src/components/IssueV1/components/IssueTableV1.vue
index d860ee22c8..7c2d369a0d 100644
--- a/frontend/src/components/IssueV1/components/IssueTableV1.vue
+++ b/frontend/src/components/IssueV1/components/IssueTableV1.vue
@@ -128,6 +128,7 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
key: "labels",
title: t("common.labels"),
resizable: true,
+ minWidth: 120,
render: (issue) => {
const labelMap: Map<string, Label> =
issue.projectEntity.issueLabels.reduce((map, label) => {
@@ -161,7 +162,7 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
{
key: "updateTime",
title: t("issue.table.updated"),
- width: 150,
+ minWidth: 130,
resizable: true,
hide: !showExtendedColumns.value,
render: (issue) => humanizeTs((issue.updateTime?.getTime() ?? 0) / 1000),