Skip to content

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

chore: always use new layout for database creation issues (#17322)

boojackaea4124cbd05
diff --git a/frontend/src/components/IssueV1/IssueDetailPage.vue b/frontend/src/components/IssueV1/IssueDetailPage.vue
index 67d3390fdb..fbbf088c68 100644
--- a/frontend/src/components/IssueV1/IssueDetailPage.vue
+++ b/frontend/src/components/IssueV1/IssueDetailPage.vue
@@ -176,15 +176,29 @@ const {
} = provideSidebarContext(containerRef);
onMounted(() => {
+ // Always redirect creating database issue to new issue layout.
+ if (
+ issue.value.planEntity?.specs.every(
+ (spec) => spec.config.case === "createDatabaseConfig"
+ )
+ ) {
+ router.replace({
+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
+ params: {
+ projectId: extractProjectResourceName(project.value.name),
+ issueId: extractIssueUID(issue.value.name),
+ },
+ query: route.query,
+ });
+ return;
+ }
+
if (
enabledNewLayout.value &&
issue.value.type === Issue_Type.DATABASE_CHANGE &&
- (issue.value.planEntity?.specs.every(
+ issue.value.planEntity?.specs.every(
(spec) => spec.config.case === "changeDatabaseConfig"
- ) ||
- issue.value.planEntity?.specs.every(
- (spec) => spec.config.case === "createDatabaseConfig"
- ))
+ )
) {
if (isCreating.value) {
// Redirect to plans creation page with original query parameters
diff --git a/frontend/src/views/project/IssueDetailV1View.vue b/frontend/src/views/project/IssueDetailV1View.vue
index 5e37e51628..7371eb4235 100644
--- a/frontend/src/views/project/IssueDetailV1View.vue
+++ b/frontend/src/views/project/IssueDetailV1View.vue
@@ -60,8 +60,11 @@ const planType = computed(() => {
});
onMounted(() => {
- // Redirect to legacy layout if new layout is disabled
- if (!enabledNewLayout.value) {
+ const isCreatingDatabasePlan = plan.value.specs.every(
+ (spec) => spec.config.case === "createDatabaseConfig"
+ );
+ // Redirect to legacy layout if new layout is disabled and the plan is not a database creation plan.
+ if (!enabledNewLayout.value && !isCreatingDatabasePlan) {
const legacyIssueSlug = issueV1Slug(
`projects/${props.projectId}/issues/${props.issueId}`,
"issue"
@@ -74,9 +77,8 @@ onMounted(() => {
},
query: route.query,
});
- } else {
- // New layout enabled, set loading to false
- isLoading.value = false;
+ return;
}
+ isLoading.value = false;
});
</script>