Skip to content

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

feat: add new project webhook type issue approval notify (#6535)

p0ny59caf725a070
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index d10ee9bc2f..a3e110e204 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -2056,6 +2056,8 @@ func convertToActivityTypeStrings(types []v1pb.Activity_Type) ([]string, error)
result = append(result, string(api.ActivityIssueFieldUpdate))
case v1pb.Activity_TYPE_ISSUE_STATUS_UPDATE:
result = append(result, string(api.ActivityIssueStatusUpdate))
+ case v1pb.Activity_TYPE_ISSUE_APPROVAL_NOTIFY:
+ result = append(result, string(api.ActivityIssueApprovalNotify))
case v1pb.Activity_TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE:
result = append(result, string(api.ActivityPipelineStageStatusUpdate))
case v1pb.Activity_TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE:
@@ -2107,6 +2109,8 @@ func convertNotificationTypeStrings(types []string) []v1pb.Activity_Type {
result = append(result, v1pb.Activity_TYPE_ISSUE_FIELD_UPDATE)
case string(api.ActivityIssueStatusUpdate):
result = append(result, v1pb.Activity_TYPE_ISSUE_STATUS_UPDATE)
+ case string(api.ActivityIssueApprovalNotify):
+ result = append(result, v1pb.Activity_TYPE_ISSUE_APPROVAL_NOTIFY)
case string(api.ActivityPipelineStageStatusUpdate):
result = append(result, v1pb.Activity_TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE)
case string(api.ActivityPipelineTaskStatusUpdate):
diff --git a/frontend/src/components/Issue/IssueActivityPanel.vue b/frontend/src/components/Issue/IssueActivityPanel.vue
index 8fdc5ec15f..a25a165e52 100644
--- a/frontend/src/components/Issue/IssueActivityPanel.vue
+++ b/frontend/src/components/Issue/IssueActivityPanel.vue
@@ -234,6 +234,10 @@ const activityList = computed((): DistinctActivity[] => {
const list = activityStore
.getActivityListByIssue(issue.value.id)
.filter((activity: Activity) => {
+ if (activity.type === "bb.issue.approval.notify") {
+ return false;
+ }
+
if (activity.type === "bb.issue.field.update") {
const containUserVisibleChange =
(activity.payload as ActivityIssueFieldUpdatePayload).fieldId !==
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 23bfed1a1c..16e2b780ce 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1431,6 +1431,10 @@
"issue-comment-creation": {
"title": "Issue comment creation",
"label": "When new issue comment has been created"
+ },
+ "issue-approval-notify": {
+ "title": "Issue approval needed",
+ "label": "When issue is pending approval"
}
}
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 97ff1d6ded..f605bc6856 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1425,6 +1425,10 @@
"issue-comment-creation": {
"title": "Creación de comentario de incidencia",
"label": "Cuando se crea un nuevo comentario en la incidencia"
+ },
+ "issue-approval-notify": {
+ "title": "Notificación de aprobación de incidencia",
+ "label": "Cuando se aprueba o rechaza una incidencia"
}
}
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index d7972d428c..1ffe490b85 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1427,6 +1427,10 @@
"issue-stage-status-change": {
"title": "工单阶段状态变更",
"label": "当一个工单包含的阶段状态发生了变更"
+ },
+ "issue-approval-notify": {
+ "title": "工单待审批",
+ "label": "当工单需要审批"
}
}
},
diff --git a/frontend/src/types/activity.ts b/frontend/src/types/activity.ts
index bb31e11429..c60ac9062b 100644
--- a/frontend/src/types/activity.ts
+++ b/frontend/src/types/activity.ts
@@ -25,6 +25,7 @@ export type IssueActivityType =
| "bb.issue.comment.create"
| "bb.issue.field.update"
| "bb.issue.status.update"
+ | "bb.issue.approval.notify"
| "bb.pipeline.stage.status.update"
| "bb.pipeline.task.status.update"
| "bb.pipeline.task.file.commit"
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index ba36eebbbe..742e0fbe1a 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -769,6 +769,8 @@ export enum Activity_Type {
TYPE_ISSUE_FIELD_UPDATE = 3,
/** TYPE_ISSUE_STATUS_UPDATE - TYPE_ISSUE_STATUS_UPDATE represents the issue status change, including OPEN, CLOSE, CANCEL fow now. */
TYPE_ISSUE_STATUS_UPDATE = 4,
+ /** TYPE_ISSUE_APPROVAL_NOTIFY - TYPE_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. */
+ TYPE_ISSUE_APPROVAL_NOTIFY = 21,
/** TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE - TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now. */
TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE = 5,
/** TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE - TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now. */
@@ -835,6 +837,9 @@ export function activity_TypeFromJSON(object: any): Activity_Type {
case 4:
case "TYPE_ISSUE_STATUS_UPDATE":
return Activity_Type.TYPE_ISSUE_STATUS_UPDATE;
+ case 21:
+ case "TYPE_ISSUE_APPROVAL_NOTIFY":
+ return Activity_Type.TYPE_ISSUE_APPROVAL_NOTIFY;
case 5:
case "TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE":
return Activity_Type.TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE;
@@ -902,6 +907,8 @@ export function activity_TypeToJSON(object: Activity_Type): string {
return "TYPE_ISSUE_FIELD_UPDATE";
case Activity_Type.TYPE_ISSUE_STATUS_UPDATE:
return "TYPE_ISSUE_STATUS_UPDATE";
+ case Activity_Type.TYPE_ISSUE_APPROVAL_NOTIFY:
+ return "TYPE_ISSUE_APPROVAL_NOTIFY";
case Activity_Type.TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE:
return "TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE";
case Activity_Type.TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE:
diff --git a/frontend/src/types/v1/projectWebhook.ts b/frontend/src/types/v1/projectWebhook.ts
index f2f278c710..d69c81ea03 100644
--- a/frontend/src/types/v1/projectWebhook.ts
+++ b/frontend/src/types/v1/projectWebhook.ts
@@ -110,5 +110,10 @@ export const projectWebhookV1ActivityItemList =
label: t("project.webhook.activity-item.issue-comment-creation.label"),
activity: Activity_Type.TYPE_ISSUE_COMMENT_CREATE,
},
+ {
+ title: t("project.webhook.activity-item.issue-approval-notify.title"),
+ label: t("project.webhook.activity-item.issue-approval-notify.label"),
+ activity: Activity_Type.TYPE_ISSUE_APPROVAL_NOTIFY,
+ },
];
};
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index c36ec65b70..d57c55f113 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -5206,6 +5206,7 @@ TYPE_ISSUE_CREATE represents creating an issue. |
| TYPE_ISSUE_COMMENT_CREATE | 2 | TYPE_ISSUE_COMMENT_CREATE represents commenting on an issue. |
| TYPE_ISSUE_FIELD_UPDATE | 3 | TYPE_ISSUE_FIELD_UPDATE represents updating the issue field, likes title, description, assignee, etc. |
| TYPE_ISSUE_STATUS_UPDATE | 4 | TYPE_ISSUE_STATUS_UPDATE represents the issue status change, including OPEN, CLOSE, CANCEL fow now. |
+| TYPE_ISSUE_APPROVAL_NOTIFY | 21 | TYPE_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval. |
| TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE | 5 | TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now. |
| TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE | 6 | TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now. |
| TYPE_ISSUE_PIPELINE_TASK_FILE_COMMIT | 7 | TYPE_ISSUE_PIPELINE_TASK_FILE_COMMIT represents the VCS trigger to commit a file to update the task statement. |
diff --git a/proto/generated-go/v1/project_service.pb.go b/proto/generated-go/v1/project_service.pb.go
index e1ea81fd1a..e0886c4f04 100644
--- a/proto/generated-go/v1/project_service.pb.go
+++ b/proto/generated-go/v1/project_service.pb.go
@@ -506,6 +506,8 @@ const (
Activity_TYPE_ISSUE_FIELD_UPDATE Activity_Type = 3
// TYPE_ISSUE_STATUS_UPDATE represents the issue status change, including OPEN, CLOSE, CANCEL fow now.
Activity_TYPE_ISSUE_STATUS_UPDATE Activity_Type = 4
+ // TYPE_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval.
+ Activity_TYPE_ISSUE_APPROVAL_NOTIFY Activity_Type = 21
// TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now.
Activity_TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE Activity_Type = 5
// TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now.
@@ -554,6 +556,7 @@ var (
2: "TYPE_ISSUE_COMMENT_CREATE",
3: "TYPE_ISSUE_FIELD_UPDATE",
4: "TYPE_ISSUE_STATUS_UPDATE",
+ 21: "TYPE_ISSUE_APPROVAL_NOTIFY",
5: "TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE",
6: "TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE",
7: "TYPE_ISSUE_PIPELINE_TASK_FILE_COMMIT",
@@ -577,6 +580,7 @@ var (
"TYPE_ISSUE_COMMENT_CREATE": 2,
"TYPE_ISSUE_FIELD_UPDATE": 3,
"TYPE_ISSUE_STATUS_UPDATE": 4,
+ "TYPE_ISSUE_APPROVAL_NOTIFY": 21,
"TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE": 5,
"TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE": 6,
"TYPE_ISSUE_PIPELINE_TASK_FILE_COMMIT": 7,
@@ -4109,8 +4113,8 @@ var file_v1_project_service_proto_rawDesc = []byte{
0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20,
- 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xde, 0x05, 0x0a, 0x08,
- 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x22, 0xd1, 0x05, 0x0a, 0x04, 0x54, 0x79, 0x70,
+ 0x03, 0x28, 0x09, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xfe, 0x05, 0x0a, 0x08,
+ 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x22, 0xf1, 0x05, 0x0a, 0x04, 0x54, 0x79, 0x70,
0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x1d,
@@ -4119,7 +4123,9 @@ var file_v1_project_service_proto_rawDesc = []byte{
0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c,
0x44, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
- 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x59, 0x50, 0x45,
+ 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, 0x5f,
+ 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x15, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x49, 0x53, 0x53, 0x55, 0x45, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x5f,
0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x50, 0x44,
0x41, 0x54, 0x45, 0x10, 0x05, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x53,
diff --git a/proto/v1/project_service.proto b/proto/v1/project_service.proto
index f457680f1a..5d8800ae19 100644
--- a/proto/v1/project_service.proto
+++ b/proto/v1/project_service.proto
@@ -591,6 +591,8 @@ message Activity {
TYPE_ISSUE_FIELD_UPDATE = 3;
// TYPE_ISSUE_STATUS_UPDATE represents the issue status change, including OPEN, CLOSE, CANCEL fow now.
TYPE_ISSUE_STATUS_UPDATE = 4;
+ // TYPE_ISSUE_APPROVAL_NOTIFY is the type for notifying issue approval.
+ TYPE_ISSUE_APPROVAL_NOTIFY = 21;
// TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE represents the pipeline stage status change, including BEGIN, END for now.
TYPE_ISSUE_PIPELINE_STAGE_STATUS_UPDATE = 5;
// TYPE_ISSUE_PIPELINE_TASK_STATUS_UPDATE represents the pipeline task status change, including PENDING, PENDING_APPROVAL, RUNNING, SUCCESS, FAILURE, CANCELED for now.