Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: deprecate bookmarks (#9093)
Danny Xuf757f8481aff
diff --git a/frontend/src/components/BookmarkListSidePanel.vue b/frontend/src/components/BookmarkListSidePanel.vuedeleted file mode 100644index 75f0f2cdef..0000000000--- a/frontend/src/components/BookmarkListSidePanel.vue+++ /dev/null@@ -1,67 +0,0 @@-<template>- <BBOutline- :id="'bookmark'"- :title="$t('common.bookmarks')"- :item-list="- bookmarkList.map((item) => {- return {- id: item.name,- name: item.title,- link: item.link,- };- })- "- :allow-delete="true"- :allow-collapse="true"- :outline-item-class="'pt-0.5 pb-0.5'"- @delete-index="deleteIndex"- />-</template>--<script lang="ts" setup>-import { Action, defineAction, useRegisterActions } from "@bytebase/vue-kbar";-import { computed, watchEffect } from "vue";-import { useI18n } from "vue-i18n";-import { useRouter } from "vue-router";-import { useBookmarkV1Store, useCurrentUser } from "@/store";-import { Bookmark } from "@/types/proto/v1/bookmark_service";-import { UNKNOWN_ID } from "../types";--const { t } = useI18n();-const router = useRouter();-const bookmarkV1Store = useBookmarkV1Store();--const currentUser = useCurrentUser();--const prepareBookmarkList = async () => {- // It will also be called when user logout- if (currentUser.value.id != UNKNOWN_ID) {- await bookmarkV1Store.fetchBookmarkList();- }-};--watchEffect(prepareBookmarkList);--const bookmarkList = computed(() => bookmarkV1Store.getBookmarkList());--const deleteIndex = (index: number) => {- bookmarkV1Store.deleteBookmark(bookmarkList.value[index].name);-};--const kbarActions = computed((): Action[] => {- const actions = bookmarkList.value.map((item: Bookmark) =>- defineAction({- // here `id` looks like "bb.bookmark.12345"- id: `bb.bookmark.${item.name}`,- section: t("common.bookmarks"),- name: item.title,- keywords: "bookmark",- perform: () => {- router.push({ path: item.link });- },- })- );- return actions;-});-useRegisterActions(kbarActions);-</script>diff --git a/frontend/src/components/Breadcrumb.vue b/frontend/src/components/Breadcrumb.vueindex 2ccad96c7b..698492fb2b 100644--- a/frontend/src/components/Breadcrumb.vue+++ b/frontend/src/components/Breadcrumb.vue@@ -38,21 +38,6 @@><TenantIcon class="ml-1 text-control" /></span>- <button- v-if="allowBookmark && index == breadcrumbList.length - 1"- class="relative focus:outline-none"- type="button"- @click.prevent="toggleBookmark"- >- <heroicons-solid:star- v-if="isBookmarked"- class="h-5 w-5 text-yellow-400 hover:text-yellow-600"- />- <heroicons-solid:star- v-else- class="h-5 w-5 text-control-light hover:text-control-light-hover"- />- </button></div></div></div>@@ -73,14 +58,8 @@ import { useI18n } from "vue-i18n";import { useRouter } from "vue-router";import HelpTriggerIcon from "@/components/HelpTriggerIcon.vue";import TenantIcon from "@/components/TenantIcon.vue";-import {- useRouterStore,- useBookmarkV1Store,- useProjectV1Store,- useDatabaseV1Store,-} from "@/store";+import { useRouterStore, useProjectV1Store, useDatabaseV1Store } from "@/store";import { RouteMapList } from "@/types";-import { Bookmark } from "@/types/proto/v1/bookmark_service";import { TenantMode } from "@/types/proto/v1/project_service";import { databaseV1Slug, idFromSlug, projectV1Slug } from "../utils";@@ -100,7 +79,6 @@ export default defineComponent({const routerStore = useRouterStore();const currentRoute = useRouter().currentRoute;const { t } = useI18n();- const bookmarkV1Store = useBookmarkV1Store();const projectV1Store = useProjectV1Store();const documentTitle = useTitle(null, { observe: true });@@ -118,14 +96,6 @@ export default defineComponent({routeHelpNameMapList.value = await res.json();});- const bookmark: ComputedRef<Bookmark | undefined> = computed(() =>- bookmarkV1Store.findBookmarkByLink(currentRoute.value.path)- );-- const isBookmarked: ComputedRef<boolean> = computed(() => !!bookmark.value);-- const allowBookmark = computed(() => currentRoute.value.meta.allowBookmark);-const isTenantProject: ComputedRef<boolean> = computed(() => {const routeSlug = routerStore.routeSlug(currentRoute.value);const projectSlug = routeSlug.projectSlug;@@ -307,24 +277,9 @@ export default defineComponent({return list;});- const toggleBookmark = () => {- if (bookmark.value) {- bookmarkV1Store.deleteBookmark(bookmark.value.name);- } else {- bookmarkV1Store.createBookmark({- title: breadcrumbList.value[breadcrumbList.value.length - 1].name,- link: currentRoute.value.path,- });- }- };-return {- allowBookmark,- bookmark,- isBookmarked,isTenantProject,breadcrumbList,- toggleBookmark,currentRoute,helpName,};diff --git a/frontend/src/views/DashboardSidebar.vue b/frontend/src/views/DashboardSidebar.vueindex 7021d606e7..0ff43a3178 100644--- a/frontend/src/views/DashboardSidebar.vue+++ b/frontend/src/views/DashboardSidebar.vue@@ -60,9 +60,6 @@<heroicons-outline:shield-exclamation class="w-5 h-5 mr-2" />{{ $t("anomaly-center") }}</router-link>- <div>- <BookmarkListSidePanel />- </div><div><ProjectListSidePanel /></div>@@ -76,7 +73,6 @@<script lang="ts" setup>import { useKBarHandler } from "@bytebase/vue-kbar";import { computed } from "vue";-import BookmarkListSidePanel from "@/components/BookmarkListSidePanel.vue";import BytebaseLogo from "@/components/BytebaseLogo.vue";import DatabaseListSidePanel from "@/components/DatabaseListSidePanel.vue";import ProjectListSidePanel from "@/components/ProjectListSidePanel.vue";