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(frontend): refine branch merge and rebase page (#10648)
Liu Ji17b43a5e8243
diff --git a/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue b/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vueindex 4b2c856477..b108a7ca18 100644--- a/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue+++ b/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue@@ -1,61 +1,79 @@<template>- <div class="h-full relative">- <StepTab- :step-list="stepList"- :current-index="state.currentStepIndex"- :show-cancel="false"- :allow-next="allowNextStep"- class="h-full flex flex-col !space-y-0 gap-y-4"- pane-class="flex-1 flex flex-col gap-y-2 relative overflow-hidden"- footer-class="!space-y-0 !border-0 !pt-0"- @update:current-index="tryChangeStep"- @finish="handleMergeBranch"- >- <template #0>- <SelectBranchStep- v-model:delete-branch-after-merged="state.deleteBranchAfterMerged"- :project="project"- :head-branch="headBranch"- :target-branch="targetBranch"- :is-loading-head-branch="isLoadingHeadBranch"- :is-loading-target-branch="isLoadingTargetBranch"- :is-validating="isValidating"- :validation-state="validationState"- @update:head-branch-name="handleUpdateHeadBranch"- @update:target-branch-name="state.targetBranchName = $event || null"- />- </template>- <template #1>- <MergeBranchStep- v-if="targetBranch && headBranch && validationState?.branch"- :project="project"- :merged-branch="validationState.branch"- :base-branch="targetBranch"- />- </template>- </StepTab>+ <div class="h-full relative flex flex-col gap-y-2 overflow-y-hidden text-sm"><MaskSpinner v-if="state.isMerging" />++ <MergeBranchSelect+ v-model:delete-branch-after-merged="state.deleteBranchAfterMerged"+ :project="project"+ :head-branch="headBranch"+ :target-branch="targetBranch"+ @update:head-branch-name="handleUpdateHeadBranch"+ @update:target-branch-name="state.targetBranchName = $event || null"+ />++ <MergeBranchValidationStateView+ :project="project"+ :head-branch="headBranch"+ :target-branch="targetBranch"+ :is-loading-head-branch="isLoadingHeadBranch"+ :is-loading-target-branch="isLoadingTargetBranch"+ :is-validating="isValidating"+ :validation-state="validationState"+ />++ <div class="flex-1">+ <BranchComparison+ v-if="validationState?.branch"+ :project="project"+ :base="targetBranch"+ :head="validationState?.branch"+ :is-base-loading="isLoadingTargetBranch"+ :is-head-loading="isValidating"+ >+ <template v-if="targetBranch" #baseline-title>+ {{ targetBranch.branchId }}+ {{ $t("branch.merge-rebase.before-merge") }}+ </template>+ <template v-if="targetBranch" #head-title>+ {{ targetBranch.branchId }}+ {{ $t("branch.merge-rebase.after-merge") }}+ </template>+ </BranchComparison>+ <div v-else-if="validationState?.errmsg" class="text-error text-sm">+ {{ validationState.errmsg }}+ </div>+ </div>++ <div class="flex flex-row justify-end items-center gap-x-3">+ <NButton+ type="primary"+ :disabled="!allowConfirm || state.isMerging"+ @click="handleMergeBranch"+ >+ {{ $t("common.confirm") }}+ </NButton>+ </div></div></template><script lang="ts" setup>import { computedAsync } from "@vueuse/core";+import { NButton } from "naive-ui";import { Status } from "nice-grpc-common";import { computed, reactive, ref, watch } from "vue";import { useI18n } from "vue-i18n";import MaskSpinner from "@/components/misc/MaskSpinner.vue";-import { StepTab } from "@/components/v2";import { branchServiceClient } from "@/grpcweb";import { pushNotification, useBranchStore } from "@/store";import { ComposedProject } from "@/types";import { Branch } from "@/types/proto/v1/branch_service";import { extractGrpcErrorMessage, getErrorCode } from "@/utils/grpcweb";-import MergeBranchStep from "./MergeBranchStep.vue";-import SelectBranchStep from "./SelectBranchStep.vue";+import BranchComparison from "../common/BranchComparison.vue";+import MergeBranchSelect from "./MergeBranchSelect.vue";+import MergeBranchValidationStateView from "./MergeBranchValidationStateView.vue";import { MergeBranchValidationState } from "./types";interface LocalState {- currentStepIndex: number;targetBranchName: string | null;deleteBranchAfterMerged: boolean;isMerging: boolean;@@ -77,7 +95,6 @@ const emit = defineEmits<{}>();const state = reactive<LocalState>({- currentStepIndex: 0,targetBranchName: null,deleteBranchAfterMerged: false,isMerging: false,@@ -87,16 +104,6 @@ const branchStore = useBranchStore();const isLoadingHeadBranch = ref(false);const isLoadingTargetBranch = ref(false);const isValidating = ref(false);-const combinedIsLoadingBranch = computed(() => {- return isLoadingHeadBranch.value || isLoadingTargetBranch.value;-});--const stepList = computed(() => [- { title: t("branch.select-branch") },- { title: t("common.preview") },-]);-const STEP_SELECT_BRANCH = 0;-const STEP_MERGE_BRANCH = 1;const headBranch = computedAsync(async () => {@@ -169,27 +176,12 @@ const handleUpdateHeadBranch = (branchName: string | undefined) => {emit("update:head-branch-name", branchName || null);};-const tryChangeStep = (nextStepIndex: number) => {- if (combinedIsLoadingBranch.value) {- return;- }- state.currentStepIndex = nextStepIndex;-};--const allowNextStep = computed(() => {- if (state.currentStepIndex === STEP_SELECT_BRANCH) {- return (- headBranch.value !== undefined &&- targetBranch.value !== undefined &&- validationState.value?.status === Status.OK- );- }- if (state.currentStepIndex === STEP_MERGE_BRANCH) {- return true;- }-- console.error("[BranchMergeView.allowNextStep] should never reach this line");- return false;+const allowConfirm = computed(() => {+ return (+ headBranch.value !== undefined &&+ targetBranch.value !== undefined &&+ validationState.value?.status === Status.OK+ );});const handleMergeBranch = async () => {diff --git a/frontend/src/components/Branch/BranchMergeView/MergeBranchSelect.vue b/frontend/src/components/Branch/BranchMergeView/MergeBranchSelect.vuenew file mode 100644index 0000000000..96690b7d0a--- /dev/null+++ b/frontend/src/components/Branch/BranchMergeView/MergeBranchSelect.vue@@ -0,0 +1,71 @@+<template>+ <div+ class="w-full grid grid-cols-4 items-center text-sm gap-x-2"+ style="grid-template-columns: 1fr auto 1fr auto"+ >+ <BranchSelector+ class="!w-full text-center"+ :clearable="false"+ :project="project"+ :branch="targetBranch?.name"+ :filter="targetBranchFilter"+ @update:branch="$emit('update:target-branch-name', $event)"+ />+ <div class="flex flex-row justify-center px-2">+ <MoveLeftIcon :size="40" stroke-width="1" />+ </div>+ <BranchSelector+ class="!full text-center"+ :clearable="false"+ :project="project"+ :branch="headBranch?.name"+ :filter="headBranchFilter"+ @update:branch="$emit('update:head-branch-name', $event)"+ />+ <NCheckbox+ :checked="deleteBranchAfterMerged"+ @update:checked="+ $emit('update:delete-branch-after-merged', $event as boolean)+ "+ >+ {{ $t("branch.merge-rebase.delete-branch-after-merged") }}+ </NCheckbox>+ </div>+</template>++<script setup lang="ts">+import { MoveLeftIcon } from "lucide-vue-next";+import { NCheckbox } from "naive-ui";+import { ComposedProject } from "@/types";+import { Branch } from "@/types/proto/v1/branch_service";++const props = defineProps<{+ project: ComposedProject;+ targetBranch: Branch | undefined;+ headBranch: Branch | undefined;+ deleteBranchAfterMerged: boolean;+}>();++defineEmits<{+ (event: "update:head-branch-name", branch: string | undefined): void;+ (event: "update:target-branch-name", branch: string | undefined): void;+ (event: "update:delete-branch-after-merged", on: boolean): void;+}>();++const targetBranchFilter = (branch: Branch) => {+ const { headBranch } = props;+ if (!headBranch) {+ return true;+ }+ return branch.engine === headBranch.engine && branch.name !== headBranch.name;+};+const headBranchFilter = (branch: Branch) => {+ const { targetBranch } = props;+ if (!targetBranch) {+ return true;+ }+ return (+ branch.engine === targetBranch.engine && branch.name !== targetBranch.name+ );+};+</script>diff --git a/frontend/src/components/Branch/BranchMergeView/MergeBranchStep.vue b/frontend/src/components/Branch/BranchMergeView/MergeBranchStep.vuedeleted file mode 100644index a0c6b8f68c..0000000000--- a/frontend/src/components/Branch/BranchMergeView/MergeBranchStep.vue+++ /dev/null@@ -1,74 +0,0 @@-<template>- <div class="flex-1 flex flex-col gap-y-1 text-sm">- <div>- {{- $t("branch.merge-rebase.preview-merge-result", {- branch: baseBranch.branchId,- })- }}- </div>- <NTabs v-model:value="tab">- <NTab name="schema-editor">- {{ $t("schema-editor.self") }}- </NTab>- <NTab name="raw-schema-text">- {{ $t("schema-editor.raw-sql") }}- </NTab>- </NTabs>- <div- v-show="tab === 'schema-editor'"- class="w-full flex-1 relative text-sm"- >- <SchemaEditorLite- ref="schemaEditorRef"- resource-type="branch"- :project="project"- :readonly="true"- :branch="mergedBranch"- />- </div>- <div- v-show="tab === 'raw-schema-text'"- class="w-full flex-1 relative text-sm border rounded overflow-clip"- >- <DiffEditor- :readonly="true"- :original="mergedBranch.baselineSchema"- :modified="mergedBranch.schema"- class="h-full"- />- </div>- </div>-</template>--<script setup lang="ts">-import { ref, watch } from "vue";-import { DiffEditor } from "@/components/MonacoEditor";-import SchemaEditorLite from "@/components/SchemaEditorLite";-import { useDatabaseV1Store } from "@/store";-import { ComposedProject } from "@/types";-import { Branch } from "@/types/proto/v1/branch_service";-import { DatabaseMetadata } from "@/types/proto/v1/database_service";--type TabValue = "schema-editor" | "raw-schema-text";--const props = defineProps<{- project: ComposedProject;- baseBranch: Branch;- mergedBranch: Branch;-}>();--const schemaEditorRef = ref<InstanceType<typeof SchemaEditorLite>>();-const tab = ref<TabValue>("raw-schema-text");--watch([() => props.mergedBranch, schemaEditorRef], ([branch, editor]) => {- if (branch && editor) {- const db = useDatabaseV1Store().getDatabaseByName(branch.baselineDatabase);- editor.rebuildMetadataEdit(- db,- branch.baselineSchemaMetadata ?? DatabaseMetadata.fromPartial({}),- branch.schemaMetadata ?? DatabaseMetadata.fromPartial({})- );- }-});-</script>diff --git a/frontend/src/components/Branch/BranchMergeView/MergeBranchValidationStateView.vue b/frontend/src/components/Branch/BranchMergeView/MergeBranchValidationStateView.vuenew file mode 100644index 0000000000..dfe0ee3b0a--- /dev/null+++ b/frontend/src/components/Branch/BranchMergeView/MergeBranchValidationStateView.vue@@ -0,0 +1,71 @@+<template>+ <div class="relative text-sm">+ <div class="flex flex-row items-center gap-x-1">+ <span v-if="!headBranch || !targetBranch">+ {{ $t("branch.merge-rebase.select-branches-to-merge") }}+ </span>+ <template v-else>+ <template v-if="isValidating">+ <BBSpin class="!w-4 !h-4" />+ <span>{{ $t("branch.merge-rebase.validating-branch") }}</span>+ </template>+ <template v-else-if="validationState">+ <template v-if="validationState.status === Status.OK">+ <CheckIcon class="w-4 h-4 text-success" />+ <span>{{ $t("branch.merge-rebase.able-to-merge") }}</span>+ </template>+ <template v-else>+ <div class="flex flex-row items-center gap-x-1">+ <XCircleIcon class="w-4 h-4 text-error" />+ <i18n-t+ keypath="branch.merge-rebase.cannot-automatically-merge"+ tag="span"+ class="text-error"+ >+ <template #rebase_branch>+ <router-link+ :to="rebaseLink(headBranch, targetBranch)"+ class="normal-link"+ >+ {{ $t("branch.merge-rebase.go-rebase") }}+ </router-link>+ </template>+ </i18n-t>+ </div>+ </template>+ </template>+ </template>+ </div>+ </div>+</template>++<script setup lang="ts">+import { CheckIcon, XCircleIcon } from "lucide-vue-next";+import { Status } from "nice-grpc-common";+import { PROJECT_V1_ROUTE_BRANCH_REBASE } from "@/router/dashboard/projectV1";+import { ComposedProject } from "@/types";+import { Branch } from "@/types/proto/v1/branch_service";+import { MergeBranchValidationState } from "./types";++defineProps<{+ project: ComposedProject;+ targetBranch: Branch | undefined;+ headBranch: Branch | undefined;+ isLoadingTargetBranch?: boolean;+ isLoadingHeadBranch?: boolean;+ isValidating?: boolean;+ validationState: MergeBranchValidationState | undefined;+}>();++const rebaseLink = (headBranch: Branch, targetBranch: Branch) => {+ return {+ name: PROJECT_V1_ROUTE_BRANCH_REBASE,+ params: {+ branchName: headBranch.branchId,+ },+ query: {+ source: targetBranch.branchId,+ },+ };+};+</script>diff --git a/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vue b/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vuedeleted file mode 100644index 1b101f5432..0000000000--- a/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vue+++ /dev/null@@ -1,214 +0,0 @@-<template>- <div- class="w-full grid grid-cols-4 items-center text-sm gap-x-2"- style="grid-template-columns: 1fr auto 1fr auto"- >- <BranchSelector- class="!w-full text-center"- :clearable="false"- :project="project"- :branch="targetBranch?.name"- :filter="targetBranchFilter"- @update:branch="$emit('update:target-branch-name', $event)"- />- <div class="flex flex-row justify-center px-2">- <MoveLeftIcon :size="40" stroke-width="1" />- </div>- <BranchSelector- class="!full text-center"- :clearable="false"- :project="project"- :branch="headBranch?.name"- :filter="headBranchFilter"- @update:branch="$emit('update:head-branch-name', $event)"- />- <NCheckbox- :checked="deleteBranchAfterMerged"- @update:checked="- $emit('update:delete-branch-after-merged', $event as boolean)- "- >- {{ $t("branch.merge-rebase.delete-branch-after-merged") }}- </NCheckbox>- </div>- <div class="flex-1 flex flex-col relative text-sm gap-y-1 overflow-hidden">- <div class="flex flex-row items-center gap-x-1">- <span v-if="!headBranch || !targetBranch">- {{ $t("branch.merge-rebase.select-branches-to-merge") }}- </span>- <template v-else>- <template v-if="isValidating">- <BBSpin class="!w-4 !h-4" />- <span>{{ $t("branch.merge-rebase.validating-branch") }}</span>- </template>- <template v-else-if="validationState">- <template v-if="validationState.status === Status.OK">- <CheckIcon class="w-4 h-4 text-success" />- <span>{{ $t("branch.merge-rebase.able-to-merge") }}</span>- </template>- <template v-else>- <NTooltip- :disabled="!validationState.errmsg"- placement="bottom-start"- >- <template #trigger>- <div class="flex flex-row items-center gap-x-1">- <XCircleIcon class="w-4 h-4 text-error" />- <i18n-t- keypath="branch.merge-rebase.cannot-automatically-merge"- tag="span"- class="text-error"- >- <template #rebase_branch>- <router-link- :to="rebaseLink(headBranch, targetBranch)"- class="normal-link"- >- {{ $t("branch.merge-rebase.go-rebase") }}- </router-link>- </template>- </i18n-t>- </div>- </template>- <template #default>- <div class="max-w-[24rem]">- {{ validationState.errmsg }}- </div>- </template>- </NTooltip>- </template>- </template>- </template>- </div>- <NTabs v-model:value="tab">- <template v-if="headBranch" #prefix>- <div class="text-control-placeholder">- {{- $t("branch.merge-rebase.changes-of-branch", {- branch: headBranch.branchId,- })- }}- </div>- </template>- <NTab name="schema-editor">- {{ $t("schema-editor.self") }}- </NTab>- <NTab name="raw-schema-text">- {{ $t("schema-editor.raw-sql") }}- </NTab>- </NTabs>- <div- v-show="tab === 'schema-editor'"- class="flex-1 relative text-sm overflow-hidden"- >- <SchemaEditorLite- ref="schemaEditorRef"- :key="headBranch?.name"- resource-type="branch"- :project="project"- :readonly="true"- :loading="isLoadingHeadBranch"- :branch="headBranch ?? Branch.fromPartial({})"- />- <MaskSpinner v-if="isLoadingHeadBranch" />- </div>- <div- v-show="tab === 'raw-schema-text'"- class="w-full flex-1 relative text-sm border rounded overflow-clip"- >- <DiffEditor- :readonly="true"- :original="headBranch?.baselineSchema"- :modified="headBranch?.schema"- class="h-full"- />-- <MaskSpinner v-if="isLoadingHeadBranch || isLoadingTargetBranch" />- </div>- </div>-</template>--<script setup lang="ts">-import { CheckIcon, XCircleIcon, MoveLeftIcon } from "lucide-vue-next";-import { NCheckbox, NTab, NTabs } from "naive-ui";-import { Status } from "nice-grpc-common";-import { ref, watch } from "vue";-import { DiffEditor } from "@/components/MonacoEditor";-import SchemaEditorLite from "@/components/SchemaEditorLite";-import MaskSpinner from "@/components/misc/MaskSpinner.vue";-import { PROJECT_V1_ROUTE_BRANCH_REBASE } from "@/router/dashboard/projectV1";-import { useDatabaseV1Store } from "@/store";-import { ComposedProject } from "@/types";-import { Branch } from "@/types/proto/v1/branch_service";-import { DatabaseMetadata } from "@/types/proto/v1/database_service";-import { MergeBranchValidationState } from "./types";--type TabValue = "schema-editor" | "raw-schema-text";--const props = defineProps<{- project: ComposedProject;- targetBranch: Branch | undefined;- headBranch: Branch | undefined;- isLoadingTargetBranch?: boolean;- isLoadingHeadBranch?: boolean;- isValidating?: boolean;- validationState: MergeBranchValidationState | undefined;- deleteBranchAfterMerged: boolean;-}>();--defineEmits<{- (event: "update:head-branch-name", branch: string | undefined): void;- (event: "update:target-branch-name", branch: string | undefined): void;- (event: "update:delete-branch-after-merged", on: boolean): void;-}>();--const schemaEditorRef = ref<InstanceType<typeof SchemaEditorLite>>();-const tab = ref<TabValue>("schema-editor");--const targetBranchFilter = (branch: Branch) => {- const { headBranch } = props;- if (!headBranch) {- return true;- }- return branch.engine === headBranch.engine && branch.name !== headBranch.name;-};-const headBranchFilter = (branch: Branch) => {- const { targetBranch } = props;- if (!targetBranch) {- return true;- }- return (- branch.engine === targetBranch.engine && branch.name !== targetBranch.name- );-};--const rebaseLink = (headBranch: Branch, targetBranch: Branch) => {- return {- name: PROJECT_V1_ROUTE_BRANCH_REBASE,- params: {- branchName: headBranch.branchId,- },- query: {- source: targetBranch.branchId,- },- };-};--// re-calculate diff for coloring when branch changed-watch(- [() => props.headBranch, schemaEditorRef],- ([head, editor]) => {- if (head && editor) {- const db = useDatabaseV1Store().getDatabaseByName(head.baselineDatabase);- editor.rebuildMetadataEdit(- db,- head.baselineSchemaMetadata ?? DatabaseMetadata.fromPartial({}),- head.schemaMetadata ?? DatabaseMetadata.fromPartial({})- );- }- },- {- immediate: true,- }-);-</script>diff --git a/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue b/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vueindex da95c351a0..01eea41c44 100644--- a/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue+++ b/frontend/src/components/Branch/BranchRebaseView/BranchRebaseView.vue@@ -1,44 +1,66 @@<template>- <div class="h-full relative">- <StepTab- :step-list="stepList"- :current-index="state.currentStepIndex"- :show-cancel="false"- :allow-next="allowNextStep"- class="h-full flex flex-col !space-y-0 gap-y-2"- pane-class="flex-1 flex flex-col gap-y-2 relative overflow-hidden"- footer-class="!space-y-0 !border-0 !pt-0"- @update:current-index="tryChangeStep"- @finish="handleRebaseBranch"- >- <template #0>- <SelectBranchStep- :project="project"- :source-type="state.sourceType"- :head-branch="headBranch"- :source-branch="sourceBranch"- :source-database="sourceDatabase"- :is-loading-head-branch="isLoadingHeadBranch"- :is-loading-source-branch="isLoadingSourceBranch"- :is-validating="isValidating"- :validation-state="validationState"- @update:source-type="state.sourceType = $event"- @update:head-branch-name="handleUpdateHeadBranch"- @update:source-branch-name="state.sourceBranchName = $event || null"- @update:source-database-uid="state.sourceDatabaseUID = $event || null"- />- </template>- <template #1>- <RebaseBranchStep- v-if="headBranch && sourceBranchOrDatabase && validationState"- ref="rebaseBranchStepRef"- :project="project"- :validation-state="validationState"- :base-branch="headBranch"- />- </template>- </StepTab>+ <div class="h-full relative flex flex-col gap-y-2 overflow-y-hidden text-sm"><MaskSpinner v-if="state.isRebasing" :zindexable="false" />++ <RebaseBranchSelect+ :project="project"+ :source-type="state.sourceType"+ :head-branch="headBranch"+ :source-branch="sourceBranch"+ :source-database="sourceDatabase"+ @update:source-type="state.sourceType = $event"+ @update:head-branch-name="handleUpdateHeadBranch"+ @update:source-branch-name="state.sourceBranchName = $event || null"+ @update:source-database-uid="state.sourceDatabaseUID = $event || null"+ />++ <RebaseBranchValidationStateView+ :project="project"+ :source-type="state.sourceType"+ :head-branch="headBranch"+ :source-branch="sourceBranch"+ :source-database="sourceDatabase"+ :is-loading-head-branch="isLoadingHeadBranch"+ :is-loading-source-branch="isLoadingSourceBranch"+ :is-validating="isValidating"+ :validation-state="validationState"+ />++ <div class="flex-1 flex flex-col overflow-y-hidden">+ <BranchComparison+ v-if="validationState?.branch"+ :project="project"+ :base="headBranch"+ :head="validationState?.branch"+ :is-base-loading="isLoadingHeadBranch"+ :is-head-loading="isValidating"+ >+ <template v-if="headBranch" #baseline-title>+ {{ headBranch.branchId }}+ {{ $t("branch.merge-rebase.before-rebase") }}+ </template>+ <template v-if="headBranch" #head-title>+ {{ headBranch.branchId }}+ {{ $t("branch.merge-rebase.after-rebase") }}+ </template>+ </BranchComparison>+ <ResolveConflict+ v-else-if="validationState"+ ref="resolveConflictRef"+ :project="project"+ :validation-state="validationState"+ />+ </div>++ <div class="flex flex-row justify-end items-center gap-x-3">+ <NButton+ type="primary"+ :disabled="!allowConfirm || state.isRebasing"+ @click="handleRebaseBranch"+ >+ {{ $t("common.confirm") }}+ </NButton>+ </div></div></template>@@ -50,14 +72,14 @@ import { computed, onMounted, reactive, ref, watch } from "vue";import { useI18n } from "vue-i18n";import { useRoute } from "vue-router";import MaskSpinner from "@/components/misc/MaskSpinner.vue";-import { StepTab } from "@/components/v2";import { branchServiceClient } from "@/grpcweb";import { pushNotification, useBranchStore, useDatabaseV1Store } from "@/store";import { ComposedProject, UNKNOWN_ID } from "@/types";import { Branch } from "@/types/proto/v1/branch_service";import { defer } from "@/utils";-import RebaseBranchStep from "./RebaseBranchStep.vue";-import SelectBranchStep from "./SelectBranchStep.vue";+import RebaseBranchSelect from "./RebaseBranchSelect.vue";+import RebaseBranchValidationStateView from "./RebaseBranchValidationStateView.vue";+import ResolveConflict from "./ResolveConflict.vue";import { RebaseBranchValidationState, RebaseSourceType } from "./types";interface LocalState {@@ -88,21 +110,11 @@ const state = reactive<LocalState>({const { t } = useI18n();const route = useRoute();const $dialog = useDialog();-const rebaseBranchStepRef = ref<InstanceType<typeof RebaseBranchStep>>();+const resolveConflictRef = ref<InstanceType<typeof ResolveConflict>>();const branchStore = useBranchStore();const isLoadingHeadBranch = ref(false);const isLoadingSourceBranch = ref(false);const isValidating = ref(false);-const combinedIsLoadingBranch = computed(() => {- return isLoadingHeadBranch.value || isLoadingSourceBranch.value;-});--const stepList = computed(() => [- { title: t("branch.select-branch") },- { title: t("common.preview") },-]);-const STEP_SELECT_BRANCH = 0;-const STEP_REBASE_BRANCH = 1;const headBranch = computedAsync(async () => {@@ -178,29 +190,12 @@ const handleUpdateHeadBranch = (branchName: string | undefined) => {emit("update:head-branch-name", branchName || null);};-const tryChangeStep = (nextStepIndex: number) => {- if (combinedIsLoadingBranch.value) {- return;- }- state.currentStepIndex = nextStepIndex;-};--const allowNextStep = computed(() => {- if (state.currentStepIndex === STEP_SELECT_BRANCH) {- return (- headBranch.value !== undefined &&- sourceBranchOrDatabase.value !== undefined &&- validationState.value !== undefined- );- }- if (state.currentStepIndex === STEP_REBASE_BRANCH) {- return true;- }-- console.error(- "[BranchRebaseView.allowNextStep] should never reach this line"+const allowConfirm = computed(() => {+ return (+ headBranch.value !== undefined &&+ sourceBranchOrDatabase.value !== undefined &&+ validationState.value !== undefined);- return false;});const confirmRebaseWithMaybeConflict = () => {@@ -226,12 +221,12 @@ const handleRebaseBranch = async () => {if (!source) return;const head = headBranch.value;if (!head) return;- const rebaseBranchStep = rebaseBranchStepRef.value;- if (!rebaseBranchStep) return;+ const resolveConflict = resolveConflictRef.value;+ if (!resolveConflict) return;state.isRebasing = true;try {- const validation = rebaseBranchStep.validateConflictSchema();+ const validation = resolveConflict.validateConflictSchema();if (!validation.valid) {const confirmed = await confirmRebaseWithMaybeConflict();if (!confirmed) return;diff --git a/frontend/src/components/Branch/BranchRebaseView/RebaseBranchSelect.vue b/frontend/src/components/Branch/BranchRebaseView/RebaseBranchSelect.vuenew file mode 100644index 0000000000..babf618562--- /dev/null+++ b/frontend/src/components/Branch/BranchRebaseView/RebaseBranchSelect.vue@@ -0,0 +1,101 @@+<template>+ <div+ class="w-full grid grid-cols-3 items-end text-sm gap-x-2"+ style="grid-template-columns: 1fr auto 1fr"+ >+ <BranchSelector+ class="!full text-center"+ :clearable="false"+ :project="project"+ :branch="headBranch?.name"+ :filter="headBranchFilter"+ @update:branch="$emit('update:head-branch-name', $event)"+ />+ <div class="flex flex-row justify-center px-2 h-[34px]">+ <MoveLeftIcon :size="40" stroke-width="1" />+ </div>+ <div class="flex flex-col">+ <NRadioGroup+ :value="sourceType"+ class="space-x-2"+ @update:value="$emit('update:source-type', $event as RebaseSourceType)"+ >+ <NRadio value="BRANCH">{{ $t("common.branch") }}</NRadio>+ <NRadio value="DATABASE">{{ $t("common.database") }}</NRadio>+ </NRadioGroup>+ <BranchSelector+ v-if="sourceType === 'BRANCH'"+ class="!w-full text-center"+ :clearable="false"+ :project="project"+ :branch="sourceBranch?.name"+ :filter="sourceBranchFilter"+ @update:branch="$emit('update:source-branch-name', $event)"+ />+ <DatabaseSelect+ v-if="sourceType === 'DATABASE'"+ :database="sourceDatabase?.uid"+ :project="project.uid"+ :allowed-engine-type-list="headBranch ? [headBranch.engine] : undefined"+ style="width: 100%"+ @update:database="$emit('update:source-database-uid', $event)"+ />+ </div>+ </div>+</template>++<script setup lang="ts">+import { MoveLeftIcon } from "lucide-vue-next";+import { NRadioGroup } from "naive-ui";+import { computed } from "vue";+import { DatabaseSelect } from "@/components/v2";+import { ComposedDatabase, ComposedProject } from "@/types";+import { Branch } from "@/types/proto/v1/branch_service";+import { RebaseSourceType } from "./types";++const props = defineProps<{+ project: ComposedProject;+ sourceType: RebaseSourceType;+ headBranch: Branch | undefined;+ sourceBranch: Branch | undefined;+ sourceDatabase: ComposedDatabase | undefined;+ isLoadingSourceBranch?: boolean;+ isLoadingHeadBranch?: boolean;+}>();++defineEmits<{+ (event: "update:source-type", type: RebaseSourceType): void;+ (event: "update:head-branch-name", branch: string | undefined): void;+ (event: "update:source-branch-name", branch: string | undefined): void;+ (event: "update:source-database-uid", uid: string | undefined): void;+}>();++const sourceBranchOrDatabase = computed(() => {+ return props.sourceType === "BRANCH"+ ? props.sourceBranch+ : props.sourceDatabase;+});++const sourceBranchFilter = (branch: Branch) => {+ const { headBranch } = props;+ if (!headBranch) {+ return true;+ }+ return branch.engine === headBranch.engine && branch.name !== headBranch.name;+};+const headBranchFilter = (branch: Branch) => {+ const source = sourceBranchOrDatabase.value;+ if (!source) {+ return true;+ }+ if (props.sourceType === "BRANCH") {+ const sourceBranch = source as Branch;+ return (+ branch.engine === sourceBranch.engine && branch.name !== sourceBranch.name+ );+ } else {+ const sourceDatabase = source as ComposedDatabase;+ return branch.engine === sourceDatabase.instanceEntity.engine;+ }+};+</script>diff --git a/frontend/src/components/Branch/BranchRebaseView/RebaseBranchValidationStateView.vue b/frontend/src/components/Branch/BranchRebaseView/RebaseBranchValidationStateView.vuenew file mode 100644index 0000000000..aa2a3049c3--- /dev/null+++ b/frontend/src/components/Branch/BranchRebaseView/RebaseBranchValidationStateView.vue@@ -0,0 +1,58 @@+<template>+ <div class="flex flex-row items-center gap-x-1">+ <span v-if="!headBranch || !sourceBranchOrDatabase">+ {{ $t("branch.merge-rebase.select-branches-to-rebase") }}+ </span>+ <template v-else>+ <template v-if="isValidating">+ <BBSpin class="!w-4 !h-4" />+ <span>{{ $t("branch.merge-rebase.validating-branch") }}</span>+ </template>+ <template v-else-if="validationState">+ <template v-if="validationState.branch">+ <CheckIcon class="w-4 h-4 text-success" />+ <span>{{ $t("branch.merge-rebase.able-to-rebase") }}</span>+ </template>+ <template v-else>+ <XCircleIcon class="w-4 h-4 text-error" />+ <span class="text-error">+ {{ $t("branch.merge-rebase.cannot-automatically-rebase") }}+ </span>+ </template>+ </template>+ </template>+ </div>+</template>++<script setup lang="ts">+import { CheckIcon, XCircleIcon } from "lucide-vue-next";+import { computed } from "vue";+import { ComposedDatabase, ComposedProject } from "@/types";+import { Branch } from "@/types/proto/v1/branch_service";+import { RebaseBranchValidationState, RebaseSourceType } from "./types";++const props = defineProps<{+ project: ComposedProject;+ sourceType: RebaseSourceType;+ headBranch: Branch | undefined;+ sourceBranch: Branch | undefined;+ sourceDatabase: ComposedDatabase | undefined;+ isLoadingSourceBranch?: boolean;+ isLoadingHeadBranch?: boolean;+ isValidating?: boolean;+ validationState: RebaseBranchValidationState | undefined;+}>();++defineEmits<{+ (event: "update:source-type", type: RebaseSourceType): void;+ (event: "update:head-branch-name", branch: string | undefined): void;+ (event: "update:source-branch-name", branch: string | undefined): void;+ (event: "update:source-database-uid", uid: string | undefined): void;+}>();++const sourceBranchOrDatabase = computed(() => {+ return props.sourceType === "BRANCH"+ ? props.sourceBranch+ : props.sourceDatabase;+});+</script>diff --git a/frontend/src/components/Branch/BranchRebaseView/ResolveConflict.vue b/frontend/src/components/Branch/BranchRebaseView/ResolveConflict.vuenew file mode 100644index 0000000000..8d067daff4--- /dev/null+++ b/frontend/src/components/Branch/BranchRebaseView/ResolveConflict.vue@@ -0,0 +1,117 @@+<template>+ <div+ class="w-full flex-1 relative text-sm border rounded overflow-clip bb-resolve-conflict-editor"+ >+ <MonacoEditor+ v-model:content="state.editingSchema"+ :line-highlights="lineHighlightOptions"+ class="h-full"+ />+ </div>+</template>++<script setup lang="ts">+import { computed, reactive, watch } from "vue";+import {+ LineHighlightOption,+ LineHighlightOverviewRulerPosition,+ MonacoEditor,+} from "@/components/MonacoEditor";+import { ComposedProject } from "@/types";+import { RebaseBranchValidationState } from "./types";++type LocalState = {+ editingSchema: string;+};+const ConflictMarkers = [+ {+ pattern: "<<<<<<",+ type: "current",+ color: "rgb(16 185 129)", // bg-emerald-500+ position: "LEFT" as LineHighlightOverviewRulerPosition,+ },+ {+ pattern: "======",+ type: "gutter",+ color: "rgb(107 114 128)", // bg-gray-500+ position: "FULL" as LineHighlightOverviewRulerPosition,+ },+ {+ pattern: ">>>>>>",+ type: "incoming",+ color: "rgb(59 130 246)", // bg-blue-500+ position: "RIGHT" as LineHighlightOverviewRulerPosition,+ },+];++const props = defineProps<{+ project: ComposedProject;+ validationState: RebaseBranchValidationState;+}>();++const state = reactive<LocalState>({+ editingSchema: "",+});++const lineHighlightOptions = computed(() => {+ const options: LineHighlightOption[] = [];+ state.editingSchema.split("\n").forEach((line, index) => {+ const marker = ConflictMarkers.find((m) => line.startsWith(m.pattern));+ if (marker) {+ options.push({+ lineNumber: index + 1,+ className: `bb-conflict-line--${marker.type}`,+ overviewRuler: {+ color: marker.color,+ position: marker.position,+ },+ });+ }+ });+ return options;+});++const validateConflictSchema = () => {+ if (props.validationState.branch) {+ // Auto rebase+ return {+ valid: true,+ schema: undefined,+ };+ }+ if (lineHighlightOptions.value.length === 0) {+ // Conflict resolved+ return {+ valid: true,+ schema: state.editingSchema,+ };+ }+ return {+ valid: false,+ schema: state.editingSchema,+ };+};+watch(+ () => props.validationState.conflictSchema,+ (conflictSchema) => {+ state.editingSchema = conflictSchema ?? "";+ },+ {+ immediate: true,+ }+);++defineExpose({ validateConflictSchema });+</script>++<style lang="postcss" scoped>+.bb-resolve-conflict-editor :deep(.bb-conflict-line--current) {+ @apply bg-emerald-300;+}+.bb-resolve-conflict-editor :deep(.bb-conflict-line--gutter) {+ @apply bg-gray-300;+}+.bb-resolve-conflict-editor :deep(.bb-conflict-line--incoming) {+ @apply bg-blue-300;+}+</style>diff --git a/frontend/src/components/Branch/common/BranchComparison.vue b/frontend/src/components/Branch/common/BranchComparison.vuenew file mode 100644index 0000000000..f97d954ad5--- /dev/null+++ b/frontend/src/components/Branch/common/BranchComparison.vue@@ -0,0 +1,126 @@+<template>+ <div class="h-full flex flex-col gap-y-1 relative">+ <NTabs v-model:value="tab">+ <template #prefix>+ <slot name="tab-prefix" />+ </template>+ <NTab name="schema-text">+ {{ $t("branch.schema-text") }}+ </NTab>+ <NTab name="visualized-schema">+ {{ $t("branch.visualized-schema") }}+ </NTab>++ <template #suffix>+ <slot name="tab-suffix" />+ </template>+ </NTabs>+ <div v-show="tab === 'schema-text'" class="flex-1 flex flex-col text-sm">+ <div class="flex items-center justify-between text-control-placeholder">+ <div class="flex-1">+ <slot name="baseline-title">+ {{ $t("branch.baseline") }}+ </slot>+ </div>+ <div class="flex-1">+ <slot name="head-title">+ {{ $t("branch.head") }}+ </slot>+ </div>+ </div>+ <div class="flex-1 w-full relative text-sm border rounded overflow-clip">+ <DiffEditor+ :readonly="true"+ :original="virtualBranch?.baselineSchema ?? ''"+ :modified="virtualBranch?.schema ?? ''"+ class="h-full"+ />+ </div>+ </div>+ <div+ v-show="tab === 'visualized-schema'"+ class="flex-1 relative text-sm overflow-y-hidden"+ >+ <SchemaEditorLite+ ref="schemaEditorRef"+ :key="virtualBranch?.name"+ resource-type="branch"+ :project="project"+ :readonly="true"+ :branch="virtualBranch ?? Branch.fromPartial({})"+ :loading="combinedLoading"+ />+ </div>+ <MaskSpinner v-if="combinedLoading" />+ </div>+</template>++<script lang="ts" setup>+import { cloneDeep } from "lodash-es";+import { v1 as uuidv1 } from "uuid";+import { computed, ref, watch } from "vue";+import { DiffEditor } from "@/components/MonacoEditor";+import SchemaEditorLite from "@/components/SchemaEditorLite";+import { useDatabaseV1Store } from "@/store";+import { ComposedProject } from "@/types";+import { Branch } from "@/types/proto/v1/branch_service";+import { DatabaseMetadata } from "@/types/proto/v1/database_service";++type TabValue = "schema-text" | "visualized-schema";++const props = defineProps<{+ project: ComposedProject;+ base: Branch | undefined;+ head: Branch | undefined;+ isBaseLoading?: boolean;+ isHeadLoading?: boolean;+}>();++const tab = ref<TabValue>("schema-text");+const schemaEditorRef = ref<InstanceType<typeof SchemaEditorLite>>();+const combinedLoading = computed(() => {+ return props.isBaseLoading || props.isHeadLoading;+});++const emptyBranch = () => {+ return Branch.fromPartial({});+};++const virtualBranch = computed(() => {+ if (combinedLoading.value) {+ return emptyBranch();+ }+ const { project, base, head } = props;+ if (!base || !head) {+ return emptyBranch();+ }+ return Branch.fromPartial({+ name: `${project.name}/branches/${uuidv1()}`,+ baselineDatabase: base.baselineDatabase,+ baselineSchema: base.schema,+ baselineSchemaMetadata: cloneDeep(base.schemaMetadata),+ schema: head.schema,+ schemaMetadata: cloneDeep(head.schemaMetadata),+ });+});++// re-calculate diff for coloring when branch changed+watch(+ [virtualBranch, schemaEditorRef],+ ([branch, editor]) => {+ if (branch && editor) {+ const db = useDatabaseV1Store().getDatabaseByName(+ branch.baselineDatabase+ );+ editor.rebuildMetadataEdit(+ db,+ branch.baselineSchemaMetadata ?? DatabaseMetadata.fromPartial({}),+ branch.schemaMetadata ?? DatabaseMetadata.fromPartial({})+ );+ }+ },+ {+ immediate: true,+ }+);+</script>diff --git a/frontend/src/components/Branch/common/BranchDetailViewer.vue b/frontend/src/components/Branch/common/BranchDetailViewer.vuenew file mode 100644index 0000000000..b402359c62--- /dev/null+++ b/frontend/src/components/Branch/common/BranchDetailViewer.vue@@ -0,0 +1,59 @@+<template>+ <div class="h-full flex flex-col gap-y-1 relative">+ <NTabs v-model:value="tab">+ <template v-if="branch" #prefix>+ <span class="text-control-placeholder text-sm">+ {{ branch.branchId }}+ </span>+ </template>+ <NTab name="visualized-schema">+ {{ $t("branch.visualized-schema") }}+ </NTab>+ <NTab name="schema-text">+ {{ $t("branch.schema-text") }}+ </NTab>+ </NTabs>+ <div+ v-show="tab === 'visualized-schema'"+ class="flex-1 relative text-sm overflow-y-hidden"+ >+ <SchemaEditorLite+ ref="schemaEditorRef"+ :key="branch?.name"+ resource-type="branch"+ :project="project"+ :readonly="true"+ :branch="branch ?? Branch.fromPartial({})"+ :loading="loading"+ />+ </div>+ <div+ v-show="tab === 'schema-text'"+ class="w-full flex-1 relative text-sm border rounded overflow-clip"+ >+ <MonacoEditor+ :readonly="true"+ :content="branch?.schema ?? ''"+ class="h-full"+ />+ </div>+ <MaskSpinner v-if="loading" />+ </div>+</template>++<script lang="ts" setup>+import { ref } from "vue";+import { MonacoEditor } from "@/components/MonacoEditor";+import { ComposedProject } from "@/types";+import { Branch } from "@/types/proto/v1/branch_service";++type TabValue = "visualized-schema" | "schema-text";++defineProps<{+ project: ComposedProject;+ branch: Branch | undefined;+ loading?: boolean;+}>();++const tab = ref<TabValue>("visualized-schema");+</script>diff --git a/frontend/src/components/MonacoEditor/DiffEditor.vue b/frontend/src/components/MonacoEditor/DiffEditor.vueindex a108afb320..6ac95e1c17 100644--- a/frontend/src/components/MonacoEditor/DiffEditor.vue+++ b/frontend/src/components/MonacoEditor/DiffEditor.vue@@ -23,10 +23,14 @@ import {} from "vue";import type { Language } from "@/types";import type { AutoHeightOptions } from "./composables";-import { useAutoHeight, useOptionByKey } from "./composables";+import { useAutoHeight, useOptionByKey, useOptions } from "./composables";import monaco, { createMonacoDiffEditor } from "./editor";import { useMonacoTextModel } from "./text-model";-import type { IStandaloneDiffEditor, MonacoModule } from "./types";+import type {+ IStandaloneDiffEditor,+ IStandaloneDiffEditorConstructionOptions,+ MonacoModule,+} from "./types";import { extensionNameOfLanguage } from "./utils";export type DiffEditorAutoHeightOptions = AutoHeightOptions & {@@ -39,6 +43,7 @@ const props = withDefaults(modified?: string;language?: Language;readonly?: boolean;+ options?: IStandaloneDiffEditorConstructionOptions;autoHeight?: DiffEditorAutoHeightOptions;}>(),{@@ -46,6 +51,7 @@ const props = withDefaults(modified: "",language: "sql",readonly: false,+ options: undefined,autoHeight: undefined,});@@ -127,6 +133,7 @@ onMounted(async () => {useDiffModels(monaco, editor);// Use "plugin" composable featuresuseOptionByKey(monaco, editor, "readOnly", toRef(props, "readonly"));+ useOptions(monaco, editor, toRef(props, "options"));const modifiedContent = useModifiedContent(monaco, editor);if (props.autoHeight) {useAutoHeight(diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 835f1ffd46..e0eee13112 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -3429,7 +3429,15 @@"conflict-not-resolved": "It seems that some conflicts haven't been resolved yet.","resolve-conflicts-to-rebase": "Resolve conflicts to rebase","preview-merge-result": "Preview changes on {branch} after merge",- "preview-rebase-result": "Preview changes on {branch} after rebase"+ "preview-rebase-result": "Preview changes on {branch} after rebase",+ "diffs-between": "Diffs between {left} and {right}",+ "base-branch": "Base branch",+ "head-branch": "Head branch",+ "preview": "Preview",+ "before-merge": "Before merge",+ "after-merge": "After merge",+ "before-rebase": "Before rebase",+ "after-rebase": "After rebase"},"source": {"baseline-version": "Baseline version",@@ -3440,6 +3448,10 @@"drop-index-confirm": "Drop index?"},"force-delete": "Force delete",- "deleting-parent-branch": "Deleting a parent branch."+ "deleting-parent-branch": "Deleting a parent branch.",+ "visualized-schema": "Visualized Schema",+ "schema-text": "Schema Text",+ "baseline": "Baseline",+ "head": "Head"}}diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 8479058856..a2afc21dd9 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -3426,7 +3426,15 @@"conflict-not-resolved": "Parece que algunos conflictos aún no se han resuelto.","resolve-conflicts-to-rebase": "Resolver conflictos para rebase","preview-merge-result": "Vista previa de los cambios en {branch} después de la fusión",- "preview-rebase-result": "Vista previa de los cambios en {branch} después de la rebase"+ "preview-rebase-result": "Vista previa de los cambios en {branch} después de la rebase",+ "diffs-between": "Diferencias entre {left} y {right}",+ "base-branch": "sucursal base",+ "head-branch": "rama principal",+ "preview": "Avance",+ "before-merge": "Antes de fusionarse",+ "after-merge": "Después de fusionar",+ "before-rebase": "Antes de rebase",+ "after-rebase": "Después de rebase"},"source": {"baseline-version": "Versión básica",@@ -3437,6 +3445,10 @@"drop-index-confirm": "¿Índice de caída?"},"force-delete": "Forzar eliminación",- "deleting-parent-branch": "Eliminando una rama principal."+ "deleting-parent-branch": "Eliminando una rama principal.",+ "visualized-schema": "Esquema visualizado",+ "schema-text": "Texto del esquema",+ "baseline": "Base",+ "head": "Cabeza"}}diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex 8fce7b44ee..0a85802f50 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -3426,7 +3426,15 @@"conflict-not-resolved": "まだ解決されていない衝突があるようです","resolve-conflicts-to-rebase": "リベースするために衝突を解決してください","preview-merge-result": "merge 後に {branch} の変更をプレビューする",- "preview-rebase-result": "rebase 後に {branch} の変更をプレビューする"+ "preview-rebase-result": "rebase 後に {branch} の変更をプレビューする",+ "diffs-between": "{left} と {right} の差分",+ "base-branch": "ベースブランチ",+ "head-branch": "本店",+ "preview": "プレビュー",+ "before-merge": "マージ前",+ "after-merge": "マージ後",+ "before-rebase": "リベース前",+ "after-rebase": "リベース後"},"source": {"baseline-version": "ベースラインバージョン",@@ -3437,6 +3445,10 @@"drop-index-confirm": "インデックスを削除しますか?"},"force-delete": "強制削除",- "deleting-parent-branch": "親ブランチを削除しています"+ "deleting-parent-branch": "親ブランチを削除しています",+ "visualized-schema": "視覚化されたスキーマ",+ "schema-text": "スキーマテキスト",+ "baseline": "ベースライン",+ "head": "頭"}}diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 90fe17f719..08dfaff41e 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -3428,7 +3428,15 @@"conflict-not-resolved": "Có vẻ như một số xung đột vẫn chưa được giải quyết.","resolve-conflicts-to-rebase": "Giải quyết xung đột để rebase","preview-merge-result": "Xem trước các thay đổi trên {branch} sau khi hợp nhất",- "preview-rebase-result": "Xem trước các thay đổi trên {branch} sau rebase"+ "preview-rebase-result": "Xem trước các thay đổi trên {branch} sau rebase",+ "diffs-between": "Sự khác biệt giữa {left} và {right}",+ "base-branch": "Nhánh cơ sở",+ "head-branch": "Trưởng chi nhánh",+ "preview": "Xem trước",+ "before-merge": "Trước khi hợp nhất",+ "after-merge": "Sau khi hợp nhất",+ "before-rebase": "Trước khi nổi loạn",+ "after-rebase": "Sau khi nổi loạn"},"source": {"baseline-version": "Phiên bản cơ bản",@@ -3439,6 +3447,10 @@"drop-index-confirm": "Bỏ chỉ số?"},"force-delete": "Buộc xóa",- "deleting-parent-branch": "Xóa một nhánh cha."+ "deleting-parent-branch": "Xóa một nhánh cha.",+ "visualized-schema": "Lược đồ trực quan",+ "schema-text": "Văn bản lược đồ",+ "baseline": "Đường cơ sở",+ "head": "Cái đầu"}}diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex a10ec5401c..682db47988 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -3421,7 +3421,15 @@"conflict-not-resolved": "似乎还有尚未解决的冲突。","resolve-conflicts-to-rebase": "解决冲突以进行 rebase","preview-merge-result": "预览合并后 {branch} 上的更改",- "preview-rebase-result": "预览 rebase 后 {branch} 上的修改"+ "preview-rebase-result": "预览 rebase 后 {branch} 上的修改",+ "diffs-between": "{left} 和 {right}的差异",+ "base-branch": "Base 分支",+ "head-branch": "Head 分支",+ "preview": "预览",+ "before-merge": "合并前",+ "after-merge": "合并后",+ "before-rebase": "rebase 前",+ "after-rebase": "rebase 后"},"source": {"baseline-version": "基线版本",@@ -3432,6 +3440,10 @@"drop-index-confirm": "删除索引?"},"force-delete": "强制删除",- "deleting-parent-branch": "将要删除一个父分支。"+ "deleting-parent-branch": "将要删除一个父分支。",+ "visualized-schema": "可视化 Schema",+ "schema-text": "文本 Schema",+ "baseline": "基线",+ "head": "当前"}}