Skip to content

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

chore: make assignee optional (#9325)

Liu Ji57b3e5b8ec41
diff --git a/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue b/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
index 9a475d0119..c4e6504a8f 100644
--- a/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
+++ b/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
@@ -148,22 +148,6 @@
/>
</div>
</template>
-
- <div v-if="showAssigneeSelect" class="w-full">
- <label for="user" class="textlabel">
- {{ $t("common.assignee") }} <span class="text-red-600">*</span>
- </label>
- <!-- DBA and Owner always have all access, so we only need to grant to developer -->
- <MemberSelect
- id="user"
- class="mt-1 w-full"
- name="user"
- :allowed-role-list="[UserRole.OWNER, UserRole.DBA]"
- :selected-id="state.assigneeId"
- :placeholder="'Select assignee'"
- @select-user-id="selectAssignee"
- />
- </div>
</div>
</div>
@@ -187,7 +171,6 @@ import { v4 as uuidv4 } from "uuid";
import { computed, reactive, PropType } from "vue";
import { useRouter } from "vue-router";
import InstanceRoleSelect from "@/components/InstanceRoleSelect.vue";
-import MemberSelect from "@/components/MemberSelect.vue";
import {
ProjectSelect,
EnvironmentSelect,
@@ -203,7 +186,6 @@ import {
useProjectV1Store,
} from "@/store";
import {
- SYSTEM_BOT_ID,
defaultCharsetOfEngineV1,
defaultCollationOfEngineV1,
UNKNOWN_ID,
@@ -211,7 +193,6 @@ import {
unknownInstance,
} from "@/types";
import { INTERNAL_RDS_INSTANCE_USER_LIST } from "@/types/InstanceUser";
-import { UserRole } from "@/types/proto/v1/auth_service";
import { Engine } from "@/types/proto/v1/common";
import { Backup } from "@/types/proto/v1/database_service";
import { InstanceRole } from "@/types/proto/v1/instance_role_service";
@@ -225,7 +206,6 @@ import {
import {
extractBackupResourceName,
extractDatabaseResourceName,
- hasWorkspacePermissionV1,
instanceV1HasCollationAndCharacterSet,
instanceV1HasCreateDatabase,
} from "@/utils";
@@ -241,7 +221,6 @@ interface LocalState {
characterSet: string;
collation: string;
cluster: string;
- assigneeId?: string;
showFeatureModal: boolean;
creating: boolean;
}
@@ -277,15 +256,6 @@ const currentUserV1 = useCurrentUserV1();
const environmentV1Store = useEnvironmentV1Store();
const projectV1Store = useProjectV1Store();
-const showAssigneeSelect = computed(() => {
- // If the role can't change assignee after creating the issue, then we will show the
- // assignee select in the prep stage here to request a particular assignee.
- return !hasWorkspacePermissionV1(
- "bb.permission.workspace.manage-issue",
- currentUserV1.value.userRole
- );
-});
-
const state = reactive<LocalState>({
databaseName: "",
projectId: props.projectId,
@@ -296,7 +266,6 @@ const state = reactive<LocalState>({
characterSet: "",
collation: "",
cluster: "",
- assigneeId: showAssigneeSelect.value ? undefined : String(SYSTEM_BOT_ID),
showFeatureModal: false,
creating: false,
});
@@ -324,8 +293,7 @@ const allowCreate = computed(() => {
!isReservedName.value &&
state.projectId &&
state.environmentId &&
- state.instanceId &&
- state.assigneeId
+ state.instanceId
);
});
@@ -382,10 +350,6 @@ const selectInstanceRole = (name?: string) => {
state.instanceRole = name;
};
-const selectAssignee = (assigneeId: string) => {
- state.assigneeId = assigneeId;
-};
-
const filterInstanceRole = (user: InstanceRole) => {
if (INTERNAL_RDS_INSTANCE_USER_LIST.includes(user.roleName)) {
return false;
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
index b3db90c4da..210641d323 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
@@ -69,9 +69,6 @@ const issueCreateErrorList = computed(() => {
if (issue.value.rolloutEntity.stages.some((stage) => !isValidStage(stage))) {
errorList.push("Missing SQL statement in some stages");
}
- if (!issue.value.assignee) {
- errorList.push("Assignee is required");
- }
return errorList;
});
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Assignee/Assignee.vue b/frontend/src/components/IssueV1/components/HeaderSection/Assignee/Assignee.vue
index e14ac8cbf4..43c99b59f1 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Assignee/Assignee.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Assignee/Assignee.vue
@@ -30,6 +30,7 @@
:include-system-bot="false"
:map-options="mapUserOptions"
:fallback-option="fallbackUser"
+ :clearable="true"
style="width: 14rem"
@update:user="changeAssigneeUID"
/>
@@ -112,14 +113,15 @@ const errors = asyncComputed(async () => {
const changeAssigneeUID = async (uid: string | undefined) => {
if (!uid || uid === String(UNKNOWN_ID)) {
- return;
- }
- const assignee = userStore.getUserById(uid);
- if (!assignee) {
issue.value.assignee = "";
- return;
+ } else {
+ const assignee = userStore.getUserById(uid);
+ if (!assignee) {
+ issue.value.assignee = "";
+ } else {
+ issue.value.assignee = `users/${assignee.email}`;
+ }
}
- issue.value.assignee = `users/${assignee.email}`;
if (!isCreating.value) {
const issuePatch = Issue.fromJSON(issue.value);