Skip to content

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

chore: rollout view (#16673)

boojackf923f6523082
diff --git a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentList.vue b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentList.vue
index 02e12c713c..f020ffd8fc 100644
--- a/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentList.vue
+++ b/frontend/src/components/IssueV1/components/IssueCommentSection/IssueCommentList.vue
@@ -95,8 +95,9 @@
@change="(val: string) => (state.newComment = val)"
@submit="doCreateComment(state.newComment)"
/>
- <div class="my-4 flex items-center justify-between">
+ <div class="my-3 flex items-center justify-between">
<NButton
+ size="small"
:disabled="state.newComment.length == 0"
@click.prevent="doCreateComment(state.newComment)"
>
@@ -137,6 +138,10 @@ import {
} from "./IssueCommentView";
import IssueCreatedComment from "./IssueCommentView/IssueCreatedComment.vue";
+const props = defineProps<{
+ commentFilter?: (comment: ComposedIssueComment) => boolean;
+}>();
+
interface LocalState {
editCommentMode: boolean;
activeComment?: ComposedIssueComment;
@@ -203,7 +208,9 @@ const issueComments = computed((): DistinctIssueComment[] => {
distinctIssueComments.push({ comment, similar: [] });
}
}
- return distinctIssueComments;
+ return props.commentFilter
+ ? distinctIssueComments.filter((item) => props.commentFilter!(item.comment))
+ : distinctIssueComments;
});
const allowCreateComment = computed(() => {
diff --git a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
index f1328cc25c..0311bd1294 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
@@ -68,14 +68,18 @@
issueId: extractIssueUID(issue.name),
},
}"
- class="text-sm font-normal text-blue-700 hover:underline"
+ class="text-sm font-normal text-gray-500 hover:text-blue-600 hover:underline flex items-center"
+ target="_blank"
>
- {{ "Experimental issue page" }}
+ <span>{{ $t("issue.expermental-page.self") }}</span>
+ <ExternalLinkIcon class="inline w-4 h-4 ml-1" />
</router-link>
</div>
</template>
<script lang="ts" setup>
+import { create } from "@bufbuild/protobuf";
+import { ExternalLinkIcon } from "lucide-vue-next";
import { NTooltip } from "naive-ui";
import { computed, ref } from "vue";
import { useI18n } from "vue-i18n";
@@ -84,16 +88,18 @@ import { targetsForSpec } from "@/components/Plan";
import { GhostSection } from "@/components/Plan/components/Configuration";
import { provideGhostSettingContext } from "@/components/Plan/components/Configuration/GhostSection/context";
import { ApprovalFlowSection } from "@/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection";
-import { create } from "@bufbuild/protobuf";
import { issueServiceClientConnect } from "@/grpcweb";
-import { UpdateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { convertNewIssueToOld, convertOldIssueToNew } from "@/utils/v1/issue-conversions";
import { PROJECT_V1_ROUTE_ISSUE_DETAIL_V1 } from "@/router/dashboard/projectV1";
import { pushNotification, useCurrentProjectV1 } from "@/store";
+import { UpdateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import { Issue, Issue_Type } from "@/types/proto/v1/issue_service";
import type { Plan } from "@/types/proto/v1/plan_service";
import { extractIssueUID, extractProjectResourceName, isDev } from "@/utils";
+import {
+ convertNewIssueToOld,
+ convertOldIssueToNew,
+} from "@/utils/v1/issue-conversions";
import { specForTask, useIssueContext } from "../../logic";
import IssueLabels from "./IssueLabels.vue";
import PreBackupSection from "./PreBackupSection";
diff --git a/frontend/src/components/Plan/PlanDetailPage.vue b/frontend/src/components/Plan/PlanDetailPage.vue
index c58345bc12..d3a1011594 100644
--- a/frontend/src/components/Plan/PlanDetailPage.vue
+++ b/frontend/src/components/Plan/PlanDetailPage.vue
@@ -27,6 +27,7 @@
<SpecsView v-else-if="tabKey === TabKey.Specifications" />
<ChecksView v-else-if="tabKey === TabKey.Checks" />
<IssueReviewView v-else-if="tabKey === TabKey.Review" />
+ <RolloutView v-else-if="tabKey === TabKey.Rollout" />
<div class="pt-4 mx-auto max-w-2xl" v-else>
<p>Unknown view for {{ tabKey }}</p>
</div>
@@ -46,11 +47,18 @@ import {
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,
} from "@/router/dashboard/projectV1";
-import { extractIssueUID, extractPlanUID } from "@/utils";
+import {
+ extractIssueUID,
+ extractPlanUID,
+ extractRolloutUID,
+ isNullOrUndefined,
+} from "@/utils";
import { ChecksView, HeaderSection, Overview } from "./components";
import CurrentSpecSelector from "./components/CurrentSpecSelector.vue";
import { IssueReviewView } from "./components/IssueReviewView";
+import { RolloutView } from "./components/RolloutView";
import SpecsView from "./components/SpecsView.vue";
import { useSpecsValidation } from "./components/common";
import { gotoSpec } from "./components/common/utils";
@@ -61,6 +69,7 @@ enum TabKey {
Specifications = "specifications",
Checks = "checks",
Review = "review",
+ Rollout = "rollout",
}
const { t } = useI18n();
@@ -89,17 +98,29 @@ const tabKey = computed(() => {
return TabKey.Checks;
} else if (routeName === PROJECT_V1_ROUTE_ISSUE_DETAIL_V1) {
return TabKey.Review;
+ } else if (routeName === PROJECT_V1_ROUTE_ROLLOUT_DETAIL) {
+ return TabKey.Rollout;
}
+ // Fallback to Overview if no specific tab is matched.
return TabKey.Overview;
});
const availableTabs = computed<TabKey[]>(() => {
const tabs: TabKey[] = [TabKey.Overview, TabKey.Specifications];
if (!isCreating.value) {
- tabs.push(TabKey.Checks);
+ if (
+ plan.value.specs.some(
+ (spec) => !isNullOrUndefined(spec.changeDatabaseConfig)
+ )
+ ) {
+ tabs.push(TabKey.Checks);
+ }
if (plan.value.issue) {
tabs.push(TabKey.Review);
}
+ if (plan.value.rollout) {
+ tabs.push(TabKey.Rollout);
+ }
}
return tabs;
});
@@ -133,6 +154,8 @@ const tabRender = (tab: TabKey) => {
);
case TabKey.Review:
return t("plan.navigator.review");
+ case TabKey.Rollout:
+ return t("plan.navigator.rollout");
default:
// Fallback to raw tab name.
return tab;
@@ -148,6 +171,9 @@ const handleTabChange = (tab: TabKey) => {
if (plan.value.issue) {
params.issueId = extractIssueUID(plan.value.issue);
}
+ if (plan.value.rollout) {
+ params.rolloutId = extractRolloutUID(plan.value.rollout);
+ }
}
if (tab === TabKey.Overview) {
@@ -180,6 +206,12 @@ const handleTabChange = (tab: TabKey) => {
params: params,
query: route.query,
});
+ } else if (tab === TabKey.Rollout) {
+ router.push({
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
+ params: params,
+ query: route.query,
+ });
}
};
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue
index d149fd5a07..e4fea9f0b1 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/Actions.vue
@@ -1,15 +1,20 @@
<template>
<CreateButton v-if="isCreating" />
<template v-else>
- <CreateIssueButton v-if="!plan.issue" />
- <template v-else-if="plan.issue">
- <UnifiedActionGroup
- :primary-action="primaryAction"
- :secondary-actions="secondaryActions"
- @perform-action="handlePerformAction"
+ <!-- Show unified actions for all plan states -->
+ <UnifiedActionGroup
+ :primary-action="primaryAction"
+ :secondary-actions="secondaryActions"
+ @perform-action="handlePerformAction"
+ />
+
+ <!-- Panels -->
+
+ <template v-if="issue">
+ <IssueCreationActionPanel
+ :action="pendingIssueCreationAction"
+ @close="pendingIssueCreationAction = undefined"
/>
-
- <!-- Panels -->
<IssueReviewActionPanel
:action="pendingReviewAction"
@close="pendingReviewAction = undefined"
@@ -19,6 +24,10 @@
@close="pendingStatusAction = undefined"
/>
</template>
+ <RolloutActionPanel
+ :action="pendingRolloutAction"
+ @close="pendingRolloutAction = undefined"
+ />
</template>
</template>
@@ -38,8 +47,13 @@ import {
Issue_Approver_Status,
} from "@/types/proto/v1/issue_service";
import { isUserIncludedInList, hasProjectPermissionV2 } from "@/utils";
-import { CreateButton, CreateIssueButton } from "./create";
-import { IssueReviewActionPanel, IssueStatusActionPanel } from "./panels";
+import { CreateButton } from "./create";
+import {
+ IssueReviewActionPanel,
+ IssueStatusActionPanel,
+ RolloutActionPanel,
+ IssueCreationActionPanel,
+} from "./panels";
import {
UnifiedActionGroup,
type ActionConfig,
@@ -58,12 +72,26 @@ const reviewContext = provideIssueReviewContext(issue);
// Panel visibility state
const pendingReviewAction = ref<IssueReviewAction | undefined>(undefined);
const pendingStatusAction = ref<IssueStatusAction | undefined>(undefined);
+const pendingRolloutAction = ref<"CREATE" | undefined>(undefined);
+const pendingIssueCreationAction = ref<"CREATE" | undefined>(undefined);
// Compute available actions based on issue state and user permissions
const availableActions = computed(() => {
const actions: UnifiedAction[] = [];
- if (!issue?.value || isCreating.value) return actions;
+ if (isCreating.value) return actions;
+
+ // If no issue exists, show create issue action
+ if (!issue?.value) {
+ const canCreateIssue = hasProjectPermissionV2(
+ project.value,
+ "bb.plans.create"
+ );
+ if (canCreateIssue) {
+ actions.push("CREATE_ISSUE");
+ }
+ return actions;
+ }
const issueValue = issue.value;
const isCanceled = issueValue.status === IssueStatus.CANCELED;
@@ -139,12 +167,33 @@ const availableActions = computed(() => {
actions.push("CLOSE");
}
+ // Check for rollout creation action
+ if (reviewContext.done.value && !plan.value.rollout) {
+ const canCreateRollout = hasProjectPermissionV2(
+ project.value,
+ "bb.rollouts.create"
+ );
+ if (canCreateRollout) {
+ actions.push("CREATE_ROLLOUT");
+ }
+ }
+
return actions;
});
const primaryAction = computed((): ActionConfig | undefined => {
const actions = availableActions.value;
+ // CREATE_ISSUE is the highest priority when no issue exists
+ if (actions.includes("CREATE_ISSUE")) {
+ return { action: "CREATE_ISSUE" };
+ }
+
+ // CREATE_ROLLOUT is the highest priority when available
+ if (actions.includes("CREATE_ROLLOUT")) {
+ return { action: "CREATE_ROLLOUT" };
+ }
+
// REOPEN is primary when issue is closed
if (actions.includes("REOPEN")) {
return { action: "REOPEN" };
@@ -187,6 +236,12 @@ const handlePerformAction = (action: UnifiedAction) => {
case "REOPEN":
pendingStatusAction.value = action as IssueStatusAction;
break;
+ case "CREATE_ROLLOUT":
+ pendingRolloutAction.value = "CREATE";
+ break;
+ case "CREATE_ISSUE":
+ pendingIssueCreationAction.value = "CREATE";
+ break;
}
};
</script>
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue
new file mode 100644
index 0000000000..707b74ccb3
--- /dev/null
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue
@@ -0,0 +1,260 @@
+<template>
+ <CommonDrawer
+ :show="action !== undefined"
+ :title="title"
+ :loading="state.loading"
+ @show="resetState"
+ @close="$emit('close')"
+ >
+ <template #default>
+ <div v-if="action" class="flex flex-col gap-y-4 px-1">
+ <div class="flex flex-col gap-y-1">
+ <div class="font-medium text-control">Plan</div>
+ <div class="textinfolabel">
+ {{ plan.title }}
+ </div>
+ </div>
+
+ <div class="flex flex-col gap-y-1">
+ <div class="font-medium text-control">
+ {{ $t("common.description") }}
+ </div>
+ <div class="textinfolabel">
+ {{ plan.description || "No description" }}
+ </div>
+ </div>
+
+ <div class="flex flex-col gap-y-1">
+ <p class="font-medium text-control">
+ {{ $t("common.comment") }}
+ </p>
+ <NInput
+ v-model:value="comment"
+ type="textarea"
+ :placeholder="$t('issue.leave-a-comment')"
+ :autosize="{
+ minRows: 3,
+ maxRows: 10,
+ }"
+ />
+ </div>
+ </div>
+ </template>
+ <template #footer>
+ <div
+ v-if="action"
+ class="w-full flex flex-row justify-end items-center gap-2"
+ >
+ <div class="flex justify-end gap-x-3">
+ <NButton @click="$emit('close')">
+ {{ $t("common.cancel") }}
+ </NButton>
+
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ type="primary"
+ :disabled="confirmErrors.length > 0"
+ @click="handleConfirm"
+ >
+ {{ $t("common.create") }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
+ </div>
+ </div>
+ </template>
+ </CommonDrawer>
+</template>
+
+<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
+import { uniqBy } from "lodash-es";
+import { NButton, NInput, NTooltip, useDialog } from "naive-ui";
+import { computed, nextTick, reactive, ref, watchEffect } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
+import CommonDrawer from "@/components/IssueV1/components/Panel/CommonDrawer.vue";
+import { ErrorList } from "@/components/Plan/components/common";
+import { planCheckRunListForSpec, usePlanContext } from "@/components/Plan/logic";
+import { planCheckRunSummaryForCheckRunList } from "@/components/PlanCheckRun/common";
+import { issueServiceClientConnect } from "@/grpcweb";
+import { PROJECT_V1_ROUTE_ISSUE_DETAIL_V1 } from "@/router/dashboard/projectV1";
+import { useCurrentProjectV1, useCurrentUserV1, usePolicyV1Store } from "@/store";
+import { emptyIssue } from "@/types";
+import { CreateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
+import { Issue, IssueStatus, Issue_Type } from "@/types/proto/v1/issue_service";
+import { PolicyType } from "@/types/proto/v1/org_policy_service";
+import { PlanCheckRun_Result_Status } from "@/types/proto/v1/plan_service";
+import {
+ extractIssueUID,
+ extractProjectResourceName,
+ hasProjectPermissionV2,
+} from "@/utils";
+import { convertNewIssueToOld, convertOldIssueToNew } from "@/utils/v1/issue-conversions";
+
+type IssueCreationAction = "CREATE";
+
+type LocalState = {
+ loading: boolean;
+};
+
+const props = defineProps<{
+ action?: IssueCreationAction;
+}>();
+const emit = defineEmits<{
+ (event: "close"): void;
+}>();
+
+const { t } = useI18n();
+const router = useRouter();
+const dialog = useDialog();
+const state = reactive<LocalState>({
+ loading: false,
+});
+const { project } = useCurrentProjectV1();
+const currentUser = useCurrentUserV1();
+const policyV1Store = usePolicyV1Store();
+const { plan, planCheckRunList } = usePlanContext();
+const comment = ref("");
+const restrictIssueCreationForSqlReviewPolicy = ref(false);
+
+const title = computed(() => {
+ switch (props.action) {
+ case "CREATE":
+ return t("plan.ready-for-review");
+ }
+ return ""; // Make linter happy
+});
+
+const planCheckStatus = computed((): PlanCheckRun_Result_Status => {
+ const planCheckList = uniqBy(
+ plan.value.specs.flatMap((spec) =>
+ planCheckRunListForSpec(planCheckRunList.value, spec)
+ ),
+ (checkRun) => checkRun.name
+ );
+ const summary = planCheckRunSummaryForCheckRunList(planCheckList);
+ if (summary.errorCount > 0) {
+ return PlanCheckRun_Result_Status.ERROR;
+ }
+ if (summary.warnCount > 0) {
+ return PlanCheckRun_Result_Status.WARNING;
+ }
+ return PlanCheckRun_Result_Status.SUCCESS;
+});
+
+const confirmErrors = computed(() => {
+ const errors: string[] = [];
+
+ if (!hasProjectPermissionV2(project.value, "bb.plans.create")) {
+ errors.push(t("common.missing-required-permission"));
+ }
+
+ if (!plan.value.title.trim()) {
+ errors.push("Missing issue title");
+ }
+
+ if (
+ planCheckStatus.value === PlanCheckRun_Result_Status.ERROR &&
+ restrictIssueCreationForSqlReviewPolicy.value
+ ) {
+ errors.push(
+ t(
+ "custom-approval.issue-review.disallow-approve-reason.some-task-checks-didnt-pass"
+ )
+ );
+ }
+
+ return errors;
+});
+
+watchEffect(async () => {
+ const workspaceLevelPolicy =
+ await policyV1Store.getOrFetchPolicyByParentAndType({
+ parentPath: "",
+ policyType: PolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW,
+ });
+ if (workspaceLevelPolicy?.restrictIssueCreationForSqlReviewPolicy?.disallow) {
+ restrictIssueCreationForSqlReviewPolicy.value = true;
+ return;
+ }
+
+ const projectLevelPolicy =
+ await policyV1Store.getOrFetchPolicyByParentAndType({
+ parentPath: project.value.name,
+ policyType: PolicyType.RESTRICT_ISSUE_CREATION_FOR_SQL_REVIEW,
+ });
+ if (projectLevelPolicy?.restrictIssueCreationForSqlReviewPolicy?.disallow) {
+ restrictIssueCreationForSqlReviewPolicy.value = true;
+ return;
+ }
+
+ // Fall back to default value.
+ restrictIssueCreationForSqlReviewPolicy.value = false;
+});
+
+const handleConfirm = async () => {
+ const { action } = props;
+ if (!action) return;
+
+ dialog.info({
+ title: t("common.confirm"),
+ content: t("issue.this-plan-will-be-converted-to-a-new-issue"),
+ negativeText: t("common.cancel"),
+ positiveText: t("common.create"),
+ onPositiveClick: async () => {
+ await doCreateIssue();
+ },
+ });
+};
+
+const doCreateIssue = async () => {
+ state.loading = true;
+
+ try {
+ const issueToCreate = {
+ ...Issue.fromPartial(buildIssue()),
+ rollout: "",
+ plan: plan.value.name,
+ };
+ const newIssue = convertOldIssueToNew(issueToCreate);
+ const request = create(CreateIssueRequestSchema, {
+ parent: project.value.name,
+ issue: newIssue,
+ });
+ const newCreatedIssue = await issueServiceClientConnect.createIssue(request);
+ const createdIssue = convertNewIssueToOld(newCreatedIssue);
+
+ nextTick(() => {
+ router.push({
+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
+ params: {
+ projectId: extractProjectResourceName(plan.value.name),
+ issueId: extractIssueUID(createdIssue.name),
+ },
+ });
+ });
+ } finally {
+ state.loading = false;
+ emit("close");
+ }
+};
+
+const buildIssue = () => {
+ const issue = emptyIssue();
+ issue.creator = `users/${currentUser.value.email}`;
+ issue.title = plan.value.title;
+ issue.description = plan.value.description;
+ issue.status = IssueStatus.OPEN;
+ issue.type = Issue_Type.DATABASE_CHANGE;
+ return issue;
+};
+
+const resetState = () => {
+ comment.value = "";
+};
+</script>
\ No newline at end of file
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/panels/RolloutActionPanel.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/RolloutActionPanel.vue
new file mode 100644
index 0000000000..d0e409754b
--- /dev/null
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/RolloutActionPanel.vue
@@ -0,0 +1,178 @@
+<template>
+ <CommonDrawer
+ :show="action !== undefined"
+ :title="title"
+ :loading="state.loading"
+ @show="resetState"
+ @close="$emit('close')"
+ >
+ <template #default>
+ <div v-if="action" class="flex flex-col gap-y-4 px-1">
+ <div class="flex flex-col gap-y-1">
+ <div class="font-medium text-control">Plan</div>
+ <div class="textinfolabel">
+ {{ plan.title }}
+ </div>
+ </div>
+
+ <div class="flex flex-col gap-y-1">
+ <div class="font-medium text-control">
+ {{ $t("common.description") }}
+ </div>
+ <div class="textinfolabel">
+ {{ plan.description || "No description" }}
+ </div>
+ </div>
+
+ <div class="flex flex-col gap-y-1">
+ <p class="font-medium text-control">
+ {{ $t("common.comment") }}
+ </p>
+ <NInput
+ v-model:value="comment"
+ type="textarea"
+ :placeholder="$t('issue.leave-a-comment')"
+ :autosize="{
+ minRows: 3,
+ maxRows: 10,
+ }"
+ />
+ </div>
+ </div>
+ </template>
+ <template #footer>
+ <div
+ v-if="action"
+ class="w-full flex flex-row justify-end items-center gap-2"
+ >
+ <div class="flex justify-end gap-x-3">
+ <NButton @click="$emit('close')">
+ {{ $t("common.cancel") }}
+ </NButton>
+
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ type="primary"
+ :disabled="confirmErrors.length > 0"
+ @click="handleConfirm"
+ >
+ {{ $t("common.create") }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
+ </div>
+ </div>
+ </template>
+ </CommonDrawer>
+</template>
+
+<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
+import { NButton, NInput, NTooltip } from "naive-ui";
+import { computed, nextTick, reactive, ref } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
+import CommonDrawer from "@/components/IssueV1/components/Panel/CommonDrawer.vue";
+import { ErrorList } from "@/components/Plan/components/common";
+import { usePlanContext, useIssueReviewContext } from "@/components/Plan/logic";
+import { rolloutServiceClientConnect } from "@/grpcweb";
+import { PROJECT_V1_ROUTE_ROLLOUT_DETAIL } from "@/router/dashboard/projectV1";
+import { useCurrentProjectV1 } from "@/store";
+import { CreateRolloutRequestSchema } from "@/types/proto-es/v1/rollout_service_pb";
+import {
+ extractProjectResourceName,
+ extractRolloutUID,
+ hasProjectPermissionV2,
+} from "@/utils";
+
+type RolloutAction = "CREATE";
+
+type LocalState = {
+ loading: boolean;
+};
+
+const props = defineProps<{
+ action?: RolloutAction;
+}>();
+const emit = defineEmits<{
+ (event: "close"): void;
+}>();
+
+const { t } = useI18n();
+const router = useRouter();
+const state = reactive<LocalState>({
+ loading: false,
+});
+const { project } = useCurrentProjectV1();
+const { plan } = usePlanContext();
+const reviewContext = useIssueReviewContext();
+const comment = ref("");
+
+const title = computed(() => {
+ switch (props.action) {
+ case "CREATE":
+ return t("common.create") + " " + t("common.rollout");
+ }
+ return ""; // Make linter happy
+});
+
+const confirmErrors = computed(() => {
+ const errors: string[] = [];
+
+ if (!hasProjectPermissionV2(project.value, "bb.rollouts.create")) {
+ errors.push(t("common.missing-required-permission"));
+ }
+
+ if (plan.value.rollout) {
+ errors.push("Rollout already exists for this plan");
+ }
+
+ if (!reviewContext.done.value) {
+ errors.push("Issue must pass approval review before creating rollout");
+ }
+
+ return errors;
+});
+
+const handleConfirm = async () => {
+ const { action } = props;
+ if (!action) return;
+ state.loading = true;
+
+ try {
+ if (action === "CREATE") {
+ const request = create(CreateRolloutRequestSchema, {
+ parent: project.value.name,
+ rollout: {
+ plan: plan.value.name,
+ title: plan.value.title,
+ },
+ });
+
+ const createdRollout =
+ await rolloutServiceClientConnect.createRollout(request);
+
+ nextTick(() => {
+ router.push({
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
+ params: {
+ projectId: extractProjectResourceName(plan.value.name),
+ rolloutId: extractRolloutUID(createdRollout.name),
+ },
+ });
+ });
+ }
+ } finally {
+ state.loading = false;
+ emit("close");
+ }
+};
+
+const resetState = () => {
+ comment.value = "";
+};
+</script>
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/panels/index.ts b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/index.ts
index 0b2babd0c6..a58b9979e6 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/panels/index.ts
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/index.ts
@@ -1,2 +1,4 @@
export { default as IssueReviewActionPanel } from "./IssueReviewActionPanel.vue";
-export { default as IssueStatusActionPanel } from "./IssueStatusActionPanel.vue";
\ No newline at end of file
+export { default as IssueStatusActionPanel } from "./IssueStatusActionPanel.vue";
+export { default as RolloutActionPanel } from "./RolloutActionPanel.vue";
+export { default as IssueCreationActionPanel } from "./IssueCreationActionPanel.vue";
\ No newline at end of file
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/rollout/CreateRolloutButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/rollout/CreateRolloutButton.vue
new file mode 100644
index 0000000000..0a8a809372
--- /dev/null
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/rollout/CreateRolloutButton.vue
@@ -0,0 +1,60 @@
+<template>
+ <NTooltip :disabled="errors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ type="primary"
+ size="medium"
+ tag="div"
+ :disabled="errors.length > 0"
+ @click="handleCreateRollout"
+ >
+ {{ $t("common.create") }} {{ $t("common.rollout") }}
+ </NButton>
+ </template>
+
+ <template #default>
+ <ErrorList :errors="errors" />
+ </template>
+ </NTooltip>
+</template>
+
+<script setup lang="ts">
+import { NTooltip, NButton } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import { ErrorList } from "@/components/Plan/components/common";
+import { usePlanContext, useIssueReviewContext } from "@/components/Plan/logic";
+import { useCurrentProjectV1 } from "@/store";
+import { hasProjectPermissionV2 } from "@/utils";
+
+const emit = defineEmits<{
+ (event: "create-rollout"): void;
+}>();
+
+const { t } = useI18n();
+const { project } = useCurrentProjectV1();
+const { plan } = usePlanContext();
+const reviewContext = useIssueReviewContext();
+
+const errors = computed(() => {
+ const errorList: string[] = [];
+
+ if (!hasProjectPermissionV2(project.value, "bb.rollouts.create")) {
+ errorList.push(t("common.missing-required-permission"));
+ }
+
+ if (plan.value.rollout) {
+ errorList.push("Rollout already exists for this plan");
+ }
+
+ if (!reviewContext.done.value) {
+ errorList.push("Issue must pass approval review before creating rollout");
+ }
+
+ return errorList;
+});
+
+const handleCreateRollout = () => {
+ emit("create-rollout");
+};
+</script>
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/rollout/index.ts b/frontend/src/components/Plan/components/HeaderSection/Actions/rollout/index.ts
new file mode 100644
index 0000000000..1180545ff4
--- /dev/null
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/rollout/index.ts
@@ -0,0 +1 @@
+export { default as CreateRolloutButton } from "./CreateRolloutButton.vue";
\ No newline at end of file
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionButton.vue
index e535a74bf4..aee8fc4529 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionButton.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionButton.vue
@@ -38,12 +38,18 @@ const actionDisplayName = (action: UnifiedAction): string => {
return t("issue.batch-transition.close");
case "REOPEN":
return t("issue.batch-transition.reopen");
+ case "CREATE_ROLLOUT":
+ return t("common.create") + " " + t("common.rollout");
+ case "CREATE_ISSUE":
+ return t("common.create") + " " + t("common.issue");
}
};
const actionButtonProps = (action: UnifiedAction) => {
switch (action) {
case "APPROVE":
+ case "CREATE_ROLLOUT":
+ case "CREATE_ISSUE":
return {
type: "primary" as const,
};
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionGroup.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionGroup.vue
index 7b1121adb5..b5f9e898ad 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionGroup.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/unified/UnifiedActionGroup.vue
@@ -57,6 +57,10 @@ const actionDisplayName = (action: UnifiedAction): string => {
return t("issue.batch-transition.close");
case "REOPEN":
return t("issue.batch-transition.reopen");
+ case "CREATE_ROLLOUT":
+ return t("common.create") + " " + t("common.rollout");
+ case "CREATE_ISSUE":
+ return t("common.create") + " " + t("common.issue");
}
};
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/unified/types.ts b/frontend/src/components/Plan/components/HeaderSection/Actions/unified/types.ts
index a68c93616b..0118877487 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/unified/types.ts
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/unified/types.ts
@@ -2,7 +2,11 @@ export type IssueReviewAction = "APPROVE" | "REJECT" | "RE_REQUEST";
export type IssueStatusAction = "CLOSE" | "REOPEN";
-export type UnifiedAction = IssueReviewAction | IssueStatusAction;
+export type RolloutAction = "CREATE_ROLLOUT";
+
+export type IssueCreationAction = "CREATE_ISSUE";
+
+export type UnifiedAction = IssueReviewAction | IssueStatusAction | RolloutAction | IssueCreationAction;
export interface ActionConfig {
action: UnifiedAction;
diff --git a/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue b/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue
index c14b79c073..83690e9742 100644
--- a/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/HeaderSection.vue
@@ -1,6 +1,6 @@
<template>
<div
- class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 py-2 px-4"
+ class="flex flex-row items-center justify-between gap-2 py-2 px-2 sm:px-4"
>
<TitleInput />
<div class="flex flex-row items-center justify-end">
diff --git a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue
index bd63ea254e..9250d86f13 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/ActivitySection/ActivitySection.vue
@@ -5,10 +5,24 @@
{{ $t("common.activity") }}
</h3>
</div>
- <IssueCommentList />
+ <IssueCommentList :comment-filter="commentFilter" />
</div>
</template>
<script setup lang="ts">
+import { includes } from "lodash-es";
import IssueCommentList from "@/components/IssueV1/components/IssueCommentSection/IssueCommentList.vue";
+import { IssueCommentType, type ComposedIssueComment } from "@/store";
+
+// Only show issue related comments.
+const commentFilter = (comment: ComposedIssueComment): boolean => {
+ return includes(
+ [
+ IssueCommentType.USER_COMMENT,
+ IssueCommentType.APPROVAL,
+ IssueCommentType.ISSUE_UPDATE,
+ ],
+ comment.type
+ );
+};
</script>
diff --git a/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue b/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue
index 1e78c9a2e0..cd6e45206b 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/IssueReviewView.vue
@@ -1,11 +1,11 @@
<template>
- <div class="flex-1 flex">
+ <div class="flex-1 flex w-full">
<!-- Left Panel - Activity -->
- <div class="flex-1">
+ <div class="flex-1 shrink">
<ActivitySection />
</div>
- <div class="w-80 flex border-l">
+ <div class="w-80 shrink-0 flex flex-col border-l">
<Sidebar />
</div>
</div>
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/IssueStatusSection.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/IssueStatusSection.vue
new file mode 100644
index 0000000000..82d0119aca
--- /dev/null
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/IssueStatusSection.vue
@@ -0,0 +1,103 @@
+<template>
+ <div class="w-full flex flex-row justify-between items-center gap-2">
+ <h3 class="textlabel">
+ {{ $t("common.status") }}
+ </h3>
+ <NTag :type="issueStatusTagType" size="medium" round>
+ {{ issueStatusText }}
+ </NTag>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { NTag } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import {
+ Issue,
+ IssueStatus,
+ Issue_Approver_Status,
+} from "@/types/proto/v1/issue_service";
+import { useIssueReviewContext } from "../../../logic/";
+
+const props = defineProps<{
+ issue: Issue;
+}>();
+
+const { t } = useI18n();
+const reviewContext = useIssueReviewContext();
+
+const issueStatusText = computed(() => {
+ const issueValue = props.issue;
+
+ switch (issueValue.status) {
+ case IssueStatus.OPEN:
+ // Show review status instead of just "Open"
+ if (!issueValue.approvalFindingDone) {
+ return t("issue.table.open");
+ }
+
+ const reviewStatus = reviewContext.done.value
+ ? Issue_Approver_Status.APPROVED
+ : issueValue.approvers.some(
+ (app) => app.status === Issue_Approver_Status.REJECTED
+ )
+ ? Issue_Approver_Status.REJECTED
+ : Issue_Approver_Status.PENDING;
+
+ switch (reviewStatus) {
+ case Issue_Approver_Status.APPROVED:
+ return t("issue.review.approved");
+ case Issue_Approver_Status.REJECTED:
+ return t("issue.review.rejected");
+ case Issue_Approver_Status.PENDING:
+ return t("issue.review.under-review");
+ default:
+ return t("issue.table.open");
+ }
+ case IssueStatus.DONE:
+ return t("common.done");
+ case IssueStatus.CANCELED:
+ return t("common.canceled");
+ default:
+ return "";
+ }
+});
+
+const issueStatusTagType = computed(() => {
+ const issueValue = props.issue;
+
+ switch (issueValue.status) {
+ case IssueStatus.OPEN:
+ // Show different colors based on review status
+ if (!issueValue.approvalFindingDone) {
+ return "info";
+ }
+
+ const reviewStatus = reviewContext.done.value
+ ? Issue_Approver_Status.APPROVED
+ : issueValue.approvers.some(
+ (app) => app.status === Issue_Approver_Status.REJECTED
+ )
+ ? Issue_Approver_Status.REJECTED
+ : Issue_Approver_Status.PENDING;
+
+ switch (reviewStatus) {
+ case Issue_Approver_Status.APPROVED:
+ return "success";
+ case Issue_Approver_Status.REJECTED:
+ return "error";
+ case Issue_Approver_Status.PENDING:
+ return "warning";
+ default:
+ return "info";
+ }
+ case IssueStatus.DONE:
+ return "success";
+ case IssueStatus.CANCELED:
+ return "default";
+ default:
+ return "default";
+ }
+});
+</script>
diff --git a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue
index e882f3330b..0816211dbe 100644
--- a/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue
+++ b/frontend/src/components/Plan/components/IssueReviewView/Sidebar/Sidebar.vue
@@ -1,5 +1,7 @@
<template>
<div class="w-full flex flex-col p-4 gap-4">
+ <IssueStatusSection :issue="issue" />
+
<ApprovalFlowSection :issue="issue" />
<IssueLabels
@@ -28,25 +30,26 @@
</template>
<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
import { isEqual } from "lodash-es";
import { NInput } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import IssueLabels from "@/components/IssueV1/components/Sidebar/IssueLabels.vue";
-import { create } from "@bufbuild/protobuf";
import { issueServiceClientConnect } from "@/grpcweb";
-import { UpdateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { convertOldIssueToNew } from "@/utils/v1/issue-conversions";
import {
extractUserId,
pushNotification,
useCurrentProjectV1,
useCurrentUserV1,
} from "@/store";
+import { UpdateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
import { Issue, IssueStatus } from "@/types/proto/v1/issue_service";
import { hasProjectPermissionV2 } from "@/utils";
+import { convertOldIssueToNew } from "@/utils/v1/issue-conversions";
import { usePlanContextWithIssue } from "../../../logic/context";
import ApprovalFlowSection from "./ApprovalFlowSection/ApprovalFlowSection.vue";
+import IssueStatusSection from "./IssueStatusSection.vue";
const { t } = useI18n();
const { issue } = usePlanContextWithIssue();
diff --git a/frontend/src/components/Plan/components/RolloutView/RolloutView.vue b/frontend/src/components/Plan/components/RolloutView/RolloutView.vue
new file mode 100644
index 0000000000..ba42aba43a
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/RolloutView.vue
@@ -0,0 +1,60 @@
+<template>
+ <div class="w-full h-full flex flex-col">
+ <div class="flex justify-between items-center gap-2 px-4 pt-4">
+ <!-- Task Filter -->
+ <TaskFilter
+ v-model:task-status-list="taskStatusFilter"
+ :rollout="rollout"
+ />
+ <!-- View Toggle -->
+ <NButtonGroup size="small">
+ <NButton
+ :type="!isTableView ? 'primary' : 'tertiary'"
+ @click="isTableView = false"
+ >
+ <template #icon>
+ <Columns3Icon :size="16" />
+ </template>
+ </NButton>
+ <NButton
+ :type="isTableView ? 'primary' : 'tertiary'"
+ @click="isTableView = true"
+ >
+ <template #icon>
+ <ListIcon :size="16" />
+ </template>
+ </NButton>
+ </NButtonGroup>
+ </div>
+
+ <!-- Content area -->
+ <div class="flex-1 overflow-hidden">
+ <StageView
+ v-if="!isTableView"
+ :rollout="rollout"
+ :task-status-filter="taskStatusFilter"
+ />
+ <TaskTable
+ v-else
+ :rollout="rollout"
+ :task-status-filter="taskStatusFilter"
+ />
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { ListIcon, Columns3Icon } from "lucide-vue-next";
+import { NButton, NButtonGroup } from "naive-ui";
+import { ref } from "vue";
+import { Task_Status } from "@/types/proto/v1/rollout_service";
+import { usePlanContextWithRollout } from "../../logic";
+import StageView from "./StageView.vue";
+import TaskFilter from "./TaskFilter.vue";
+import TaskTable from "./TaskTable.vue";
+
+const { rollout } = usePlanContextWithRollout();
+
+const isTableView = ref(false);
+const taskStatusFilter = ref<Task_Status[]>([]);
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/StageCard.vue b/frontend/src/components/Plan/components/RolloutView/StageCard.vue
new file mode 100644
index 0000000000..091f9c460a
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/StageCard.vue
@@ -0,0 +1,90 @@
+<template>
+ <div class="!w-80 bg-white z-[1] rounded-lg p-1 hover:shadow">
+ <div
+ class="w-full flex flex-row justify-between items-center gap-2 px-2 pt-2 pb-1"
+ >
+ <p class="textlabel">
+ {{ environmentStore.getEnvironmentByName(stage.environment).title }}
+ </p>
+ </div>
+ <NVirtualList
+ style="max-height: 100vh"
+ :items="filteredTasks"
+ :item-size="56"
+ >
+ <template #default="{ item: task }: { item: Task }">
+ <div
+ :key="task.name"
+ class="w-full border-t border-zinc-50 flex flex-col items-start justify-start truncate px-2 py-1 h-14"
+ >
+ <div class="w-full flex flex-row items-center text-sm truncate">
+ <TaskStatus :status="task.status" size="small" />
+ <InstanceV1EngineIcon
+ class="inline-block ml-2 mr-1"
+ :instance="databaseForTask(project, task).instanceResource"
+ />
+ <span class="truncate">
+ {{ databaseForTask(project, task).instanceResource.title }}
+ </span>
+ <ChevronRightIcon class="inline opacity-60 w-4 shrink-0" />
+ <span class="truncate">
+ {{ databaseForTask(project, task).databaseName }}
+ </span>
+ </div>
+ <p class="space-x-1 mt-0.5 leading-4">
+ <NTooltip>
+ <template #trigger>
+ <NTag round size="tiny">{{ semanticTaskType(task.type) }}</NTag>
+ </template>
+ {{ $t("common.type") }}
+ </NTooltip>
+ <NTooltip v-if="extractSchemaVersionFromTask(task)">
+ <template #trigger>
+ <NTag round size="tiny">
+ {{ extractSchemaVersionFromTask(task) }}
+ </NTag>
+ </template>
+ {{ $t("common.version") }}
+ </NTooltip>
+ </p>
+ </div>
+ </template>
+ </NVirtualList>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { ChevronRightIcon } from "lucide-vue-next";
+import { NTag, NVirtualList, NTooltip } from "naive-ui";
+import { computed } from "vue";
+import { semanticTaskType } from "@/components/IssueV1";
+import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
+import { databaseForTask } from "@/components/Rollout/RolloutDetail/utils";
+import { InstanceV1EngineIcon } from "@/components/v2";
+import { useEnvironmentV1Store, useCurrentProjectV1 } from "@/store";
+import {
+ Stage,
+ type Task,
+ type Rollout,
+ type Task_Status,
+} from "@/types/proto/v1/rollout_service";
+import { extractSchemaVersionFromTask } from "@/utils";
+
+const props = defineProps<{
+ stage: Stage;
+ rollout: Rollout;
+ taskStatusFilter: Task_Status[];
+}>();
+
+const environmentStore = useEnvironmentV1Store();
+const { project } = useCurrentProjectV1();
+
+const filteredTasks = computed(() => {
+ if (props.taskStatusFilter.length === 0) {
+ return props.stage.tasks;
+ }
+ return props.stage.tasks.filter((task) =>
+ props.taskStatusFilter.includes(task.status)
+ );
+});
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/StageView.vue b/frontend/src/components/Plan/components/RolloutView/StageView.vue
new file mode 100644
index 0000000000..735ad60a53
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/StageView.vue
@@ -0,0 +1,28 @@
+<template>
+ <div class="w-full h-full flex flex-col p-4">
+ <div class="w-full flex grow overflow-auto bg-zinc-50 p-6 rounded-lg">
+ <div
+ class="relative w-auto flex flex-row items-start justify-start gap-6"
+ >
+ <div class="absolute top-5 border-2 w-full"></div>
+ <StageCard
+ v-for="stage in rollout.stages"
+ :key="stage.name"
+ :stage="stage"
+ :rollout="rollout"
+ :task-status-filter="taskStatusFilter"
+ />
+ </div>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import type { Rollout, Task_Status } from "@/types/proto/v1/rollout_service";
+import StageCard from "./StageCard.vue";
+
+defineProps<{
+ rollout: Rollout;
+ taskStatusFilter: Task_Status[];
+}>();
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue b/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue
new file mode 100644
index 0000000000..0de4e49efd
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/TaskFilter.vue
@@ -0,0 +1,73 @@
+<template>
+ <div class="flex flex-row justify-start items-center gap-4">
+ <div class="flex items-center justify-between">
+ <h3 class="text-base font-medium">
+ {{ $t("common.tasks") }}
+ <span>({{ totalTaskCount }})</span>
+ </h3>
+ </div>
+ <div class="flex flex-row gap-1 items-center">
+ <template v-for="status in TASK_STATUS_FILTERS" :key="status">
+ <NTag
+ v-if="getTaskCount(status) > 0"
+ round
+ checkable
+ :checked="taskStatusList.includes(status)"
+ @update:checked="
+ (checked) => {
+ emit(
+ 'update:taskStatusList',
+ checked
+ ? [...taskStatusList, status]
+ : taskStatusList.filter((s) => s !== status)
+ );
+ }
+ "
+ >
+ <template #avatar>
+ <TaskStatus :status="status" size="small" />
+ </template>
+ <span class="select-none text-base">{{ getTaskCount(status) }}</span>
+ </NTag>
+ </template>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { flatten } from "lodash-es";
+import { NTag } from "naive-ui";
+import { computed } from "vue";
+import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
+import type { Rollout, Task_Status } from "@/types/proto/v1/rollout_service";
+import { Task_Status as TaskStatusEnum } from "@/types/proto/v1/rollout_service";
+
+const props = defineProps<{
+ rollout: Rollout;
+ taskStatusList: Task_Status[];
+}>();
+
+const emit = defineEmits<{
+ (event: "update:taskStatusList", taskStatusList: Task_Status[]): void;
+}>();
+
+const TASK_STATUS_FILTERS: Task_Status[] = [
+ TaskStatusEnum.NOT_STARTED,
+ TaskStatusEnum.PENDING,
+ TaskStatusEnum.RUNNING,
+ TaskStatusEnum.DONE,
+ TaskStatusEnum.FAILED,
+ TaskStatusEnum.CANCELED,
+ TaskStatusEnum.SKIPPED,
+];
+
+const allTasks = computed(() => {
+ return flatten(props.rollout.stages.map((stage) => stage.tasks));
+});
+
+const totalTaskCount = computed(() => allTasks.value.length);
+
+const getTaskCount = (status: Task_Status) => {
+ return allTasks.value.filter((task) => task.status === status).length;
+};
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
new file mode 100644
index 0000000000..167d3e64f8
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
@@ -0,0 +1,113 @@
+<template>
+ <div class="w-full h-full flex flex-col p-4">
+ <NDataTable
+ size="small"
+ :columns="columnList"
+ :data="taskList"
+ :striped="true"
+ :bordered="true"
+ :row-key="(task: Task) => task.name"
+ />
+ </div>
+</template>
+
+<script lang="tsx" setup>
+import { flatten } from "lodash-es";
+import { ChevronRightIcon } from "lucide-vue-next";
+import type { DataTableColumn } from "naive-ui";
+import { NDataTable } from "naive-ui";
+import { computed } from "vue";
+import { useI18n } from "vue-i18n";
+import { semanticTaskType } from "@/components/IssueV1";
+import TaskStatus from "@/components/Rollout/RolloutDetail/Panels/kits/TaskStatus.vue";
+import { databaseForTask } from "@/components/Rollout/RolloutDetail/utils";
+import { InstanceV1EngineIcon } from "@/components/v2";
+import { useCurrentProjectV1, useEnvironmentV1Store } from "@/store";
+import type { Task, Rollout, Task_Status } from "@/types/proto/v1/rollout_service";
+import { extractSchemaVersionFromTask } from "@/utils";
+
+const props = defineProps<{
+ rollout: Rollout;
+ taskStatusFilter: Task_Status[];
+}>();
+
+const { t } = useI18n();
+const { project } = useCurrentProjectV1();
+const environmentStore = useEnvironmentV1Store();
+
+const taskList = computed(() => {
+ const allTasks = flatten(props.rollout.stages.map((stage) => stage.tasks));
+ if (props.taskStatusFilter.length === 0) {
+ return allTasks;
+ }
+ return allTasks.filter((task) =>
+ props.taskStatusFilter.includes(task.status)
+ );
+});
+
+const stages = computed(() => props.rollout.stages);
+
+const columnList = computed((): DataTableColumn<Task>[] => {
+ return [
+ {
+ key: "status",
+ width: 80,
+ title: t("common.status"),
+ render: (task) => {
+ return <TaskStatus status={task.status} size="small" />;
+ },
+ },
+ {
+ key: "stage",
+ title: t("common.stage"),
+ width: 120,
+ render: (task) => {
+ const stage = stages.value.find((stage) =>
+ stage.tasks.find((t) => t.name === task.name)
+ );
+ if (stage) {
+ const environment = environmentStore.getEnvironmentByName(
+ stage.environment
+ );
+ return environment.title;
+ }
+ return "-";
+ },
+ },
+ {
+ key: "type",
+ width: 120,
+ title: t("common.type"),
+ render: (task) => {
+ return semanticTaskType(task.type);
+ },
+ },
+ {
+ key: "database",
+ title: t("common.database"),
+ render: (task) => {
+ const database = databaseForTask(project.value, task);
+ return (
+ <div class="w-auto flex flex-row items-center truncate">
+ <InstanceV1EngineIcon
+ class="inline-block mr-1"
+ instance={database.instanceResource}
+ />
+ <span class="truncate">{database.instanceResource.title}</span>
+ <ChevronRightIcon class="inline opacity-60 w-4 shrink-0 mx-1" />
+ <span class="truncate">{database.databaseName}</span>
+ </div>
+ );
+ },
+ },
+ {
+ key: "version",
+ title: t("common.version"),
+ width: 100,
+ render: (task) => {
+ return extractSchemaVersionFromTask(task) || "-";
+ },
+ },
+ ];
+});
+</script>
diff --git a/frontend/src/components/Plan/components/RolloutView/index.ts b/frontend/src/components/Plan/components/RolloutView/index.ts
new file mode 100644
index 0000000000..9034811da7
--- /dev/null
+++ b/frontend/src/components/Plan/components/RolloutView/index.ts
@@ -0,0 +1 @@
+export { default as RolloutView } from "./RolloutView.vue";
diff --git a/frontend/src/components/Plan/logic/context.ts b/frontend/src/components/Plan/logic/context.ts
index 8b7d27ef1c..10b106fd1a 100644
--- a/frontend/src/components/Plan/logic/context.ts
+++ b/frontend/src/components/Plan/logic/context.ts
@@ -4,6 +4,7 @@ import type { InjectionKey, Ref } from "vue";
import { inject, provide } from "vue";
import type { Issue } from "@/types/proto/v1/issue_service";
import type { Plan, PlanCheckRun } from "@/types/proto/v1/plan_service";
+import type { Rollout } from "@/types/proto/v1/rollout_service";
import type {
IssueReviewAction,
IssueStatusAction,
@@ -23,7 +24,7 @@ export type PlanContext = {
plan: Ref<Plan>;
planCheckRunList: Ref<PlanCheckRun[]>;
issue?: Ref<Issue | undefined>;
- // TODO(steven): save related rollout for checking if the plan is changable.
+ rollout?: Ref<Rollout | undefined>;
// UI events
events: PlanEvents;
@@ -46,6 +47,17 @@ export const usePlanContextWithIssue = () => {
};
};
+export const usePlanContextWithRollout = () => {
+ const context = inject(KEY)!;
+ if (!context.rollout?.value) {
+ throw new Error("Rollout is required but not available in plan context");
+ }
+ return {
+ ...context,
+ rollout: context.rollout as Ref<Rollout>,
+ };
+};
+
export const providePlanContext = (
context: Partial<PlanContext>,
root = false
diff --git a/frontend/src/components/Plan/logic/index.ts b/frontend/src/components/Plan/logic/index.ts
index 06df74229d..23d8a683ce 100644
--- a/frontend/src/components/Plan/logic/index.ts
+++ b/frontend/src/components/Plan/logic/index.ts
@@ -7,3 +7,4 @@ export * from "./plan-check";
export * from "./poll";
export * from "./utils";
export * from "./sidebar";
+export * from "./issue-review";
diff --git a/frontend/src/components/Plan/logic/initialize/index.ts b/frontend/src/components/Plan/logic/initialize/index.ts
index 41657c6d3c..4ad33b0b7d 100644
--- a/frontend/src/components/Plan/logic/initialize/index.ts
+++ b/frontend/src/components/Plan/logic/initialize/index.ts
@@ -1,14 +1,20 @@
+import { create } from "@bufbuild/protobuf";
import { computed, ref, unref, watch, type MaybeRef } from "vue";
import { useRoute, useRouter, type LocationQuery } from "vue-router";
-import { create } from "@bufbuild/protobuf";
-import { issueServiceClientConnect } from "@/grpcweb";
-import { GetIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import { convertNewIssueToOld } from "@/utils/v1/issue-conversions";
+import {
+ issueServiceClientConnect,
+ rolloutServiceClientConnect,
+} from "@/grpcweb";
import { projectNamePrefix, usePlanStore } from "@/store";
import { EMPTY_ID, UNKNOWN_ID } from "@/types";
+import { GetIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
+import { GetRolloutRequestSchema } from "@/types/proto-es/v1/rollout_service_pb";
import type { Issue } from "@/types/proto/v1/issue_service";
import type { Plan, PlanCheckRun } from "@/types/proto/v1/plan_service";
+import type { Rollout } from "@/types/proto/v1/rollout_service";
import { emptyPlan } from "@/types/v1/issue/plan";
+import { convertNewIssueToOld } from "@/utils/v1/issue-conversions";
+import { convertNewRolloutToOld } from "@/utils/v1/rollout-conversions";
import { createPlanSkeleton } from "./create";
export * from "./create";
@@ -18,10 +24,11 @@ export * from "./util";
export function useInitializePlan(
projectId: MaybeRef<string>,
planId: MaybeRef<string | undefined>,
- issueId: MaybeRef<string | undefined>
+ issueId: MaybeRef<string | undefined>,
+ rolloutId?: MaybeRef<string | undefined>
) {
const isCreating = computed(() => {
- const id = unref(planId) || unref(issueId);
+ const id = unref(planId) || unref(issueId) || unref(rolloutId);
return id?.toLowerCase() === "create";
});
@@ -34,6 +41,13 @@ export function useInitializePlan(
if (uid > 0) return String(uid);
return String(UNKNOWN_ID);
}
+ // Otherwise, if rolloutId is provided, we'll fetch the plan from the rollout
+ if (unref(rolloutId)) {
+ const id = unref(rolloutId)!;
+ if (id.toLowerCase() === "create") return String(EMPTY_ID);
+ // For rollout-based initialization, return a special marker
+ return `rollout:${id}`;
+ }
// Otherwise, if issueId is provided, we'll fetch the plan from the issue
if (unref(issueId)) {
const id = unref(issueId)!;
@@ -52,10 +66,12 @@ export function useInitializePlan(
const plan = ref<Plan>(emptyPlan());
const planCheckRunList = ref<PlanCheckRun[]>([]);
const issue = ref<Issue | undefined>(undefined);
+ const rollout = ref<Rollout | undefined>(undefined);
const runner = async (uid: string, projectId: string, url: string) => {
let planResult: Plan;
let issueResult: Issue | undefined = undefined;
+ let rolloutResult: Rollout | undefined = undefined;
if (uid === String(EMPTY_ID)) {
// Creating a new plan
@@ -63,6 +79,38 @@ export function useInitializePlan(
route,
convertRouterQuery(router.resolve(url).query)
);
+ } else if (uid.startsWith("rollout:")) {
+ // Fetch plan from rollout
+ const rolloutUid = uid.substring(8);
+ const rolloutRequest = create(GetRolloutRequestSchema, {
+ name: `${projectNamePrefix}${projectId}/rollouts/${rolloutUid}`,
+ });
+ const newRollout =
+ await rolloutServiceClientConnect.getRollout(rolloutRequest);
+ rolloutResult = convertNewRolloutToOld(newRollout);
+
+ if (!rolloutResult.plan) {
+ throw new Error(
+ `Rollout ${rolloutUid} does not have an associated plan`
+ );
+ }
+
+ // Fetch the plan using the rollout's plan reference
+ planResult = await planStore.fetchPlanByName(rolloutResult.plan);
+
+ // Fetch the associated issue if it exists
+ if (rolloutResult.issue) {
+ try {
+ const issueRequest = create(GetIssueRequestSchema, {
+ name: rolloutResult.issue,
+ });
+ const newIssue =
+ await issueServiceClientConnect.getIssue(issueRequest);
+ issueResult = convertNewIssueToOld(newIssue);
+ } catch {
+ // Issue might not exist or we don't have permission, that's ok
+ }
+ }
} else if (uid.startsWith("issue:")) {
// Fetch plan from issue
const issueUid = uid.substring(6);
@@ -97,11 +145,26 @@ export function useInitializePlan(
// Issue might not exist or we don't have permission, that's ok
}
}
+
+ // If we have a plan, try to fetch the associated rollout if it exists
+ if (planResult.rollout) {
+ try {
+ const rolloutRequest = create(GetRolloutRequestSchema, {
+ name: planResult.rollout,
+ });
+ const newRollout =
+ await rolloutServiceClientConnect.getRollout(rolloutRequest);
+ rolloutResult = convertNewRolloutToOld(newRollout);
+ } catch {
+ // Rollout might not exist or we don't have permission, that's ok
+ }
+ }
}
return {
plan: planResult,
issue: issueResult,
+ rollout: rolloutResult,
url,
};
};
@@ -122,13 +185,14 @@ export function useInitializePlan(
}
plan.value = result.plan;
issue.value = result.issue;
+ rollout.value = result.rollout;
isInitializing.value = false;
});
},
{ immediate: true }
);
- return { isCreating, plan, planCheckRunList, issue, isInitializing };
+ return { isCreating, plan, planCheckRunList, issue, rollout, isInitializing };
}
export const convertRouterQuery = (query: LocationQuery) => {
diff --git a/frontend/src/layouts/ProjectV1Layout.vue b/frontend/src/layouts/ProjectV1Layout.vue
index 825ba7cfc0..d992b949b9 100644
--- a/frontend/src/layouts/ProjectV1Layout.vue
+++ b/frontend/src/layouts/ProjectV1Layout.vue
@@ -93,8 +93,8 @@ import {
PresetRoleType,
UNKNOWN_PROJECT_NAME,
} from "@/types";
-import { State } from "@/types/proto/v1/common";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
+import { State } from "@/types/proto/v1/common";
import { hasProjectPermissionV2 } from "@/utils";
import { useBodyLayoutContext } from "./common";
diff --git a/frontend/src/locales/dynamic/ja-JP.json b/frontend/src/locales/dynamic/ja-JP.json
index e53ff9ca61..97e4ff9dcf 100644
--- a/frontend/src/locales/dynamic/ja-JP.json
+++ b/frontend/src/locales/dynamic/ja-JP.json
@@ -377,4 +377,4 @@
"review-config": "設定を確認する",
"role": "役割"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 13747c091a..ef9558521c 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1022,6 +1022,14 @@
"schema-drift-detected": {
"self": "Schema drift detected",
"description": "The selected database(s) has schema drift. Please make sure the drift is expected and safe to apply."
+ },
+ "review": {
+ "approved": "Approved",
+ "rejected": "Rejected",
+ "under-review": "Under review"
+ },
+ "expermental-page": {
+ "self": "Experimental issue page"
}
},
"plan": {
@@ -1046,6 +1054,7 @@
"specifications": "Specifications",
"checks": "Checks",
"review": "Review",
+ "rollout": "Rollout",
"statement-empty": "Statement is empty"
},
"spec": {
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index f445fff6e9..87369f9a76 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1022,6 +1022,14 @@
"schema-drift-detected": {
"self": "Se detectó una desviación del esquema",
"description": "Las bases de datos seleccionadas presentan una desviación de esquema. Asegúrese de que la desviación sea la esperada y de que sea segura para su aplicación."
+ },
+ "review": {
+ "approved": "Aprobado",
+ "rejected": "Rechazado",
+ "under-review": "Bajo revisión"
+ },
+ "expermental-page": {
+ "self": "Página de problemas experimentales"
}
},
"plan": {
@@ -1046,6 +1054,7 @@
"specifications": "Presupuesto",
"checks": "Cheques",
"review": "Revisar",
+ "rollout": "Despliegue",
"statement-empty": "La declaración está vacía"
},
"spec": {
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 8e7e92a2d2..39b506a569 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1022,6 +1022,14 @@
"schema-drift-detected": {
"self": "スキーマドリフトが検出されました",
"description": "選択したデータベースにはスキーマドリフトがあります。ドリフトが想定どおりであり、適用しても安全であることを確認してください。"
+ },
+ "review": {
+ "approved": "承認された",
+ "rejected": "拒否",
+ "under-review": "審査中"
+ },
+ "expermental-page": {
+ "self": "実験問題ページ"
}
},
"plan": {
@@ -1046,6 +1054,7 @@
"specifications": "仕様",
"checks": "小切手",
"review": "レビュー",
+ "rollout": "ロールアウトする",
"statement-empty": "ステートメントが空です"
},
"spec": {
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 18610f1ee7..d6fe28ee2e 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1022,6 +1022,14 @@
"schema-drift-detected": {
"self": "Đã phát hiện sự trôi dạt của sơ đồ",
"description": "Cơ sở dữ liệu được chọn có sự trôi dạt lược đồ. Vui lòng đảm bảo rằng sự trôi dạt này được mong đợi và an toàn để áp dụng."
+ },
+ "review": {
+ "approved": "Tán thành",
+ "rejected": "Vật bị loại bỏ",
+ "under-review": "Đang xem xét"
+ },
+ "expermental-page": {
+ "self": "Trang vấn đề thử nghiệm"
}
},
"plan": {
@@ -1046,6 +1054,7 @@
"specifications": "Thông số kỹ thuật",
"checks": "Kiểm tra",
"review": "Ôn tập",
+ "rollout": "Triển khai",
"statement-empty": "Câu lệnh trống rỗng"
},
"spec": {
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 75920eff17..fc987e64c4 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1022,6 +1022,14 @@
"schema-drift-detected": {
"self": "检测到 Schema 偏差",
"description": "所选数据库存在 Schema 偏差,请在变更前确保该偏差符合预期。"
+ },
+ "review": {
+ "approved": "已批准",
+ "rejected": "已拒绝",
+ "under-review": "等待审批"
+ },
+ "expermental-page": {
+ "self": "实验性工单页面"
}
},
"plan": {
@@ -1046,6 +1054,7 @@
"specifications": "变更项",
"checks": "检查",
"review": "审查",
+ "rollout": "推出",
"statement-empty": "变更语句为空"
},
"spec": {
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index dc48c8872b..0f0b68c8db 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -37,6 +37,117 @@ export const PROJECT_V1_ROUTE_ROLLOUTS = `${PROJECT_V1_ROUTE_DASHBOARD}.rollout`
export const PROJECT_V1_ROUTE_ROLLOUT_DETAIL = `${PROJECT_V1_ROUTE_ROLLOUTS}.detail`;
export const PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL = `${PROJECT_V1_ROUTE_ROLLOUT_DETAIL}.task.detail`;
+const cicdRoutes: RouteRecordRaw[] = [
+ {
+ path: "",
+ children: [
+ {
+ path: "plans",
+ props: true,
+ children: [
+ {
+ path: "",
+ name: PROJECT_V1_ROUTE_PLANS,
+ meta: {
+ // TODO(claude): rename title to "Plans" later.
+ title: () => t("review-center.self"),
+ requiredPermissionList: () => [
+ "bb.databases.list",
+ "bb.plans.list",
+ ],
+ },
+ component: () => import("@/views/ReviewCenter/index.vue"),
+ props: true,
+ },
+ {
+ path: ":planId",
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL,
+ meta: {
+ requiredPermissionList: () => ["bb.plans.get"],
+ },
+ component: () => import("@/views/project/ProjectPlanDetail.vue"),
+ props: true,
+ children: [
+ {
+ path: "specs",
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
+ component: () =>
+ import("@/views/project/ProjectPlanDetail.vue"),
+ children: [
+ {
+ path: ":specId",
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
+ component: () =>
+ import("@/views/project/ProjectPlanDetail.vue"),
+ },
+ ],
+ },
+ {
+ path: "planCheckRuns",
+ name: PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
+ component: () =>
+ import("@/views/project/ProjectPlanDetail.vue"),
+ },
+ ],
+ },
+ ],
+ },
+ {
+ path: "issues/:issueId(\\d+)",
+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
+ meta: {
+ requiredPermissionList: () => ["bb.issues.get"],
+ },
+ component: () => import("@/views/project/ProjectPlanDetail.vue"),
+ props: true,
+ },
+ {
+ path: "rollouts",
+ meta: {
+ title: () => t("common.rollout"),
+ },
+ props: true,
+ children: [
+ {
+ path: "",
+ name: PROJECT_V1_ROUTE_ROLLOUTS,
+ meta: {
+ requiredPermissionList: () => ["bb.rollouts.list"],
+ },
+ component: () =>
+ import("@/views/project/ProjectRolloutDashboard.vue"),
+ props: true,
+ },
+ {
+ path: ":rolloutId",
+ props: true,
+ children: [
+ {
+ path: "",
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
+ component: () =>
+ import("@/views/project/ProjectPlanDetail.vue"),
+ props: true,
+ meta: {
+ requiredPermissionList: () => ["bb.rollouts.get"],
+ },
+ },
+ // TODO(steven): Add more children routes for rollout detail.
+ {
+ path: "stages/:stageId/tasks/:taskId",
+ name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
+ component: () =>
+ import("@/components/Rollout/RolloutDetail/TaskDetail/"),
+ props: true,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ },
+];
+
const projectV1Routes: RouteRecordRaw[] = [
{
path: "projects/:projectId",
@@ -146,15 +257,6 @@ const projectV1Routes: RouteRecordRaw[] = [
import("@/views/project/ProjectIssueDashboard.vue"),
props: true,
},
- {
- path: ":issueId(\\d+)",
- name: PROJECT_V1_ROUTE_ISSUE_DETAIL_V1,
- meta: {
- requiredPermissionList: () => ["bb.issues.get"],
- },
- component: () => import("@/views/project/ProjectPlanDetail.vue"),
- props: true,
- },
{
path: ":issueSlug",
name: PROJECT_V1_ROUTE_ISSUE_DETAIL,
@@ -332,61 +434,6 @@ const projectV1Routes: RouteRecordRaw[] = [
component: () => import("@/views/ExportCenter/index.vue"),
props: true,
},
- {
- path: "plans",
- props: true,
- children: [
- {
- path: "",
- name: PROJECT_V1_ROUTE_PLANS,
- meta: {
- // TODO(claude): rename title to "Plans" later.
- title: () => t("review-center.self"),
- requiredPermissionList: () => [
- "bb.databases.list",
- "bb.plans.list",
- ],
- },
- component: () => import("@/views/ReviewCenter/index.vue"),
- props: true,
- },
- {
- path: ":planId",
- alias: [
- ":planId/planCheckRuns",
- ":planId/planCheckRuns/:planCheckRunId",
- ],
- name: PROJECT_V1_ROUTE_PLAN_DETAIL,
- meta: {
- requiredPermissionList: () => ["bb.plans.get"],
- },
- component: () => import("@/views/project/ProjectPlanDetail.vue"),
- props: true,
- children: [
- {
- path: "specs",
- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPECS,
- component: () =>
- import("@/views/project/ProjectPlanDetail.vue"),
- children: [
- {
- path: ":specId",
- name: PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
- component: () =>
- import("@/views/project/ProjectPlanDetail.vue"),
- },
- ],
- },
- {
- path: "planCheckRuns",
- name: PROJECT_V1_ROUTE_PLAN_DETAIL_CHECK_RUNS,
- component: () =>
- import("@/views/project/ProjectPlanDetail.vue"),
- },
- ],
- },
- ],
- },
{
path: "releases",
meta: {
@@ -415,51 +462,7 @@ const projectV1Routes: RouteRecordRaw[] = [
},
],
},
- {
- path: "rollouts",
- meta: {
- title: () => t("common.rollout"),
- },
- props: true,
- children: [
- {
- path: "",
- name: PROJECT_V1_ROUTE_ROLLOUTS,
- meta: {
- requiredPermissionList: () => ["bb.rollouts.list"],
- },
- component: () =>
- import("@/views/project/ProjectRolloutDashboard.vue"),
- props: true,
- },
- {
- path: ":rolloutId",
- component: () =>
- import(
- "@/components/Rollout/RolloutDetail/RolloutDetailLayout.vue"
- ),
- props: true,
- meta: {
- requiredPermissionList: () => ["bb.rollouts.get"],
- },
- children: [
- {
- path: "",
- name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL,
- component: () => import("@/components/Rollout/RolloutDetail/"),
- props: true,
- },
- {
- path: "stages/:stageId/tasks/:taskId",
- name: PROJECT_V1_ROUTE_ROLLOUT_DETAIL_TASK_DETAIL,
- component: () =>
- import("@/components/Rollout/RolloutDetail/TaskDetail/"),
- props: true,
- },
- ],
- },
- ],
- },
+ ...cicdRoutes,
],
},
];
diff --git a/frontend/src/views/project/ProjectPlanDetail.vue b/frontend/src/views/project/ProjectPlanDetail.vue
index 2585b2a6cb..eb7cea6d8e 100644
--- a/frontend/src/views/project/ProjectPlanDetail.vue
+++ b/frontend/src/views/project/ProjectPlanDetail.vue
@@ -28,14 +28,16 @@ const props = defineProps<{
projectId: string;
planId?: string;
issueId?: string;
+ rolloutId?: string;
}>();
const { t } = useI18n();
-const { isCreating, plan, planCheckRunList, issue, isInitializing } =
+const { isCreating, plan, planCheckRunList, issue, rollout, isInitializing } =
useInitializePlan(
toRef(props, "projectId"),
toRef(props, "planId"),
- toRef(props, "issueId")
+ toRef(props, "issueId"),
+ toRef(props, "rolloutId")
);
const planBaseContext = useBasePlanContext({
isCreating,
@@ -52,6 +54,7 @@ providePlanContext(
plan,
planCheckRunList,
issue,
+ rollout,
...planBaseContext,
},
true /* root */