Skip to content

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

chore(frontend): retire assignee (more) (#12058)

Liu Jia4255e9d69ba
diff --git a/frontend/src/components/Issue/panel/RequestExportPanel/index.vue b/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
index 553450ffab..560ac80499 100644
--- a/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
+++ b/frontend/src/components/Issue/panel/RequestExportPanel/index.vue
@@ -90,7 +90,7 @@
<script lang="ts" setup>
import dayjs from "dayjs";
-import { head, isUndefined } from "lodash-es";
+import { isUndefined } from "lodash-es";
import { NButton, NInput, NInputNumber } from "naive-ui";
import { computed, onMounted, reactive } from "vue";
import { useI18n } from "vue-i18n";
@@ -107,7 +107,7 @@ import {
pushNotification,
} from "@/store";
import type { DatabaseResource, ComposedProject } from "@/types";
-import { SYSTEM_BOT_EMAIL, UNKNOWN_ID, PresetRoleType } from "@/types";
+import { UNKNOWN_ID, PresetRoleType } from "@/types";
import { Duration } from "@/types/proto/google/protobuf/duration";
import { Expr } from "@/types/proto/google/type/expr";
import { Issue, Issue_Type } from "@/types/proto/v1/issue_service";
@@ -115,7 +115,6 @@ import {
extractProjectResourceName,
hasProjectPermissionV2,
issueSlug,
- memberListInProjectV1,
} from "@/utils";
import DatabaseResourceForm from "../RequestQueryPanel/DatabaseResourceForm/index.vue";
@@ -237,21 +236,10 @@ const doCreateIssue = async () => {
title: generateIssueName(),
description: state.description,
type: Issue_Type.GRANT_REQUEST,
- assignee: `users/${SYSTEM_BOT_EMAIL}`,
grantRequest: {},
});
- // update issue's assignee to first project owner.
const project = await projectStore.getOrFetchProjectByUID(state.projectId!);
- const memberList = memberListInProjectV1(project, project.iamPolicy);
- const ownerList = memberList.filter((member) =>
- member.roleList.includes(PresetRoleType.PROJECT_OWNER)
- );
- const projectOwner = head(ownerList);
- if (projectOwner) {
- newIssue.assignee = `users/${projectOwner.user.email}`;
- }
-
const expression: string[] = [];
const expireDays = state.expireDays;
expression.push(
diff --git a/frontend/src/components/Issue/panel/RequestQueryPanel/index.vue b/frontend/src/components/Issue/panel/RequestQueryPanel/index.vue
index 147950d2f2..c82dc4e596 100644
--- a/frontend/src/components/Issue/panel/RequestQueryPanel/index.vue
+++ b/frontend/src/components/Issue/panel/RequestQueryPanel/index.vue
@@ -80,7 +80,7 @@
<script lang="ts" setup>
import dayjs from "dayjs";
-import { head, isUndefined, uniq } from "lodash-es";
+import { isUndefined, uniq } from "lodash-es";
import { NButton, NInput } from "naive-ui";
import { computed, reactive } from "vue";
import { useI18n } from "vue-i18n";
@@ -96,15 +96,11 @@ import {
useProjectV1Store,
} from "@/store";
import type { ComposedDatabase, DatabaseResource } from "@/types";
-import { SYSTEM_BOT_EMAIL, UNKNOWN_ID, PresetRoleType } from "@/types";
+import { UNKNOWN_ID, PresetRoleType } from "@/types";
import { Duration } from "@/types/proto/google/protobuf/duration";
import { Expr } from "@/types/proto/google/type/expr";
import { Issue, Issue_Type } from "@/types/proto/v1/issue_service";
-import {
- extractProjectResourceName,
- issueSlug,
- memberListInProjectV1,
-} from "@/utils";
+import { extractProjectResourceName, issueSlug } from "@/utils";
import DatabaseResourceForm from "./DatabaseResourceForm/index.vue";
interface LocalState {
@@ -212,22 +208,12 @@ const doCreateIssue = async () => {
title: generateIssueName(),
description: state.description,
type: Issue_Type.GRANT_REQUEST,
- assignee: `users/${SYSTEM_BOT_EMAIL}`,
grantRequest: {},
});
- // update issue's assignee to first project owner.
const project = await useProjectV1Store().getOrFetchProjectByUID(
state.projectId!
);
- const memberList = memberListInProjectV1(project, project.iamPolicy);
- const ownerList = memberList.filter((member) =>
- member.roleList.includes(PresetRoleType.PROJECT_OWNER)
- );
- const projectOwner = head(ownerList);
- if (projectOwner) {
- newIssue.assignee = `users/${projectOwner.user.email}`;
- }
const expression: string[] = [];
const expireDays = state.expireDays;
diff --git a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
index dc447881d0..bd8f35eb2a 100644
--- a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
@@ -116,10 +116,9 @@ const allowEdit = computed(() => {
}
if (
- extractUserResourceName(issue.value.assignee) === currentUser.value.email ||
extractUserResourceName(issue.value.creator) === currentUser.value.email
) {
- // Allowed if current user is the assignee or creator.
+ // Allowed if current user is the creator.
return true;
}
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Title.vue b/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
index be3cb1f39c..9bac2e3ea7 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Title.vue
@@ -72,10 +72,9 @@ const allowEdit = computed(() => {
}
if (
- extractUserResourceName(issue.value.assignee) === currentUser.value.email ||
extractUserResourceName(issue.value.creator) === currentUser.value.email
) {
- // Allowed if current user is the assignee or creator.
+ // Allowed if current user is the creator.
return true;
}
diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionIcon.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionIcon.vue
index 74adbfb919..5c50347f4f 100644
--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionIcon.vue
+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionIcon.vue
@@ -196,13 +196,10 @@ const icon = computed((): ActionIconType => {
}
return action;
} else if (issueComment.type === IssueCommentType.ISSUE_UPDATE) {
- const { toTitle, toDescription, toAssignee } =
- IssueComment_IssueUpdate.fromPartial(issueComment.issueUpdate || {});
- if (
- toAssignee !== undefined ||
- toTitle !== undefined ||
- toDescription !== undefined
- ) {
+ const { toTitle, toDescription } = IssueComment_IssueUpdate.fromPartial(
+ issueComment.issueUpdate || {}
+ );
+ if (toTitle !== undefined || toDescription !== undefined) {
return "update";
}
// Otherwise, show avatar icon based on the creator.
diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue
index c2ba4022f9..05574bcf40 100644
--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue
+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue
@@ -7,14 +7,9 @@ import dayjs from "dayjs";
import type { h } from "vue";
import { defineComponent } from "vue";
import { Translation, useI18n } from "vue-i18n";
-import {
- IssueCommentType,
- useUserStore,
- type ComposedIssueComment,
-} from "@/store";
+import { IssueCommentType, type ComposedIssueComment } from "@/store";
import type { ComposedIssue } from "@/types";
import { SYSTEM_BOT_EMAIL } from "@/types";
-import { unknownUser } from "@/types";
import {
IssueComment_Approval,
IssueComment_Approval_Status,
@@ -45,7 +40,6 @@ const props = defineProps<{
}>();
const { t } = useI18n();
-const userStore = useUserStore();
const renderActionSentence = () => {
const { issueComment, issue } = props;
@@ -72,8 +66,6 @@ const renderActionSentence = () => {
toDescription,
fromStatus,
toStatus,
- fromAssignee,
- toAssignee,
} = IssueComment_IssueUpdate.fromPartial(issueComment.issueUpdate || {});
if (fromTitle !== undefined && toTitle !== undefined) {
return t("activity.sentence.changed-from-to", {
@@ -92,33 +84,6 @@ const renderActionSentence = () => {
} else if (toStatus === IssueStatus.OPEN) {
return t("activity.sentence.reopened-issue");
}
- } else if (fromAssignee !== undefined || toAssignee !== undefined) {
- if (fromAssignee && toAssignee) {
- const oldName = (
- userStore.getUserByIdentifier(fromAssignee) ?? unknownUser()
- ).title;
- const newName = (
- userStore.getUserByIdentifier(toAssignee) ?? unknownUser()
- ).title;
- return t("activity.sentence.reassigned-issue", {
- oldName,
- newName,
- });
- } else if (!fromAssignee && toAssignee) {
- const newName = (
- userStore.getUserByIdentifier(toAssignee) ?? unknownUser()
- ).title;
- return t("activity.sentence.assigned-issue", { newName });
- } else if (fromAssignee && !toAssignee) {
- const oldName = (
- userStore.getUserByIdentifier(fromAssignee) ?? unknownUser()
- ).title;
- return t("activity.sentence.unassigned-issue", {
- oldName,
- });
- } else {
- return t("activity.sentence.invalid-assignee-update");
- }
}
} else if (issueComment.type === IssueCommentType.STAGE_END) {
const { stage } = IssueComment_StageEnd.fromPartial(
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue
index e76b5a9639..e604aba444 100644
--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue
+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue
@@ -48,15 +48,11 @@ const show = computed(() => {
const allowRunChecks = computed(() => {
// Allowing below users to run plan checks
// - the creator of the issue
- // - the assignee of the issue
// - ones who have bb.planCheckRuns.run permission in the project
const me = currentUser.value;
if (extractUserResourceName(issue.value.creator) === me.email) {
return true;
}
- if (extractUserResourceName(issue.value.assignee) === me.email) {
- return true;
- }
if (
hasProjectPermissionV2(
issue.value.projectEntity,
diff --git a/frontend/src/components/IssueV1/components/Sidebar/Assignee/Assignee.vue b/frontend/src/components/IssueV1/components/Sidebar/Assignee/Assignee.vue
deleted file mode 100644
index 1602d94ac5..0000000000
--- a/frontend/src/components/IssueV1/components/Sidebar/Assignee/Assignee.vue
+++ /dev/null
@@ -1,269 +0,0 @@
-<template>
- <div v-if="shouldShowAssignee" class="flex flex-col gap-y-1">
- <div class="flex items-center gap-1">
- <NTooltip>
- <template #trigger>
- <div class="flex items-center gap-x-1 textlabel">
- <span>{{ $t("common.assignee") }}</span>
- </div>
- </template>
- <template #default>
- <div class="max-w-[14rem]">
- {{ $t("issue.assignee-tooltip") }}
- </div>
- </template>
- </NTooltip>
- </div>
-
- <NTooltip :disabled="errors.length === 0">
- <template #trigger>
- <UserSelect
- :multiple="false"
- :user="assigneeUID"
- :disabled="errors.length > 0 || isUpdating"
- :loading="isUpdating"
- :filter="filterAssignee"
- :include-system-bot="false"
- :map-options="mapUserOptions"
- :fallback-option="fallbackUser"
- :clearable="true"
- :auto-reset="false"
- @update:user="changeAssigneeUID"
- />
- </template>
- <template #default>
- <ErrorList :errors="errors" class="max-w-[24rem] !whitespace-normal" />
- </template>
- </NTooltip>
- </div>
-</template>
-
-<script setup lang="ts">
-import { asyncComputed } from "@vueuse/core";
-import type { SelectGroupOption } from "naive-ui";
-import { NTooltip } from "naive-ui";
-import { computed, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import {
- allowUserToChangeAssignee,
- useIssueContext,
- useWrappedReviewStepsV1,
-} from "@/components/IssueV1/logic";
-import type { ErrorItem } from "@/components/misc/ErrorList.vue";
-import ErrorList from "@/components/misc/ErrorList.vue";
-import { UserSelect } from "@/components/v2";
-import { issueServiceClient } from "@/grpcweb";
-import { emitWindowEvent } from "@/plugins";
-import {
- pushNotification,
- useCurrentUserV1,
- usePageMode,
- useUserStore,
-} from "@/store";
-import {
- SYSTEM_BOT_EMAIL,
- SYSTEM_BOT_ID,
- SYSTEM_BOT_USER_NAME,
- UNKNOWN_ID,
- unknownUser,
-} from "@/types";
-import type { User } from "@/types/proto/v1/auth_service";
-import { Issue } from "@/types/proto/v1/issue_service";
-import {
- extractUserResourceName,
- extractUserUID,
- hasProjectPermissionV2,
- isDatabaseChangeRelatedIssue,
-} from "@/utils";
-
-const { t } = useI18n();
-const userStore = useUserStore();
-const pageMode = usePageMode();
-const { isCreating, issue, reviewContext, releaserCandidates } =
- useIssueContext();
-const currentUser = useCurrentUserV1();
-const isUpdating = ref(false);
-
-const shouldShowAssignee = computed(() => {
- return (
- !isCreating.value &&
- pageMode.value === "BUNDLED" &&
- isDatabaseChangeRelatedIssue(issue.value)
- );
-});
-
-const assigneeEmail = computed(() => {
- const assignee = issue.value.assignee;
- if (!assignee) return undefined;
- return extractUserResourceName(assignee);
-});
-
-const assigneeUID = computed(() => {
- if (!assigneeEmail.value) return undefined;
- if (assigneeEmail.value === SYSTEM_BOT_EMAIL) return String(SYSTEM_BOT_ID);
- const user = userStore.getUserByEmail(assigneeEmail.value);
- if (!user) return undefined;
- return extractUserUID(user.name);
-});
-
-const allowChangeAssignee = computed(() => {
- if (isCreating.value) {
- return true;
- }
- return allowUserToChangeAssignee(currentUser.value, issue.value);
-});
-
-const errors = asyncComputed(async () => {
- const errors: ErrorItem[] = [];
- if (!allowChangeAssignee.value) {
- errors.push(t("issue.you-are-not-allowed-to-change-this-value"));
- }
- return errors;
-}, []);
-
-const changeAssigneeUID = async (uid: string | undefined) => {
- if (!uid || uid === String(UNKNOWN_ID)) {
- issue.value.assignee = "";
- } else {
- const assignee = userStore.getUserById(uid);
- if (!assignee) {
- issue.value.assignee = "";
- } else {
- issue.value.assignee = `users/${assignee.email}`;
- }
- }
-
- if (!isCreating.value) {
- const issuePatch = Issue.fromJSON(issue.value);
- isUpdating.value = true;
- try {
- const updated = await issueServiceClient.updateIssue({
- issue: issuePatch,
- updateMask: ["assignee"],
- });
- Object.assign(issue.value, updated);
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("common.updated"),
- });
- emitWindowEvent("bb.issue-field-update");
- } finally {
- isUpdating.value = false;
- }
- }
-};
-
-const filterAssignee = (user: User): boolean => {
- // Users can be assignee candidates only if they have permission to "See"
- // the issue
- return hasProjectPermissionV2(
- issue.value.projectEntity,
- user,
- "bb.issues.get"
- );
-};
-
-const mapUserOptions = (users: User[]) => {
- const project = issue.value.projectEntity;
- const phase = isCreating.value
- ? "PREVIEW"
- : reviewContext.done.value
- ? "CD"
- : "CI";
- const added = new Set<string>(); // by user.name
- const groups: SelectGroupOption[] = [];
- const mapUserOption = (user: User) => ({
- user,
- value: extractUserUID(user.name),
- label: user.title,
- });
- // `addGroup` ensures that
- // 1. any users will be added at most once
- // 2. empty groups will not be added
- const addGroup = (group: SelectGroupOption, users: User[]) => {
- const filteredUsers = users.filter((u) => !added.has(u.name));
- if (filteredUsers.length > 0) {
- filteredUsers.forEach((u) => added.add(u.name));
- group.children = filteredUsers.map(mapUserOption);
- groups.push(group);
- }
- };
-
- // Groups in order
- // - current assignee
- // - approvers of current step (CI phase only)
- // - releasers of current stage (CD phase only)
- // - project or workspace owners
- if (assigneeEmail.value) {
- const assignee = userStore.getUserByEmail(assigneeEmail.value);
- if (assignee) {
- addGroup(
- {
- type: "group",
- label: t("issue.assignee.current-assignee"),
- key: "current-assignee",
- },
- [assignee]
- );
- }
- }
-
- if (phase === "CI") {
- const steps = useWrappedReviewStepsV1(issue, reviewContext);
- const currentStep = steps.value?.find((step) => step.status === "CURRENT");
- addGroup(
- {
- type: "group",
- label: t("issue.assignee.approvers-of-current-step"),
- key: "approvers",
- },
- currentStep?.candidates ?? []
- );
- }
- if (phase === "CD") {
- const candidates = new Set(releaserCandidates.value.map((c) => c.name));
- const releasers = users.filter((user) => candidates.has(user.name));
- addGroup(
- {
- type: "group",
- label: t("issue.assignee.releasers-of-current-stage"),
- key: "releasers",
- },
- releasers
- );
- }
- const owners = users.filter((user) =>
- hasProjectPermissionV2(project, user, "bb.issues.update")
- );
- addGroup(
- {
- type: "group",
- label: t("issue.assignee.project-owners"),
- key: "project-owners",
- },
- owners
- );
-
- return groups;
-};
-
-const fallbackUser = (uid: string) => {
- if (uid === String(SYSTEM_BOT_ID)) {
- return {
- user: userStore.getUserByName(SYSTEM_BOT_USER_NAME)!,
- value: uid,
- };
- }
- return {
- user: unknownUser(),
- value: uid,
- };
-};
-
-defineExpose({
- shown: computed(() => {
- return shouldShowAssignee.value;
- }),
-});
-</script>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/Assignee/index.ts b/frontend/src/components/IssueV1/components/Sidebar/Assignee/index.ts
deleted file mode 100644
index aff6feea9f..0000000000
--- a/frontend/src/components/IssueV1/components/Sidebar/Assignee/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Assignee from "./Assignee.vue";
-
-export default Assignee;
diff --git a/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue b/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue
index 1cdb6a1688..2af4252daf 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue
@@ -140,12 +140,6 @@ const disallowEditReasons = computed(() => {
) {
allow = true;
}
- // Issue assignee is allowed to change the rollout time.
- if (
- extractUserResourceName(issue.value.assignee) === currentUser.value.email
- ) {
- allow = true;
- }
if (
hasProjectPermissionV2(
issue.value.projectEntity,
diff --git a/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts b/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts
index bd3a6c3d85..8289baf546 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts
+++ b/frontend/src/components/IssueV1/components/Sidebar/RollbackSection/common.ts
@@ -104,11 +104,6 @@ export const useRollbackContext = () => {
return true;
}
- if (user.email === extractUserResourceName(issue.value.assignee)) {
- // Allowed to the issue assignee
- return true;
- }
-
if (hasProjectPermissionV2(project.value, user, "bb.plans.update")) {
return true;
}
diff --git a/frontend/src/components/IssueV1/logic/action/issue.ts b/frontend/src/components/IssueV1/logic/action/issue.ts
index a83e4878fd..785c82d69d 100644
--- a/frontend/src/components/IssueV1/logic/action/issue.ts
+++ b/frontend/src/components/IssueV1/logic/action/issue.ts
@@ -111,13 +111,10 @@ export const allowUserToApplyIssueStatusAction = (
return true;
}
- // The creator and the assignee are allowed.
+ // The creator is allowed.
if (extractUserResourceName(issue.creator) === user.email) {
return true;
}
- if (extractUserResourceName(issue.assignee) === user.email) {
- return true;
- }
return false;
};
diff --git a/frontend/src/components/IssueV1/logic/assignee.ts b/frontend/src/components/IssueV1/logic/assignee.ts
deleted file mode 100644
index 6209200eb0..0000000000
--- a/frontend/src/components/IssueV1/logic/assignee.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import type { ComposedIssue } from "@/types";
-import type { User } from "@/types/proto/v1/auth_service";
-import { IssueStatus } from "@/types/proto/v1/issue_service";
-import { extractUserResourceName, hasProjectPermissionV2 } from "@/utils";
-
-export const allowUserToChangeAssignee = (user: User, issue: ComposedIssue) => {
- if (issue.status !== IssueStatus.OPEN) {
- return false;
- }
-
- if (hasProjectPermissionV2(issue.projectEntity, user, "bb.issues.update")) {
- return true;
- }
-
- const currentUserEmail = user.email;
-
- const creatorEmail = extractUserResourceName(issue.creator);
- if (currentUserEmail === creatorEmail) {
- // The creator of the issue can change the assignee.
- return true;
- }
-
- const assigneeEmail = extractUserResourceName(issue.assignee);
- if (currentUserEmail === assigneeEmail) {
- // The current assignee can re-assignee (forward) to another assignee.
- return true;
- }
-
- return false;
-};
diff --git a/frontend/src/components/IssueV1/logic/index.ts b/frontend/src/components/IssueV1/logic/index.ts
index d9762b2020..ed9a170142 100644
--- a/frontend/src/components/IssueV1/logic/index.ts
+++ b/frontend/src/components/IssueV1/logic/index.ts
@@ -1,7 +1,6 @@
export * from "./context";
export * from "./base";
export * from "./common";
-export * from "./assignee";
export * from "./releaser";
export * from "./plan";
export * from "./review";
diff --git a/frontend/src/components/IssueV1/logic/transition.ts b/frontend/src/components/IssueV1/logic/transition.ts
index 1d3f957958..6f948b7100 100644
--- a/frontend/src/components/IssueV1/logic/transition.ts
+++ b/frontend/src/components/IssueV1/logic/transition.ts
@@ -109,13 +109,10 @@ const allowUserToApplyIssueStatusTransition = (
return true;
}
- // The creator and the assignee can apply issue status transition
+ // The creator can apply issue status transition
if (user.name === issue.creatorEntity.name) {
return true;
}
- if (user.name === issue.assigneeEntity?.name) {
- return true;
- }
return false;
};
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 0e9ba5d7de..9e2c995b09 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -76,7 +76,6 @@
"role": {
"self": "Role"
},
- "assignee": "Assignee",
"revert": "Revert",
"apply": "Apply",
"reorder": "Reorder",
@@ -336,7 +335,6 @@
"warn": "Warning",
"error": "Error"
},
- "earliest-allowed-time-no-modify": "You cannot modify this field because you are not the issue assignee or it's not pending to run.",
"type": {
"bb-task-database-schema-update-ghost-sync": "Sync data",
"bb-task-database-schema-update-ghost-cutover": "Switch tables",
@@ -896,10 +894,6 @@
"sentence": {
"created-issue": "created issue",
"commented": "commented",
- "reassigned-issue": "reassigned issue from {oldName} to {newName}",
- "assigned-issue": "assigned issue to {newName}",
- "unassigned-issue": "unassigned issue from {oldName}",
- "invalid-assignee-update": "invalid assignee update",
"changed-description": "changed description",
"changed-from-to": "changed {name} from \"{oldValue}\" to \"{newValue}\"",
"unset-from": "unset {name} from \"{oldValue}\"",
@@ -1015,17 +1009,13 @@
"title": "Creator",
"description": "Search by the issue creator"
},
- "assignee": {
- "title": "Assignee",
- "description": "Search by the issue assignee"
- },
"subscriber": {
"title": "Subscriber",
"description": "Search by the issue subscriber"
},
"principal": {
"title": "Related Principal",
- "description": "Search by the issue creator, assignee or subscriber"
+ "description": "Search by the issue creator or subscriber"
},
"approver": {
"title": "Approver",
@@ -1066,7 +1056,6 @@
"updated": "Updated",
"approver": "Approver",
"creator": "Creator",
- "assignee": "Assignee",
"current-approver": "Current approver"
},
"stage-select": {
@@ -1113,19 +1102,12 @@
},
"will-rollback": "This task will rollback {link}",
"issue-link-with-task": "Issue {issue} - task {task}",
- "assignee-attention": {
- "send-approval-request-successfully": "Send a {im} approval request successfully",
- "send-attention-request-successfully": "Request assignee {principal} attention successfully",
- "needs-attention": "Attention needed",
- "click-to-mark": "Click to request assignee attention"
- },
"sdl": {
"schema-change": "Schema change",
"generated-ddl-statements": "Generated DDL statements",
"full-schema": "Full schema",
"left-schema-may-change": "The schema on the left side may change before the issue is applied."
},
- "assignee-tooltip": "The assignees are those responsible for an issue, and when an issue is assigned to them, it shows up in their list of assigned issues.",
"approval-flow": {
"self": "Approval flow",
"tooltip": "The approvers will review and approve the issue in the order specified in the flow. The issue can only be applied after all steps in the flow have been approved. You can configure a custom approval flow for each risk.",
@@ -1191,14 +1173,6 @@
"you-are-not-allowed-to-perform-this-action": "You are not allowed to perform this action"
},
"approval-requested": "Approval Requested",
- "assignee": {
- "current-assignee": "Current assignee",
- "workspace-admins": "Workspace admins",
- "workspace-dbas": "DBA",
- "project-owners": "Project owners",
- "releasers-of-current-stage": "Releasers of current stage",
- "approvers-of-current-step": "Approvers of current step"
- },
"unfinished-resolved-issue-tips": "This issue is marked as \"Done\" but some of its tasks are not executed successfully.",
"some-tasks-are-not-executed-successfully": "(Some tasks are not executed successfully)",
"preview": "Preview issue",
@@ -1911,7 +1885,7 @@
},
"issue-info-change": {
"title": "Issue info change",
- "label": "When issue info (e.g. assignee, title, description) has changed"
+ "label": "When issue info (e.g. title, description) has changed"
},
"issue-comment-creation": {
"title": "Issue comment creation",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index c40b67e5d2..873910c8f1 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -76,7 +76,6 @@
"role": {
"self": "Rol"
},
- "assignee": "Asignado",
"revert": "Revertir",
"apply": "Aplicar",
"reorder": "Reordenar",
@@ -336,7 +335,6 @@
"warn": "Advertencia",
"error": "Error"
},
- "earliest-allowed-time-no-modify": "No puedes modificar este campo porque no eres el asignado a la incidencia o no está pendiente por ejecutar.",
"type": {
"bb-task-database-schema-update-ghost-sync": "Sincronizar datos",
"bb-task-database-schema-update-ghost-cutover": "Cambiar de tabla",
@@ -896,10 +894,6 @@
"sentence": {
"created-issue": "incidencia creado",
"commented": "comentado",
- "reassigned-issue": "incidencia reasignada de {oldName} a {newName}",
- "assigned-issue": "incidencia asignada a {newName}",
- "unassigned-issue": "incidencia desasignada de {oldName}",
- "invalid-assignee-update": "actualización de asignatario no válida",
"changed-description": "cambio de descripción",
"changed-from-to": "cambio de {name} de \"{oldValue}\" a \"{newValue}\"",
"unset-from": "eliminación de {name} de \"{oldValue}\"",
@@ -1015,10 +1009,6 @@
"title": "Creador",
"description": "Búsqueda por tema creador"
},
- "assignee": {
- "title": "Cesionario",
- "description": "Buscar por el responsable del problema"
- },
"subscriber": {
"title": "Abonado",
"description": "Buscar por suscriptor del problema"
@@ -1066,7 +1056,6 @@
"updated": "Actualizado",
"approver": "Aprobador",
"creator": "Creador",
- "assignee": "Asignado",
"current-approver": "Aprobador actual"
},
"stage-select": {
@@ -1113,19 +1102,12 @@
},
"will-rollback": "Esta tarea revertirá {link}",
"issue-link-with-task": "Incidencia {issue} - tarea {task}",
- "assignee-attention": {
- "send-approval-request-successfully": "Enviar una solicitud de aprobación de {im} correctamente",
- "send-attention-request-successfully": "Solicitar la atención del asignado {principal} con éxito",
- "needs-attention": "Necesita atención",
- "click-to-mark": "Haga clic para solicitar la atención del asignado"
- },
"sdl": {
"schema-change": "Cambio de esquema",
"generated-ddl-statements": "Declaraciones DDL generadas",
"full-schema": "Esquema completo",
"left-schema-may-change": "El esquema del lado izquierdo puede cambiar antes de que se aplique la incidencia."
},
- "assignee-tooltip": "Los asignados son responsables de un problema y cuando se les asigna un problema, aparece en su lista de problemas asignados.",
"approval-flow": {
"self": "Flujo de aprobación",
"tooltip": "Los aprobadores revisarán y aprobarán el problema en el orden especificado en el flujo. \nLa emisión solo se puede aplicar después de que se hayan aprobado todos los pasos del flujo. \nPuede configurar un flujo de aprobación personalizado para cada riesgo.",
@@ -1191,14 +1173,6 @@
"you-are-not-allowed-to-perform-this-action": "No tienes permiso para realizar esta acción."
},
"approval-requested": "Aprobación solicitada",
- "assignee": {
- "current-assignee": "Asignatario actual",
- "workspace-admins": "Administrador del espacio de trabajo",
- "workspace-dbas": "DBA",
- "project-owners": "Propietarios del proyecto",
- "releasers-of-current-stage": "Liberadores de la etapa actual.",
- "approvers-of-current-step": "Aprobadores del paso actual"
- },
"unfinished-resolved-issue-tips": "Este problema está marcado como \"Listo\", pero algunas de sus tareas no se ejecutan correctamente.",
"some-tasks-are-not-executed-successfully": "(Algunas tareas no se ejecutan correctamente)",
"preview": "Problema de vista previa",
@@ -1911,7 +1885,7 @@
},
"issue-info-change": {
"title": "Cambio de información de incidencia",
- "label": "Cuando cambia la información de la incidencia (por ejemplo, asignación, título, descripción)"
+ "label": "Cuando cambia la información de la incidencia (por ejemplo, título, descripción)"
},
"issue-comment-creation": {
"title": "Creación de comentario de incidencia",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 357d6885a1..ec8c9b2577 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -76,7 +76,6 @@
"role": {
"self": "役割"
},
- "assignee": "被指名者",
"revert": "回復する",
"apply": "応用",
"reorder": "選別",
@@ -336,7 +335,6 @@
"warn": "警告する",
"error": "間違い"
},
- "earliest-allowed-time-no-modify": "チケットのレビュー担当者ではないか、チケットが保留中ではないため、このフィールドは変更できません。",
"type": {
"bb-task-database-schema-update-ghost-sync": "同期データ",
"bb-task-database-schema-update-ghost-cutover": "スイッチテーブル",
@@ -896,10 +894,6 @@
"sentence": {
"created-issue": "作業指示書を作成する",
"commented": "コメント",
- "reassigned-issue": "作業指示書を {oldName} から {newName} に再割り当てします",
- "assigned-issue": "作業指示書を {newName} に割り当てます",
- "unassigned-issue": "{oldName} からの作業指示の割り当てを解除する",
- "invalid-assignee-update": "無効な代入操作",
"changed-description": "説明の変更",
"changed-from-to": "{name} を「{oldValue}」から「{newValue}」に変更します",
"unset-from": "{name} の値を元に戻します (「{oldValue}」から)",
@@ -1015,10 +1009,6 @@
"title": "創設者",
"description": "チケット作成者で検索"
},
- "assignee": {
- "title": "被指名者",
- "description": "作業指示の担当者で検索"
- },
"subscriber": {
"title": "購読者",
"description": "チケット購入者から探す"
@@ -1066,7 +1056,6 @@
"updated": "に更新されました",
"approver": "承認者",
"creator": "創設者",
- "assignee": "被指名者",
"current-approver": "現在の承認者"
},
"stage-select": {
@@ -1113,19 +1102,12 @@
},
"will-rollback": "現在のタスクはロールバックされます {link}",
"issue-link-with-task": "チケット {issue} - タスク {task}",
- "assignee-attention": {
- "send-approval-request-successfully": "{im}承認リクエストは正常に送信されました",
- "send-attention-request-successfully": "レビューアー {principal} がフォローリクエストを受け取りました",
- "needs-attention": "注意が必要です",
- "click-to-mark": "クリックして査読者の注意をリクエストします"
- },
"sdl": {
"schema-change": "スキーマの変更",
"generated-ddl-statements": "生成されたDDLステートメント",
"full-schema": "完全なスキーマ",
"left-schema-may-change": "左側のスキーマは、チケットが実行される前に変更される可能性があります。"
},
- "assignee-tooltip": "担当者は、問題に取り組む責任のある人であり、問題が割り当てられると、その担当者の [割り当て済み問題] リストに表示されます。",
"approval-flow": {
"self": "承認の流れ",
"tooltip": "承認者は、承認フローで指定された順序で作業指示書を確認し、承認する必要があります。作業指示は、承認フローのすべてのステップが承認された後にのみ実行できます。リスクレベルごとに承認をカスタマイズできます。",
@@ -1191,14 +1173,6 @@
"you-are-not-allowed-to-perform-this-action": "このアクションを実行する権限がありません"
},
"approval-requested": "承認リクエスト",
- "assignee": {
- "current-assignee": "現在の譲受人",
- "workspace-admins": "バイトベースワークスペース管理者",
- "workspace-dbas": "DBA",
- "project-owners": "プロジェクトオーナー",
- "releasers-of-current-stage": "現在のステージの発行元",
- "approvers-of-current-step": "現在のステップの承認者"
- },
"unfinished-resolved-issue-tips": "作業指示書は「完了」とマークされましたが、一部のタスクは正常に実行されませんでした。",
"some-tasks-are-not-executed-successfully": "(一部のタスクは正常に実行されませんでした)",
"preview": "作業指示のプレビュー",
@@ -1911,7 +1885,7 @@
},
"issue-info-change": {
"title": "作業指示情報の変更",
- "label": "作業指示書の情報 (例: 担当者、タイトル、説明) が変更されたとき"
+ "label": "作業指示書の情報 (例: タイトル、説明) が変更されたとき"
},
"issue-comment-creation": {
"title": "作業指示のコメント付き",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index d6127be6a1..c820c8578b 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -76,7 +76,6 @@
"role": {
"self": "角色"
},
- "assignee": "指派人",
"revert": "恢复",
"apply": "应用",
"reorder": "排序",
@@ -336,7 +335,6 @@
"warn": "警告",
"error": "错误"
},
- "earliest-allowed-time-no-modify": "您无法修改此字段,因为您不是该工单的审核人或者它不在待执行状态。",
"type": {
"bb-task-database-schema-update-ghost-sync": "同步数据",
"bb-task-database-schema-update-ghost-cutover": "切换表",
@@ -896,10 +894,6 @@
"sentence": {
"created-issue": "创建工单",
"commented": "评论",
- "reassigned-issue": "将工单由 {oldName} 重新指派给 {newName}",
- "assigned-issue": "将工单指派给 {newName}",
- "unassigned-issue": "将工单由 {oldName} 解除指派",
- "invalid-assignee-update": "无效的指派操作",
"changed-description": "修改描述",
"changed-from-to": "将 {name} 从 \"{oldValue}\" 修改为 \"{newValue}\"",
"unset-from": "撤销 {name} 的值 (从 \"{oldValue}\")",
@@ -1015,10 +1009,6 @@
"title": "创建人",
"description": "根据工单创建人搜索"
},
- "assignee": {
- "title": "指派人",
- "description": "根据工单指派人搜索"
- },
"subscriber": {
"title": "订阅人",
"description": "根据工单订阅人搜索"
@@ -1066,7 +1056,6 @@
"updated": "更新于",
"approver": "审批人",
"creator": "创建人",
- "assignee": "指派人",
"current-approver": "当前审批人"
},
"stage-select": {
@@ -1113,19 +1102,12 @@
},
"will-rollback": "当前任务将会回滚 {link}",
"issue-link-with-task": "工单 {issue} - 任务 {task}",
- "assignee-attention": {
- "send-approval-request-successfully": "{im}审批请求发送成功",
- "send-attention-request-successfully": "审核人 {principal} 已收到关注请求",
- "needs-attention": "需要关注",
- "click-to-mark": "点击以请求审核人关注"
- },
"sdl": {
"schema-change": "Schema 变化",
"generated-ddl-statements": "生成的 DDL 语句",
"full-schema": "完整 schema",
"left-schema-may-change": "左边的 schema 在工单执行前可能会发生变化。"
},
- "assignee-tooltip": "被指派人是负责处理问题的人,当问题分配给他们时,它会显示在他们的已分配问题列表中。",
"approval-flow": {
"self": "审批流",
"tooltip": "审批人需要按审批流指定的顺序审核和审批工单。只有审批流中所有步骤都完成审批后工单才可以执行。您可以为每个风险级别自定义审批。",
@@ -1191,14 +1173,6 @@
"you-are-not-allowed-to-perform-this-action": "您无权执行此操作"
},
"approval-requested": "审批请求",
- "assignee": {
- "current-assignee": "当前指派人",
- "workspace-admins": "Bytebase 工作空间管理员",
- "workspace-dbas": "DBA",
- "project-owners": "项目所有者",
- "releasers-of-current-stage": "当前阶段的发布人",
- "approvers-of-current-step": "当前步骤的审批人"
- },
"unfinished-resolved-issue-tips": "该工单被标记为「已完成」,但其中某些任务并未成功执行。",
"some-tasks-are-not-executed-successfully": "(部分任务并未成功执行)",
"preview": "预览工单",
@@ -1911,7 +1885,7 @@
},
"issue-info-change": {
"title": "工单信息变更",
- "label": "当一个工单的信息 (比如: 指派人, 标题, 描述) 发生了变更"
+ "label": "当一个工单的信息 (比如: 标题, 描述) 发生了变更"
},
"issue-comment-creation": {
"title": "工单被评论",
diff --git a/frontend/src/plugins/index.ts b/frontend/src/plugins/index.ts
index 23b6100418..d425b266e9 100644
--- a/frontend/src/plugins/index.ts
+++ b/frontend/src/plugins/index.ts
@@ -1,3 +1,2 @@
export * from "./issue";
-export * from "./types";
export * from "./window-events";
diff --git a/frontend/src/plugins/types.ts b/frontend/src/plugins/types.ts
deleted file mode 100644
index dfab37d8c9..0000000000
--- a/frontend/src/plugins/types.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-// Issue
-// It has to be string type because the id for stage field contain multiple parts.
-export type FieldId = string;
-
-export enum IssueBuiltinFieldId {
- NAME = "1",
- STATUS = "2",
- ASSIGNEE = "3",
- DESCRIPTION = "4",
- PROJECT = "5",
- SUBSCRIBER_LIST = "6",
- SQL = "7",
-}
diff --git a/frontend/src/store/modules/v1/experimental-issue.ts b/frontend/src/store/modules/v1/experimental-issue.ts
index 4558fd0a8c..22528bc7d4 100644
--- a/frontend/src/store/modules/v1/experimental-issue.ts
+++ b/frontend/src/store/modules/v1/experimental-issue.ts
@@ -89,13 +89,6 @@ export const composeIssue = async (
}
}
- if (issue.assignee) {
- const assigneeEntity = userStore.getUserByEmail(
- extractUserResourceName(rawIssue.assignee)
- );
- issue.assigneeEntity = assigneeEntity;
- }
-
return issue;
};
diff --git a/frontend/src/store/modules/v1/issue.ts b/frontend/src/store/modules/v1/issue.ts
index f6c2646b3a..333529fa97 100644
--- a/frontend/src/store/modules/v1/issue.ts
+++ b/frontend/src/store/modules/v1/issue.ts
@@ -35,9 +35,6 @@ export const buildIssueFilter = (find: IssueFilter): string => {
if (find.creator) {
filter.push(`creator = "${find.creator}"`);
}
- if (find.assignee) {
- filter.push(`assignee = "${find.assignee}"`);
- }
if (find.subscriber) {
filter.push(`subscriber = "${find.subscriber}"`);
}
diff --git a/frontend/src/types/common.ts b/frontend/src/types/common.ts
index 2f5c411810..e2a60f1208 100644
--- a/frontend/src/types/common.ts
+++ b/frontend/src/types/common.ts
@@ -207,8 +207,6 @@ const makeUnknown = (type: ResourceType) => {
status: "DONE",
type: "bb.issue.general",
description: "",
- assignee: UNKNOWN_PRINCIPAL,
- assigneeNeedAttention: false,
subscriberList: [],
payload: {},
};
@@ -403,8 +401,6 @@ const makeEmpty = (type: ResourceType) => {
status: "DONE",
type: "bb.issue.general",
description: "",
- assignee: EMPTY_PRINCIPAL,
- assigneeNeedAttention: false,
subscriberList: [],
payload: {},
};
diff --git a/frontend/src/types/issue.ts b/frontend/src/types/issue.ts
index 62d535817c..0c7abe368f 100644
--- a/frontend/src/types/issue.ts
+++ b/frontend/src/types/issue.ts
@@ -59,8 +59,6 @@ export type Issue = {
status: IssueStatus;
type: IssueType;
description: string;
- assignee: Principal;
- assigneeNeedAttention: boolean;
subscriberList: Principal[];
payload: IssuePayload;
};
diff --git a/frontend/src/types/v1/issue/issue.ts b/frontend/src/types/v1/issue/issue.ts
index 576c2f21f8..34cb06afa9 100644
--- a/frontend/src/types/v1/issue/issue.ts
+++ b/frontend/src/types/v1/issue/issue.ts
@@ -23,7 +23,6 @@ export interface ComposedIssue extends Issue {
rolloutTaskRunList: TaskRun[];
project: string;
projectEntity: ComposedProject;
- assigneeEntity?: User;
creatorEntity: User;
}
@@ -76,7 +75,6 @@ export interface IssueFilter {
query: string;
principal?: string;
creator?: string;
- assignee?: string;
subscriber?: string;
statusList?: IssueStatus[];
createdTsAfter?: number;
diff --git a/frontend/src/utils/task.ts b/frontend/src/utils/task.ts
index 737f180919..444ecfd9a4 100644
--- a/frontend/src/utils/task.ts
+++ b/frontend/src/utils/task.ts
@@ -1,22 +1,13 @@
import { groupBy, maxBy } from "lodash-es";
-import {
- useCurrentUserV1,
- useDatabaseV1Store,
- useProjectV1Store,
-} from "@/store";
+import { useDatabaseV1Store } from "@/store";
import type {
- Issue,
Task,
TaskCheckStatus,
TaskCheckType,
TaskCreate,
TaskDatabaseCreatePayload,
- TaskStatus,
} from "@/types";
import { unknownDatabase } from "@/types";
-import { hasProjectPermissionV2 } from "./iam";
-import { activeTask } from "./pipeline";
-import { extractUserUID } from "./v1";
export const extractDatabaseNameFromTask = (
task: Task | TaskCreate
@@ -137,55 +128,6 @@ export const isTaskCreate = (task: Task | TaskCreate): task is TaskCreate => {
return !isTaskEntity(task);
};
-/**
- *
- * @param task
- * @param issue
- * @param activeOnly if true, only "Active Task" can be skipped
- * @returns
- */
-export const canSkipTask = (
- task: Task,
- issue: Issue,
- activeOnly = false,
- failedOnly = false
-) => {
- const pipeline = issue.pipeline;
- const isActiveTask = task.id === activeTask(pipeline!).id;
- if (activeOnly && !isActiveTask) {
- return false;
- }
-
- const applicableStatusList: TaskStatus[] = failedOnly
- ? ["FAILED"]
- : ["PENDING_APPROVAL", "FAILED"];
-
- if (!applicableStatusList.includes(task.status)) {
- return false;
- }
-
- const currentUserV1 = useCurrentUserV1();
- const composedProject = useProjectV1Store().getProjectByName(
- issue.project.name
- );
-
- if (
- hasProjectPermissionV2(
- composedProject,
- currentUserV1.value,
- "bb.issues.update"
- )
- ) {
- return true;
- }
-
- if (extractUserUID(currentUserV1.value.name) === String(issue.assignee.id)) {
- return true;
- }
-
- return false;
-};
-
export const checkStatusOfTask = (task: Task): TaskCheckStatus | undefined => {
if (task.status === "PENDING" || task.status === "PENDING_APPROVAL") {
const summary = taskCheckRunSummary(task);
diff --git a/frontend/src/utils/v1/advanced-search/common.ts b/frontend/src/utils/v1/advanced-search/common.ts
index 3a516fe327..a202110118 100644
--- a/frontend/src/utils/v1/advanced-search/common.ts
+++ b/frontend/src/utils/v1/advanced-search/common.ts
@@ -23,7 +23,6 @@ export const SearchScopeIdList = [
"created",
"status",
// issue related search scopes.
- "assignee",
"subscriber",
"label",
"taskType",
diff --git a/frontend/src/utils/v1/advanced-search/issue/utils.ts b/frontend/src/utils/v1/advanced-search/issue/utils.ts
index 32b4388d97..99e99838ee 100644
--- a/frontend/src/utils/v1/advanced-search/issue/utils.ts
+++ b/frontend/src/utils/v1/advanced-search/issue/utils.ts
@@ -40,7 +40,6 @@ export const buildIssueFilterBySearchParams = (
createdTsBefore: createdTsRange?.[1],
taskType: taskTypeScope?.value,
creator: getValueFromSearchParams(params, "creator", "users/"),
- assignee: getValueFromSearchParams(params, "assignee", "users/"),
subscriber: getValueFromSearchParams(params, "subscriber", "users/"),
statusList:
status === "OPEN"