Skip to content

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

chore: update my issues action (#13437)

boojack7a5015964360
diff --git a/frontend/src/components/IssueV1/components/IssueTableV1.vue b/frontend/src/components/IssueV1/components/IssueTableV1.vue
index 3da77a06e8..d38ae0d7ab 100644
--- a/frontend/src/components/IssueV1/components/IssueTableV1.vue
+++ b/frontend/src/components/IssueV1/components/IssueTableV1.vue
@@ -71,6 +71,7 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
const columns: (DataTableColumn<ComposedIssue> & { hide?: boolean })[] = [
{
type: "selection",
+ width: 40,
cellProps: (issue, rowIndex) => {
return {
onClick: (e: MouseEvent) => {
@@ -84,6 +85,7 @@ const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
type: "expand",
width: 0,
expandable: (issue) => isIssueExpanded(issue),
+ hide: !props.highlightText,
renderExpand: (issue) =>
h("div", {
class:
diff --git a/frontend/src/components/IssueV1/components/PagedIssueTableV1.vue b/frontend/src/components/IssueV1/components/PagedIssueTableV1.vue
index a424a04e1b..cee913cfc3 100644
--- a/frontend/src/components/IssueV1/components/PagedIssueTableV1.vue
+++ b/frontend/src/components/IssueV1/components/PagedIssueTableV1.vue
@@ -86,23 +86,11 @@ const props = defineProps({
type: Boolean,
default: false,
},
- loading: {
- type: Boolean,
- default: false,
- },
- loadingMore: {
- type: Boolean,
- default: false,
- },
composeIssueConfig: {
type: Object as PropType<ComposeIssueConfig>,
default: undefined,
},
});
-const emit = defineEmits<{
- (event: "update:loading", loading: boolean): void;
- (event: "update:loading-more", loadingMore: boolean): void;
-}>();
const state = reactive<LocalState>({
loading: false,
@@ -224,19 +212,4 @@ watch(isLoggedIn, () => {
useRefreshIssueList(() => {
refresh();
});
-
-watch(
- () => state.loading,
- (loading) => {
- emit("update:loading", loading);
- },
- { immediate: true }
-);
-watch(
- () => state.loadingMore,
- (loadingMore) => {
- emit("update:loading-more", loadingMore);
- },
- { immediate: true }
-);
</script>
diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
index 03b3868077..62cc5a711c 100644
--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
@@ -1,5 +1,5 @@
<template>
- <NPerformantEllipsis expand-trigger="click" line-clamp="3" :tooltip="false">
+ <NPerformantEllipsis expand-trigger="click" line-clamp="2" :tooltip="false">
{{ comment }}
</NPerformantEllipsis>
@@ -132,7 +132,7 @@ const commentLink = computed((): CommentLink => {
} else if (taskRun.status === TaskRun_Status.FAILED) {
const db = databaseForTask(issue.value, task);
// Cast a wide net to catch migration version error
- if (comment.value.includes('version')) {
+ if (comment.value.includes("version")) {
return {
title: t("common.troubleshoot"),
link: "https://www.bytebase.com/docs/change-database/troubleshoot/?source=console#duplicate-version",
diff --git a/frontend/src/components/Project/ProjectIssuesPanel.vue b/frontend/src/components/Project/ProjectIssuesPanel.vue
index ce8fa75436..b64d49e9b2 100644
--- a/frontend/src/components/Project/ProjectIssuesPanel.vue
+++ b/frontend/src/components/Project/ProjectIssuesPanel.vue
@@ -54,8 +54,6 @@
<div class="relative min-h-[20rem]">
<PagedIssueTableV1
:key="keyForTab(tab)"
- v-model:loading="state.loading"
- v-model:loading-more="state.loadingMore"
:session-key="keyForTab(tab)"
:issue-filter="mergedIssueFilter"
:ui-issue-filter="mergedUIIssueFilter"
@@ -120,8 +118,6 @@ type TabValue = (typeof TABS)[number];
interface LocalState {
params: SearchParams;
advanced: boolean;
- loading: boolean;
- loadingMore: boolean;
}
const props = defineProps<{
@@ -294,8 +290,6 @@ const initializeSearchParamsFromQueryOrLocalStorage = () => {
const state = reactive<LocalState>({
...initializeSearchParamsFromQueryOrLocalStorage(),
- loading: false,
- loadingMore: false,
});
const tab = computed<TabValue>({
@@ -311,7 +305,7 @@ const tab = computed<TabValue>({
});
const statusTabDisabled = computed(() => {
- if (state.advanced) return false;
+ if (state.advanced) return true;
return ["WAITING_APPROVAL", "WAITING_ROLLOUT"].includes(tab.value);
});
diff --git a/frontend/src/utils/localStorage.ts b/frontend/src/utils/localStorage.ts
new file mode 100644
index 0000000000..7a89eb9f84
--- /dev/null
+++ b/frontend/src/utils/localStorage.ts
@@ -0,0 +1,3 @@
+export const getComponentIdLocalStorageKey = (component: string): string => {
+ return `bb.components.${component}.id`;
+};
diff --git a/frontend/src/views/DashboardHeader.vue b/frontend/src/views/DashboardHeader.vue
index 8fb4886f9b..67a0066b15 100644
--- a/frontend/src/views/DashboardHeader.vue
+++ b/frontend/src/views/DashboardHeader.vue
@@ -67,7 +67,7 @@
</NButton>
<NTooltip>
<template #trigger>
- <NButton size="small">
+ <NButton size="small" @click="goToMyIssues">
<router-link :to="myIssueLink" exact-active-class="">
<CircleDotIcon class="w-4 h-auto" />
</router-link>
@@ -113,6 +113,7 @@
<script lang="ts" setup>
import { defineAction, useRegisterActions } from "@bytebase/vue-kbar";
import { useKBarHandler } from "@bytebase/vue-kbar";
+import { useLocalStorage } from "@vueuse/core";
import {
SettingsIcon,
CircleDotIcon,
@@ -122,6 +123,7 @@ import {
} from "lucide-vue-next";
import { NButton, NTooltip } from "naive-ui";
import { storeToRefs } from "pinia";
+import { v4 as uuidv4 } from "uuid";
import { computed, reactive } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
@@ -138,6 +140,7 @@ import {
import { useSubscriptionV1Store } from "@/store";
import { PlanType } from "@/types/proto/v1/subscription_service";
import { extractProjectResourceName, hasWorkspacePermissionV2 } from "@/utils";
+import { getComponentIdLocalStorageKey } from "@/utils/localStorage";
import BytebaseLogo from "../components/BytebaseLogo.vue";
import ProfileBrandingLogo from "../components/ProfileBrandingLogo.vue";
import ProfileDropdown from "../components/ProfileDropdown.vue";
@@ -202,6 +205,14 @@ const myIssueLink = computed(() => {
});
});
+const goToMyIssues = () => {
+ // Trigger page reload manually.
+ useLocalStorage<string>(
+ getComponentIdLocalStorageKey(WORKSPACE_ROUTE_MY_ISSUES),
+ ""
+ ).value = uuidv4();
+};
+
const kbarActions = computed(() => {
if (!hasGetSettingPermission.value) {
return [];
diff --git a/frontend/src/views/ExportCenter/index.vue b/frontend/src/views/ExportCenter/index.vue
index a193cfc8f0..73ddc59f3a 100644
--- a/frontend/src/views/ExportCenter/index.vue
+++ b/frontend/src/views/ExportCenter/index.vue
@@ -30,8 +30,6 @@
<div class="relative w-full mt-4 min-h-[20rem]">
<PagedIssueTableV1
- v-model:loading="state.loading"
- v-model:loading-more="state.loadingMore"
:session-key="'export-center'"
:issue-filter="mergedIssueFilter"
:page-size="50"
@@ -88,8 +86,6 @@ const props = defineProps<{
interface LocalState {
showRequestExportPanel: boolean;
params: SearchParams;
- loading: boolean;
- loadingMore: boolean;
}
const specificProject = computed(() => {
@@ -120,8 +116,6 @@ const projectV1Store = useProjectV1Store();
const state = reactive<LocalState>({
showRequestExportPanel: false,
params: defaultSearchParams(),
- loading: false,
- loadingMore: false,
});
const dataExportIssueSearchParams = computed(() => {
diff --git a/frontend/src/views/MyIssues.vue b/frontend/src/views/MyIssues.vue
index f03e37bdaa..ab3624eb13 100644
--- a/frontend/src/views/MyIssues.vue
+++ b/frontend/src/views/MyIssues.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex flex-col">
+ <div :key="viewId" class="flex flex-col">
<IssueSearch
v-model:params="state.params"
:components="
@@ -9,7 +9,7 @@
class="px-4 pb-2"
>
<template v-if="!state.advanced" #default>
- <div class="h-[34px] flex items-center gap-x-2">
+ <div class="flex items-center gap-x-2">
<div class="flex-1 overflow-auto">
<TabFilter
:value="tab"
@@ -54,8 +54,6 @@
<div class="relative min-h-[20rem]">
<PagedIssueTableV1
:key="keyForTab(tab)"
- v-model:loading="state.loading"
- v-model:loading-more="state.loadingMore"
:session-key="keyForTab(tab)"
:issue-filter="mergedIssueFilter"
:ui-issue-filter="mergedUIIssueFilter"
@@ -133,7 +131,7 @@
</template>
<script lang="ts" setup>
-import { type UseStorageOptions } from "@vueuse/core";
+import { useLocalStorage, type UseStorageOptions } from "@vueuse/core";
import { cloneDeep } from "lodash-es";
import { ChevronDownIcon, SearchIcon } from "lucide-vue-next";
import { NButton, NTooltip } from "naive-ui";
@@ -146,6 +144,7 @@ import IssueTableV1 from "@/components/IssueV1/components/IssueTableV1.vue";
import PagedIssueTableV1 from "@/components/IssueV1/components/PagedIssueTableV1.vue";
import type { TabFilterItem } from "@/components/v2";
import { TabFilter } from "@/components/v2";
+import { WORKSPACE_ROUTE_MY_ISSUES } from "@/router/dashboard/workspaceRoutes";
import { SETTING_ROUTE_WORKSPACE_SUBSCRIPTION } from "@/router/dashboard/workspaceSetting";
import {
useSubscriptionV1Store,
@@ -164,6 +163,7 @@ import {
upsertScope,
useDynamicLocalStorage,
} from "@/utils";
+import { getComponentIdLocalStorageKey } from "@/utils/localStorage";
const TABS = [
"CREATED",
@@ -177,8 +177,6 @@ const TABS = [
type TabValue = (typeof TABS)[number];
interface LocalState {
- loading: boolean;
- loadingMore: boolean;
params: SearchParams;
advanced: boolean;
showTrialStartModal: boolean;
@@ -191,6 +189,11 @@ const me = useCurrentUserV1();
const route = useRoute();
const router = useRouter();
+const viewId = useLocalStorage<string>(
+ getComponentIdLocalStorageKey(WORKSPACE_ROUTE_MY_ISSUES),
+ ""
+);
+
const storedStatus = useDynamicLocalStorage<SemanticIssueStatus>(
computed(() => `bb.home.issue-list-status.${me.value.name}`),
"OPEN",
@@ -373,8 +376,6 @@ const initializeSearchParamsFromQueryOrLocalStorage = () => {
};
const state = reactive<LocalState>({
- loading: false,
- loadingMore: false,
...initializeSearchParamsFromQueryOrLocalStorage(),
showTrialStartModal: false,
});
@@ -406,7 +407,7 @@ const planImage = computed(() => {
});
const statusTabHidden = computed(() => {
- if (state.advanced) return false;
+ if (state.advanced) return true;
return ["APPROVAL_REQUESTED", "WAITING_ROLLOUT"].includes(tab.value);
});
diff --git a/frontend/src/views/ReviewCenter/index.vue b/frontend/src/views/ReviewCenter/index.vue
index 0656530606..0f2021573f 100644
--- a/frontend/src/views/ReviewCenter/index.vue
+++ b/frontend/src/views/ReviewCenter/index.vue
@@ -25,8 +25,6 @@
<div class="relative w-full mt-4 min-h-[20rem]">
<PagedPlanTable
- v-model:loading="state.loading"
- v-model:loading-more="state.loadingMore"
:session-key="'review-center'"
:plan-find="mergedPlanFind"
:page-size="50"
@@ -84,8 +82,6 @@ const props = defineProps<{
interface LocalState {
params: SearchParams;
- loading: boolean;
- loadingMore: boolean;
selectedPlanOnlyType?:
| "bb.issue.database.schema.update"
| "bb.issue.database.data.update";
@@ -119,8 +115,6 @@ const currentUser = useCurrentUserV1();
const projectV1Store = useProjectV1Store();
const state = reactive<LocalState>({
params: defaultSearchParams(),
- loading: false,
- loadingMore: false,
});
const planCreationButtonOptions = computed((): DropdownOption[] => {