Skip to content

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

feat(frontend): add "Bytebase" to the user filter in issue list page (#1832)

Liu Ji29065c6efc73
diff --git a/frontend/src/components/MemberSelect.vue b/frontend/src/components/MemberSelect.vue
index c753ee2521..f5110e67a6 100644
--- a/frontend/src/components/MemberSelect.vue
+++ b/frontend/src/components/MemberSelect.vue
@@ -84,6 +84,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
+ showSystemBot: {
+ type: Boolean,
+ default: false,
+ },
allowedRoleList: {
default: () => ["OWNER", "DBA", "DEVELOPER"],
type: Array as PropType<RoleType[]>,
@@ -117,7 +121,7 @@ export default defineComponent({
});
// If system bot is the selected ID (e.g. when issue is created by the bot on observing new sql file),
// Then we add system bot to the list so it can display properly.
- if (props.selectedId == SYSTEM_BOT_ID) {
+ if (props.selectedId == SYSTEM_BOT_ID || props.showSystemBot) {
list.unshift(principalStore.principalById(SYSTEM_BOT_ID));
}
// If `showAll` is true, we insert a virtual user before the list.
diff --git a/frontend/src/views/IssueDashboard.vue b/frontend/src/views/IssueDashboard.vue
index 8b738c1246..174d7b3a29 100644
--- a/frontend/src/views/IssueDashboard.vue
+++ b/frontend/src/views/IssueDashboard.vue
@@ -20,6 +20,7 @@
v-if="scopeByPrincipal"
class="w-72"
:show-all="true"
+ :show-system-bot="true"
:selected-id="state.selectedPrincipalId"
@select-principal-id="selectPrincipal"
/>
@@ -42,7 +43,6 @@
<script lang="ts">
import { useRoute, useRouter } from "vue-router";
-import { isEmpty } from "lodash-es";
import EnvironmentTabFilter from "../components/EnvironmentTabFilter.vue";
import { IssueTable } from "../components/Issue";
import MemberSelect from "../components/MemberSelect.vue";
@@ -54,6 +54,7 @@ import {
onMounted,
watchEffect,
defineComponent,
+ watch,
} from "vue";
import { activeEnvironment, isDBAOrOwner, projectSlug } from "../utils";
import { BBTableSectionDataSource } from "../bbkit/types";
@@ -128,7 +129,14 @@ export default defineComponent({
? EMPTY_ID // default to 'All' if current user is owner or DBA
: currentUser.value.id; // default to current user otherwise
};
- state.selectedPrincipalId = initializeSelectedPrincipalIdFromQuery();
+
+ watch(
+ () => route.query.user,
+ () => {
+ state.selectedPrincipalId = initializeSelectedPrincipalIdFromQuery();
+ },
+ { immediate: true }
+ );
onMounted(() => {
// Focus on the internal search field when mounted