Skip to content

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

chore: show merge error message (#10558)

Liu Ji0a12579a6384
diff --git a/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue b/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue
index ed3651756b..4b2c856477 100644
--- a/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue
+++ b/frontend/src/components/Branch/BranchMergeView/BranchMergeView.vue
@@ -49,7 +49,7 @@ import { branchServiceClient } from "@/grpcweb";
import { pushNotification, useBranchStore } from "@/store";
import { ComposedProject } from "@/types";
import { Branch } from "@/types/proto/v1/branch_service";
-import { getErrorCode } from "@/utils/grpcweb";
+import { extractGrpcErrorMessage, getErrorCode } from "@/utils/grpcweb";
import MergeBranchStep from "./MergeBranchStep.vue";
import SelectBranchStep from "./SelectBranchStep.vue";
import { MergeBranchValidationState } from "./types";
@@ -153,8 +153,10 @@ const validationState = computedAsync(
};
} catch (err) {
const status = getErrorCode(err);
+ const errmsg = extractGrpcErrorMessage(err);
return {
status,
+ errmsg,
};
}
},
diff --git a/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vue b/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vue
index 13c50632ab..1b101f5432 100644
--- a/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vue
+++ b/frontend/src/components/Branch/BranchMergeView/SelectBranchStep.vue
@@ -47,21 +47,35 @@
<span>{{ $t("branch.merge-rebase.able-to-merge") }}</span>
</template>
<template v-else>
- <XCircleIcon class="w-4 h-4 text-error" />
- <i18n-t
- keypath="branch.merge-rebase.cannot-automatically-merge"
- tag="span"
- class="text-error"
+ <NTooltip
+ :disabled="!validationState.errmsg"
+ placement="bottom-start"
>
- <template #rebase_branch>
- <router-link
- :to="rebaseLink(headBranch, targetBranch)"
- class="normal-link"
- >
- {{ $t("branch.merge-rebase.go-rebase") }}
- </router-link>
+ <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>
- </i18n-t>
+ <template #default>
+ <div class="max-w-[24rem]">
+ {{ validationState.errmsg }}
+ </div>
+ </template>
+ </NTooltip>
</template>
</template>
</template>
diff --git a/frontend/src/components/Branch/BranchMergeView/types.ts b/frontend/src/components/Branch/BranchMergeView/types.ts
index 2adf1ccd9b..bb54b314eb 100644
--- a/frontend/src/components/Branch/BranchMergeView/types.ts
+++ b/frontend/src/components/Branch/BranchMergeView/types.ts
@@ -4,4 +4,5 @@ import { Branch } from "@/types/proto/v1/branch_service";
export type MergeBranchValidationState = {
status: Status;
branch?: Branch;
+ errmsg?: string;
};