Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: disallow modify comment for approval rejected comments (#3655)
p0ny33f127a91d0a
diff --git a/api/activity.go b/api/activity.goindex f3181e3290..a7ca1e3675 100644--- a/api/activity.go+++ b/api/activity.go@@ -89,7 +89,7 @@ type ActivityIssueCreatePayload struct {// ActivityIssueCommentCreatePayload is the API message payloads for creating issue comments.type ActivityIssueCommentCreatePayload struct {- ExternalApprovalEvent *ExternalApprovalEvent `json:"externalApprovalEvent"`+ ExternalApprovalEvent *ExternalApprovalEvent `json:"externalApprovalEvent,omitempty"`// Used by inbox to display info without paying the join costIssueName string `json:"issueName"`diff --git a/frontend/src/components/Issue/IssueActivityPanel.vue b/frontend/src/components/Issue/IssueActivityPanel.vueindex 4736aeefd4..9cf16e6c7b 100644--- a/frontend/src/components/Issue/IssueActivityPanel.vue+++ b/frontend/src/components/Issue/IssueActivityPanel.vue@@ -339,6 +339,7 @@ import type {IssueSubscriber,ActivityTaskFileCommitPayload,Task,+ ActivityIssueCommentCreatePayload,} from "@/types";import { UNKNOWN_ID, EMPTY_ID, SYSTEM_BOT_ID } from "@/types";import { findTaskById, issueSlug, sizeToFit, taskSlug } from "@/utils";@@ -533,10 +534,17 @@ const lgtm = (e: Event) => {};const allowEditActivity = (activity: Activity) => {- return (- activity.type === "bb.issue.comment.create" &&- currentUser.value.id === activity.creator.id- );+ if (activity.type !== "bb.issue.comment.create") {+ return false;+ }+ if (currentUser.value.id !== activity.creator.id) {+ return false;+ }+ const payload = activity.payload as ActivityIssueCommentCreatePayload;+ if (payload && payload.externalApprovalEvent) {+ return false;+ }+ return true;};const onUpdateComment = (activity: Activity) => {