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: tweak issue activity section (#16857)
boojack5da39ffcdadb
diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vueindex 2f61ceaa80..0be2827ade 100644--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/ActionSentence.vue@@ -94,7 +94,7 @@ const renderActionSentence = () => {const params: VerbTypeTarget = {issueComment,type: t("common.stage"),- target: <StageName stage={stageEntity} issue={issue} />,+ target: <StageName stage={stageEntity} />,verb: t("activity.sentence.completed"),};return renderVerbTypeTarget(params);diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vueindex b2f2a9e88d..dd806fc2d7 100644--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentAction.vue@@ -59,6 +59,7 @@ import HumanizeTs from "@/components/misc/HumanizeTs.vue";import { IssueCommentType, type ComposedIssueComment } from "@/store";import { useUserStore, extractUserId } from "@/store";import { getTimeForPbTimestampProtoEs, type ComposedIssue } from "@/types";+import type { Rollout } from "@/types/proto-es/v1/rollout_service_pb";import ActionCreator from "./ActionCreator.vue";import ActionSentence from "./ActionSentence.vue";@@ -67,6 +68,7 @@ defineProps<{index: number;issueComment: ComposedIssueComment;similar: ComposedIssueComment[];+ rollout?: Rollout;}>();const userStore = useUserStore();diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentView.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentView.vueindex d779c4455d..534a4d0476 100644--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentView.vue+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/IssueCommentView.vue@@ -31,6 +31,7 @@<script lang="ts" setup>import type { ComposedIssueComment } from "@/store";import type { ComposedIssue } from "@/types";+import type { Rollout } from "@/types/proto-es/v1/rollout_service_pb";import ActionIcon from "./ActionIcon.vue";import IssueCommentAction from "./IssueCommentAction.vue";@@ -40,5 +41,6 @@ defineProps<{index: number;issueComment: ComposedIssueComment;similar: ComposedIssueComment[];+ rollout?: Rollout;}>();</script>diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/StageName.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/StageName.vueindex ece2a0291b..8f964f9da9 100644--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/StageName.vue+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/StageName.vue@@ -7,11 +7,9 @@<script lang="ts" setup>import { computed } from "vue";import { useEnvironmentV1Store } from "@/store";-import type { ComposedIssue } from "@/types";import type { Stage } from "@/types/proto-es/v1/rollout_service_pb";const props = defineProps<{- issue: ComposedIssue;stage: Stage;}>();diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/TaskName.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/TaskName.vueindex 15721cae9b..5c4c044d31 100644--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/TaskName.vue+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentView/TaskName.vue@@ -21,11 +21,15 @@import scrollIntoView from "scroll-into-view-if-needed";import { computed } from "vue";import type { LocationQueryRaw } from "vue-router";-import { stageForTask, projectOfIssue } from "@/components/IssueV1/logic";-import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";-import type { ComposedIssue } from "@/types";+import { projectOfIssue } from "@/components/IssueV1/logic";+import { useIssueLayoutVersion } from "@/composables/useIssueLayoutVersion";+import {+ PROJECT_V1_ROUTE_ISSUE_DETAIL,+ PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,+} from "@/router/dashboard/projectV1";+import type { Issue } from "@/types/proto-es/v1/issue_service_pb";import type { Task } from "@/types/proto-es/v1/rollout_service_pb";-import { databaseForTask } from "@/utils";+import { databaseForTask, extractRolloutUID } from "@/utils";import {extractProjectResourceName,extractSchemaVersionFromTask,@@ -35,10 +39,12 @@ import {} from "@/utils";const props = defineProps<{- issue: ComposedIssue;+ issue: Issue;task: Task;}>();+const { enabledNewLayout } = useIssueLayoutVersion();+const schemaVersion = computed(() => {return extractSchemaVersionFromTask(props.task);});@@ -46,23 +52,31 @@ const schemaVersion = computed(() => {const link = computed(() => {const { issue, task } = props;- const query: LocationQueryRaw = {- task: extractTaskUID(task.name),- };+ if (enabledNewLayout) {+ return {+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,+ params: {+ projectId: extractProjectResourceName(task.name),+ rolloutId: extractRolloutUID(task.name),+ stageId: extractStageUID(task.name),+ taskId: extractTaskUID(task.name),+ },+ };+ } else {+ const query: LocationQueryRaw = {+ task: extractTaskUID(task.name),+ stage: extractStageUID(task.name),+ };- const stage = stageForTask(issue, task);- if (stage) {- query.stage = extractStageUID(stage.name);+ return {+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL,+ params: {+ projectId: extractProjectResourceName(issue.name),+ issueSlug: issueV1Slug(issue.name, issue.title),+ },+ query,+ };}-- return {- name: PROJECT_V1_ROUTE_ISSUE_DETAIL,- params: {- projectId: extractProjectResourceName(issue.name),- issueSlug: issueV1Slug(issue.name, issue.title),- },- query,- };});const toTop = () => {diff --git a/frontend/src/components/IssueV1/logic/utils.ts b/frontend/src/components/IssueV1/logic/utils.tsindex 251616be08..2430299580 100644--- a/frontend/src/components/IssueV1/logic/utils.ts+++ b/frontend/src/components/IssueV1/logic/utils.ts@@ -3,6 +3,7 @@ import { NButton } from "naive-ui";import { h } from "vue";import { t } from "@/plugins/i18n";import {+ projectNamePrefix,useDatabaseV1Store,useEnvironmentV1Store,useInstanceResourceByName,@@ -18,20 +19,24 @@ import {} from "@/types";import { State } from "@/types/proto-es/v1/common_pb";import { InstanceResourceSchema } from "@/types/proto-es/v1/instance_service_pb";-import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";+import { IssueStatus, type Issue } from "@/types/proto-es/v1/issue_service_pb";import type { Plan } from "@/types/proto-es/v1/plan_service_pb";import type { Task } from "@/types/proto-es/v1/rollout_service_pb";import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";import {defer,extractDatabaseResourceName,+ extractProjectResourceName,flattenTaskV1List,isValidIssueName,} from "@/utils";import type { IssueContext } from "./context";-export const projectOfIssue = (issue: ComposedIssue): ComposedProject =>- useProjectV1Store().getProjectByName(issue.project);+export const projectOfIssue = (issue: Issue): ComposedProject => {+ return useProjectV1Store().getProjectByName(+ `${projectNamePrefix}${extractProjectResourceName(issue.name)}`+ );+};export const useInstanceForTask = (task: Task) => {let instanceName: string = "";diff --git a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vueindex fb7b4b58c8..a2291acfd1 100644--- a/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue+++ b/frontend/src/components/Plan/components/Configuration/GhostSection/GhostSwitch.vue@@ -4,13 +4,23 @@<NSwitchsize="small":value="enabled"- :disabled="!allowChange || errors.length > 0"+ :disabled="+ !allowChange ||+ (!enabled &&+ (databasesNotMeetingRequirements.length > 0 || errors.length > 0))+ "@update:value="toggleChecked"/></template><div class="max-w-sm"><p class="opacity-80">{{ tooltipMessage }}</p><ErrorList v-if="errors.length > 0" :errors="errors" class="mt-2" />+ <LearnMoreLink+ v-if="databasesNotMeetingRequirements.length > 0"+ :url="'https://docs.bytebase.com/change-database/rollback-data-changes?source=console'"+ color="light"+ class="mt-1 text-sm"+ /></div></NTooltip></template>@@ -21,6 +31,7 @@ import { cloneDeep } from "lodash-es";import { NSwitch, NTooltip } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";+import LearnMoreLink from "@/components/LearnMoreLink.vue";import { targetsForSpec } from "@/components/Plan/logic";import type { ErrorItem } from "@/components/misc/ErrorList.vue";import { default as ErrorList } from "@/components/misc/ErrorList.vue";@@ -44,15 +55,15 @@ const {const errors = computed(() => {const errors: ErrorItem[] = [];- const backupUnavailableDatabases = databases.value.filter(- (db) => !db.backupAvailable || !allowGhostForDatabase(db)+ const unsupportedDatabases = databases.value.filter(+ (db) => !allowGhostForDatabase(db));- if (backupUnavailableDatabases.length > 0) {+ if (unsupportedDatabases.length > 0) {errors.push(t("task.online-migration.error.not-applicable.database-doesnt-meet-ghost-requirement",{- database: backupUnavailableDatabases+ database: unsupportedDatabases.map((db) => db.databaseName).join(", "),}diff --git a/frontend/src/components/Plan/components/Configuration/PreBackupSection/PreBackupSwitch.vue b/frontend/src/components/Plan/components/Configuration/PreBackupSection/PreBackupSwitch.vueindex 2dae5f9e23..583fd7ab7b 100644--- a/frontend/src/components/Plan/components/Configuration/PreBackupSection/PreBackupSwitch.vue+++ b/frontend/src/components/Plan/components/Configuration/PreBackupSection/PreBackupSwitch.vue@@ -4,7 +4,11 @@<NSwitchsize="small":value="enabled"- :disabled="!allowChange || errors.length > 0"+ :disabled="+ !allowChange ||+ (!enabled &&+ (databasesNotMeetingRequirements.length > 0 || errors.length > 0))+ "@update:value="(on) => handleToggle(on)"/></template>@@ -12,8 +16,8 @@<p class="opacity-80">{{ tooltipMessage }}</p><ErrorList v-if="errors.length > 0" :errors="errors" class="mt-2" /><LearnMoreLink- v-if="disallowPreBackupLink && errors.length === 0"- :url="disallowPreBackupLink"+ v-if="databasesNotMeetingRequirements.length > 0"+ :url="'https://docs.bytebase.com/change-database/rollback-data-changes?source=console'"color="light"class="mt-1 text-sm"/>@@ -39,35 +43,10 @@ const { t } = useI18n();const { enabled, allowChange, databases, toggle, selectedSpec } =usePreBackupSettingContext();-const hasBackupUnavailable = computed(() => {- return !databases.value.some((db) => !db.backupAvailable);-});--const disallowPreBackupLink = computed(() => {- if (allowChange.value || !hasBackupUnavailable.value) {- return undefined;- }- return "https://docs.bytebase.com/change-database/rollback-data-changes?source=console";-});-// Compute detailed errors for ErrorListconst errors = computed(() => {const errors: ErrorItem[] = [];- // Check for databases without backup available- const backupUnavailableDatabases = databases.value.filter(- (db) => !db.backupAvailable- );- if (backupUnavailableDatabases.length > 0) {- errors.push(- t("database.backup-unavailable-for-databases", {- databases: backupUnavailableDatabases- .map((db) => db.databaseName)- .join(", "),- })- );- }-// Check for unsupported database enginesconst unsupportedEngineDatabases = databases.value.filter((db) => !PRE_BACKUP_AVAILABLE_ENGINES.includes(db.instanceResource.engine)diff --git a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vueindex 6c135d81f6..d136ed874f 100644--- a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue@@ -5,24 +5,10 @@{{ $t("common.activity") }}</h3></div>- <IssueCommentList :comment-filter="commentFilter" />+ <IssueCommentList /></div></template><script setup lang="ts">-import { includes } from "lodash-es";import IssueCommentList from "@/components/IssueV1/components/IssueCommentSection/IssueCommentList.vue";-import { IssueCommentType, type ComposedIssueComment } from "@/store";--// Only show issue related comments.-const commentFilter = (comment: ComposedIssueComment): boolean => {- return includes(- [- IssueCommentType.USER_COMMENT,- IssueCommentType.APPROVAL,- IssueCommentType.ISSUE_UPDATE,- ],- comment.type- );-};</script>diff --git a/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue b/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vueindex 838b6f94e3..73f8a97e11 100644--- a/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue+++ b/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue@@ -25,7 +25,7 @@ import OverviewSection from "./OverviewSection.vue";import { Sidebar } from "./Sidebar";const { project, ready } = useCurrentProjectV1();-const { issue } = usePlanContextWithIssue();+const { plan, issue, rollout } = usePlanContextWithIssue();const currentUser = useCurrentUserV1();const issueBaseContext = useBaseIssueContext({@@ -48,12 +48,25 @@ const allowChange = computed(() => {);});+// TODO(steven): remove ComposedIssue.+const composedIssue = computed(() => {+ const composedIssue = issue.value as ComposedIssue;+ composedIssue.project = unref(project).name;+ composedIssue.plan = unref(plan).name;+ composedIssue.planEntity = unref(plan);+ if (rollout?.value) {+ composedIssue.rollout = rollout.value.name;+ composedIssue.rolloutEntity = rollout.value;+ }+ return composedIssue;+});+provideIssueContext({isCreating: computed(() => false),ready,allowChange,- issue: computed(() => issue.value as ComposedIssue),+ issue: composedIssue,...issueBaseContext,},true /* root */diff --git a/frontend/src/components/Plan/logic/initialize/index.ts b/frontend/src/components/Plan/logic/initialize/index.tsindex ea11ab1e07..1c5343fe54 100644--- a/frontend/src/components/Plan/logic/initialize/index.ts+++ b/frontend/src/components/Plan/logic/initialize/index.ts@@ -125,6 +125,20 @@ export function useInitializePlan(// Fetch the plan using the issue's plan referenceplanResult = await planStore.fetchPlanByName(issueResult.plan);++ // Fetch the associated rollout if it exists+ if (issueResult.rollout) {+ try {+ const rolloutRequest = create(GetRolloutRequestSchema, {+ name: issueResult.rollout,+ });+ const newRollout =+ await rolloutServiceClientConnect.getRollout(rolloutRequest);+ rolloutResult = newRollout;+ } catch {+ // Rollout might not exist or we don't have permission, that's ok+ }+ }} else {// Direct plan IDplanResult = await planStore.fetchPlanByName(diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex cc11c140ac..85316e1572 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1622,7 +1622,6 @@"reference": "Reference"},"checks": "Checks",- "backup-unavailable-for-databases": "Backup is not available for databases: {databases}","engine-not-supported-for-backup": "Prior backup is not supported for: {databases}","revision": {"self": "Revision",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 1f18648da5..49dabbf269 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -1622,7 +1622,6 @@"reference": "Referencia"},"checks": "Cheques",- "backup-unavailable-for-databases": "La copia de seguridad no está disponible para las bases de datos: {databases}","engine-not-supported-for-backup": "No se admite la copia de seguridad previa para: {databases}","revision": {"self": "Revisión",diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 80a624bc23..6d7b2443bc 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -1622,7 +1622,6 @@"reference": "参照"},"checks": "チェック",- "backup-unavailable-for-databases": "データベースのバックアップは利用できません: {databases}","engine-not-supported-for-backup": "以前のバックアップはサポートされていません: {databases}","revision": {"self": "リビジョン",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex b46d334e25..50803b5398 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -1622,7 +1622,6 @@"reference": "Tham chiếu"},"checks": "Kiểm tra",- "backup-unavailable-for-databases": "Sao lưu không khả dụng cho cơ sở dữ liệu: {databases}","engine-not-supported-for-backup": "Sao lưu trước đó không được hỗ trợ cho: {databases}","revision": {"self": "Bản sửa đổi",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 6971a42c66..bcc298dcc3 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1622,7 +1622,6 @@"reference": "引用"},"checks": "Check 约束",- "backup-unavailable-for-databases": "数据库无法开启备份:{databases}","engine-not-supported-for-backup": "引擎不支持预备份:{databases}","revision": {"self": "版本",diff --git a/frontend/src/views/DatabaseDetail/DatabaseDetail.vue b/frontend/src/views/DatabaseDetail/DatabaseDetail.vueindex c7bfc4c2c6..a1e23ee443 100644--- a/frontend/src/views/DatabaseDetail/DatabaseDetail.vue+++ b/frontend/src/views/DatabaseDetail/DatabaseDetail.vue@@ -94,9 +94,12 @@<NButtonv-if="allowTransferDatabase"@click.prevent="tryTransferProject"+ icon-placement="right"><span>{{ $t("database.transfer-project") }}</span>- <ArrowRightLeftIcon class="ml-1" :size="16" />+ <template #icon>+ <ArrowRightLeftIcon :size="16" />+ </template></NButton><NButtonv-if="allowChangeData"