Skip to content

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

refactor(frontend): restructure RolloutV1 into domain subdirectories (#19337)

boojack70778f5b53c2
diff --git a/frontend/src/components/Changelog/ChangelogDetail.vue b/frontend/src/components/Changelog/ChangelogDetail.vue
index 23c767bc37..3995efe930 100644
--- a/frontend/src/components/Changelog/ChangelogDetail.vue
+++ b/frontend/src/components/Changelog/ChangelogDetail.vue
@@ -121,7 +121,7 @@ import { useRouter } from "vue-router";
import { BBSpin } from "@/bbkit";
import { useDatabaseDetailContext } from "@/components/Database/context";
import { DiffEditor, MonacoEditor } from "@/components/MonacoEditor";
-import { TaskRunLogViewer } from "@/components/RolloutV1/components/TaskRunLogViewer";
+import { TaskRunLogViewer } from "@/components/RolloutV1/components/TaskRun/TaskRunLogViewer";
import { CopyButton } from "@/components/v2";
import { PROJECT_V1_ROUTE_SYNC_SCHEMA } from "@/router/dashboard/projectV1";
import {
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue
index 8312173054..8d2ff2978b 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue
@@ -69,7 +69,7 @@ import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { usePlanContext, useRolloutReadyLink } from "@/components/Plan/logic";
import { useResourcePoller } from "@/components/Plan/logic/poller";
-import TaskRolloutActionPanel from "@/components/RolloutV1/components/TaskRolloutActionPanel.vue";
+import TaskRolloutActionPanel from "@/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue";
import {
issueServiceClientConnect,
rolloutServiceClientConnect,
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue
index 76d57aa857..ec93163aba 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/RolloutReadyLink.vue
@@ -16,7 +16,7 @@ import { ArrowUpRightIcon } from "lucide-vue-next";
import { NButton } from "naive-ui";
import { computed } from "vue";
import { usePlanContext } from "@/components/Plan/logic";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
import {
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue
index 629f3ab696..fc8f468844 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/RolloutCreatePanel.vue
@@ -77,7 +77,7 @@ import { useRouter } from "vue-router";
import { ApprovalFlowSection } from "@/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection";
import PlanCheckStatusCount from "@/components/Plan/components/PlanCheckStatusCount.vue";
import { usePlanCheckStatus, usePlanContext } from "@/components/Plan/logic";
-import CommonDrawer from "@/components/RolloutV1/components/CommonDrawer.vue";
+import CommonDrawer from "@/components/RolloutV1/components/Rollout/CommonDrawer.vue";
import {
issueServiceClientConnect,
rolloutServiceClientConnect,
diff --git a/frontend/src/components/Plan/components/IssueReviewView/DatabaseCreateView.vue b/frontend/src/components/Plan/components/IssueReviewView/DatabaseCreateView.vue
index c0bf6c8fe1..bbbe0dad2e 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/DatabaseCreateView.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/DatabaseCreateView.vue
@@ -72,8 +72,8 @@
<script lang="ts" setup>
import { computed, watchEffect } from "vue";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
-import TaskRunTable from "@/components/RolloutV1/components/TaskRunTable.vue";
+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";
+import TaskRunTable from "@/components/RolloutV1/components/TaskRun/TaskRunTable.vue";
import { EnvironmentV1Name, InstanceV1Name } from "@/components/v2";
import {
useCurrentProjectV1,
diff --git a/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/ExecutionHistorySection.vue b/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/ExecutionHistorySection.vue
index 4a36d60c21..c31e172991 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/ExecutionHistorySection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/ExecutionHistorySection.vue
@@ -40,7 +40,7 @@
<script lang="ts" setup>
import { NButton } from "naive-ui";
import { computed } from "vue";
-import TaskRunTable from "@/components/RolloutV1/components/TaskRunTable.vue";
+import TaskRunTable from "@/components/RolloutV1/components/TaskRun/TaskRunTable.vue";
import type { TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
import { extractTaskUID } from "@/utils";
import { usePlanContext } from "../../../logic";
diff --git a/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/TasksSection.vue b/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/TasksSection.vue
index 11573c3de6..bc8e093656 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/TasksSection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/DatabaseExportView/TasksSection.vue
@@ -22,8 +22,7 @@
/>
<TaskStatusActions
:task="task"
- :task-runs="getTaskRunsForTask(task)"
- :rollout="rollout"
+ :stage="getStageForTask(task)!"
:size="'tiny'"
@action-confirmed="handleActionConfirmed"
/>
@@ -52,14 +51,14 @@
<script lang="ts" setup>
import { computed, watchEffect } from "vue";
import DatabaseDisplay from "@/components/Plan/components/common/DatabaseDisplay.vue";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
-import TaskStatusActions from "@/components/RolloutV1/components/TaskStatusActions.vue";
-import { taskRunNamePrefix, useDatabaseV1Store } from "@/store";
-import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";
+import TaskStatusActions from "@/components/RolloutV1/components/Task/TaskStatusActions.vue";
+import { useDatabaseV1Store } from "@/store";
+import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";
import { usePlanContextWithRollout } from "../../../logic";
import { useExpandableList } from ".";
-const { plan, rollout, taskRuns, events } = usePlanContextWithRollout();
+const { plan, rollout, events } = usePlanContextWithRollout();
const dbStore = useDatabaseV1Store();
const tasks = computed(() => {
@@ -80,10 +79,10 @@ const {
remainingCount,
} = useExpandableList(tasks);
-// Get task runs for a specific task
-const getTaskRunsForTask = (task: Task) => {
- return taskRuns.value.filter((run) =>
- run.name.startsWith(`${task.name}/${taskRunNamePrefix}`)
+// Get the stage that contains a given task
+const getStageForTask = (task: Task): Stage | undefined => {
+ return rollout.value.stages.find((stage) =>
+ stage.tasks.some((t) => t.name === task.name)
);
};
diff --git a/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue b/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue
index a8ad08520a..192dc9ed49 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/OverviewSection.vue
@@ -69,7 +69,7 @@
<script setup lang="ts">
import { ref } from "vue";
import { useRouter } from "vue-router";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";
import { EnvironmentV1Name } from "@/components/v2";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE } from "@/router/dashboard/projectV1";
import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue
index cfc69c8be2..f2f071447a 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/StagesSection.vue
@@ -34,7 +34,7 @@
<script setup lang="ts">
import { useRouter } from "vue-router";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";
import { EnvironmentV1Name } from "@/components/v2";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE } from "@/router/dashboard/projectV1";
import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";
diff --git a/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue b/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue
index a386896ebf..47d6a0506a 100644
--- a/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue
+++ b/frontend/src/components/Plan/components/SpecDetailView/FailedTaskRunsSection.vue
@@ -56,9 +56,9 @@ import { computed, reactive, ref, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import HumanizeDate from "@/components/misc/HumanizeDate.vue";
-import TaskRunComment from "@/components/RolloutV1/components/TaskRunComment.vue";
-import TaskRunDetail from "@/components/RolloutV1/components/TaskRunDetail.vue";
-import TaskRunStatusIcon from "@/components/RolloutV1/components/TaskRunStatusIcon.vue";
+import TaskRunComment from "@/components/RolloutV1/components/TaskRun/TaskRunComment.vue";
+import TaskRunDetail from "@/components/RolloutV1/components/TaskRun/TaskRunDetail.vue";
+import TaskRunStatusIcon from "@/components/RolloutV1/components/TaskRun/TaskRunStatusIcon.vue";
import { Drawer, DrawerContent } from "@/components/v2";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";
import { useCurrentProjectV1, useDatabaseV1Store } from "@/store";
diff --git a/frontend/src/components/Plan/constants/task.ts b/frontend/src/components/Plan/constants/task.ts
deleted file mode 100644
index 60302df8ba..0000000000
--- a/frontend/src/components/Plan/constants/task.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
-
-export const TASK_STATUS_FILTERS: Task_Status[] = [
- Task_Status.RUNNING,
- Task_Status.FAILED,
- Task_Status.PENDING,
- Task_Status.NOT_STARTED,
- Task_Status.CANCELED,
- Task_Status.DONE,
- Task_Status.SKIPPED,
-];
diff --git a/frontend/src/components/Revision/RevisionDetailPanel.vue b/frontend/src/components/Revision/RevisionDetailPanel.vue
index 0482144a62..2de77a9ec8 100644
--- a/frontend/src/components/Revision/RevisionDetailPanel.vue
+++ b/frontend/src/components/Revision/RevisionDetailPanel.vue
@@ -72,7 +72,7 @@ import { ArrowUpRightIcon } from "lucide-vue-next";
import { computed, reactive, watch } from "vue";
import { BBSpin } from "@/bbkit";
import { MonacoEditor } from "@/components/MonacoEditor";
-import { TaskRunLogViewer } from "@/components/RolloutV1/components/TaskRunLogViewer";
+import { TaskRunLogViewer } from "@/components/RolloutV1/components/TaskRun/TaskRunLogViewer";
import { CopyButton } from "@/components/v2";
import { sheetServiceClientConnect } from "@/connect";
import { useRevisionStore } from "@/store";
diff --git a/frontend/src/components/Rollout/RolloutDataTable.vue b/frontend/src/components/Rollout/RolloutDataTable.vue
index 3a3108b4ef..d9b3520dbd 100644
--- a/frontend/src/components/Rollout/RolloutDataTable.vue
+++ b/frontend/src/components/Rollout/RolloutDataTable.vue
@@ -22,8 +22,8 @@ import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import Timestamp from "@/components/misc/Timestamp.vue";
-import { TASK_STATUS_FILTERS } from "@/components/Plan/constants/task";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
+import TaskStatus from "@/components/RolloutV1/components/Task/TaskStatus.vue";
+import { TASK_STATUS_FILTERS } from "@/components/RolloutV1/constants/task";
import { EnvironmentV1Name } from "@/components/v2";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT } from "@/router/dashboard/projectV1";
import { useEnvironmentV1Store } from "@/store";
diff --git a/frontend/src/components/RolloutV1/components/CommonDrawer.vue b/frontend/src/components/RolloutV1/components/Rollout/CommonDrawer.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/CommonDrawer.vue
rename to frontend/src/components/RolloutV1/components/Rollout/CommonDrawer.vue
diff --git a/frontend/src/components/RolloutV1/components/ErrorList.vue b/frontend/src/components/RolloutV1/components/Rollout/ErrorList.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/ErrorList.vue
rename to frontend/src/components/RolloutV1/components/Rollout/ErrorList.vue
diff --git a/frontend/src/components/RolloutV1/components/ReleaseInfoCard.vue b/frontend/src/components/RolloutV1/components/Rollout/ReleaseInfoCard.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/ReleaseInfoCard.vue
rename to frontend/src/components/RolloutV1/components/Rollout/ReleaseInfoCard.vue
diff --git a/frontend/src/components/RolloutV1/components/RolloutBreadcrumb.vue b/frontend/src/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/RolloutBreadcrumb.vue
rename to frontend/src/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vue
diff --git a/frontend/src/components/RolloutV1/components/RolloutView.vue b/frontend/src/components/RolloutV1/components/Rollout/RolloutView.vue
similarity index 90%
rename from frontend/src/components/RolloutV1/components/RolloutView.vue
rename to frontend/src/components/RolloutV1/components/Rollout/RolloutView.vue
index 645c605487..40137a61e1 100644
--- a/frontend/src/components/RolloutV1/components/RolloutView.vue
+++ b/frontend/src/components/RolloutV1/components/Rollout/RolloutView.vue
@@ -69,14 +69,14 @@ import {
extractPlanUIDFromRolloutName,
extractProjectResourceName,
} from "@/utils";
-import { useExpectedTaskCount } from "./composables/useExpectedTaskCount";
-import { useStageSelection } from "./composables/useStageSelection";
-import { useTaskInstancePreload } from "./composables/useTaskInstancePreload";
-import PendingTasksPreviewDrawer from "./PendingTasksPreviewDrawer.vue";
-import StageContentView from "./StageContentView.vue";
-import StageNavigationBar from "./StageNavigationBar.vue";
-import type { TargetType } from "./TaskRolloutActionPanel.vue";
-import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";
+import StageContentView from "../Stage/StageContentView.vue";
+import StageNavigationBar from "../Stage/StageNavigationBar.vue";
+import { useStageSelection } from "../Stage/useStageSelection";
+import PendingTasksPreviewDrawer from "../Task/PendingTasksPreviewDrawer.vue";
+import type { TargetType } from "../Task/TaskRolloutActionPanel.vue";
+import TaskRolloutActionPanel from "../Task/TaskRolloutActionPanel.vue";
+import { useExpectedTaskCount } from "../Task/useExpectedTaskCount";
+import { useTaskInstancePreload } from "../Task/useTaskInstancePreload";
const route = useRoute();
const router = useRouter();
diff --git a/frontend/src/components/RolloutV1/components/StageContentSidebar.vue b/frontend/src/components/RolloutV1/components/Stage/StageContentSidebar.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/StageContentSidebar.vue
rename to frontend/src/components/RolloutV1/components/Stage/StageContentSidebar.vue
diff --git a/frontend/src/components/RolloutV1/components/StageContentView.vue b/frontend/src/components/RolloutV1/components/Stage/StageContentView.vue
similarity index 97%
rename from frontend/src/components/RolloutV1/components/StageContentView.vue
rename to frontend/src/components/RolloutV1/components/Stage/StageContentView.vue
index a654f25d84..c3cad0eea8 100644
--- a/frontend/src/components/RolloutV1/components/StageContentView.vue
+++ b/frontend/src/components/RolloutV1/components/Stage/StageContentView.vue
@@ -88,9 +88,9 @@ import { usePlanContextWithRollout } from "@/components/Plan/logic";
import { RUNNABLE_TASK_STATUSES } from "@/components/RolloutV1/constants/task";
import type { Rollout, Stage } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
+import TaskFilter from "../Task/TaskFilter.vue";
+import TaskList from "../Task/TaskList.vue";
import StageContentSidebar from "./StageContentSidebar.vue";
-import TaskFilter from "./TaskFilter.vue";
-import TaskList from "./TaskList.vue";
const props = defineProps<{
selectedStage: Stage | null | undefined;
diff --git a/frontend/src/components/RolloutV1/components/StageNavigationBar.vue b/frontend/src/components/RolloutV1/components/Stage/StageNavigationBar.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/StageNavigationBar.vue
rename to frontend/src/components/RolloutV1/components/Stage/StageNavigationBar.vue
diff --git a/frontend/src/components/RolloutV1/components/StageProgressCard.vue b/frontend/src/components/RolloutV1/components/Stage/StageProgressCard.vue
similarity index 87%
rename from frontend/src/components/RolloutV1/components/StageProgressCard.vue
rename to frontend/src/components/RolloutV1/components/Stage/StageProgressCard.vue
index bb5395bdd4..c69611b976 100644
--- a/frontend/src/components/RolloutV1/components/StageProgressCard.vue
+++ b/frontend/src/components/RolloutV1/components/Stage/StageProgressCard.vue
@@ -9,11 +9,11 @@
<script lang="ts" setup>
import { computed } from "vue";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import EnvironmentV1Name from "@/components/v2/Model/EnvironmentV1Name.vue";
import { useEnvironmentV1Store } from "@/store";
import type { Stage } from "@/types/proto-es/v1/rollout_service_pb";
-import { useStageStatus } from "./composables/useStageStatus";
+import TaskStatus from "../Task/TaskStatus.vue";
+import { useStageStatus } from "./useStageStatus";
const props = withDefaults(
defineProps<{
diff --git a/frontend/src/components/RolloutV1/components/StageTaskRunsRollback.vue b/frontend/src/components/RolloutV1/components/Stage/StageTaskRunsRollback.vue
similarity index 88%
rename from frontend/src/components/RolloutV1/components/StageTaskRunsRollback.vue
rename to frontend/src/components/RolloutV1/components/Stage/StageTaskRunsRollback.vue
index bbbb063a3b..20be336826 100644
--- a/frontend/src/components/RolloutV1/components/StageTaskRunsRollback.vue
+++ b/frontend/src/components/RolloutV1/components/Stage/StageTaskRunsRollback.vue
@@ -22,8 +22,8 @@ import { NButton } from "naive-ui";
import { ref, toRef } from "vue";
import { usePlanContextWithRollout } from "@/components/Plan/logic";
import type { Stage } from "@/types/proto-es/v1/rollout_service_pb";
-import { useRollbackableTasks } from "./composables/useRollbackableTasks";
-import TaskRunRollbackDrawer from "./TaskRunRollbackDrawer.vue";
+import TaskRunRollbackDrawer from "../TaskRun/TaskRunRollbackDrawer.vue";
+import { useRollbackableTasks } from "../TaskRun/useRollbackableTasks";
const props = defineProps<{
stage: Stage | null | undefined;
diff --git a/frontend/src/components/RolloutV1/components/StageTimeline.vue b/frontend/src/components/RolloutV1/components/Stage/StageTimeline.vue
similarity index 97%
rename from frontend/src/components/RolloutV1/components/StageTimeline.vue
rename to frontend/src/components/RolloutV1/components/Stage/StageTimeline.vue
index da24a21bd6..5f487d2f49 100644
--- a/frontend/src/components/RolloutV1/components/StageTimeline.vue
+++ b/frontend/src/components/RolloutV1/components/Stage/StageTimeline.vue
@@ -135,7 +135,6 @@ import { computed, onUnmounted, ref, watch } from "vue";
import BBSpin from "@/bbkit/BBSpin.vue";
import TimestampDisplay from "@/components/misc/Timestamp.vue";
import { useResourcePoller } from "@/components/Plan/logic/poller";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import { Drawer, DrawerContent } from "@/components/v2";
import { useCurrentProjectV1 } from "@/store";
import type { Stage, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
@@ -145,15 +144,16 @@ import {
extractDatabaseResourceName,
extractInstanceResourceName,
} from "@/utils";
-import { useTaskNavigation } from "./composables/useTaskNavigation";
+import ScheduledTimeIndicator from "../Task/ScheduledTimeIndicator.vue";
+import TaskStatus from "../Task/TaskStatus.vue";
+import { useTaskNavigation } from "../Task/useTaskNavigation";
+import TaskRunDetail from "../TaskRun/TaskRunDetail.vue";
import {
getTaskNameFromTaskRun,
getTaskRunDuration,
getTimelineType,
mapTaskRunStatusToTaskStatus,
-} from "./composables/useTaskRunUtils";
-import ScheduledTimeIndicator from "./ScheduledTimeIndicator.vue";
-import TaskRunDetail from "./TaskRunDetail.vue";
+} from "../TaskRun/useTaskRunUtils";
const props = withDefaults(
defineProps<{
diff --git a/frontend/src/components/RolloutV1/components/composables/useStageSelection.ts b/frontend/src/components/RolloutV1/components/Stage/useStageSelection.ts
similarity index 96%
rename from frontend/src/components/RolloutV1/components/composables/useStageSelection.ts
rename to frontend/src/components/RolloutV1/components/Stage/useStageSelection.ts
index cb78a19925..6991dfef7a 100644
--- a/frontend/src/components/RolloutV1/components/composables/useStageSelection.ts
+++ b/frontend/src/components/RolloutV1/components/Stage/useStageSelection.ts
@@ -1,6 +1,6 @@
import { type ComputedRef, computed, type Ref } from "vue";
import type { Rollout, Stage } from "@/types/proto-es/v1/rollout_service_pb";
-import { isTaskRunning, isTaskUnfinished } from "../utils/taskStatus";
+import { isTaskRunning, isTaskUnfinished } from "../shared/taskStatus";
export interface UseStageSelectionReturn {
selectedStage: ComputedRef<Stage | undefined>;
diff --git a/frontend/src/components/RolloutV1/components/composables/useStageStatus.ts b/frontend/src/components/RolloutV1/components/Stage/useStageStatus.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useStageStatus.ts
rename to frontend/src/components/RolloutV1/components/Stage/useStageStatus.ts
diff --git a/frontend/src/components/RolloutV1/components/LatestTaskRunInfo.vue b/frontend/src/components/RolloutV1/components/Task/LatestTaskRunInfo.vue
similarity index 96%
rename from frontend/src/components/RolloutV1/components/LatestTaskRunInfo.vue
rename to frontend/src/components/RolloutV1/components/Task/LatestTaskRunInfo.vue
index b00d2a500f..017db33133 100644
--- a/frontend/src/components/RolloutV1/components/LatestTaskRunInfo.vue
+++ b/frontend/src/components/RolloutV1/components/Task/LatestTaskRunInfo.vue
@@ -73,8 +73,8 @@ import { computed, h } from "vue";
import { useI18n } from "vue-i18n";
import Timestamp from "@/components/misc/Timestamp.vue";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
-import type { TaskRunLogSummary } from "./composables/useTaskRunLogSummary";
-import { TaskRunLogViewer } from "./TaskRunLogViewer";
+import { TaskRunLogViewer } from "../TaskRun/TaskRunLogViewer";
+import type { TaskRunLogSummary } from "../TaskRun/useTaskRunLogSummary";
// Types
interface StatusConfig {
diff --git a/frontend/src/components/RolloutV1/components/PendingTasksPreviewDrawer.vue b/frontend/src/components/RolloutV1/components/Task/PendingTasksPreviewDrawer.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/PendingTasksPreviewDrawer.vue
rename to frontend/src/components/RolloutV1/components/Task/PendingTasksPreviewDrawer.vue
diff --git a/frontend/src/components/RolloutV1/components/ScheduledTimeIndicator.vue b/frontend/src/components/RolloutV1/components/Task/ScheduledTimeIndicator.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/ScheduledTimeIndicator.vue
rename to frontend/src/components/RolloutV1/components/Task/ScheduledTimeIndicator.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskDatabaseName.vue b/frontend/src/components/RolloutV1/components/Task/TaskDatabaseName.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskDatabaseName.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskDatabaseName.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskFilter.vue b/frontend/src/components/RolloutV1/components/Task/TaskFilter.vue
similarity index 96%
rename from frontend/src/components/RolloutV1/components/TaskFilter.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskFilter.vue
index 9ea82e7199..e6e11e697a 100644
--- a/frontend/src/components/RolloutV1/components/TaskFilter.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskFilter.vue
@@ -31,13 +31,13 @@
<script lang="ts" setup>
import { NTag } from "naive-ui";
import { computed } from "vue";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import { TASK_STATUS_FILTERS } from "@/components/RolloutV1/constants/task";
import type {
Stage,
Task_Status,
} from "@/types/proto-es/v1/rollout_service_pb";
import { stringifyTaskStatus } from "@/utils";
+import TaskStatus from "./TaskStatus.vue";
const props = defineProps<{
stage: Stage;
diff --git a/frontend/src/components/RolloutV1/components/TaskItem.vue b/frontend/src/components/RolloutV1/components/Task/TaskItem.vue
similarity index 94%
rename from frontend/src/components/RolloutV1/components/TaskItem.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskItem.vue
index 667a895a19..d83d13f0e9 100644
--- a/frontend/src/components/RolloutV1/components/TaskItem.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskItem.vue
@@ -235,9 +235,7 @@ import HighlightCodeBlock from "@/components/HighlightCodeBlock.vue";
import Timestamp from "@/components/misc/Timestamp.vue";
import { usePlanContextWithRollout } from "@/components/Plan";
import DatabaseDisplay from "@/components/Plan/components/common/DatabaseDisplay.vue";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";
-import { taskRunNamePrefix } from "@/store";
import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
import {
@@ -249,15 +247,17 @@ import {
isReleaseBasedTask,
releaseNameOfTaskV1,
} from "@/utils";
-import { useTaskActions } from "./composables/useTaskActions";
-import { useTaskDisplay } from "./composables/useTaskDisplay";
-import { useTaskRunLogSummary } from "./composables/useTaskRunLogSummary";
-import { useTaskStatement } from "./composables/useTaskStatement";
-import { useTaskTiming } from "./composables/useTaskTiming";
+import ReleaseInfoCard from "../Rollout/ReleaseInfoCard.vue";
+import { useTaskRunsForTask } from "../shared/useTaskRunsForTask";
+import { useTaskRunLogSummary } from "../TaskRun/useTaskRunLogSummary";
import LatestTaskRunInfo from "./LatestTaskRunInfo.vue";
-import ReleaseInfoCard from "./ReleaseInfoCard.vue";
import ScheduledTimeIndicator from "./ScheduledTimeIndicator.vue";
import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";
+import TaskStatus from "./TaskStatus.vue";
+import { useTaskActions } from "./useTaskActions";
+import { useTaskDisplay } from "./useTaskDisplay";
+import { useTaskStatement } from "./useTaskStatement";
+import { useTaskTiming } from "./useTaskTiming";
const props = withDefaults(
defineProps<{
@@ -333,11 +333,13 @@ const { loading, displayedStatement, isStatementTruncated } = useTaskStatement(
() => props.isExpanded
);
+const taskRunsForTask = useTaskRunsForTask(
+ () => props.task.name,
+ () => allTaskRuns.value
+);
+
const latestTaskRun = computed(() => {
- const taskRunsForTask = allTaskRuns.value.filter((run) =>
- run.name.startsWith(`${props.task.name}/${taskRunNamePrefix}`)
- );
- return last(taskRunsForTask);
+ return last(taskRunsForTask.value);
});
const { timingDisplay, timingType, scheduledTime } = useTaskTiming(
diff --git a/frontend/src/components/RolloutV1/components/TaskList.vue b/frontend/src/components/RolloutV1/components/Task/TaskList.vue
similarity index 95%
rename from frontend/src/components/RolloutV1/components/TaskList.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskList.vue
index 9a8dd0a57b..e1575815fc 100644
--- a/frontend/src/components/RolloutV1/components/TaskList.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskList.vue
@@ -51,11 +51,11 @@ import { computed, ref, watch } from "vue";
import { usePlanContextWithRollout } from "@/components/Plan/logic";
import type { Rollout, Stage } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
-import { useTaskCollapse } from "./composables/useTaskCollapse";
-import { useTaskSelection } from "./composables/useTaskSelection";
-import { DEFAULT_PAGE_SIZE } from "./constants";
+import { DEFAULT_PAGE_SIZE } from "../../constants";
import TaskItem from "./TaskItem.vue";
import TaskToolbar from "./TaskToolbar.vue";
+import { useTaskCollapse } from "./useTaskCollapse";
+import { useTaskSelection } from "./useTaskSelection";
const props = withDefaults(
defineProps<{
diff --git a/frontend/src/components/RolloutV1/components/TaskRollbackButton.vue b/frontend/src/components/RolloutV1/components/Task/TaskRollbackButton.vue
similarity index 94%
rename from frontend/src/components/RolloutV1/components/TaskRollbackButton.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskRollbackButton.vue
index 6519d714a1..263f5773e2 100644
--- a/frontend/src/components/RolloutV1/components/TaskRollbackButton.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskRollbackButton.vue
@@ -31,7 +31,7 @@ import type {
TaskRun,
} from "@/types/proto-es/v1/rollout_service_pb";
import { databaseForTask } from "@/utils";
-import TaskRunRollbackDrawer from "./TaskRunRollbackDrawer.vue";
+import TaskRunRollbackDrawer from "../TaskRun/TaskRunRollbackDrawer.vue";
const props = defineProps<{
task: Task;
diff --git a/frontend/src/components/RolloutV1/components/TaskRolloutActionPanel.vue b/frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue
similarity index 99%
rename from frontend/src/components/RolloutV1/components/TaskRolloutActionPanel.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue
index 87a0fd2c47..88a12be4a9 100644
--- a/frontend/src/components/RolloutV1/components/TaskRolloutActionPanel.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskRolloutActionPanel.vue
@@ -200,7 +200,6 @@ import {
import { computed, ref, watch, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
import { usePlanContextWithRollout } from "@/components/Plan/logic";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import {
CANCELABLE_TASK_STATUSES,
RUNNABLE_TASK_STATUSES,
@@ -228,9 +227,10 @@ import {
TaskRun_Status,
} from "@/types/proto-es/v1/rollout_service_pb";
import { extractStageUID } from "@/utils";
-import CommonDrawer from "./CommonDrawer.vue";
-import ErrorList from "./ErrorList.vue";
+import CommonDrawer from "../Rollout/CommonDrawer.vue";
+import ErrorList from "../Rollout/ErrorList.vue";
import TaskDatabaseName from "./TaskDatabaseName.vue";
+import TaskStatus from "./TaskStatus.vue";
import { canRolloutTasks } from "./taskPermissions";
// 1 hour default delay for scheduled tasks
diff --git a/frontend/src/components/Rollout/kits/TaskStatus.vue b/frontend/src/components/RolloutV1/components/Task/TaskStatus.vue
similarity index 100%
rename from frontend/src/components/Rollout/kits/TaskStatus.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskStatus.vue
diff --git a/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vue b/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vue
new file mode 100644
index 0000000000..6290fa702d
--- /dev/null
+++ b/frontend/src/components/RolloutV1/components/Task/TaskStatusActions.vue
@@ -0,0 +1,119 @@
+<template>
+ <div>
+ <div
+ v-if="!readonly && hasActions"
+ class="flex flex-row justify-end items-center gap-x-2"
+ >
+ <NButton v-if="primaryAction" :size="size" @click="handlePrimaryAction">
+ {{ primaryActionLabel }}
+ </NButton>
+ <NDropdown
+ v-if="dropdownOptions.length > 0"
+ trigger="hover"
+ :options="dropdownOptions"
+ @select="handleDropdownSelect"
+ >
+ <NButton :size="size" class="px-1!" quaternary>
+ <template #icon>
+ <EllipsisVerticalIcon class="w-4 h-4" />
+ </template>
+ </NButton>
+ </NDropdown>
+ </div>
+
+ <template v-if="currentAction && actionTarget">
+ <TaskRolloutActionPanel
+ :show="showActionPanel"
+ :action="currentAction"
+ :target="actionTarget"
+ @close="handleActionPanelClose"
+ />
+ </template>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { EllipsisVerticalIcon } from "lucide-vue-next";
+import { NButton, NDropdown } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import { usePlanContextWithRollout } from "@/components/Plan/logic";
+import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";
+import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
+import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";
+import { useTaskActions } from "./useTaskActions";
+
+const props = withDefaults(
+ defineProps<{
+ task: Task;
+ stage: Stage;
+ size?: "tiny" | "small" | "medium" | "large";
+ }>(),
+ {
+ size: "small",
+ }
+);
+
+const emit = defineEmits<{
+ "action-confirmed": [];
+}>();
+
+const { t } = useI18n();
+const { readonly } = usePlanContextWithRollout();
+
+const {
+ canRun,
+ canSkip,
+ canCancel,
+ hasActions,
+ showActionPanel,
+ currentAction,
+ actionTarget,
+ runTask,
+ skipTask,
+ cancelTask,
+ closeActionPanel,
+} = useTaskActions(
+ () => props.task,
+ () => props.stage
+);
+
+const primaryAction = computed(() => {
+ if (canRun.value) {
+ if (props.task.status === Task_Status.FAILED) return "RETRY";
+ return "RUN";
+ }
+ return null;
+});
+
+const primaryActionLabel = computed(() => {
+ if (primaryAction.value === "RETRY") return t("common.retry");
+ if (primaryAction.value === "RUN") return t("common.run");
+ return "";
+});
+
+const dropdownOptions = computed(() => {
+ const options: { key: string; label: string }[] = [];
+ if (canSkip.value) {
+ options.push({ key: "SKIP", label: t("common.skip") });
+ }
+ if (canCancel.value) {
+ options.push({ key: "CANCEL", label: t("common.cancel") });
+ }
+ return options;
+});
+
+const handlePrimaryAction = () => {
+ runTask();
+};
+
+const handleDropdownSelect = (key: string) => {
+ if (key === "SKIP") skipTask();
+ else if (key === "CANCEL") cancelTask();
+};
+
+const handleActionPanelClose = () => {
+ closeActionPanel();
+ emit("action-confirmed");
+};
+</script>
diff --git a/frontend/src/components/RolloutV1/components/TaskTable.vue b/frontend/src/components/RolloutV1/components/Task/TaskTable.vue
similarity index 93%
rename from frontend/src/components/RolloutV1/components/TaskTable.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskTable.vue
index 4d8489abdd..7baf1fa5ae 100644
--- a/frontend/src/components/RolloutV1/components/TaskTable.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskTable.vue
@@ -28,19 +28,33 @@ import { useRouter } from "vue-router";
import Timestamp from "@/components/misc/Timestamp.vue";
import DatabaseDisplay from "@/components/Plan/components/common/DatabaseDisplay.vue";
import { usePlanContextWithRollout } from "@/components/Plan/logic";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import { PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK } from "@/router/dashboard/projectV1";
import { useDatabaseV1Store } from "@/store";
import { getTimeForPbTimestampProtoEs } from "@/types";
import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
-import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
+import { Task_Status, Task_Type } from "@/types/proto-es/v1/rollout_service_pb";
import {
extractPlanUIDFromRolloutName,
extractProjectResourceName,
extractStageNameFromTaskName,
humanizeTs,
} from "@/utils";
-import { semanticTaskType } from "../logic";
+import TaskStatus from "./TaskStatus.vue";
+
+const semanticTaskType = (type: Task_Type) => {
+ switch (type) {
+ case Task_Type.DATABASE_CREATE:
+ return t("task.type.database-create");
+ case Task_Type.DATABASE_MIGRATE:
+ return t("task.type.migrate");
+ case Task_Type.DATABASE_EXPORT:
+ return t("task.type.database-export");
+ case Task_Type.GENERAL:
+ return t("task.type.general");
+ default:
+ return "";
+ }
+};
const props = withDefaults(
defineProps<{
diff --git a/frontend/src/components/RolloutV1/components/TaskToolbar.vue b/frontend/src/components/RolloutV1/components/Task/TaskToolbar.vue
similarity index 99%
rename from frontend/src/components/RolloutV1/components/TaskToolbar.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskToolbar.vue
index b9aa02b33c..9c14fdee78 100644
--- a/frontend/src/components/RolloutV1/components/TaskToolbar.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskToolbar.vue
@@ -112,9 +112,9 @@ import { useCurrentUserV1 } from "@/store";
import { userNamePrefix } from "@/store/modules/v1/common";
import { Issue_Type } from "@/types/proto-es/v1/issue_service_pb";
import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";
+import type { TaskAction } from "../../types";
import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";
import { canRolloutTasks } from "./taskPermissions";
-import type { TaskAction } from "./types";
const props = defineProps<{
selectedTasks: Task[];
diff --git a/frontend/src/components/RolloutV1/components/TaskView.vue b/frontend/src/components/RolloutV1/components/Task/TaskView.vue
similarity index 96%
rename from frontend/src/components/RolloutV1/components/TaskView.vue
rename to frontend/src/components/RolloutV1/components/Task/TaskView.vue
index 501f810397..d2a25544c4 100644
--- a/frontend/src/components/RolloutV1/components/TaskView.vue
+++ b/frontend/src/components/RolloutV1/components/Task/TaskView.vue
@@ -43,9 +43,7 @@
<!-- Task Status Actions -->
<TaskStatusActions
:task="task"
- :task-runs="taskRuns"
- :rollout="rollout"
- :readonly="readonly"
+ :stage="selectedStage!"
@action-confirmed="handleTaskActionConfirmed"
/>
<!-- Rollback entry -->
@@ -142,7 +140,6 @@ import {
getSpecTitle,
usePlanContextWithRollout,
} from "@/components/Plan/logic";
-import TaskStatus from "@/components/Rollout/kits/TaskStatus.vue";
import { PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL } from "@/router/dashboard/projectV1";
import {
taskRunNamePrefix,
@@ -164,10 +161,11 @@ import {
releaseNameOfTaskV1,
sheetNameOfTaskV1,
} from "@/utils";
-import ReleaseInfoCard from "./ReleaseInfoCard.vue";
+import ReleaseInfoCard from "../Rollout/ReleaseInfoCard.vue";
+import TaskRunDetail from "../TaskRun/TaskRunDetail.vue";
+import TaskRunTable from "../TaskRun/TaskRunTable.vue";
import TaskRollbackButton from "./TaskRollbackButton.vue";
-import TaskRunDetail from "./TaskRunDetail.vue";
-import TaskRunTable from "./TaskRunTable.vue";
+import TaskStatus from "./TaskStatus.vue";
import TaskStatusActions from "./TaskStatusActions.vue";
const props = defineProps<{
@@ -180,7 +178,6 @@ const { project } = useCurrentProjectV1();
const {
rollout,
taskRuns: allTaskRuns,
- readonly,
events,
plan,
} = usePlanContextWithRollout();
diff --git a/frontend/src/components/RolloutV1/components/taskPermissions.ts b/frontend/src/components/RolloutV1/components/Task/taskPermissions.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/taskPermissions.ts
rename to frontend/src/components/RolloutV1/components/Task/taskPermissions.ts
diff --git a/frontend/src/components/RolloutV1/components/composables/useExpectedTaskCount.ts b/frontend/src/components/RolloutV1/components/Task/useExpectedTaskCount.ts
similarity index 56%
rename from frontend/src/components/RolloutV1/components/composables/useExpectedTaskCount.ts
rename to frontend/src/components/RolloutV1/components/Task/useExpectedTaskCount.ts
index dadba63612..02d475a695 100644
--- a/frontend/src/components/RolloutV1/components/composables/useExpectedTaskCount.ts
+++ b/frontend/src/components/RolloutV1/components/Task/useExpectedTaskCount.ts
@@ -9,25 +9,31 @@ export const useExpectedTaskCount = (plan: Ref<Plan>) => {
const dbGroupStore = useDBGroupStore();
const expectedTaskCount = ref(0);
+ const countTargets = async (targets: string[]): Promise<number> => {
+ let count = 0;
+ for (const target of targets) {
+ if (isValidDatabaseGroupName(target)) {
+ try {
+ const dbGroup = await dbGroupStore.getOrFetchDBGroupByName(target, {
+ view: DatabaseGroupView.FULL,
+ silent: true,
+ });
+ count += dbGroup.matchedDatabases?.length ?? 0;
+ } catch {
+ // Ignore errors
+ }
+ } else {
+ count++;
+ }
+ }
+ return count;
+ };
+
const update = async () => {
let count = 0;
for (const spec of plan.value.specs) {
if (spec.config.case === "changeDatabaseConfig") {
- for (const target of spec.config.value.targets ?? []) {
- if (isValidDatabaseGroupName(target)) {
- try {
- const dbGroup = await dbGroupStore.getOrFetchDBGroupByName(
- target,
- { view: DatabaseGroupView.FULL, silent: true }
- );
- count += dbGroup.matchedDatabases?.length ?? 0;
- } catch {
- // Ignore errors
- }
- } else {
- count++;
- }
- }
+ count += await countTargets(spec.config.value.targets ?? []);
}
}
expectedTaskCount.value = count;
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskActions.ts b/frontend/src/components/RolloutV1/components/Task/useTaskActions.ts
similarity index 96%
rename from frontend/src/components/RolloutV1/components/composables/useTaskActions.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskActions.ts
index 77e1edb098..f035f31a40 100644
--- a/frontend/src/components/RolloutV1/components/composables/useTaskActions.ts
+++ b/frontend/src/components/RolloutV1/components/Task/useTaskActions.ts
@@ -5,9 +5,8 @@ import {
RUNNABLE_TASK_STATUSES,
} from "@/components/RolloutV1/constants/task";
import type { Stage, Task } from "@/types/proto-es/v1/rollout_service_pb";
-import { canRolloutTasks } from "../taskPermissions";
-
-export type TaskAction = "RUN" | "SKIP" | "CANCEL";
+import type { TaskAction } from "../../types";
+import { canRolloutTasks } from "./taskPermissions";
export interface TaskActionTarget {
type: "tasks";
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskCollapse.ts b/frontend/src/components/RolloutV1/components/Task/useTaskCollapse.ts
similarity index 96%
rename from frontend/src/components/RolloutV1/components/composables/useTaskCollapse.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskCollapse.ts
index a87834486a..043bd21678 100644
--- a/frontend/src/components/RolloutV1/components/composables/useTaskCollapse.ts
+++ b/frontend/src/components/RolloutV1/components/Task/useTaskCollapse.ts
@@ -2,7 +2,7 @@ import { head } from "lodash-es";
import { type Ref, ref, watch } from "vue";
import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
import { isValidTaskName } from "@/utils";
-import { addToSet, deleteFromSet } from "../utils/reactivity";
+import { addToSet, deleteFromSet } from "../shared/reactivity";
export interface UseTaskCollapseReturn {
expandedTaskIds: Ref<Set<string>>;
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskDisplay.ts b/frontend/src/components/RolloutV1/components/Task/useTaskDisplay.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useTaskDisplay.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskDisplay.ts
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskInstancePreload.ts b/frontend/src/components/RolloutV1/components/Task/useTaskInstancePreload.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useTaskInstancePreload.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskInstancePreload.ts
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskNavigation.ts b/frontend/src/components/RolloutV1/components/Task/useTaskNavigation.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useTaskNavigation.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskNavigation.ts
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskSelection.ts b/frontend/src/components/RolloutV1/components/Task/useTaskSelection.ts
similarity index 94%
rename from frontend/src/components/RolloutV1/components/composables/useTaskSelection.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskSelection.ts
index 495b6771fc..55f2d602f3 100644
--- a/frontend/src/components/RolloutV1/components/composables/useTaskSelection.ts
+++ b/frontend/src/components/RolloutV1/components/Task/useTaskSelection.ts
@@ -5,8 +5,8 @@ import {
clearSet,
deleteFromSet,
triggerSetReactivity,
-} from "../utils/reactivity";
-import { isTaskSelectable } from "../utils/taskStatus";
+} from "../shared/reactivity";
+import { isTaskSelectable } from "../shared/taskStatus";
export interface UseTaskSelectionReturn {
selectedTaskIds: Ref<Set<string>>;
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskStatement.ts b/frontend/src/components/RolloutV1/components/Task/useTaskStatement.ts
similarity index 97%
rename from frontend/src/components/RolloutV1/components/composables/useTaskStatement.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskStatement.ts
index bb166d0328..923a690599 100644
--- a/frontend/src/components/RolloutV1/components/composables/useTaskStatement.ts
+++ b/frontend/src/components/RolloutV1/components/Task/useTaskStatement.ts
@@ -3,7 +3,7 @@ import { useI18n } from "vue-i18n";
import { useSheetV1Store } from "@/store";
import type { Task } from "@/types/proto-es/v1/rollout_service_pb";
import { getSheetStatement, sheetNameOfTaskV1 } from "@/utils";
-import { MAX_STATEMENT_DISPLAY_SIZE } from "../constants";
+import { MAX_STATEMENT_DISPLAY_SIZE } from "../../constants";
export interface UseTaskStatementReturn {
loading: Ref<boolean>;
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskTiming.ts b/frontend/src/components/RolloutV1/components/Task/useTaskTiming.ts
similarity index 96%
rename from frontend/src/components/RolloutV1/components/composables/useTaskTiming.ts
rename to frontend/src/components/RolloutV1/components/Task/useTaskTiming.ts
index 7706caee2e..3cb9293020 100644
--- a/frontend/src/components/RolloutV1/components/composables/useTaskTiming.ts
+++ b/frontend/src/components/RolloutV1/components/Task/useTaskTiming.ts
@@ -2,7 +2,7 @@ import type { ComputedRef } from "vue";
import { computed } from "vue";
import type { Task, TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
-import { getTaskRunDuration } from "./useTaskRunUtils";
+import { getTaskRunDuration } from "../TaskRun/useTaskRunUtils";
export type TimingType = "scheduled" | "running" | "completed" | "none";
diff --git a/frontend/src/components/RolloutV1/components/TaskRunComment.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunComment.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunComment.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunComment.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunDetail.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunDetail.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunDetail.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunDetail.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/SectionContent.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/SectionContent.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/SectionContent.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/SectionContent.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/SectionHeader.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/SectionHeader.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/SectionHeader.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/SectionHeader.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/TaskRunLogViewer.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/TaskRunLogViewer.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/TaskRunLogViewer.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/TaskRunLogViewer.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/index.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/index.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/index.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/index.ts
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/types.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/types.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/types.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/types.ts
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/useTaskRunLogData.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/useTaskRunLogData.ts
similarity index 58%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/useTaskRunLogData.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/useTaskRunLogData.ts
index 0764f1536c..2b10ccd3c7 100644
--- a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/useTaskRunLogData.ts
+++ b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/useTaskRunLogData.ts
@@ -79,11 +79,60 @@ export const useTaskRunLogData = (
// Track fetch version to handle race conditions
let fetchVersion = 0;
+ const fetchReleaseSheets = async (
+ releaseName: string,
+ version: number
+ ): Promise<void> => {
+ const release = await releaseStore.fetchReleaseByName(releaseName, true);
+ if (version !== fetchVersion) return;
+
+ const results = await Promise.all(
+ release.files
+ .filter((f) => f.sheet && f.version)
+ .map(async (file) => {
+ try {
+ const s = await sheetServiceClientConnect.getSheet({
+ name: file.sheet,
+ raw: true,
+ });
+ return { version: file.version, sheet: s };
+ } catch {
+ return null;
+ }
+ })
+ );
+ if (version !== fetchVersion) return;
+
+ const newMap = new Map<string, Sheet>();
+ for (const r of results) {
+ if (r?.sheet) newMap.set(r.version, r.sheet);
+ }
+ sheetsMap.value = newMap;
+ };
+
+ const fetchSingleSheet = async (
+ sheetName: string,
+ version: number
+ ): Promise<void> => {
+ try {
+ const fetched = await sheetServiceClientConnect.getSheet({
+ name: sheetName,
+ raw: true,
+ });
+ if (version !== fetchVersion) return;
+ sheet.value = fetched;
+ } catch {
+ if (version === fetchVersion) {
+ sheet.value = undefined;
+ }
+ }
+ };
+
// Fetch sheet(s) based on task type
watch(
task,
async (currentTask) => {
- const currentFetchVersion = ++fetchVersion;
+ const currentVersion = ++fetchVersion;
if (!currentTask) {
sheet.value = undefined;
@@ -91,67 +140,20 @@ export const useTaskRunLogData = (
return;
}
- if (isReleaseBasedTask(currentTask)) {
- // Release task: fetch release and build sheets map by version
- const releaseName = releaseNameOfTaskV1(currentTask);
- if (!releaseName) return;
-
- try {
- const release = await releaseStore.fetchReleaseByName(
- releaseName,
- true
- );
- // Abort if a newer fetch has started
- if (currentFetchVersion !== fetchVersion) return;
-
- // Fetch all sheets in parallel
- const filesToFetch = release.files.filter(
- (f) => f.sheet && f.version
- );
- const sheetPromises = filesToFetch.map(async (file) => {
- try {
- const fetchedSheet = await sheetServiceClientConnect.getSheet({
- name: file.sheet,
- raw: true,
- });
- return { version: file.version, sheet: fetchedSheet };
- } catch {
- return null;
- }
- });
-
- const results = await Promise.all(sheetPromises);
- // Abort if a newer fetch has started
- if (currentFetchVersion !== fetchVersion) return;
-
- const newSheetsMap = new Map<string, Sheet>();
- for (const result of results) {
- if (result?.sheet) {
- newSheetsMap.set(result.version, result.sheet);
- }
+ try {
+ if (isReleaseBasedTask(currentTask)) {
+ const releaseName = releaseNameOfTaskV1(currentTask);
+ if (releaseName) {
+ await fetchReleaseSheets(releaseName, currentVersion);
}
- sheetsMap.value = newSheetsMap;
- } catch {
- // Ignore release fetch errors
- }
- } else {
- // Non-release task: fetch single sheet
- const sheetName = sheetNameOfTaskV1(currentTask);
- if (!sheetName) return;
-
- try {
- const fetchedSheet = await sheetServiceClientConnect.getSheet({
- name: sheetName,
- raw: true,
- });
- // Abort if a newer fetch has started
- if (currentFetchVersion !== fetchVersion) return;
- sheet.value = fetchedSheet;
- } catch {
- if (currentFetchVersion === fetchVersion) {
- sheet.value = undefined;
+ } else {
+ const sheetName = sheetNameOfTaskV1(currentTask);
+ if (sheetName) {
+ await fetchSingleSheet(sheetName, currentVersion);
}
}
+ } catch {
+ // Ignore fetch errors
}
},
{ immediate: true }
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/useTaskRunLogSections.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/useTaskRunLogSections.ts
similarity index 78%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/useTaskRunLogSections.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/useTaskRunLogSections.ts
index 1487170850..31c805c2a3 100644
--- a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/useTaskRunLogSections.ts
+++ b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/useTaskRunLogSections.ts
@@ -13,7 +13,7 @@ import {
TaskRunLogEntry_Type,
} from "@/types/proto-es/v1/rollout_service_pb";
import type { Sheet } from "@/types/proto-es/v1/sheet_service_pb";
-import { addToSet, deleteFromSet } from "../utils/reactivity";
+import { addToSet, deleteFromSet } from "../../shared/reactivity";
import type {
DisplayItem,
ReleaseFileGroup,
@@ -124,97 +124,124 @@ export const useTaskRunLogSections = (
return new TextDecoder().decode(subarray);
};
- const getEntryDetail = (
+ const getCommandExecuteDetail = (
entry: TaskRunLogEntry,
sheetContent: Uint8Array | undefined,
sheetsMapValue: Map<string, Sheet> | undefined,
fileVersion?: string
): string => {
- switch (entry.type) {
- case TaskRunLogEntry_Type.COMMAND_EXECUTE: {
- const cmd = entry.commandExecute;
- if (!cmd) return "";
- if (cmd.response?.error) return cmd.response.error;
-
- let statement: string | undefined;
- if (cmd.statement) {
- statement = cmd.statement;
- } else if (cmd.range) {
- statement = extractStatementFromRange(
+ const cmd = entry.commandExecute;
+ if (!cmd) return "";
+ if (cmd.response?.error) return cmd.response.error;
+
+ const statement =
+ cmd.statement ??
+ (cmd.range
+ ? extractStatementFromRange(
cmd.range,
sheetContent,
sheetsMapValue,
fileVersion
- );
- }
- if (statement) {
- const stmt = statement.trim().replace(/\s+/g, " ");
- return stmt.length > 80 ? stmt.substring(0, 80) + "..." : stmt;
- }
- return "-";
- }
- case TaskRunLogEntry_Type.TRANSACTION_CONTROL: {
- const txn = entry.transactionControl;
- if (!txn) return "";
- const typeLabels: Record<number, string> = {
- [TaskRunLogEntry_TransactionControl_Type.BEGIN]: "BEGIN",
- [TaskRunLogEntry_TransactionControl_Type.COMMIT]: "COMMIT",
- [TaskRunLogEntry_TransactionControl_Type.ROLLBACK]: "ROLLBACK",
- };
- const typeStr = typeLabels[txn.type] ?? "";
- return txn.error ? `${typeStr} error: ${txn.error}` : typeStr;
- }
- case TaskRunLogEntry_Type.SCHEMA_DUMP: {
- const dump = entry.schemaDump;
- if (!dump) return "";
- if (dump.error) return dump.error;
- if (dump.startTime && dump.endTime) return "completed";
- return t("task-run.log-detail.dumping");
- }
- case TaskRunLogEntry_Type.DATABASE_SYNC: {
- const sync = entry.databaseSync;
- if (!sync) return "";
- if (sync.error) return sync.error;
- if (sync.startTime && sync.endTime) return "completed";
- return t("task-run.log-detail.syncing");
- }
- case TaskRunLogEntry_Type.PRIOR_BACKUP: {
- const backup = entry.priorBackup;
- if (!backup) return "";
- if (backup.error) return backup.error;
- const items = backup.priorBackupDetail?.items;
- if (items?.length) {
- return t("task-run.log-detail.backup-completed", {
- count: items.length,
- });
- }
- if (backup.startTime && backup.endTime) return "completed";
- return t("task-run.log-detail.backing-up");
- }
- case TaskRunLogEntry_Type.RETRY_INFO: {
- const retry = entry.retryInfo;
- if (!retry) return "";
- const attempt = t("task-run.log-detail.retry-attempt", {
- current: retry.retryCount,
- max: retry.maximumRetries,
- });
- return retry.error ? `${attempt} - ${retry.error}` : attempt;
- }
- case TaskRunLogEntry_Type.COMPUTE_DIFF: {
- const diff = entry.computeDiff;
- if (!diff) return "";
- if (diff.error) return diff.error;
- if (diff.startTime && diff.endTime) return "completed";
- return t("task-run.log-detail.computing");
- }
- case TaskRunLogEntry_Type.RELEASE_FILE_EXECUTE: {
- const rfe = entry.releaseFileExecute;
- if (!rfe) return "";
- if (rfe.filePath) {
- return `${rfe.version}: ${rfe.filePath}`;
- }
- return rfe.version;
- }
+ )
+ : undefined);
+ if (statement) {
+ const stmt = statement.trim().replace(/\s+/g, " ");
+ return stmt.length > 80 ? stmt.substring(0, 80) + "..." : stmt;
+ }
+ return "-";
+ };
+
+ const getTransactionControlDetail = (entry: TaskRunLogEntry): string => {
+ const txn = entry.transactionControl;
+ if (!txn) return "";
+ const typeLabels: Record<number, string> = {
+ [TaskRunLogEntry_TransactionControl_Type.BEGIN]: "BEGIN",
+ [TaskRunLogEntry_TransactionControl_Type.COMMIT]: "COMMIT",
+ [TaskRunLogEntry_TransactionControl_Type.ROLLBACK]: "ROLLBACK",
+ };
+ const typeStr = typeLabels[txn.type] ?? "";
+ return txn.error ? `${typeStr} error: ${txn.error}` : typeStr;
+ };
+
+ const getTimedEntryDetail = (
+ data:
+ | { error?: string; startTime?: unknown; endTime?: unknown }
+ | undefined,
+ runningLabel: string
+ ): string => {
+ if (!data) return "";
+ if (data.error) return data.error;
+ if (data.startTime && data.endTime) return "completed";
+ return runningLabel;
+ };
+
+ const getPriorBackupDetail = (entry: TaskRunLogEntry): string => {
+ const backup = entry.priorBackup;
+ if (!backup) return "";
+ if (backup.error) return backup.error;
+ const items = backup.priorBackupDetail?.items;
+ if (items?.length) {
+ return t("task-run.log-detail.backup-completed", {
+ count: items.length,
+ });
+ }
+ if (backup.startTime && backup.endTime) return "completed";
+ return t("task-run.log-detail.backing-up");
+ };
+
+ const getRetryInfoDetail = (entry: TaskRunLogEntry): string => {
+ const retry = entry.retryInfo;
+ if (!retry) return "";
+ const attempt = t("task-run.log-detail.retry-attempt", {
+ current: retry.retryCount,
+ max: retry.maximumRetries,
+ });
+ return retry.error ? `${attempt} - ${retry.error}` : attempt;
+ };
+
+ const getReleaseFileExecuteDetail = (entry: TaskRunLogEntry): string => {
+ const rfe = entry.releaseFileExecute;
+ if (!rfe) return "";
+ return rfe.filePath ? `${rfe.version}: ${rfe.filePath}` : rfe.version;
+ };
+
+ const getEntryDetail = (
+ entry: TaskRunLogEntry,
+ sheetContent: Uint8Array | undefined,
+ sheetsMapValue: Map<string, Sheet> | undefined,
+ fileVersion?: string
+ ): string => {
+ switch (entry.type) {
+ case TaskRunLogEntry_Type.COMMAND_EXECUTE:
+ return getCommandExecuteDetail(
+ entry,
+ sheetContent,
+ sheetsMapValue,
+ fileVersion
+ );
+ case TaskRunLogEntry_Type.TRANSACTION_CONTROL:
+ return getTransactionControlDetail(entry);
+ case TaskRunLogEntry_Type.SCHEMA_DUMP:
+ return getTimedEntryDetail(
+ entry.schemaDump,
+ t("task-run.log-detail.dumping")
+ );
+ case TaskRunLogEntry_Type.DATABASE_SYNC:
+ return getTimedEntryDetail(
+ entry.databaseSync,
+ t("task-run.log-detail.syncing")
+ );
+ case TaskRunLogEntry_Type.PRIOR_BACKUP:
+ return getPriorBackupDetail(entry);
+ case TaskRunLogEntry_Type.RETRY_INFO:
+ return getRetryInfoDetail(entry);
+ case TaskRunLogEntry_Type.COMPUTE_DIFF:
+ return getTimedEntryDetail(
+ entry.computeDiff,
+ t("task-run.log-detail.computing")
+ );
+ case TaskRunLogEntry_Type.RELEASE_FILE_EXECUTE:
+ return getReleaseFileExecuteDetail(entry);
default:
return "";
}
@@ -559,16 +586,15 @@ export const useTaskRunLogSections = (
return expandedReleaseFiles.value.has(fileId);
};
- // Get all section IDs (from flat sections, release file groups, and replica groups)
- const getAllSectionIds = (): string[] => {
+ // All section/replica/file IDs as computeds to avoid nested function depth issues
+ const allSectionIds = computed((): string[] => {
if (hasMultipleReplicas.value) {
- return replicaGroups.value.flatMap((group) => {
- const orphanSectionIds = group.sections.map((s) => s.id);
- const fileSectionIds = group.releaseFileGroups.flatMap((fg) =>
+ return replicaGroups.value.flatMap((group) => [
+ ...group.sections.map((s) => s.id),
+ ...group.releaseFileGroups.flatMap((fg) =>
fg.sections.map((s) => s.id)
- );
- return [...orphanSectionIds, ...fileSectionIds];
- });
+ ),
+ ]);
}
if (hasReleaseFiles.value) {
return releaseFileGroups.value.flatMap((fg) =>
@@ -576,15 +602,13 @@ export const useTaskRunLogSections = (
);
}
return sections.value.map((section) => section.id);
- };
+ });
- // Get all replica IDs
- const getAllReplicaIds = (): string[] => {
+ const allReplicaIds = computed((): string[] => {
return replicaGroups.value.map((group) => group.replicaId);
- };
+ });
- // Get all release file IDs
- const getAllReleaseFileIds = (): string[] => {
+ const allReleaseFileIds = computed((): string[] => {
if (hasMultipleReplicas.value) {
return replicaGroups.value.flatMap((group) =>
group.releaseFileGroups.map(
@@ -593,90 +617,83 @@ export const useTaskRunLogSections = (
);
}
return releaseFileGroups.value.map((_, idx) => `file-${idx}`);
- };
+ });
const expandAll = () => {
- // Expand all sections
- for (const sectionId of getAllSectionIds()) {
+ for (const sectionId of allSectionIds.value) {
addToSet(expandedSections, sectionId);
deleteFromSet(userCollapsedSections, sectionId);
}
- // Expand all replica groups (for multi-replica view)
if (hasMultipleReplicas.value) {
- for (const replicaId of getAllReplicaIds()) {
+ for (const replicaId of allReplicaIds.value) {
addToSet(expandedReplicas, replicaId);
deleteFromSet(userCollapsedReplicas, replicaId);
}
}
- // Expand all release file groups
- for (const fileId of getAllReleaseFileIds()) {
+ for (const fileId of allReleaseFileIds.value) {
addToSet(expandedReleaseFiles, fileId);
deleteFromSet(userCollapsedReleaseFiles, fileId);
}
};
const collapseAll = () => {
- // Collapse all sections
- for (const sectionId of getAllSectionIds()) {
+ for (const sectionId of allSectionIds.value) {
deleteFromSet(expandedSections, sectionId);
addToSet(userCollapsedSections, sectionId);
}
- // Collapse all replica groups (for multi-replica view)
if (hasMultipleReplicas.value) {
- for (const replicaId of getAllReplicaIds()) {
+ for (const replicaId of allReplicaIds.value) {
deleteFromSet(expandedReplicas, replicaId);
addToSet(userCollapsedReplicas, replicaId);
}
}
- // Collapse all release file groups
- for (const fileId of getAllReleaseFileIds()) {
+ for (const fileId of allReleaseFileIds.value) {
deleteFromSet(expandedReleaseFiles, fileId);
addToSet(userCollapsedReleaseFiles, fileId);
}
};
const areAllExpanded = computed((): boolean => {
- const allSectionIds = getAllSectionIds();
- if (allSectionIds.length === 0) return false;
+ if (allSectionIds.value.length === 0) return false;
- const allSectionsExpanded = allSectionIds.every((id) =>
+ const allSectionsExpanded = allSectionIds.value.every((id) =>
expandedSections.value.has(id)
);
+ const allFilesExpanded =
+ allReleaseFileIds.value.length === 0 ||
+ allReleaseFileIds.value.every((id) => expandedReleaseFiles.value.has(id));
- // Check release file groups
- const allReleaseFileIds = getAllReleaseFileIds();
- const allReleaseFilesExpanded =
- allReleaseFileIds.length === 0 ||
- allReleaseFileIds.every((id) => expandedReleaseFiles.value.has(id));
-
- // For multi-replica view, also check replica groups
if (hasMultipleReplicas.value) {
- const allReplicaIds = getAllReplicaIds();
- const allReplicasExpanded = allReplicaIds.every((id) =>
+ const allReplicasExpanded = allReplicaIds.value.every((id) =>
expandedReplicas.value.has(id)
);
- return (
- allSectionsExpanded && allReplicasExpanded && allReleaseFilesExpanded
- );
+ return allSectionsExpanded && allReplicasExpanded && allFilesExpanded;
}
- return allSectionsExpanded && allReleaseFilesExpanded;
+ return allSectionsExpanded && allFilesExpanded;
});
+ const countSections = (secs: Section[]): number => secs.length;
+
+ const countEntries = (secs: Section[]): number =>
+ secs.reduce((sum, s) => sum + s.entryCount, 0);
+
const totalSections = computed((): number => {
if (hasMultipleReplicas.value) {
- return replicaGroups.value.reduce((sum, group) => {
- const orphanCount = group.sections.length;
- const fileCount = group.releaseFileGroups.reduce(
- (fSum, fg) => fSum + fg.sections.length,
- 0
- );
- return sum + orphanCount + fileCount;
- }, 0);
+ return replicaGroups.value.reduce(
+ (sum, group) =>
+ sum +
+ countSections(group.sections) +
+ group.releaseFileGroups.reduce(
+ (fSum, fg) => fSum + countSections(fg.sections),
+ 0
+ ),
+ 0
+ );
}
if (hasReleaseFiles.value) {
return releaseFileGroups.value.reduce(
- (sum, fg) => sum + fg.sections.length,
+ (sum, fg) => sum + countSections(fg.sections),
0
);
}
@@ -685,27 +702,24 @@ export const useTaskRunLogSections = (
const totalEntries = computed((): number => {
if (hasMultipleReplicas.value) {
- return replicaGroups.value.reduce((sum, group) => {
- const orphanEntries = group.sections.reduce(
- (sSum, section) => sSum + section.entryCount,
- 0
- );
- const fileEntries = group.releaseFileGroups.reduce(
- (fSum, fg) =>
- fSum + fg.sections.reduce((sSum, s) => sSum + s.entryCount, 0),
- 0
- );
- return sum + orphanEntries + fileEntries;
- }, 0);
+ return replicaGroups.value.reduce(
+ (sum, group) =>
+ sum +
+ countEntries(group.sections) +
+ group.releaseFileGroups.reduce(
+ (fSum, fg) => fSum + countEntries(fg.sections),
+ 0
+ ),
+ 0
+ );
}
if (hasReleaseFiles.value) {
return releaseFileGroups.value.reduce(
- (sum, fg) =>
- sum + fg.sections.reduce((sSum, s) => sSum + s.entryCount, 0),
+ (sum, fg) => sum + countEntries(fg.sections),
0
);
}
- return sections.value.reduce((sum, section) => sum + section.entryCount, 0);
+ return countEntries(sections.value);
});
const totalDuration = computed((): string => {
diff --git a/frontend/src/components/RolloutV1/components/TaskRunLogViewer/utils.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/utils.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunLogViewer/utils.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunLogViewer/utils.ts
diff --git a/frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunRollbackDrawer.vue
similarity index 99%
rename from frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunRollbackDrawer.vue
index dd511f9646..2e2000d4d3 100644
--- a/frontend/src/components/RolloutV1/components/TaskRunRollbackDrawer.vue
+++ b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunRollbackDrawer.vue
@@ -164,7 +164,7 @@ import {
extractProjectResourceName,
hasProjectPermissionV2,
} from "@/utils";
-import TaskTable from "./TaskTable.vue";
+import TaskTable from "../Task/TaskTable.vue";
type LocalState = {
loading: boolean;
diff --git a/frontend/src/components/RolloutV1/components/TaskRunRollbackSection.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunRollbackSection.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunRollbackSection.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunRollbackSection.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunSession/Cells/StatementCell.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/Cells/StatementCell.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunSession/Cells/StatementCell.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/Cells/StatementCell.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunSession/Cells/TimeCell.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/Cells/TimeCell.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunSession/Cells/TimeCell.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/Cells/TimeCell.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunSession/Cells/index.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/Cells/index.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunSession/Cells/index.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/Cells/index.ts
diff --git a/frontend/src/components/RolloutV1/components/TaskRunSession/PostgresSessionTable.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/PostgresSessionTable.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunSession/PostgresSessionTable.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/PostgresSessionTable.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunSession/TaskRunSession.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/TaskRunSession.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunSession/TaskRunSession.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/TaskRunSession.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunSession/index.ts b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/index.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunSession/index.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunSession/index.ts
diff --git a/frontend/src/components/RolloutV1/components/TaskRunStatusIcon.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunStatusIcon.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunStatusIcon.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunStatusIcon.vue
diff --git a/frontend/src/components/RolloutV1/components/TaskRunTable.vue b/frontend/src/components/RolloutV1/components/TaskRun/TaskRunTable.vue
similarity index 100%
rename from frontend/src/components/RolloutV1/components/TaskRunTable.vue
rename to frontend/src/components/RolloutV1/components/TaskRun/TaskRunTable.vue
diff --git a/frontend/src/components/RolloutV1/components/composables/useRollbackableTasks.ts b/frontend/src/components/RolloutV1/components/TaskRun/useRollbackableTasks.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useRollbackableTasks.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/useRollbackableTasks.ts
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskRunLogSummary.ts b/frontend/src/components/RolloutV1/components/TaskRun/useTaskRunLogSummary.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useTaskRunLogSummary.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/useTaskRunLogSummary.ts
diff --git a/frontend/src/components/RolloutV1/components/composables/useTaskRunUtils.ts b/frontend/src/components/RolloutV1/components/TaskRun/useTaskRunUtils.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/composables/useTaskRunUtils.ts
rename to frontend/src/components/RolloutV1/components/TaskRun/useTaskRunUtils.ts
diff --git a/frontend/src/components/RolloutV1/components/TaskStatusActions.vue b/frontend/src/components/RolloutV1/components/TaskStatusActions.vue
deleted file mode 100644
index 9d6a98cd84..0000000000
--- a/frontend/src/components/RolloutV1/components/TaskStatusActions.vue
+++ /dev/null
@@ -1,213 +0,0 @@
-<template>
- <div>
- <div
- v-if="!readonly && (primaryAction || dropdownOptions.length > 0)"
- class="flex flex-row justify-end items-center gap-x-2"
- >
- <NButton v-if="primaryAction" :size="size" @click="handlePrimaryAction">
- {{ actionDisplayTitle(primaryAction) }}
- </NButton>
- <NDropdown
- v-if="dropdownOptions.length > 0"
- trigger="hover"
- :options="dropdownOptions"
- @select="handleDropdownSelect"
- >
- <NButton :size="size" class="px-1!" quaternary>
- <template #icon>
- <EllipsisVerticalIcon class="w-4 h-4" />
- </template>
- </NButton>
- </NDropdown>
- </div>
-
- <!-- Task Rollout Action Panel -->
- <template v-if="currentPanelAction && actionTarget">
- <TaskRolloutActionPanel
- :show="showActionPanel"
- :action="currentPanelAction"
- :target="actionTarget"
- @close="handleActionPanelClose"
- />
- </template>
- </div>
-</template>
-
-<script setup lang="ts">
-import { EllipsisVerticalIcon } from "lucide-vue-next";
-import { NButton, NDropdown } from "naive-ui";
-import { computed, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { usePlanContextWithRollout } from "@/components/Plan/logic";
-import {
- CANCELABLE_TASK_STATUSES,
- RUNNABLE_TASK_STATUSES,
-} from "@/components/RolloutV1/constants/task";
-import type {
- Rollout,
- Stage,
- Task,
- TaskRun,
-} from "@/types/proto-es/v1/rollout_service_pb";
-import { Task_Status } from "@/types/proto-es/v1/rollout_service_pb";
-import TaskRolloutActionPanel from "./TaskRolloutActionPanel.vue";
-import { canRolloutTasks } from "./taskPermissions";
-
-type TaskStatusAction =
- // NOT_STARTED -> PENDING
- | "RUN"
- // FAILED -> PENDING
- | "RETRY"
- // * -> CANCELLED
- | "CANCEL"
- // * -> SKIPPED
- | "SKIP";
-
-const props = withDefaults(
- defineProps<{
- task: Task;
- taskRuns: TaskRun[];
- rollout?: Rollout;
- size?: "tiny" | "small" | "medium" | "large";
- }>(),
- {
- size: "small",
- }
-);
-
-const emit = defineEmits<{
- "action-confirmed": [];
-}>();
-
-const { t } = useI18n();
-const { readonly } = usePlanContextWithRollout();
-const showActionPanel = ref(false);
-const selectedAction = ref<TaskStatusAction>();
-
-type PanelAction = "RUN" | "SKIP" | "CANCEL" | undefined;
-
-const currentPanelAction = computed((): PanelAction => {
- if (!showActionPanel.value || !selectedAction.value) return undefined;
-
- switch (selectedAction.value) {
- case "RUN":
- case "RETRY":
- return "RUN";
- case "SKIP":
- return "SKIP";
- case "CANCEL":
- return "CANCEL";
- default:
- return undefined;
- }
-});
-
-// Determine target based on action type
-const actionTarget = computed(() => {
- if (!currentPanelAction.value) return undefined;
- return {
- type: "tasks" as const,
- tasks: [props.task],
- stage: stage.value,
- };
-});
-
-// Get the stage for the current task
-const stage = computed((): Stage => {
- // Find the actual stage if rollout is provided
- if (props.rollout) {
- for (const stage of props.rollout.stages) {
- for (const stageTask of stage.tasks) {
- if (stageTask.name === props.task.name) {
- return stage;
- }
- }
- }
- }
-
- // Should not reach here.
- return {
- id: "",
- name: "",
- environment: "",
- tasks: [],
- } as unknown as Stage;
-});
-
-// Check if user has permission to perform task actions
-const canPerformTaskActions = computed(() => {
- if (!props.rollout || readonly.value) {
- return false;
- }
- return canRolloutTasks([props.task]);
-});
-
-const primaryAction = computed((): TaskStatusAction | null => {
- if (!canPerformTaskActions.value) {
- return null;
- }
-
- if (
- [Task_Status.NOT_STARTED, Task_Status.CANCELED].includes(props.task.status)
- ) {
- return "RUN";
- } else if (props.task.status === Task_Status.FAILED) {
- return "RETRY";
- } else {
- return null;
- }
-});
-
-const dropdownActions = computed((): TaskStatusAction[] => {
- if (!canPerformTaskActions.value) {
- return [];
- }
-
- if (RUNNABLE_TASK_STATUSES.includes(props.task.status)) {
- return ["SKIP"];
- } else if (CANCELABLE_TASK_STATUSES.includes(props.task.status)) {
- return ["CANCEL"];
- } else {
- return [];
- }
-});
-
-const dropdownOptions = computed(() => {
- return dropdownActions.value.map((action) => {
- return {
- key: action,
- label: actionDisplayTitle(action),
- };
- });
-});
-
-const actionDisplayTitle = (action: TaskStatusAction) => {
- if (action === "RUN") {
- return t("common.run");
- } else if (action === "RETRY") {
- return t("common.retry");
- } else if (action === "CANCEL") {
- return t("common.cancel");
- } else if (action === "SKIP") {
- return t("common.skip");
- }
-};
-
-const handlePrimaryAction = () => {
- if (primaryAction.value) {
- selectedAction.value = primaryAction.value;
- showActionPanel.value = true;
- }
-};
-
-const handleDropdownSelect = (action: TaskStatusAction) => {
- selectedAction.value = action;
- showActionPanel.value = true;
-};
-
-const handleActionPanelClose = () => {
- showActionPanel.value = false;
- selectedAction.value = undefined;
- emit("action-confirmed");
-};
-</script>
diff --git a/frontend/src/components/RolloutV1/components/utils/reactivity.ts b/frontend/src/components/RolloutV1/components/shared/reactivity.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/utils/reactivity.ts
rename to frontend/src/components/RolloutV1/components/shared/reactivity.ts
diff --git a/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.ts b/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.ts
new file mode 100644
index 0000000000..3c069af8b6
--- /dev/null
+++ b/frontend/src/components/RolloutV1/components/shared/rolloutRouteHelpers.ts
@@ -0,0 +1,53 @@
+import type { RouteLocationRaw } from "vue-router";
+import {
+ PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,
+ PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,
+} from "@/router/dashboard/projectV1";
+import {
+ extractPlanUIDFromRolloutName,
+ extractProjectResourceName,
+ extractStageNameFromTaskName,
+ extractStageUID,
+ extractTaskUID,
+} from "@/utils";
+
+/**
+ * Build a route location for the task detail view.
+ * Task name format: projects/{project}/plans/{plan}/rollout/stages/{stage}/tasks/{task}
+ */
+export const buildTaskDetailRoute = (taskName: string): RouteLocationRaw => {
+ const projectName = extractProjectResourceName(taskName);
+ const planId = extractPlanUIDFromRolloutName(taskName);
+ const stageName = extractStageNameFromTaskName(taskName);
+ const stageId = extractStageUID(stageName);
+ const taskId = extractTaskUID(taskName);
+
+ return {
+ name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,
+ params: {
+ projectId: projectName,
+ planId: planId || "-",
+ stageId: stageId || "-",
+ taskId: taskId || "-",
+ },
+ };
+};
+
+/**
+ * Build a route location for the stage view.
+ * Stage name format: projects/{project}/plans/{plan}/rollout/stages/{stage}
+ */
+export const buildStageRoute = (stageName: string): RouteLocationRaw => {
+ const projectName = extractProjectResourceName(stageName);
+ const planId = extractPlanUIDFromRolloutName(stageName);
+ const stageId = stageName.split("/").pop();
+
+ return {
+ name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,
+ params: {
+ projectId: projectName,
+ planId: planId || "_",
+ stageId: stageId || "_",
+ },
+ };
+};
diff --git a/frontend/src/components/RolloutV1/components/utils/taskStatus.ts b/frontend/src/components/RolloutV1/components/shared/taskStatus.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/utils/taskStatus.ts
rename to frontend/src/components/RolloutV1/components/shared/taskStatus.ts
diff --git a/frontend/src/components/RolloutV1/components/shared/useTaskRunsForTask.ts b/frontend/src/components/RolloutV1/components/shared/useTaskRunsForTask.ts
new file mode 100644
index 0000000000..61f9412905
--- /dev/null
+++ b/frontend/src/components/RolloutV1/components/shared/useTaskRunsForTask.ts
@@ -0,0 +1,14 @@
+import type { ComputedRef } from "vue";
+import { computed } from "vue";
+import type { TaskRun } from "@/types/proto-es/v1/rollout_service_pb";
+
+export const useTaskRunsForTask = (
+ taskName: () => string,
+ allTaskRuns: () => TaskRun[]
+): ComputedRef<TaskRun[]> => {
+ return computed(() => {
+ const name = taskName();
+ const prefix = `${name}/taskRuns/`;
+ return allTaskRuns().filter((run) => run.name.startsWith(prefix));
+ });
+};
diff --git a/frontend/src/components/RolloutV1/components/shared/useWideScreen.ts b/frontend/src/components/RolloutV1/components/shared/useWideScreen.ts
new file mode 100644
index 0000000000..54197ef429
--- /dev/null
+++ b/frontend/src/components/RolloutV1/components/shared/useWideScreen.ts
@@ -0,0 +1,7 @@
+import { useWindowSize } from "@vueuse/core";
+import { computed } from "vue";
+
+export const useWideScreen = (breakpoint = 768) => {
+ const { width } = useWindowSize();
+ return computed(() => width.value >= breakpoint);
+};
diff --git a/frontend/src/components/RolloutV1/components/constants.ts b/frontend/src/components/RolloutV1/constants.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/constants.ts
rename to frontend/src/components/RolloutV1/constants.ts
diff --git a/frontend/src/components/RolloutV1/index.ts b/frontend/src/components/RolloutV1/index.ts
index 74dd9585a6..86a54ce609 100644
--- a/frontend/src/components/RolloutV1/index.ts
+++ b/frontend/src/components/RolloutV1/index.ts
@@ -1,28 +1,25 @@
-// Main rollout components
-export { default as RolloutBreadcrumb } from "./components/RolloutBreadcrumb.vue";
-export { default as RolloutView } from "./components/RolloutView.vue";
-export { default as TaskRolloutActionPanel } from "./components/TaskRolloutActionPanel.vue";
-export { default as TaskRunTable } from "./components/TaskRunTable.vue";
-export { default as TaskTable } from "./components/TaskTable.vue";
-export { default as TaskView } from "./components/TaskView.vue";
-export { default as TaskStatusActions } from "./components/TaskStatusActions.vue";
+// Rollout
+export { default as RolloutBreadcrumb } from "./components/Rollout/RolloutBreadcrumb.vue";
+export { default as RolloutView } from "./components/Rollout/RolloutView.vue";
-// Stage components
-export { default as StageContentView } from "./components/StageContentView.vue";
-export { default as StageNavigationBar } from "./components/StageNavigationBar.vue";
-export { default as StageTimeline } from "./components/StageTimeline.vue";
+// Stage
+export { default as StageContentView } from "./components/Stage/StageContentView.vue";
+export { default as StageNavigationBar } from "./components/Stage/StageNavigationBar.vue";
+export { default as StageTimeline } from "./components/Stage/StageTimeline.vue";
-// Task list components
-export { default as TaskItem } from "./components/TaskItem.vue";
-export { default as TaskList } from "./components/TaskList.vue";
-export { default as TaskToolbar } from "./components/TaskToolbar.vue";
-export { default as TaskFilter } from "./components/TaskFilter.vue";
+// Task
+export { default as TaskItem } from "./components/Task/TaskItem.vue";
+export { default as TaskList } from "./components/Task/TaskList.vue";
+export { default as TaskTable } from "./components/Task/TaskTable.vue";
+export { default as TaskView } from "./components/Task/TaskView.vue";
+export { default as TaskFilter } from "./components/Task/TaskFilter.vue";
+export { default as TaskToolbar } from "./components/Task/TaskToolbar.vue";
+export { default as TaskRolloutActionPanel } from "./components/Task/TaskRolloutActionPanel.vue";
+export { default as TaskStatusActions } from "./components/Task/TaskStatusActions.vue";
-// Task run log viewer
-export * from "./components/TaskRunLogViewer";
-
-// Logic
-export * from "./logic";
+// TaskRun
+export { default as TaskRunTable } from "./components/TaskRun/TaskRunTable.vue";
+export * from "./components/TaskRun/TaskRunLogViewer";
// Constants
export * from "./constants/task";
diff --git a/frontend/src/components/RolloutV1/logic/index.ts b/frontend/src/components/RolloutV1/logic/index.ts
deleted file mode 100644
index 979fea9a74..0000000000
--- a/frontend/src/components/RolloutV1/logic/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from "./task";
diff --git a/frontend/src/components/RolloutV1/logic/task.ts b/frontend/src/components/RolloutV1/logic/task.ts
deleted file mode 100644
index 38aa89d723..0000000000
--- a/frontend/src/components/RolloutV1/logic/task.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { t } from "@/plugins/i18n";
-import { Task_Type } from "@/types/proto-es/v1/rollout_service_pb";
-
-export const semanticTaskType = (type: Task_Type) => {
- switch (type) {
- case Task_Type.DATABASE_CREATE:
- return t("task.type.database-create");
- case Task_Type.DATABASE_MIGRATE:
- return t("task.type.migrate");
- case Task_Type.DATABASE_EXPORT:
- return t("task.type.database-export");
- case Task_Type.GENERAL:
- return t("task.type.general");
- default:
- return "";
- }
-};
diff --git a/frontend/src/components/RolloutV1/components/types.ts b/frontend/src/components/RolloutV1/types.ts
similarity index 100%
rename from frontend/src/components/RolloutV1/components/types.ts
rename to frontend/src/components/RolloutV1/types.ts
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index c699aaef6f..6b61d5c765 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -100,21 +100,21 @@ const rolloutRoutes: RouteRecordRaw[] = [
path: "",
name: PROJECT_V1_ROUTE_PLAN_ROLLOUT,
component: () =>
- import("@/components/RolloutV1/components/RolloutView.vue"),
+ import("@/components/RolloutV1/components/Rollout/RolloutView.vue"),
props: true,
},
{
path: "stages/:stageId",
name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_STAGE,
component: () =>
- import("@/components/RolloutV1/components/RolloutView.vue"),
+ import("@/components/RolloutV1/components/Rollout/RolloutView.vue"),
props: true,
},
{
path: "stages/:stageId/tasks/:taskId",
name: PROJECT_V1_ROUTE_PLAN_ROLLOUT_TASK,
component: () =>
- import("@/components/RolloutV1/components/TaskView.vue"),
+ import("@/components/RolloutV1/components/Task/TaskView.vue"),
props: true,
},
],
diff --git a/frontend/src/utils/v1/issue/rollout.ts b/frontend/src/utils/v1/issue/rollout.ts
index aaa0dde022..defffc545e 100644
--- a/frontend/src/utils/v1/issue/rollout.ts
+++ b/frontend/src/utils/v1/issue/rollout.ts
@@ -1,5 +1,5 @@
import { useI18n } from "vue-i18n";
-import { TASK_STATUS_FILTERS } from "@/components/Plan/constants/task";
+import { TASK_STATUS_FILTERS } from "@/components/RolloutV1/constants/task";
import { useDatabaseV1Store } from "@/store";
import { isValidDatabaseName, UNKNOWN_ID, unknownDatabase } from "@/types";
import type { Plan } from "@/types/proto-es/v1/plan_service_pb";
diff --git a/frontend/src/views/project/RolloutLayout.vue b/frontend/src/views/project/RolloutLayout.vue
index 852dfa4dfe..e89bde10cc 100644
--- a/frontend/src/views/project/RolloutLayout.vue
+++ b/frontend/src/views/project/RolloutLayout.vue
@@ -39,7 +39,7 @@ import {
import RefreshIndicator from "@/components/Plan/components/RefreshIndicator.vue";
import { provideSidebarContext } from "@/components/Plan/logic/sidebar";
import PollerProvider from "@/components/Plan/PollerProvider.vue";
-import RolloutBreadcrumb from "@/components/RolloutV1/components/RolloutBreadcrumb.vue";
+import RolloutBreadcrumb from "@/components/RolloutV1/components/Rollout/RolloutBreadcrumb.vue";
import { useBodyLayoutContext } from "@/layouts/common";
import { usePolicyV1Store } from "@/store";
import { PolicyType } from "@/types/proto-es/v1/org_policy_service_pb";