Skip to content

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

feat: enhance issue finding experience (#8201)

Tianzhou (天舟)061b52f67795
diff --git a/frontend/src/components/ProjectOverviewPanel.vue b/frontend/src/components/ProjectOverviewPanel.vue
index 758a2d7727..70c1b1c126 100644
--- a/frontend/src/components/ProjectOverviewPanel.vue
+++ b/frontend/src/components/ProjectOverviewPanel.vue
@@ -39,27 +39,36 @@
</div>
<div class="space-y-2">
- <div class="flex items-center gap-x-1">
- <p class="text-lg font-medium leading-7 text-main">
- {{ $t("common.issue") }}
- </p>
- <button
- type="button"
- class="p-1 rounded hover:bg-gray-200"
- @click="
- () => {
- router.replace({
- name: 'workspace.issue',
- query: {
- project: project.uid,
- autofocus: 1,
- },
- });
- }
- "
- >
- <heroicons-outline:search class="h-4 w-4 text-control" />
- </button>
+ <div class="flex justify-between">
+ <div class="flex items-center gap-x-1">
+ <p class="text-lg font-medium leading-7 text-main">
+ {{ $t("common.issue") }}
+ </p>
+ <button
+ type="button"
+ class="p-1 rounded bg-gray-200 hover:bg-gray-300 border border-gray-300"
+ @click="
+ () => {
+ router.replace({
+ name: 'workspace.issue',
+ query: {
+ project: project.uid,
+ autofocus: 1,
+ },
+ });
+ }
+ "
+ >
+ <heroicons-outline:search class="h-3.5 w-3.5 text-control" />
+ </button>
+ </div>
+
+ <SearchBox
+ :value="state.searchText"
+ :placeholder="$t('issue.filter-issue-by-name')"
+ :autofocus="true"
+ @update:value="changeSearchText($event)"
+ />
</div>
<div>
@@ -77,7 +86,7 @@
:mode="'PROJECT'"
:show-placeholder="!loading"
:title="$t('issue.waiting-approval')"
- :issue-list="issueList"
+ :issue-list="issueList.filter(keywordFilter)"
/>
</template>
</WaitingForMyApprovalIssueTableV1>
@@ -97,7 +106,7 @@
class="-mt-px"
:mode="'PROJECT'"
:title="$t('project.overview.in-progress')"
- :issue-list="issueList"
+ :issue-list="issueList.filter(keywordFilter)"
:show-placeholder="!loading"
/>
</template>
@@ -120,7 +129,7 @@
class="-mt-px"
:mode="'PROJECT'"
:title="$t('project.overview.recently-closed')"
- :issue-list="issueList"
+ :issue-list="issueList.filter(keywordFilter)"
:show-placeholder="!loading"
/>
</template>
@@ -145,12 +154,13 @@ import { useRouter } from "vue-router";
import { featureToRef } from "@/store";
import { IssueStatus } from "@/types/proto/v1/issue_service";
import { Project } from "@/types/proto/v1/project_service";
-import { IssueFilter } from "../types";
+import { ComposedIssue, IssueFilter } from "../types";
import IssueTableV1 from "./IssueV1/components/IssueTableV1.vue";
import PagedIssueTableV1 from "./IssueV1/components/PagedIssueTableV1.vue";
import WaitingForMyApprovalIssueTableV1 from "./IssueV1/components/WaitingForMyApprovalIssueTableV1.vue";
interface LocalState {
+ searchText: string;
isFetchingActivityList: boolean;
}
@@ -162,6 +172,7 @@ const props = defineProps({
});
const state = reactive<LocalState>({
+ searchText: "",
isFetchingActivityList: false,
});
const router = useRouter();
@@ -174,4 +185,18 @@ const commonIssueFilter = computed((): IssueFilter => {
query: "",
};
});
+
+const keywordFilter = (issue: ComposedIssue) => {
+ const keyword = state.searchText.trim().toLowerCase();
+ if (keyword) {
+ if (!issue.title.toLowerCase().includes(keyword)) {
+ return false;
+ }
+ }
+ return true;
+};
+
+const changeSearchText = (searchText: string) => {
+ state.searchText = searchText;
+};
</script>
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 028447bd11..4b37f1c590 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -809,7 +809,6 @@
}
},
"view-commit": "View commit",
- "search-issue-name": "Search issue name",
"advanced-search": {
"self": "Advanced search",
"scope": {
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 743ea7b0fb..484ad5afcc 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -808,7 +808,6 @@
}
},
"view-commit": "Ver commit",
- "search-issue-name": "Buscar nombre de la incidencia",
"advanced-search": {
"self": "Búsqueda Avanzada",
"scope": {
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 7972d75d02..701031ecd2 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -806,7 +806,6 @@
}
},
"view-commit": "查看提交",
- "search-issue-name": "搜索工单名称",
"advanced-search": {
"self": "高级搜素",
"scope": {
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 246baf5651..0c80a2f49a 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -6,7 +6,6 @@
<div class="hidden md:block">
<div class="flex items-baseline space-x-1 whitespace-nowrap">
<router-link
- v-if="shouldShowIssueEntry"
to="/issue"
class="bar-link px-2 py-1 rounded-md"
:class="getRouteLinkClass('/issue')"
@@ -261,13 +260,6 @@ export default defineComponent({
return classes;
};
- const shouldShowIssueEntry = computed((): boolean => {
- return hasWorkspacePermissionV1(
- "bb.permission.workspace.manage-issue",
- currentUserV1.value.userRole
- );
- });
-
const shouldShowInstanceEntry = computed(() => {
return hasWorkspacePermissionV1(
"bb.permission.workspace.manage-instance",
@@ -408,7 +400,6 @@ export default defineComponent({
state,
getRouteLinkClass,
shouldShowInstanceEntry,
- shouldShowIssueEntry,
currentPlan,
PlanType,
isDevFeatures,
diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vue
index 0cd97b50e8..a743e7c33c 100644
--- a/frontend/src/views/DashboardSidebar.vue
+++ b/frontend/src/views/DashboardSidebar.vue
@@ -32,7 +32,7 @@
</div>
<button
type="button"
- class="p-1 rounded hover:bg-gray-300 mr-2"
+ class="p-1 rounded bg-gray-200 hover:bg-gray-300 border border-gray-300 mr-1"
@click.prevent.stop="
() => {
router.replace({
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index ed0e351eb0..d95ed73c05 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -4,7 +4,7 @@
<div><!-- empty --></div>
<SearchBox
:value="state.searchText"
- :placeholder="$t('issue.search-issue-name')"
+ :placeholder="$t('issue.filter-issue-by-name')"
:autofocus="true"
@update:value="changeSearchText($event)"
/>