Skip to content

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

chore: migrate some legacy api use cases (#8176)

Liu Jif9894148f5e8
diff --git a/frontend/src/components/ProjectMember/ProjectMemberTable/RoleDescription.vue b/frontend/src/components/ProjectMember/ProjectMemberTable/RoleDescription.vue
index 1aa76042ce..1c0fcb7bc8 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberTable/RoleDescription.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberTable/RoleDescription.vue
@@ -7,13 +7,14 @@
class="normal-link"
@click="gotoIssuePage"
>
- {{ `#${issueId}` }}
+ {{ `#${issueUID}` }}
</div>
</template>
<script lang="ts" setup>
import { computed, defineProps, onMounted, ref } from "vue";
-import { pushNotification, useIssueStore } from "@/store";
+import { issueServiceClient } from "@/grpcweb";
+import { pushNotification } from "@/store";
import { UNKNOWN_ID } from "@/types";
import { issueSlug } from "@/utils";
@@ -28,7 +29,7 @@ const props = defineProps({
},
});
-const issueId = ref(UNKNOWN_ID);
+const issueUID = ref(String(UNKNOWN_ID));
const descriptionType = computed<DescriptionType>(() => {
if (issueDescriptionRegexp.test(props.description)) {
@@ -38,24 +39,26 @@ const descriptionType = computed<DescriptionType>(() => {
});
const gotoIssuePage = async () => {
- const issue = await useIssueStore().getOrFetchIssueById(issueId.value);
- if (issue.id === UNKNOWN_ID) {
+ const issue = await issueServiceClient.getIssue({
+ name: `projects/-/issues/${issueUID.value}`,
+ });
+ if (issue.uid === String(UNKNOWN_ID)) {
pushNotification({
module: "bytebase",
style: "CRITICAL",
- title: `Issue #${issueId.value} not found`,
+ title: `Issue #${issueUID.value} not found`,
});
return;
}
- window.open(`/issue/${issueSlug(issue.name, issue.id)}`, "_blank");
+ window.open(`/issue/${issueSlug(issue.title, issue.uid)}`, "_blank");
};
onMounted(() => {
if (descriptionType.value === "ISSUE") {
const match = props.description.match(issueDescriptionRegexp);
if (match) {
- issueId.value = Number(match[1]);
+ issueUID.value = match[1];
}
}
});
diff --git a/frontend/src/views/ExportCenter/ExportRecordTable.vue b/frontend/src/views/ExportCenter/ExportRecordTable.vue
index b1f0ba12c9..117549fbda 100644
--- a/frontend/src/views/ExportCenter/ExportRecordTable.vue
+++ b/frontend/src/views/ExportCenter/ExportRecordTable.vue
@@ -67,7 +67,8 @@ import { computed, shallowRef } from "vue";
import { useI18n } from "vue-i18n";
import { BBGridColumn } from "@/bbkit";
import { InstanceV1Name } from "@/components/v2";
-import { pushNotification, useIssueStore } from "@/store";
+import { issueServiceClient } from "@/grpcweb";
+import { pushNotification } from "@/store";
import { UNKNOWN_ID } from "@/types";
import { issueSlug } from "@/utils";
import ExportDataButton from "./ExportDataButton.vue";
@@ -132,19 +133,22 @@ const toggleExpandRow = (item: ExportRecord) => {
};
const gotoIssuePage = async (item: ExportRecord) => {
- if (item.issueId === `${UNKNOWN_ID}`) {
+ const issueUID = String(item.issueId);
+ if (issueUID === `${UNKNOWN_ID}`) {
return;
}
- const issue = await useIssueStore().getOrFetchIssueById(item.issueId);
- if (issue.id === UNKNOWN_ID) {
+ const issue = await issueServiceClient.getIssue({
+ name: `projects/-/issues/${issueUID}`,
+ });
+ if (issue.uid === String(UNKNOWN_ID)) {
pushNotification({
module: "bytebase",
style: "CRITICAL",
- title: `Issue #${issue.id} not found`,
+ title: `Issue #${issueUID} not found`,
});
return;
}
- window.open(`/issue/${issueSlug(issue.name, issue.id)}`, "_blank");
+ window.open(`/issue/${issueSlug(issue.title, issue.uid)}`, "_blank");
};
</script>