Skip to content

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

chore: merge tabs in new ci/cd page (#16832)

boojack8ce6cea8e812
diff --git a/frontend/src/components/Plan/components/AddSpecDrawer.vue b/frontend/src/components/Plan/components/AddSpecDrawer.vue
index a9ffdc7430..c7c858ded6 100644
--- a/frontend/src/components/Plan/components/AddSpecDrawer.vue
+++ b/frontend/src/components/Plan/components/AddSpecDrawer.vue
@@ -95,8 +95,8 @@
<template #footer>
<div class="flex items-center justify-between">
<div class="flex items-center gap-x-3">
- <NButton v-if="currentStep === 1" @click="handleCancel">
- {{ $t("common.cancel") }}
+ <NButton quaternary v-if="currentStep === 1" @click="handleCancel">
+ {{ $t("common.close") }}
</NButton>
<NButton
v-if="currentStep === 2"
diff --git a/frontend/src/components/Plan/components/ChecksView/ChecksView.vue b/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
index da9803237e..7277f1bac5 100644
--- a/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
+++ b/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
@@ -68,16 +68,9 @@
<!-- Results List -->
<div class="flex-1 overflow-y-auto">
- <!-- Loading state -->
- <div
- v-if="!hasCompletedInitialFetch"
- class="flex items-center justify-center py-12"
- >
- <BBSpin />
- </div>
<!-- Empty state -->
<div
- v-else-if="filteredCheckRuns.length === 0"
+ v-if="filteredCheckRuns.length === 0"
class="flex flex-col items-center justify-center py-12"
>
<CheckCircleIcon class="w-12 h-12 text-control-light opacity-50 mb-4" />
@@ -168,7 +161,6 @@ import {
} from "lucide-vue-next";
import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
-import { BBSpin } from "@/bbkit";
import { getRuleLocalization } from "@/types";
import {
PlanCheckRun_Result_Status,
@@ -178,7 +170,6 @@ import {
} from "@/types/proto-es/v1/plan_service_pb";
import { humanizeTs } from "@/utils";
import { usePlanContext } from "../../logic/context";
-import { useResourcePoller } from "../../logic/poller";
import DatabaseDisplay from "../common/DatabaseDisplay.vue";
const props = defineProps<{
@@ -187,7 +178,6 @@ const props = defineProps<{
const { t } = useI18n();
const { planCheckRuns } = usePlanContext();
-const { hasCompletedInitialFetch } = useResourcePoller();
const selectedStatus = ref<PlanCheckRun_Result_Status | undefined>(
props.defaultStatus
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
index 64fcd51533..8db13967a2 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
@@ -29,7 +29,6 @@
<script setup lang="ts">
import { create } from "@bufbuild/protobuf";
-import { includes } from "lodash-es";
import { NTooltip, NButton } from "naive-ui";
import { zindexable as vZindexable } from "vdirs";
import { computed, nextTick, ref } from "vue";
@@ -45,12 +44,7 @@ import {
} from "@/components/Plan/logic";
import { usePlanContext } from "@/components/Plan/logic";
import { planServiceClientConnect } from "@/grpcweb";
-import {
- PROJECT_V1_ROUTE_PLAN_DETAIL,
- PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
- PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
- PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
-} from "@/router/dashboard/projectV1";
+import { PROJECT_V1_ROUTE_PLAN_DETAIL } from "@/router/dashboard/projectV1";
import { useCurrentProjectV1, useSheetV1Store } from "@/store";
import { CreatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";
import { type Plan_ChangeDatabaseConfig } from "@/types/proto-es/v1/plan_service_pb";
@@ -99,24 +93,8 @@ const doCreatePlan = async () => {
if (!createdPlan) return;
nextTick(() => {
- let routeName = router.currentRoute.value.name;
- if (routeName === PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL) {
- routeName = PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS;
- }
- if (
- !includes(
- [
- PROJECT_V1_ROUTE_PLAN_DETAIL,
- PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
- PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
- ],
- routeName
- )
- ) {
- routeName = PROJECT_V1_ROUTE_PLAN_DETAIL;
- }
router.replace({
- name: routeName,
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,
params: {
projectId: extractProjectResourceName(createdPlan.name),
planId: extractPlanUID(createdPlan.name),
diff --git a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue
index 9250d86f13..6c135d81f6 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue
@@ -1,5 +1,5 @@
<template>
- <div class="px-4 py-4 space-y-6">
+ <div class="space-y-4">
<div class="flex items-center justify-between">
<h3 class="text-base font-medium">
{{ $t("common.activity") }}
diff --git a/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue b/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue
index c5d6bc6f15..838b6f94e3 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue
@@ -1,7 +1,8 @@
<template>
<div class="flex-1 flex w-full">
<!-- Left Panel - Activity -->
- <div class="flex-1 shrink">
+ <div class="flex-1 shrink px-4">
+ <OverviewSection />
<ActivitySection />
</div>
@@ -20,6 +21,7 @@ import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
import { hasProjectPermissionV2 } from "@/utils";
import { usePlanContextWithIssue } from "../..";
import { ActivitySection } from "./ActivitySection";
+import OverviewSection from "./OverviewSection.vue";
import { Sidebar } from "./Sidebar";
const { project, ready } = useCurrentProjectV1();
diff --git a/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue b/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue
new file mode 100644
index 0000000000..19f17c525c
--- /dev/null
+++ b/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue
@@ -0,0 +1,214 @@
+<template>
+ <div class="w-full py-4 overflow-y-auto">
+ <!-- Statistics Cards -->
+ <div :class="'grid grid-cols-1 sm:grid-cols-3 gap-4'">
+ <!-- Plan Statistics Column -->
+ <!-- Specs Card -->
+ <div class="bg-white rounded-md border px-3 py-2">
+ <div class="flex items-center justify-between">
+ <div>
+ <p class="textlabel">
+ {{ $t("plan.overview.total-specs") }}
+ </p>
+ <p class="text-xl font-medium mt-1">
+ {{ statistics.totalSpecs }}
+ </p>
+ </div>
+ <LayersIcon class="w-8 h-8 text-control-light" stroke-width="1" />
+ </div>
+ </div>
+
+ <!-- Targets Card -->
+ <div class="bg-white rounded-md border px-3 py-2">
+ <div class="flex items-center justify-between">
+ <div>
+ <p class="textlabel">
+ {{ $t("plan.overview.total-targets") }}
+ </p>
+ <p class="text-xl font-medium mt-1">
+ {{ statistics.totalTargets }}
+ </p>
+ </div>
+ <DatabaseIcon class="w-8 h-8 text-control-light" stroke-width="1" />
+ </div>
+ </div>
+
+ <!-- Checks Card -->
+ <div class="bg-white rounded-md border px-3 py-2">
+ <div class="flex items-center justify-between">
+ <div>
+ <p class="textlabel">
+ {{ $t("plan.navigator.checks") }}
+ </p>
+ <div class="flex items-center gap-3 mt-1">
+ <div
+ v-if="statistics.checkStatus.error > 0"
+ class="flex items-center gap-1"
+ >
+ <XCircleIcon class="w-5 h-5 text-error" />
+ <span class="text-xl font-medium text-error">{{
+ statistics.checkStatus.error
+ }}</span>
+ </div>
+ <div
+ v-if="statistics.checkStatus.warning > 0"
+ class="flex items-center gap-1"
+ >
+ <AlertCircleIcon class="w-5 h-5 text-warning" />
+ <span class="text-xl font-medium text-warning">{{
+ statistics.checkStatus.warning
+ }}</span>
+ </div>
+ <div
+ v-if="statistics.checkStatus.success > 0"
+ class="flex items-center gap-1"
+ >
+ <CheckCircleIcon class="w-5 h-5 text-success" />
+ <span class="text-xl font-medium text-success">{{
+ statistics.checkStatus.success
+ }}</span>
+ </div>
+ <span
+ v-if="statistics.checkStatus.total === 0"
+ class="text-xl text-control"
+ >
+ {{ $t("plan.overview.no-checks") }}
+ </span>
+ </div>
+ </div>
+ <ActivityIcon class="w-8 h-8 text-control-light" stroke-width="1" />
+ </div>
+ </div>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import {
+ LayersIcon,
+ DatabaseIcon,
+ ActivityIcon,
+ CheckCircleIcon,
+ AlertCircleIcon,
+ XCircleIcon,
+} from "lucide-vue-next";
+import { computed, watch } from "vue";
+import { useInstanceV1Store, useDBGroupStore } from "@/store";
+import type { ComposedDatabaseGroup, ComposedInstance } from "@/types";
+import { PlanCheckRun_Result_Status } from "@/types/proto-es/v1/plan_service_pb";
+import { extractDatabaseResourceName } from "@/utils";
+import { targetsForSpec, usePlanContext } from "../../logic";
+
+const { plan } = usePlanContext();
+const instanceStore = useInstanceV1Store();
+const dbGroupStore = useDBGroupStore();
+
+// Calculate statistics
+const statistics = computed(() => {
+ let totalTargets = 0;
+ const checkStatus = {
+ total: 0,
+ success:
+ plan.value.planCheckRunStatusCount[
+ PlanCheckRun_Result_Status[PlanCheckRun_Result_Status.SUCCESS]
+ ] || 0,
+ warning:
+ plan.value.planCheckRunStatusCount[
+ PlanCheckRun_Result_Status[PlanCheckRun_Result_Status.WARNING]
+ ] || 0,
+ error:
+ plan.value.planCheckRunStatusCount[
+ PlanCheckRun_Result_Status[PlanCheckRun_Result_Status.ERROR]
+ ] || 0,
+ };
+ checkStatus.total =
+ checkStatus.success + checkStatus.warning + checkStatus.error;
+ for (const spec of plan.value.specs) {
+ totalTargets += targetsForSpec(spec).length;
+ }
+ return {
+ totalSpecs: plan.value.specs.length,
+ totalTargets,
+ checkStatus,
+ };
+});
+
+// Get affected resources
+const affectedResources = computed(() => {
+ const specs = plan.value?.specs || [];
+ const resourceList: Array<
+ | {
+ type: "instance";
+ name: string;
+ instance: ComposedInstance;
+ databases: string[];
+ }
+ | {
+ type: "databaseGroup";
+ name: string;
+ databaseGroup?: ComposedDatabaseGroup;
+ databases: string[];
+ }
+ > = [];
+
+ const instanceMap = new Map<string, Set<string>>();
+ const dbGroupSet = new Set<string>();
+
+ for (const spec of specs) {
+ const targets = targetsForSpec(spec);
+ for (const target of targets) {
+ // Check if it's a database group
+ if (target.includes("/databaseGroups/")) {
+ dbGroupSet.add(target);
+ } else {
+ // Parse instance/database format
+ const { instance, databaseName } = extractDatabaseResourceName(target);
+ if (instance && databaseName) {
+ if (!instanceMap.has(instance)) {
+ instanceMap.set(instance, new Set());
+ }
+ instanceMap.get(instance)!.add(databaseName);
+ }
+ }
+ }
+ }
+
+ // Add instances to resource list
+ for (const [instanceName, databases] of instanceMap.entries()) {
+ const instance = instanceStore.getInstanceByName(instanceName);
+ resourceList.push({
+ type: "instance",
+ name: instanceName,
+ instance: instance,
+ databases: Array.from(databases),
+ });
+ }
+
+ // Add database groups to resource list
+ for (const dbGroupName of dbGroupSet) {
+ const dbGroup = dbGroupStore.getDBGroupByName(dbGroupName);
+ resourceList.push({
+ type: "databaseGroup",
+ name: dbGroupName,
+ databaseGroup: dbGroup,
+ databases: dbGroup?.matchedDatabases.map((db) => db.name) || [],
+ });
+ }
+
+ return resourceList;
+});
+
+watch(
+ () => affectedResources.value,
+ () => {
+ for (const resource of affectedResources.value) {
+ if (resource.type === "instance") {
+ instanceStore.getOrFetchInstanceByName(resource.name);
+ } else if (resource.type === "databaseGroup") {
+ dbGroupStore.getOrFetchDBGroupByName(resource.name);
+ }
+ }
+ },
+ { immediate: true }
+);
+</script>
diff --git a/frontend/src/components/Plan/components/Overview.vue b/frontend/src/components/Plan/components/Overview.vue
index 27e9e01336..af3362c980 100644
--- a/frontend/src/components/Plan/components/Overview.vue
+++ b/frontend/src/components/Plan/components/Overview.vue
@@ -197,74 +197,6 @@
</div>
</div>
</div>
-
- <!-- Affected Resources -->
- <div v-if="affectedResources.length > 0">
- <h2 class="text-lg font-semibold mb-3">
- {{ $t("plan.overview.affected-resources") }}
- </h2>
- <div class="flex flex-row justify-start items-center gap-3">
- <div
- v-for="resource in affectedResources"
- :key="resource.name"
- class="flex items-center gap-1 px-3 py-2 max-w-[50%] rounded-md border"
- >
- <InstanceV1EngineIcon
- v-if="resource.type === 'instance' && resource.instance"
- :instance="resource.instance"
- :tooltip="false"
- size="medium"
- />
- <FolderIcon
- v-else-if="resource.type === 'databaseGroup'"
- class="w-5 h-5 text-control mt-0.5"
- />
- <div class="flex-1 min-w-0">
- <div class="flex items-center gap-2">
- <!-- Instance info -->
- <template v-if="resource.type === 'instance'">
- <span
- v-if="resource.instance?.environmentEntity"
- class="text-sm text-gray-500"
- >
- ({{ resource.instance.environmentEntity.title }})
- </span>
- <span class="truncate">
- {{
- resource.instance
- ? instanceV1Name(resource.instance)
- : resource.name
- }}
- </span>
- <span class="text-sm text-control-light shrink-0">
- {{
- resource.databases.length === 1
- ? t("plan.targets.one-database")
- : t("plan.targets.multiple-databases", {
- count: resource.databases.length,
- })
- }}
- </span>
- </template>
-
- <!-- Database Group info -->
- <template v-else-if="resource.type === 'databaseGroup'">
- <span class="font-medium truncate">
- {{ resource.databaseGroup?.title || resource.name }}
- </span>
- <span
- class="text-xs px-1.5 py-0.5 rounded-md bg-blue-100 text-blue-600"
- >
- {{ t("plan.targets.database-group") }}
- </span>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <DescriptionSection />
</div>
</div>
</template>
@@ -277,15 +209,12 @@ import {
CheckCircleIcon,
AlertCircleIcon,
XCircleIcon,
- FolderIcon,
GitBranchIcon,
ListChecksIcon,
} from "lucide-vue-next";
import { NTag } from "naive-ui";
import { computed, watch } from "vue";
-import { useI18n } from "vue-i18n";
import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
-import { InstanceV1EngineIcon } from "@/components/v2/Model/Instance";
import {
useInstanceV1Store,
useDBGroupStore,
@@ -296,17 +225,14 @@ import { PlanCheckRun_Result_Status } from "@/types/proto-es/v1/plan_service_pb"
import { Task_Status as TaskStatusEnum } from "@/types/proto-es/v1/rollout_service_pb";
import type { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
import {
- instanceV1Name,
extractDatabaseResourceName,
getStageStatus,
stringifyTaskStatus,
} from "@/utils";
import { usePlanContext } from "../logic/context";
import { targetsForSpec } from "../logic/plan";
-import DescriptionSection from "./DescriptionSection.vue";
import ApprovalFlowSection from "./IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalFlowSection.vue";
-const { t } = useI18n();
const { plan, issue, rollout } = usePlanContext();
const instanceStore = useInstanceV1Store();
const dbGroupStore = useDBGroupStore();
diff --git a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
index b41c640d16..cd7c1206b4 100644
--- a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
+++ b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
@@ -162,8 +162,6 @@ const runChecks = async () => {
};
const openDrawer = (status: PlanCheckRun_Result_Status) => {
- // Fetch the latest plan check runs for the selected status.
- requestEnhancedPolling(["planCheckRuns"], true /** once */);
selectedStatus.value = status;
drawerVisible.value = true;
};
diff --git a/frontend/src/components/Plan/logic/poller/poller.ts b/frontend/src/components/Plan/logic/poller/poller.ts
index 46cc463e05..d20aa4dce9 100644
--- a/frontend/src/components/Plan/logic/poller/poller.ts
+++ b/frontend/src/components/Plan/logic/poller/poller.ts
@@ -14,7 +14,6 @@ import { useProgressivePoll } from "@/composables/useProgressivePoll";
import {
PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
PROJECT_V1_ROUTE_PLAN_DETAIL,
- PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
@@ -101,16 +100,12 @@ export const provideResourcePoller = () => {
routeName
)
) {
- return ["plan"];
- }
-
- if (includes([PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS], routeName)) {
- return ["planCheckRuns"];
+ return ["plan", "planCheckRuns"];
}
// Issue-specific pages
if (includes([PROJECT_V1_ROUTE_ISSUE_DETAIL_V1], routeName)) {
- return ["issue", "issueComments"];
+ return ["issue", "issueComments", "plan"];
}
// Rollout-specific pages
@@ -217,7 +212,6 @@ export const provideResourcePoller = () => {
// Track if we've done initial refresh to avoid duplicate calls
let hasInitialRefresh = false;
- const hasCompletedInitialFetch = ref(false);
// Track which pollers are currently running to avoid unnecessary restarts
const pollerStates = {
plan: false,
@@ -248,7 +242,6 @@ export const provideResourcePoller = () => {
pollerStates.issueComments = false;
pollerStates.rollout = false;
hasInitialRefresh = false;
- hasCompletedInitialFetch.value = false;
// Restart active ones (this will reset the progressive intervals)
if (activeResources.includes("plan")) {
@@ -409,7 +402,6 @@ export const provideResourcePoller = () => {
// Small delay to avoid race conditions with component initialization
setTimeout(async () => {
await refreshAll();
- hasCompletedInitialFetch.value = true;
}, 100);
}
} else {
@@ -425,7 +417,6 @@ export const provideResourcePoller = () => {
pollerStates.issue = false;
pollerStates.issueComments = false;
pollerStates.rollout = false;
- hasCompletedInitialFetch.value = false;
}
});
@@ -435,7 +426,6 @@ export const provideResourcePoller = () => {
restartActivePollers,
isRefreshing: computed(() => isRefreshing.value),
activeResources: resourcesToPolled,
- hasCompletedInitialFetch: computed(() => hasCompletedInitialFetch.value),
};
provide(KEY, poller);
diff --git a/frontend/src/components/Project/useProjectSidebar.ts b/frontend/src/components/Project/useProjectSidebar.ts
index 6867af1e24..9d6253233c 100644
--- a/frontend/src/components/Project/useProjectSidebar.ts
+++ b/frontend/src/components/Project/useProjectSidebar.ts
@@ -88,11 +88,6 @@ export const useProjectSidebar = (project: MaybeRef<ComposedProject>) => {
isDefaultProject.value ||
databaseChangeMode.value === DatabaseChangeMode.EDITOR,
children: [
- {
- title: t("release.releases"),
- path: PROJECT_V1_ROUTE_RELEASES,
- type: "div",
- },
{
title: t("plan.plans"),
path: PROJECT_V1_ROUTE_PLANS,
@@ -103,6 +98,11 @@ export const useProjectSidebar = (project: MaybeRef<ComposedProject>) => {
path: PROJECT_V1_ROUTE_ROLLOUTS,
type: "div",
},
+ {
+ title: t("release.releases"),
+ path: PROJECT_V1_ROUTE_RELEASES,
+ type: "div",
+ },
],
},
]
diff --git a/frontend/src/composables/useIssueLayoutVersion.ts b/frontend/src/composables/useIssueLayoutVersion.ts
index 1a22391708..7230babb57 100644
--- a/frontend/src/composables/useIssueLayoutVersion.ts
+++ b/frontend/src/composables/useIssueLayoutVersion.ts
@@ -8,7 +8,7 @@ const CURRENT_DEFAULT_VERSION = 1;
export function useIssueLayoutVersion() {
// Store whether user prefers the new layout (true) or old layout (false)
- const enabled = useLocalStorage<boolean>(STORAGE_KEY, true);
+ const enabled = useLocalStorage<boolean>(STORAGE_KEY, false);
// Store the version number when user last made a choice
const lastVersion = useLocalStorage<number>(
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 3e6e94fe8b..24afc01f3a 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1064,13 +1064,11 @@
"overview": {
"total-specs": "Total Specs",
"total-targets": "Total Targets",
- "no-checks": "No checks",
- "affected-resources": "Affected Resources"
+ "no-checks": "No checks"
},
"navigator": {
- "specifications": "Specifications",
+ "changes": "Changes",
"checks": "Checks",
- "review": "Review",
"rollout": "Rollout",
"statement-empty": "Statement is empty"
},
@@ -1088,9 +1086,6 @@
"targets": {
"title": "Targets",
"no-targets-found": "No targets found",
- "one-database": "1 database",
- "multiple-databases": "{count} databases",
- "database-group": "Database Group",
"database-not-found": "Database not found",
"type": {
"instance": "Instance",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 51ee412c10..c32b64243c 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1064,13 +1064,11 @@
"overview": {
"total-specs": "Especificaciones totales",
"total-targets": "Objetivos totales",
- "no-checks": "Sin controles",
- "affected-resources": "Recursos afectados"
+ "no-checks": "Sin controles"
},
"navigator": {
- "specifications": "Presupuesto",
+ "changes": "Cambios",
"checks": "Cheques",
- "review": "Revisar",
"rollout": "Despliegue",
"statement-empty": "La declaración está vacía"
},
@@ -1088,9 +1086,6 @@
"targets": {
"title": "Objetivos",
"no-targets-found": "No se encontraron objetivos",
- "one-database": "1 base de datos",
- "multiple-databases": "{count} bases de datos",
- "database-group": "Grupo de bases de datos",
"database-not-found": "Base de datos no encontrada",
"type": {
"instance": "Instancia",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index aedff004f7..069a631742 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1064,13 +1064,11 @@
"overview": {
"total-specs": "合計スペック",
"total-targets": "合計ターゲット",
- "no-checks": "チェックなし",
- "affected-resources": "影響を受けるリソース"
+ "no-checks": "チェックなし"
},
"navigator": {
- "specifications": "仕様",
+ "changes": "変更点",
"checks": "小切手",
- "review": "レビュー",
"rollout": "ロールアウトする",
"statement-empty": "ステートメントが空です"
},
@@ -1088,9 +1086,6 @@
"targets": {
"title": "ターゲット",
"no-targets-found": "ターゲットが見つかりません",
- "one-database": "1 つのデータベース",
- "multiple-databases": "{count} データベース",
- "database-group": "データベースグループ",
"database-not-found": "データベースが見つかりません",
"type": {
"instance": "実例",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 9dd3cb14e8..9fd9b6a6f5 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1064,13 +1064,11 @@
"overview": {
"total-specs": "Tổng số thông số kỹ thuật",
"total-targets": "Tổng số mục tiêu",
- "no-checks": "Không kiểm tra",
- "affected-resources": "Tài nguyên bị ảnh hưởng"
+ "no-checks": "Không kiểm tra"
},
"navigator": {
- "specifications": "Thông số kỹ thuật",
+ "changes": "Thay đổi",
"checks": "Kiểm tra",
- "review": "Ôn tập",
"rollout": "Triển khai",
"statement-empty": "Câu lệnh trống rỗng"
},
@@ -1088,9 +1086,6 @@
"targets": {
"title": "Mục tiêu",
"no-targets-found": "Không tìm thấy mục tiêu",
- "one-database": "1 cơ sở dữ liệu",
- "multiple-databases": "{count} cơ sở dữ liệu",
- "database-group": "Nhóm cơ sở dữ liệu",
"database-not-found": "Không tìm thấy cơ sở dữ liệu",
"type": {
"instance": "Ví dụ",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 9ff9b72d44..33cc535c7f 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1064,13 +1064,11 @@
"overview": {
"total-specs": "变更项",
"total-targets": "变更对象",
- "no-checks": "没有检查",
- "affected-resources": "受影响的资源"
+ "no-checks": "没有检查"
},
"navigator": {
- "specifications": "变更项",
+ "changes": "变更项",
"checks": "SQL 检查",
- "review": "审批流",
"rollout": "发布任务",
"statement-empty": "变更语句为空"
},
@@ -1088,9 +1086,6 @@
"targets": {
"title": "变更对象",
"no-targets-found": "未找到变更对象",
- "one-database": "1 个数据库",
- "multiple-databases": "{count} 个数据库",
- "database-group": "数据库组",
"database-not-found": "未找到数据库",
"type": {
"instance": "实例",
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index 757964b596..66a806e25a 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -20,7 +20,6 @@ export const PROJECT_V1_ROUTE_PLANS = `${PROJECT_V1_ROUTE_DASHBOARD}.plan`;
export const PROJECT_V1_ROUTE_PLAN_DETAIL = `${PROJECT_V1_ROUTE_DASHBOARD}.plan.detail`;
export const PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS = `${PROJECT_V1_ROUTE_PLAN_DETAIL}.specs`;
export const PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL = `${PROJECT_V1_ROUTE_PLAN_DETAIL}.spec.detail`;
-export const PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS = `${PROJECT_V1_ROUTE_PLAN_DETAIL}.check-runs`;
export const PROJECT_V1_ROUTE_CHANGELISTS = `${PROJECT_V1_ROUTE_DASHBOARD}.changelist`;
export const PROJECT_V1_ROUTE_CHANGELIST_DETAIL = `${PROJECT_V1_ROUTE_DASHBOARD}.changelist.detail`;
export const PROJECT_V1_ROUTE_SYNC_SCHEMA = `${PROJECT_V1_ROUTE_DASHBOARD}.sync-schema`;
@@ -54,7 +53,9 @@ const cicdRoutes: RouteRecordRaw[] = [
{
path: "",
name: PROJECT_V1_ROUTE_PLAN_DETAIL,
- component: () => import("@/views/project/PlanDetailView.vue"),
+ redirect: {
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
+ },
},
{
path: "specs",
@@ -66,11 +67,6 @@ const cicdRoutes: RouteRecordRaw[] = [
name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
component: () => import("@/views/project/PlanSpecDetailView.vue"),
},
- {
- path: "planCheckRuns",
- name: PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
- component: () => import("@/views/project/PlanCheckRunsView.vue"),
- },
],
},
{
diff --git a/frontend/src/views/project/CICDLayout.vue b/frontend/src/views/project/CICDLayout.vue
index a21cd2e636..41eccb440f 100644
--- a/frontend/src/views/project/CICDLayout.vue
+++ b/frontend/src/views/project/CICDLayout.vue
@@ -38,7 +38,7 @@
<!-- Suffix slot -->
<template #suffix>
<div class="pr-4 flex flex-row justify-end items-center gap-4">
- <CurrentSpecSelector v-if="tabKey === TabKey.Specifications" />
+ <CurrentSpecSelector v-if="tabKey === TabKey.Plan" />
<RefreshIndicator v-if="!isCreating" />
</div>
</template>
@@ -58,6 +58,7 @@
<script lang="tsx" setup>
import { useTitle } from "@vueuse/core";
+import { CirclePlayIcon, FileDiffIcon, Layers2Icon } from "lucide-vue-next";
import { NSpin, NTab, NTabs } from "naive-ui";
import { computed, ref, toRef, watch } from "vue";
import { useI18n } from "vue-i18n";
@@ -73,12 +74,12 @@ import CurrentSpecSelector from "@/components/Plan/components/CurrentSpecSelecto
import RefreshIndicator from "@/components/Plan/components/RefreshIndicator.vue";
import { useSpecsValidation } from "@/components/Plan/components/common";
import { provideIssueReviewContext } from "@/components/Plan/logic/issue-review";
+import { useIssueLayoutVersion } from "@/composables/useIssueLayoutVersion";
import { useBodyLayoutContext } from "@/layouts/common";
import {
PROJECT_V1_ROUTE_ISSUE_DETAIL,
PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
PROJECT_V1_ROUTE_PLAN_DETAIL,
- PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
@@ -91,15 +92,12 @@ import {
extractPlanUID,
extractProjectResourceName,
extractRolloutUID,
- isNullOrUndefined,
issueV1Slug,
} from "@/utils";
enum TabKey {
- Overview = "overview",
- Specifications = "specifications",
- Checks = "checks",
- Review = "review",
+ Plan = "plan",
+ Issue = "issue",
Rollout = "rollout",
}
@@ -123,6 +121,7 @@ const planBaseContext = useBasePlanContext({
plan,
issue,
});
+const { enabledNewLayout } = useIssueLayoutVersion();
const isLoading = ref(true);
const ready = computed(() => {
@@ -175,26 +174,18 @@ watch(
const { isSpecEmpty } = useSpecsValidation(plan.value.specs);
-const planCheckRunCount = computed(() =>
- Object.values(plan.value.planCheckRunStatusCount).reduce(
- (sum, count) => sum + count,
- 0
- )
-);
-
const tabKey = computed(() => {
const routeName = route.name?.toString() as string;
if (
[
+ PROJECT_V1_ROUTE_PLAN_DETAIL,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
].includes(routeName)
) {
- return TabKey.Specifications;
- } else if ([PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS].includes(routeName)) {
- return TabKey.Checks;
+ return TabKey.Plan;
} else if (routeName === PROJECT_V1_ROUTE_ISSUE_DETAIL_V1) {
- return TabKey.Review;
+ return TabKey.Issue;
} else if (
[
PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
@@ -205,23 +196,14 @@ const tabKey = computed(() => {
return TabKey.Rollout;
}
// Fallback to Overview if no specific tab is matched.
- return TabKey.Overview;
+ return TabKey.Plan;
});
const availableTabs = computed<TabKey[]>(() => {
- const tabs: TabKey[] = [TabKey.Overview, TabKey.Specifications];
+ const tabs: TabKey[] = [TabKey.Plan];
if (!isCreating.value) {
- if (
- plan.value.specs.some(
- (spec) =>
- !isNullOrUndefined(spec.config) &&
- spec.config.case === "changeDatabaseConfig"
- )
- ) {
- tabs.push(TabKey.Checks);
- }
- if (plan.value.issue) {
- tabs.push(TabKey.Review);
+ if (plan.value.issue && enabledNewLayout.value) {
+ tabs.unshift(TabKey.Issue);
}
if (plan.value.rollout) {
tabs.push(TabKey.Rollout);
@@ -232,35 +214,37 @@ const availableTabs = computed<TabKey[]>(() => {
const tabRender = (tab: TabKey) => {
switch (tab) {
- case TabKey.Overview:
- return t("common.overview");
- case TabKey.Specifications:
+ case TabKey.Issue:
return (
- <div>
- {t("plan.navigator.specifications")}
- {plan.value.specs.some(isSpecEmpty) && (
- <span
- class="text-error ml-0.5"
- title={t("plan.navigator.statement-empty")}
- >
- *
- </span>
- )}
+ <div class="flex items-center gap-2">
+ <Layers2Icon size={18} />
+ <span>{t("common.overview")}</span>
</div>
);
- case TabKey.Checks:
+ case TabKey.Plan:
return (
- <div>
- {t("plan.navigator.checks")}
- {planCheckRunCount.value > 0 && (
- <span class="text-gray-500">({planCheckRunCount.value})</span>
- )}
+ <div class="flex items-center gap-2">
+ <FileDiffIcon size={18} />
+ <span>
+ {t("plan.navigator.changes")}
+ {plan.value.specs.some(isSpecEmpty) && (
+ <span
+ class="text-error ml-0.5"
+ title={t("plan.navigator.statement-empty")}
+ >
+ *
+ </span>
+ )}
+ </span>
</div>
);
- case TabKey.Review:
- return t("plan.navigator.review");
case TabKey.Rollout:
- return t("plan.navigator.rollout");
+ return (
+ <div class="flex items-center gap-2">
+ <CirclePlayIcon size={18} />
+ <span>{t("plan.navigator.rollout")}</span>
+ </div>
+ );
default:
// Fallback to raw tab name.
return tab;
@@ -288,27 +272,15 @@ const handleTabChange = (tab: TabKey) => {
const query = route.query || {};
- if (tab === TabKey.Overview) {
+ if (tab === TabKey.Issue) {
router.push({
- name: PROJECT_V1_ROUTE_PLAN_DETAIL,
- params: params,
- query: query,
- });
- } else if (tab === TabKey.Specifications) {
- router.push({
- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
- params: params,
- query: query,
- });
- } else if (tab === TabKey.Checks) {
- router.push({
- name: PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
params: params,
query: query,
});
- } else if (tab === TabKey.Review) {
+ } else if (tab === TabKey.Plan) {
router.push({
- name: PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,
params: params,
query: query,
});
diff --git a/frontend/src/views/project/PlanSpecsView.vue b/frontend/src/views/project/PlanSpecsView.vue
index a74f044314..254385a86d 100644
--- a/frontend/src/views/project/PlanSpecsView.vue
+++ b/frontend/src/views/project/PlanSpecsView.vue
@@ -2,10 +2,7 @@
import { head } from "lodash-es";
import { useRoute, useRouter } from "vue-router";
import { usePlanContext } from "@/components/Plan";
-import {
- PROJECT_V1_ROUTE_PLAN_DETAIL,
- PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
-} from "@/router/dashboard/projectV1";
+import { PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL } from "@/router/dashboard/projectV1";
const route = useRoute();
const router = useRouter();
@@ -15,12 +12,7 @@ const spec = head(plan.value.specs);
// Redirect to the first spec if it exists, otherwise redirect to the plan page.
if (!spec) {
- // If there are no specs, redirect to the plan page.
- router.replace({
- name: PROJECT_V1_ROUTE_PLAN_DETAIL,
- params: route.params,
- query: route.query,
- });
+ throw new Error("No spec found in the plan.");
} else {
router.replace({
name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,