Skip to content

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

Rename event/action to activity to unify the name

天舟209ec3e37dcf
diff --git a/frontend/src/components/ProjectWebhookCard.vue b/frontend/src/components/ProjectWebhookCard.vue
index 392ffb39fe..328c48052f 100644
--- a/frontend/src/components/ProjectWebhookCard.vue
+++ b/frontend/src/components/ProjectWebhookCard.vue
@@ -26,7 +26,9 @@
</dd>
</div>
<div class="grid grid-cols-5 gap-4 px-4 py-2 items-center">
- <dt class="text-sm font-medium text-control-light">Events</dt>
+ <dt class="text-sm font-medium text-control-light">
+ Triggering activities
+ </dt>
<dd class="py-0.5 flex text-sm text-main col-span-4">
{{ activityListStr }}
</dd>
@@ -64,7 +66,7 @@ import PrincipalAvatar from "../components/PrincipalAvatar.vue";
import {
ProjectWebhook,
PROJECT_HOOK_TYPE_ITEM_LIST,
- PROJECT_HOOK_EVENT_ITEM_LIST,
+ PROJECT_HOOK_ACTIVITY_ITEM_LIST,
redirectURL,
} from "../types";
import { projectWebhookSlug } from "../utils";
@@ -106,8 +108,8 @@ export default {
const activityListStr = computed(() => {
const list = props.projectWebhook.activityList.map((activity) => {
- for (const item of PROJECT_HOOK_EVENT_ITEM_LIST) {
- if (item.event == activity) {
+ for (const item of PROJECT_HOOK_ACTIVITY_ITEM_LIST) {
+ if (item.activity == activity) {
return item.title;
}
}
diff --git a/frontend/src/components/ProjectWebhookForm.vue b/frontend/src/components/ProjectWebhookForm.vue
index fdac595df1..8c68f0389f 100644
--- a/frontend/src/components/ProjectWebhookForm.vue
+++ b/frontend/src/components/ProjectWebhookForm.vue
@@ -69,19 +69,21 @@
/>
</div>
<div>
- <div class="text-md leading-6 font-medium text-main">Events</div>
+ <div class="text-md leading-6 font-medium text-main">
+ Triggering activities
+ </div>
<div
- v-for="(item, index) in PROJECT_HOOK_EVENT_ITEM_LIST"
+ v-for="(item, index) in PROJECT_HOOK_ACTIVITY_ITEM_LIST"
:key="index"
class="mt-4 space-y-4"
>
<BBCheckbox
:title="item.title"
:label="item.label"
- :value="eventOn(item.event)"
+ :value="eventOn(item.activity)"
@toggle="
(on) => {
- toggleEvent(item.event, on);
+ toggleEvent(item.activity, on);
}
"
/>
@@ -137,13 +139,13 @@
import { reactive } from "@vue/reactivity";
import { computed, PropType, watch } from "@vue/runtime-core";
import {
- ActionType,
+ ActivityType,
Project,
ProjectWebhook,
ProjectWebhookCreate,
ProjectWebhookPatch,
PROJECT_HOOK_TYPE_ITEM_LIST,
- PROJECT_HOOK_EVENT_ITEM_LIST,
+ PROJECT_HOOK_ACTIVITY_ITEM_LIST,
} from "../types";
import { cloneDeep, isEmpty, isEqual } from "lodash";
import { useRouter } from "vue-router";
@@ -239,7 +241,7 @@ export default {
);
});
- const eventOn = (type: ActionType) => {
+ const eventOn = (type: ActivityType) => {
for (const activityType of props.webhook.activityList) {
if (activityType == type) {
return true;
@@ -248,7 +250,7 @@ export default {
return false;
};
- const toggleEvent = (type: ActionType, on: boolean) => {
+ const toggleEvent = (type: ActivityType, on: boolean) => {
if (on) {
for (const activityType of state.webhook.activityList) {
if (activityType == type) {
@@ -257,7 +259,7 @@ export default {
}
state.webhook.activityList.push(type);
} else {
- const list: ActionType[] = [];
+ const list: ActivityType[] = [];
for (const activityType of state.webhook.activityList) {
if (activityType != type) {
list.push(activityType);
@@ -344,7 +346,7 @@ export default {
return {
PROJECT_HOOK_TYPE_ITEM_LIST,
- PROJECT_HOOK_EVENT_ITEM_LIST,
+ PROJECT_HOOK_ACTIVITY_ITEM_LIST,
state,
namePlaceholder,
urlPlaceholder,
diff --git a/frontend/src/types/activity.ts b/frontend/src/types/activity.ts
index 2a20e6ab91..f7ac12f0c5 100644
--- a/frontend/src/types/activity.ts
+++ b/frontend/src/types/activity.ts
@@ -5,20 +5,20 @@ import { MemberStatus, RoleType } from "./member";
import { TaskStatus } from "./pipeline";
import { Principal } from "./principal";
-export type IssueActionType =
+export type IssueActivityType =
| "bb.issue.create"
| "bb.issue.comment.create"
| "bb.issue.field.update"
| "bb.issue.status.update"
| "bb.pipeline.task.status.update";
-export type MemberActionType =
+export type MemberActivityType =
| "bb.member.create"
| "bb.member.role.update"
| "bb.member.activate"
| "bb.member.deactivate";
-export type ActionType = IssueActionType | MemberActionType;
+export type ActivityType = IssueActivityType | MemberActivityType;
export type ActivityLevel = "INFO" | "WARNING" | "ERROR";
@@ -97,7 +97,7 @@ export type Activity = {
// The object where this activity belongs
// e.g if actionType is "bb.issue.xxx", then this field refers to the corresponding issue's id.
containerId: ContainerId;
- actionType: ActionType;
+ actionType: ActivityType;
level: ActivityLevel;
comment: string;
payload?: ActionPayloadType;
@@ -106,7 +106,7 @@ export type Activity = {
export type ActivityCreate = {
// Domain specific fields
containerId: ContainerId;
- actionType: ActionType;
+ actionType: ActivityType;
comment: string;
payload?: ActionPayloadType;
};
diff --git a/frontend/src/types/projectWebhook.ts b/frontend/src/types/projectWebhook.ts
index 905e09e89a..d6304416c5 100644
--- a/frontend/src/types/projectWebhook.ts
+++ b/frontend/src/types/projectWebhook.ts
@@ -1,4 +1,4 @@
-import { ActionType } from "./activity";
+import { ActivityType } from "./activity";
import { MemberId, ProjectId } from "./id";
import { Principal } from "./principal";
@@ -48,32 +48,32 @@ export const PROJECT_HOOK_TYPE_ITEM_LIST: ProjectWebhookTypeItem[] = [
},
];
-type ProjectWebhookEventItem = {
+type ProjectWebhookActivityItem = {
title: string;
label: string;
- event: ActionType;
+ activity: ActivityType;
};
-export const PROJECT_HOOK_EVENT_ITEM_LIST: ProjectWebhookEventItem[] = [
+export const PROJECT_HOOK_ACTIVITY_ITEM_LIST: ProjectWebhookActivityItem[] = [
{
title: "Issue status change",
label: "When issue status has changed",
- event: "bb.issue.status.update",
+ activity: "bb.issue.status.update",
},
{
title: "Issue task status change",
label: "When issue's enclosing task status has changed",
- event: "bb.pipeline.task.status.update",
+ activity: "bb.pipeline.task.status.update",
},
{
title: "Issue info change",
label: "When issue info (e.g. assignee, title, description) has changed",
- event: "bb.issue.field.update",
+ activity: "bb.issue.field.update",
},
{
title: "Issue comment creation",
label: "When new issue comment has been created",
- event: "bb.issue.comment.create",
+ activity: "bb.issue.comment.create",
},
];
@@ -94,7 +94,7 @@ export type ProjectWebhook = {
type: string;
name: string;
url: string;
- activityList: ActionType[];
+ activityList: ActivityType[];
};
export type ProjectWebhookCreate = {
@@ -102,7 +102,7 @@ export type ProjectWebhookCreate = {
type: string;
name: string;
url: string;
- activityList: ActionType[];
+ activityList: ActivityType[];
};
export type ProjectWebhookPatch = {