Skip to content

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

refactor(frontend): remove Vue issue detail page files (#20046)

boojack87411f42637f
diff --git a/frontend/src/components/IssueV1/components/BatchIssueActionsV1.vue b/frontend/src/components/IssueV1/components/BatchIssueActionsV1.vue
deleted file mode 100644
index f18ba5d73a..0000000000
--- a/frontend/src/components/IssueV1/components/BatchIssueActionsV1.vue
+++ /dev/null
@@ -1,144 +0,0 @@
-<template>
- <TooltipButton
- :disabled="!isActionApplicableForAllIssues('CLOSE')"
- tooltip-mode="DISABLED-ONLY"
- @click="startBatchIssueStatusAction('CLOSE')"
- >
- <template #default>
- {{ $t("issue.batch-transition.close") }}
- </template>
- <template #tooltip>
- <div class="whitespace-nowrap">
- {{
- $t("issue.batch-transition.not-allowed-tips", {
- operation: $t("issue.batch-transition.closed"),
- })
- }}
- </div>
- <ErrorList :errors="closeErrors" :bullets="'always'" />
- </template>
- </TooltipButton>
-
- <TooltipButton
- :disabled="!isActionApplicableForAllIssues('REOPEN')"
- tooltip-mode="DISABLED-ONLY"
- @click="startBatchIssueStatusAction('REOPEN')"
- >
- {{ $t("issue.batch-transition.reopen") }}
- <template #tooltip>
- <div class="whitespace-nowrap">
- {{
- $t("issue.batch-transition.not-allowed-tips", {
- operation: $t("issue.batch-transition.reopened"),
- })
- }}
- </div>
- <ErrorList :errors="reopenErrors" :bullets="'always'" />
- </template>
- </TooltipButton>
-
- <BatchIssueStatusActionPanel
- :issue-list="issueList"
- :action="ongoingIssueStatusAction?.action"
- @updating="state.isRequesting = true"
- @updated="handleUpdated"
- @close="ongoingIssueStatusAction = undefined"
- />
-</template>
-
-<script lang="ts" setup>
-import type { PropType } from "vue";
-import { computed, reactive, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import ErrorList from "@/components/misc/ErrorList.vue";
-import { TooltipButton } from "@/components/v2";
-import { refreshIssueList } from "@/store";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
-import { BatchIssueStatusActionPanel } from "./Panel";
-import type { IssueStatusAction } from "./Panel/issueStatusAction";
-import {
- getApplicableIssueStatusActionList,
- issueStatusActionDisplayName,
-} from "./Panel/issueStatusAction";
-
-type LocalState = {
- isRequesting: boolean;
-};
-
-const props = defineProps({
- issueList: {
- type: Array as PropType<Issue[]>,
- default: () => [],
- },
-});
-
-const state = reactive<LocalState>({
- isRequesting: false,
-});
-
-const ongoingIssueStatusAction = ref<{
- action: IssueStatusAction;
- title: string;
-}>();
-
-const issueStatusActionList = computed(() => {
- return props.issueList.map((issue) => {
- const actions = getApplicableIssueStatusActionList(issue);
- return { issue, actions };
- });
-});
-
-const isActionApplicableForAllIssues = (action: IssueStatusAction): boolean => {
- return issueStatusActionList.value.every(({ actions }) => {
- return actions.includes(action);
- });
-};
-
-const { t } = useI18n();
-
-const issueStatuses = computed(() => {
- const statuses = new Set<IssueStatus>();
- for (const issue of props.issueList) {
- statuses.add(issue.status);
- }
- return statuses;
-});
-
-const closeErrors = computed(() => {
- const errors: string[] = [];
- const statuses = issueStatuses.value;
- if (statuses.has(IssueStatus.DONE)) {
- errors.push(t("issue.batch-transition.done-cannot-close"));
- }
- if (statuses.has(IssueStatus.CANCELED)) {
- errors.push(t("issue.batch-transition.canceled-cannot-close"));
- }
- return errors;
-});
-
-const reopenErrors = computed(() => {
- const errors: string[] = [];
- const statuses = issueStatuses.value;
- if (statuses.has(IssueStatus.OPEN)) {
- errors.push(t("issue.batch-transition.open-cannot-reopen"));
- }
- if (statuses.has(IssueStatus.DONE)) {
- errors.push(t("issue.batch-transition.done-cannot-reopen"));
- }
- return errors;
-});
-
-const handleUpdated = () => {
- state.isRequesting = false;
- ongoingIssueStatusAction.value = undefined;
- refreshIssueList();
-};
-
-const startBatchIssueStatusAction = (action: IssueStatusAction) => {
- ongoingIssueStatusAction.value = {
- action,
- title: issueStatusActionDisplayName(action, props.issueList.length),
- };
-};
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueApprovalStatus.vue b/frontend/src/components/IssueV1/components/IssueApprovalStatus.vue
deleted file mode 100644
index ae5773050c..0000000000
--- a/frontend/src/components/IssueV1/components/IssueApprovalStatus.vue
+++ /dev/null
@@ -1,116 +0,0 @@
-<template>
- <!-- Generating approval flow -->
- <NTag
- v-if="issue.approvalStatus === Issue_ApprovalStatus.CHECKING"
- size="small"
- round
- class="shrink-0 mt-1"
- >
- {{ t("custom-approval.issue-review.generating-approval-flow") }}
- </NTag>
-
- <!-- Has approval flow: APPROVED / REJECTED / PENDING -->
- <NPopover
- v-else-if="statusTag && approvalSteps.length > 0"
- trigger="hover"
- placement="bottom-end"
- :show-arrow="false"
- >
- <template #trigger>
- <div
- class="shrink-0 flex flex-row sm:flex-col items-center sm:items-end gap-x-1.5 sm:gap-x-0 mt-1 cursor-pointer"
- >
- <NTag size="small" round :type="statusTag.type">
- {{ statusTag.label }}
- </NTag>
- <span
- v-if="statusTag.subtitle"
- class="text-xs text-control-light whitespace-nowrap sm:mt-1"
- >
- {{ statusTag.subtitle }}
- </span>
- </div>
- </template>
- <NTimeline size="large" class="pl-1 mt-1">
- <ApprovalStepItem
- v-for="(step, index) in approvalSteps"
- :key="index"
- :step="step"
- :step-index="index"
- :step-number="index + 1"
- :issue="issue"
- readonly
- />
- </NTimeline>
- </NPopover>
-
- <!-- No approval required -->
- <NTag v-else size="small" round :bordered="false" class="shrink-0 mt-1">
- {{ t("custom-approval.approval-flow.skip") }}
- </NTag>
-</template>
-
-<script lang="ts" setup>
-import type { TagProps } from "naive-ui";
-import { NPopover, NTag, NTimeline } from "naive-ui";
-import { computed } from "vue";
-import { useI18n } from "vue-i18n";
-import ApprovalStepItem from "@/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/ApprovalStepItem.vue";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import { Issue_ApprovalStatus } from "@/types/proto-es/v1/issue_service_pb";
-import { displayRoleTitle } from "@/utils";
-
-interface StatusTag {
- label: string;
- type?: TagProps["type"];
- subtitle: string;
-}
-
-const props = defineProps<{
- issue: Issue;
-}>();
-
-const { t } = useI18n();
-
-const approvalSteps = computed(() => {
- return props.issue.approvalTemplate?.flow?.roles || [];
-});
-
-const progressText = computed(() => {
- return t("issue.table.approval-progress", {
- approved: props.issue.approvers.length,
- total: approvalSteps.value.length,
- });
-});
-
-const statusTag = computed((): StatusTag | undefined => {
- const status = props.issue.approvalStatus;
-
- if (status === Issue_ApprovalStatus.APPROVED) {
- return {
- label: t("issue.table.approved"),
- type: "success",
- subtitle: progressText.value,
- };
- }
- if (status === Issue_ApprovalStatus.REJECTED) {
- return {
- label: t("common.rejected"),
- type: "warning",
- subtitle: progressText.value,
- };
- }
- if (status === Issue_ApprovalStatus.PENDING) {
- const currentRoleIndex = props.issue.approvers.length;
- const role = approvalSteps.value[currentRoleIndex];
- const roleName = role ? displayRoleTitle(role) : "";
- return {
- label: progressText.value,
- subtitle: roleName
- ? t("issue.table.waiting-role", { role: roleName })
- : "",
- };
- }
- return undefined;
-});
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueListItem.vue b/frontend/src/components/IssueV1/components/IssueListItem.vue
deleted file mode 100644
index de5a50a5e2..0000000000
--- a/frontend/src/components/IssueV1/components/IssueListItem.vue
+++ /dev/null
@@ -1,219 +0,0 @@
-<template>
- <div
- class="flex items-start gap-x-2 px-3 sm:px-4 py-3 cursor-pointer border-b border-gray-100 hover:bg-gray-50"
- @click="onRowClick($event)"
- >
- <!-- Checkbox -->
- <NCheckbox
- v-if="showSelection"
- class="shrink-0 mt-1"
- :checked="selected"
- @update:checked="$emit('toggle-selection')"
- @click.stop
- />
-
- <!-- Content + Approval: column on mobile, row on sm+ -->
- <div
- class="flex-1 min-w-0 flex flex-col sm:flex-row sm:items-start sm:gap-x-2"
- >
- <!-- Left: issue content -->
- <div class="flex-1 min-w-0">
- <!-- Line 1: status icon + title + labels -->
- <div class="flex items-center gap-x-1.5">
- <div class="h-6 flex justify-center items-center">
- <IssueStatusIcon class="shrink-0" :issue-status="issue.status" />
- </div>
- <a
- v-if="issue.title"
- :href="issueUrl"
- class="font-medium text-main text-base truncate hover:underline"
- @click.stop
- v-html="highlightedTitle"
- ></a>
- <a
- v-else
- :href="issueUrl"
- class="font-medium text-base truncate hover:underline italic text-gray-400"
- @click.stop
- >
- {{ $t("common.untitled") }}
- </a>
- <RiskLevelIcon :risk-level="issue.riskLevel" class="shrink-0" />
- <span
- v-for="label in labels"
- :key="label.value"
- class="inline-flex items-center gap-x-1 px-1.5 py-0.5 rounded text-xs whitespace-nowrap border shrink-0"
- >
- <span
- class="w-2.5 h-2.5 rounded-sm shrink-0"
- :style="{ backgroundColor: label.color }"
- ></span>
- {{ label.value }}
- </span>
- </div>
- <!-- Line 2: metadata -->
- <div
- class="flex items-center flex-wrap gap-x-1 text-xs text-control-light mt-1"
- >
- <span class="opacity-80">
- #{{ extractIssueUID(issue.name) }}
- </span>
- <span>&middot;</span>
- {{ $t("common.created") }}
- <HumanizeTs :ts="createTimeTs" />
- <span>&middot;</span>
- <router-link
- :to="{
- name: WORKSPACE_ROUTE_USER_PROFILE,
- params: { principalEmail: creator.email },
- }"
- class="hover:underline"
- @click.stop
- >
- {{ creator.title }}
- </router-link>
- <template v-if="showProject">
- <span>&middot;</span>
- <router-link
- :to="{
- name: PROJECT_V1_ROUTE_DETAIL,
- params: {
- projectId: extractProjectResourceName(project.name),
- },
- }"
- class="hover:underline"
- @click.stop
- >
- {{ project.title }}
- </router-link>
- </template>
- </div>
- <!-- Expanded description for search highlights -->
- <div
- v-if="expanded"
- class="mt-2 max-h-80 overflow-auto whitespace-pre-wrap wrap-break-word break-all text-sm text-control-light"
- v-html="highlightedDescription"
- ></div>
- </div>
-
- <!-- Right: approval status tag -->
- <IssueApprovalStatus :issue="issue" />
- </div>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { NCheckbox } from "naive-ui";
-import { computed } from "vue";
-import { useRouter } from "vue-router";
-import RiskLevelIcon from "@/components/Plan/components/IssueReviewView/Sidebar/ApprovalFlowSection/RiskLevelIcon.vue";
-import { PROJECT_V1_ROUTE_DETAIL } from "@/router/dashboard/projectV1";
-import { WORKSPACE_ROUTE_USER_PROFILE } from "@/router/dashboard/workspaceRoutes";
-import { useUserStore } from "@/store";
-import { getTimeForPbTimestampProtoEs, unknownUser } from "@/types";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import {
- extractIssueUID,
- extractProjectResourceName,
- getHighlightHTMLByRegExp,
- getIssueRoute,
- projectOfIssue,
-} from "@/utils";
-import HumanizeTs from "../../misc/HumanizeTs.vue";
-import IssueApprovalStatus from "./IssueApprovalStatus.vue";
-import { getValidIssueLabels } from "./IssueLabelSelector.vue";
-import IssueStatusIcon from "./IssueStatusIcon.vue";
-
-const props = withDefaults(
- defineProps<{
- issue: Issue;
- selected?: boolean;
- showSelection?: boolean;
- showProject?: boolean;
- highlightText?: string;
- }>(),
- {
- selected: false,
- showSelection: true,
- showProject: false,
- highlightText: "",
- }
-);
-
-defineEmits<{
- (e: "toggle-selection"): void;
-}>();
-
-const router = useRouter();
-const userStore = useUserStore();
-
-// Navigation
-const issueUrl = computed(() => {
- const issueRoute = getIssueRoute(props.issue);
- return router.resolve({
- name: issueRoute.name,
- params: issueRoute.params,
- }).fullPath;
-});
-
-const onRowClick = (e: MouseEvent) => {
- if (e.ctrlKey || e.metaKey) {
- window.open(issueUrl.value, "_blank");
- } else {
- router.push(issueUrl.value);
- }
-};
-
-// Metadata
-const creator = computed(() => {
- return (
- userStore.getUserByIdentifier(props.issue.creator) ||
- unknownUser(props.issue.creator)
- );
-});
-
-const project = computed(() => projectOfIssue(props.issue));
-
-const createTimeTs = computed(() => {
- return Math.floor(
- getTimeForPbTimestampProtoEs(props.issue.createTime, 0) / 1000
- );
-});
-
-// Labels
-const labels = computed(() => {
- const proj = project.value;
- const validValues = getValidIssueLabels(props.issue.labels, proj.issueLabels);
- return proj.issueLabels.filter((label) => validValues.includes(label.value));
-});
-
-// Search highlighting
-const highlightWords = computed(() => {
- if (!props.highlightText) return [];
- return props.highlightText.toLowerCase().split(" ");
-});
-
-const highlightedTitle = computed(() => {
- return getHighlightHTMLByRegExp(
- props.issue.title,
- highlightWords.value,
- false,
- "bg-yellow-100"
- );
-});
-
-const highlightedDescription = computed(() => {
- return getHighlightHTMLByRegExp(
- props.issue.description,
- highlightWords.value,
- false,
- "bg-yellow-100"
- );
-});
-
-const expanded = computed(() => {
- if (!props.highlightText || !props.issue.description) return false;
- const desc = props.issue.description.toLowerCase();
- return highlightWords.value.some((word) => desc.includes(word));
-});
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueListV1.vue b/frontend/src/components/IssueV1/components/IssueListV1.vue
deleted file mode 100644
index 7eadfbd888..0000000000
--- a/frontend/src/components/IssueV1/components/IssueListV1.vue
+++ /dev/null
@@ -1,121 +0,0 @@
-<template>
- <div>
- <NSpin :show="loading">
- <IssueListItem
- v-for="issue in sortedIssueList"
- :key="issue.name"
- :issue="issue"
- :selected="selectedIssueNames.has(issue.name)"
- :show-selection="showSelection"
- :show-project="showProject"
- :highlight-text="highlightText"
- @toggle-selection="toggleSelection(issue)"
- />
- <NEmpty v-if="sortedIssueList.length === 0" class="my-4" />
- </NSpin>
- </div>
-
- <div
- v-if="selectedIssueList.length > 0"
- class="sticky bottom-0 w-full bg-white flex items-center gap-x-2 px-3 sm:px-4 py-2 border-y"
- >
- <NCheckbox
- :checked="allSelected"
- :indeterminate="!allSelected"
- @update:checked="toggleSelectAll"
- />
- <span class="text-sm text-control-light">
- {{ selectedIssueList.length }} / {{ issueList.length }}
- </span>
- <BatchIssueActionsV1 :issue-list="selectedIssueList" />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { orderBy } from "lodash-es";
-import { NCheckbox, NEmpty, NSpin } from "naive-ui";
-import { computed, ref, watch } from "vue";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import { extractIssueUID } from "@/utils";
-import BatchIssueActionsV1 from "./BatchIssueActionsV1.vue";
-import IssueListItem from "./IssueListItem.vue";
-
-const props = withDefaults(
- defineProps<{
- issueList: Issue[];
- highlightText?: string;
- loading?: boolean;
- showProject?: boolean;
- showSelection?: boolean;
- }>(),
- {
- highlightText: "",
- loading: true,
- showSelection: true,
- }
-);
-
-const selectedIssueNames = ref(new Set<string>());
-
-// Sorting: matching issues first when searching, then by ID descending
-const sortedIssueList = computed(() => {
- if (!props.highlightText) {
- return props.issueList;
- }
- return orderBy(
- props.issueList,
- [
- (issue) =>
- `${issue.title} ${issue.description}`.includes(props.highlightText)
- ? 1
- : 0,
- (issue) => parseInt(extractIssueUID(issue.name)),
- ],
- ["desc", "desc"]
- );
-});
-
-// Selection
-const selectedIssueList = computed(() => {
- return props.issueList.filter((issue) =>
- selectedIssueNames.value.has(issue.name)
- );
-});
-
-const allSelected = computed(() => {
- return (
- props.issueList.length > 0 &&
- props.issueList.every((issue) => selectedIssueNames.value.has(issue.name))
- );
-});
-
-const toggleSelection = (issue: Issue) => {
- if (selectedIssueNames.value.has(issue.name)) {
- selectedIssueNames.value.delete(issue.name);
- } else {
- selectedIssueNames.value.add(issue.name);
- }
-};
-
-const toggleSelectAll = () => {
- if (allSelected.value) {
- selectedIssueNames.value.clear();
- } else {
- for (const issue of props.issueList) {
- selectedIssueNames.value.add(issue.name);
- }
- }
-};
-
-watch(
- () => props.issueList,
- (list) => {
- const newIssueNames = new Set(list.map((issue) => issue.name));
- for (const name of selectedIssueNames.value) {
- if (!newIssueNames.has(name)) {
- selectedIssueNames.value.delete(name);
- }
- }
- }
-);
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/IssueSearch.vue b/frontend/src/components/IssueV1/components/IssueSearch/IssueSearch.vue
deleted file mode 100644
index 23fa870f91..0000000000
--- a/frontend/src/components/IssueV1/components/IssueSearch/IssueSearch.vue
+++ /dev/null
@@ -1,88 +0,0 @@
-<template>
- <div class="flex flex-col gap-y-2">
- <div class="flex items-center md:gap-2">
- <AdvancedSearch
- class="flex-1 min-w-0"
- :params="params"
- :scope-options="scopeOptions"
- :default-params="defaultParams"
- @update:params="$emit('update:params', $event)"
- />
- <TimeRange
- v-if="components.includes('time-range')"
- :params="params"
- v-bind="componentProps?.['time-range']"
- @update:params="$emit('update:params', $event)"
- />
- <IssueSortDropdown
- v-if="components.includes('sort')"
- :order-by="orderBy"
- @update:order-by="$emit('update:orderBy', $event)"
- />
- <slot name="searchbox-suffix" />
- </div>
-
- <PresetButtons
- v-if="components.includes('presets') && !componentProps?.presets?.hidden"
- :params="params"
- @update:params="$emit('update:params', $event)"
- />
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed } from "vue";
-import AdvancedSearch from "@/components/AdvancedSearch";
-import TimeRange from "@/components/AdvancedSearch/TimeRange.vue";
-import type { SearchParams, SearchScopeId } from "@/utils";
-
-import IssueSortDropdown from "./IssueSortDropdown.vue";
-import PresetButtons from "./PresetButtons.vue";
-import { useIssueSearchScopeOptions } from "./useIssueSearchScopeOptions";
-
-export type SearchComponent = "searchbox" | "presets" | "time-range" | "sort";
-
-const props = withDefaults(
- defineProps<{
- params: SearchParams;
- overrideScopeIdList?: SearchScopeId[];
- components?: SearchComponent[];
- componentProps?: Partial<Record<SearchComponent, Record<string, unknown>>>;
- defaultParams?: SearchParams;
- orderBy?: string;
- }>(),
- {
- overrideScopeIdList: () => [],
- components: () => ["searchbox", "time-range", "presets"],
- componentProps: undefined,
- defaultParams: undefined,
- orderBy: "create_time desc",
- }
-);
-
-defineEmits<{
- (event: "update:params", params: SearchParams): void;
- (event: "update:orderBy", value: string): void;
-}>();
-
-const allowedScopes = computed((): SearchScopeId[] => {
- if (props.overrideScopeIdList && props.overrideScopeIdList.length > 0) {
- return props.overrideScopeIdList;
- }
- return [
- "creator",
- "current-approver",
- "approval",
- "status",
- "issue-type",
- "issue-label",
- "project",
- "risk-level",
- ];
-});
-
-const scopeOptions = useIssueSearchScopeOptions(
- computed(() => props.params),
- allowedScopes
-);
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/IssueSortDropdown.vue b/frontend/src/components/IssueV1/components/IssueSearch/IssueSortDropdown.vue
deleted file mode 100644
index 2c41bd53f1..0000000000
--- a/frontend/src/components/IssueV1/components/IssueSearch/IssueSortDropdown.vue
+++ /dev/null
@@ -1,99 +0,0 @@
-<template>
- <NDropdown
- :show="showDropdown"
- :options="options"
- placement="bottom-end"
- @clickoutside="showDropdown = false"
- @select="handleSelect"
- >
- <NButton
- quaternary
- :size="isMdOrAbove?'medium':'small'"
- :class="
- orderBy
- ? 'text-accent! hover:text-accent'
- : 'text-control-placeholder hover:text-control'
- "
- @click="showDropdown = !showDropdown"
- >
- <template #icon>
- <ArrowUpDownIcon class="w-4 h-4" />
- </template>
- <span v-if="isMdOrAbove">{{ $t("issue.sort.sort") }}</span>
- </NButton>
- </NDropdown>
-</template>
-
-<script lang="tsx" setup>
-import { ArrowUpDownIcon, CheckIcon } from "lucide-vue-next";
-import type { DropdownOption } from "naive-ui";
-import { NButton, NDropdown } from "naive-ui";
-import { computed, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { useWideScreen } from "@/composables/useWideScreen";
-
-const props = defineProps<{
- orderBy: string;
-}>();
-
-const emit = defineEmits<{
- (event: "update:orderBy", value: string): void;
-}>();
-
-const { t } = useI18n();
-const isMdOrAbove = useWideScreen();
-const showDropdown = ref(false);
-
-const checkIcon = (value: string) => {
- return () => (
- <CheckIcon
- class={`w-3 h-3 ${props.orderBy === value ? "text-accent" : "text-transparent"}`}
- />
- );
-};
-
-const options = computed((): DropdownOption[] => [
- {
- key: "create_time",
- label: t("issue.sort.created"),
- children: [
- {
- key: "create_time desc",
- label: t("issue.sort.descending"),
- icon: checkIcon("create_time desc"),
- },
- {
- key: "create_time asc",
- label: t("issue.sort.ascending"),
- icon: checkIcon("create_time asc"),
- },
- ],
- },
- {
- key: "update_time",
- label: t("issue.sort.updated"),
- children: [
- {
- key: "update_time desc",
- label: t("issue.sort.descending"),
- icon: checkIcon("update_time desc"),
- },
- {
- key: "update_time asc",
- label: t("issue.sort.ascending"),
- icon: checkIcon("update_time asc"),
- },
- ],
- },
-]);
-
-const handleSelect = (key: string) => {
- // Clicking the already-selected option clears back to default
- if (key === props.orderBy) {
- emit("update:orderBy", "");
- } else {
- emit("update:orderBy", key);
- }
- showDropdown.value = false;
-};
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/PresetButtons.vue b/frontend/src/components/IssueV1/components/IssueSearch/PresetButtons.vue
deleted file mode 100644
index 18a3bf9a76..0000000000
--- a/frontend/src/components/IssueV1/components/IssueSearch/PresetButtons.vue
+++ /dev/null
@@ -1,144 +0,0 @@
-<template>
- <div class="shrink-0">
- <NTabs
- :value="activePreset"
- :type="'line'"
- :size="'small'"
- @update:value="selectPreset"
- >
- <NTab v-for="preset in presets" :key="preset.value" :name="preset.value">
- {{ preset.label }}
- </NTab>
- </NTabs>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { NTab, NTabs } from "naive-ui";
-import { computed } from "vue";
-import { useI18n } from "vue-i18n";
-import { useCurrentUserV1 } from "@/store";
-import {
- Issue_ApprovalStatus,
- IssueStatus,
-} from "@/types/proto-es/v1/issue_service_pb";
-import type { SearchParams } from "@/utils";
-import {
- getValueFromSearchParams,
- getValuesFromSearchParams,
- upsertScope,
-} from "@/utils";
-
-type PresetValue = "WAITING_APPROVAL" | "OPEN" | "CLOSED" | "ALL";
-
-interface Preset {
- value: PresetValue;
- label: string;
-}
-
-const props = defineProps<{
- params: SearchParams;
-}>();
-
-const emit = defineEmits<{
- (event: "update:params", params: SearchParams): void;
-}>();
-
-const { t } = useI18n();
-const me = useCurrentUserV1();
-
-const presets = computed((): Preset[] => [
- {
- value: "WAITING_APPROVAL",
- label: t("issue.waiting-approval"),
- },
- {
- value: "OPEN",
- label: t("issue.table.open"),
- },
- {
- value: "CLOSED",
- label: t("issue.table.closed"),
- },
- {
- value: "ALL",
- label: t("common.all"),
- },
-]);
-
-const activePreset = computed((): PresetValue | "" => {
- const preset = presets.value.find((p) => isActive(p.value));
- return preset?.value ?? "";
-});
-
-const isActive = (preset: PresetValue): boolean => {
- if (preset === "WAITING_APPROVAL") {
- return (
- getValueFromSearchParams(props.params, "approval") ===
- Issue_ApprovalStatus[Issue_ApprovalStatus.PENDING]
- );
- }
-
- if (preset === "OPEN") {
- const status = getValueFromSearchParams(props.params, "status");
- const approval = getValueFromSearchParams(props.params, "approval");
- return status === IssueStatus[IssueStatus.OPEN] && !approval;
- }
-
- const statuses = getValuesFromSearchParams(props.params, "status");
-
- if (preset === "CLOSED") {
- return (
- statuses.includes(IssueStatus[IssueStatus.DONE]) &&
- !statuses.includes(IssueStatus[IssueStatus.OPEN])
- );
- }
-
- if (preset === "ALL") {
- return statuses.length === 0;
- }
-
- return false;
-};
-
-const selectPreset = (preset: PresetValue) => {
- const myEmail = me.value.email;
- const readonlyScopes = props.params.scopes.filter((s) => s.readonly);
-
- let newParams: SearchParams = {
- query: "",
- scopes: [...readonlyScopes],
- };
-
- if (preset === "WAITING_APPROVAL") {
- newParams = upsertScope({
- params: newParams,
- scopes: [
- { id: "status", value: IssueStatus[IssueStatus.OPEN] },
- {
- id: "approval",
- value: Issue_ApprovalStatus[Issue_ApprovalStatus.PENDING],
- },
- { id: "current-approver", value: myEmail },
- ],
- });
- } else if (preset === "OPEN") {
- newParams = upsertScope({
- params: newParams,
- scopes: [{ id: "status", value: IssueStatus[IssueStatus.OPEN] }],
- });
- } else if (preset === "CLOSED") {
- newParams = upsertScope({
- params: newParams,
- scopes: [
- { id: "status", value: IssueStatus[IssueStatus.DONE] },
- { id: "status", value: IssueStatus[IssueStatus.CANCELED] },
- ],
- allowMultiple: true,
- });
- }
- // "ALL" preset keeps only readonly scopes (already done above)
-
- emit("update:params", newParams);
-};
-</script>
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/index.ts b/frontend/src/components/IssueV1/components/IssueSearch/index.ts
deleted file mode 100644
index 80c736535b..0000000000
--- a/frontend/src/components/IssueV1/components/IssueSearch/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as IssueSearch } from "./IssueSearch.vue";
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts b/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts
deleted file mode 100644
index 7022eeb4d5..0000000000
--- a/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts
+++ /dev/null
@@ -1,294 +0,0 @@
-import type { Ref } from "vue";
-import { computed, h, ref, watchEffect } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRoute } from "vue-router";
-import BBAvatar from "@/bbkit/BBAvatar.vue";
-import type {
- ScopeOption,
- ValueOption,
-} from "@/components/AdvancedSearch/types";
-import { useCommonSearchScopeOptions } from "@/components/AdvancedSearch/useCommonSearchScopeOptions";
-import YouTag from "@/components/misc/YouTag.vue";
-import { useCurrentUserV1, useProjectV1Store, useUserStore } from "@/store";
-import { isValidProjectName } from "@/types";
-import { RiskLevel } from "@/types/proto-es/v1/common_pb";
-import {
- Issue_ApprovalStatus,
- Issue_Type,
- IssueStatus,
-} from "@/types/proto-es/v1/issue_service_pb";
-import { type Label } from "@/types/proto-es/v1/project_service_pb";
-import type { SearchParams, SearchScopeId } from "@/utils";
-import { getDefaultPagination } from "@/utils";
-
-export const useIssueSearchScopeOptions = (
- params: Ref<SearchParams>,
- supportOptionIdList: Ref<SearchScopeId[]>
-) => {
- const { t } = useI18n();
- const route = useRoute();
- const me = useCurrentUserV1();
- const projectStore = useProjectV1Store();
- const userStore = useUserStore();
-
- const projectName = computed(() => {
- const { projectId } = route?.params ?? {};
- if (projectId && typeof projectId === "string") {
- return `projects/${projectId}`;
- }
- const projectScope = params.value.scopes.find(
- (scope) => scope.id === "project"
- );
- if (projectScope) {
- return `projects/${projectScope.value}`;
- }
- return undefined;
- });
-
- const projectLabels = ref<Label[]>([]);
-
- watchEffect(async () => {
- if (!isValidProjectName(projectName.value)) {
- return;
- }
- const project = await projectStore.getOrFetchProjectByName(
- projectName.value!
- );
- const labels = new Map<string, Label>();
- for (const label of project.issueLabels) {
- const key = `${label.value}-${label.color}`;
- labels.set(key, label);
- }
- projectLabels.value = [...labels.values()];
- });
-
- const commonScopeOptions = useCommonSearchScopeOptions(supportOptionIdList);
-
- const searchPrincipalSearchValueOptions = () => {
- return ({
- keyword,
- nextPageToken,
- }: {
- keyword: string;
- nextPageToken?: string;
- }) =>
- userStore
- .fetchUserList({
- pageToken: nextPageToken,
- pageSize: getDefaultPagination(),
- filter: {
- query: keyword,
- },
- })
- .then((resp) => ({
- nextPageToken: resp.nextPageToken,
- options: resp.users.map<ValueOption>((user) => {
- return {
- value: user.email,
- keywords: [user.email, user.title],
- render: () => {
- const children = [
- h(BBAvatar, { size: "TINY", username: user.title }),
- renderSpan(user.title),
- ];
- if (user.name === me.value.name) {
- children.push(h(YouTag));
- }
- return h(
- "div",
- { class: "flex items-center gap-x-1" },
- children
- );
- },
- };
- }),
- }));
- };
-
- // fullScopeOptions provides full search scopes and options.
- // we need this as the source of truth.
- const fullScopeOptions = computed((): ScopeOption[] => {
- const scopes: ScopeOption[] = [
- ...commonScopeOptions.value,
- {
- id: "status",
- allowMultiple: true,
- title: t("common.status"),
- description: t("issue.advanced-search.scope.status.description"),
- options: [
- {
- value: IssueStatus[IssueStatus.OPEN],
- keywords: ["open"],
- render: () => renderSpan(t("issue.table.open")),
- },
- {
- value: IssueStatus[IssueStatus.DONE],
- keywords: ["closed", "done"],
- render: () => renderSpan(t("common.approved")),
- },
- {
- value: IssueStatus[IssueStatus.CANCELED],
- keywords: ["closed", "canceled"],
- render: () => renderSpan(t("common.closed")),
- },
- ],
- },
- {
- id: "approval",
- title: t("issue.advanced-search.scope.approval.title"),
- description: t("issue.advanced-search.scope.approval.description"),
- options: [
- {
- value: Issue_ApprovalStatus[Issue_ApprovalStatus.CHECKING],
- keywords: ["checking"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.approval.value.checking")
- ),
- },
- {
- value: Issue_ApprovalStatus[Issue_ApprovalStatus.PENDING],
- keywords: ["pending"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.approval.value.pending")
- ),
- },
- {
- value: Issue_ApprovalStatus[Issue_ApprovalStatus.APPROVED],
- keywords: ["approved", "done"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.approval.value.approved")
- ),
- },
- {
- value: Issue_ApprovalStatus[Issue_ApprovalStatus.REJECTED],
- keywords: ["rejected"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.approval.value.rejected")
- ),
- },
- {
- value: Issue_ApprovalStatus[Issue_ApprovalStatus.SKIPPED],
- keywords: ["skipped"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.approval.value.skipped")
- ),
- },
- ],
- },
- {
- id: "issue-type",
- title: t("issue.advanced-search.scope.issue-type.title"),
- description: t("issue.advanced-search.scope.issue-type.description"),
- allowMultiple: true,
- options: [
- {
- value: Issue_Type[Issue_Type.DATABASE_CHANGE],
- keywords: ["database", "change"],
- render: () =>
- renderSpan(
- t(
- "issue.advanced-search.scope.issue-type.value.database-change"
- )
- ),
- },
- {
- value: Issue_Type[Issue_Type.ROLE_GRANT],
- keywords: ["grant", "request"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.issue-type.value.role-grant")
- ),
- },
- {
- value: Issue_Type[Issue_Type.DATABASE_EXPORT],
- keywords: ["database", "export"],
- render: () =>
- renderSpan(
- t(
- "issue.advanced-search.scope.issue-type.value.database-export"
- )
- ),
- },
- {
- value: Issue_Type[Issue_Type.ACCESS_GRANT],
- keywords: ["access", "grant"],
- render: () =>
- renderSpan(
- t("issue.advanced-search.scope.issue-type.value.access-grant")
- ),
- },
- ],
- },
- {
- id: "creator",
- title: t("issue.advanced-search.scope.creator.title"),
- description: t("issue.advanced-search.scope.creator.description"),
- search: searchPrincipalSearchValueOptions(),
- },
- {
- id: "current-approver",
- title: t("issue.advanced-search.scope.current-approver.title"),
- description: t(
- "issue.advanced-search.scope.current-approver.description"
- ),
- search: searchPrincipalSearchValueOptions(),
- },
- {
- id: "issue-label",
- title: t("issue.advanced-search.scope.issue-label.title"),
- description: t("issue.advanced-search.scope.issue-label.description"),
- options: projectLabels.value.map((label) => {
- return {
- value: label.value,
- keywords: [label.value],
- render: () =>
- h("div", { class: "flex items-center gap-x-2" }, [
- h("div", {
- class: "w-4 h-4 rounded-sm",
- style: `background-color: ${label.color};`,
- }),
- label.value,
- ]),
- };
- }),
- allowMultiple: true,
- },
- {
- id: "risk-level",
- title: t("issue.risk-level.self"),
- description: t("issue.risk-level.filter"),
- allowMultiple: true,
- options: [
- {
- value: RiskLevel[RiskLevel.HIGH],
- keywords: ["high"],
- render: () => renderSpan(t("issue.risk-level.high")),
- },
- {
- value: RiskLevel[RiskLevel.MODERATE],
- keywords: ["moderate"],
- render: () => renderSpan(t("issue.risk-level.moderate")),
- },
- {
- value: RiskLevel[RiskLevel.LOW],
- keywords: ["low"],
- render: () => renderSpan(t("issue.risk-level.low")),
- },
- ],
- },
- ];
- const supportOptionIdSet = new Set(supportOptionIdList.value);
- return scopes.filter((scope) => supportOptionIdSet.has(scope.id));
- });
-
- return fullScopeOptions;
-};
-
-const renderSpan = (content: string) => {
- return h("span", {}, content);
-};
diff --git a/frontend/src/components/IssueV1/components/Panel/BatchIssueStatusActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/BatchIssueStatusActionPanel.vue
deleted file mode 100644
index a1c2fa059c..0000000000
--- a/frontend/src/components/IssueV1/components/Panel/BatchIssueStatusActionPanel.vue
+++ /dev/null
@@ -1,142 +0,0 @@
-<template>
- <CommonDrawer
- :show="action !== undefined"
- :title="title"
- :loading="state.loading"
- @show="comment = ''"
- @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">
- {{
- issueList.length === 1 ? $t("common.issue") : $t("common.issues")
- }}
- </div>
- <div class="textinfolabel">
- <ul
- class="flex flex-col"
- :class="[issueList.length > 1 && 'list-disc pl-4']"
- >
- <li v-for="issue in issueList" :key="issue.name">
- {{ issue.title }}
- </li>
- </ul>
- </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="flex justify-end gap-x-2">
- <NButton @click="$emit('close')">
- {{ $t("common.cancel") }}
- </NButton>
- <NButton
- v-bind="confirmButtonProps"
- @click="handleConfirm(action, comment)"
- >
- {{ $t("common.confirm") }}
- </NButton>
- </div>
- </template>
- </CommonDrawer>
-</template>
-
-<script setup lang="ts">
-import { create } from "@bufbuild/protobuf";
-import { NButton, NInput } from "naive-ui";
-import { computed, reactive, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { issueServiceClientConnect } from "@/connect";
-import { pushNotification } from "@/store";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import { BatchUpdateIssuesStatusRequestSchema } from "@/types/proto-es/v1/issue_service_pb";
-import CommonDrawer from "./CommonDrawer.vue";
-import type { IssueStatusAction } from "./issueStatusAction";
-import {
- IssueStatusActionToIssueStatusMap,
- issueStatusActionButtonProps,
- issueStatusActionDisplayName,
-} from "./issueStatusAction";
-
-type LocalState = {
- loading: boolean;
-};
-
-const props = defineProps<{
- issueList: Issue[];
- action?: IssueStatusAction;
-}>();
-
-const emit = defineEmits<{
- (event: "updating"): void;
- (event: "updated"): void;
- (event: "close"): void;
-}>();
-
-const { t } = useI18n();
-const state = reactive<LocalState>({
- loading: false,
-});
-const comment = ref("");
-
-const title = computed(() => {
- const { action } = props;
- if (!action) return "";
-
- return issueStatusActionDisplayName(action, props.issueList.length);
-});
-
-const confirmButtonProps = computed(() => {
- if (!props.action) return {};
- const p = issueStatusActionButtonProps(props.action);
- if (p.type === "default") {
- p.type = "primary";
- }
- return p;
-});
-
-const handleConfirm = async (
- action: IssueStatusAction,
- comment: string | undefined
-) => {
- state.loading = true;
-
- try {
- emit("updating");
- const request = create(BatchUpdateIssuesStatusRequestSchema, {
- parent: "projects/-",
- issues: props.issueList.map((issue) => issue.name),
- status: IssueStatusActionToIssueStatusMap[action],
- reason: comment ?? "",
- });
- await issueServiceClientConnect.batchUpdateIssuesStatus(request);
-
- // notify the parent component that issues updated
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("common.updated"),
- });
- emit("updated");
- } finally {
- state.loading = false;
- }
-};
-</script>
diff --git a/frontend/src/components/IssueV1/components/Panel/CommonDrawer.vue b/frontend/src/components/IssueV1/components/Panel/CommonDrawer.vue
deleted file mode 100644
index 8eb50b21c1..0000000000
--- a/frontend/src/components/IssueV1/components/Panel/CommonDrawer.vue
+++ /dev/null
@@ -1,51 +0,0 @@
-<template>
- <Drawer :show="show" :mask-closable="true" @close="$emit('close')">
- <DrawerContent
- :title="title"
- class="relative overflow-hidden w-128 max-w-[100vw]"
- >
- <template #default>
- <slot />
-
- <div
- v-if="loading"
- v-zindexable="{ enabled: true }"
- class="absolute inset-0 flex items-center justify-center bg-white/50"
- >
- <BBSpin />
- </div>
- </template>
-
- <template v-if="$slots.footer" #footer>
- <slot name="footer" />
- </template>
- </DrawerContent>
- </Drawer>
-</template>
-
-<script setup lang="ts">
-import { zindexable as vZindexable } from "vdirs";
-import { watch } from "vue";
-import { BBSpin } from "@/bbkit";
-import { Drawer, DrawerContent } from "@/components/v2";
-
-const props = defineProps<{
- title: string;
- show: boolean;
- loading: boolean;
-}>();
-
-const emit = defineEmits<{
- (event: "show"): void;
- (event: "close"): void;
-}>();
-
-watch(
- () => props.show,
- (newShow, oldShow) => {
- if (newShow && !oldShow) {
- emit("show");
- }
- }
-);
-</script>
diff --git a/frontend/src/components/IssueV1/components/Panel/index.ts b/frontend/src/components/IssueV1/components/Panel/index.ts
deleted file mode 100644
index ecce7079af..0000000000
--- a/frontend/src/components/IssueV1/components/Panel/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as BatchIssueStatusActionPanel } from "./BatchIssueStatusActionPanel.vue";
diff --git a/frontend/src/components/IssueV1/components/Panel/issueStatusAction.ts b/frontend/src/components/IssueV1/components/Panel/issueStatusAction.ts
deleted file mode 100644
index d8896f6413..0000000000
--- a/frontend/src/components/IssueV1/components/Panel/issueStatusAction.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import type { ButtonProps } from "naive-ui";
-import { t } from "@/plugins/i18n";
-import type { Issue } from "@/types/proto-es/v1/issue_service_pb";
-import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
-import {
- isAccessGrantIssue,
- isDatabaseDataExportIssue,
- isRoleGrantIssue,
-} from "@/utils";
-
-export type IssueStatusAction = "CLOSE" | "REOPEN";
-
-export const IssueStatusActionToIssueStatusMap: Record<
- IssueStatusAction,
- IssueStatus
-> = {
- CLOSE: IssueStatus.CANCELED,
- REOPEN: IssueStatus.OPEN,
-};
-
-const PossibleIssueStatusActionMap: Record<IssueStatus, IssueStatusAction[]> = {
- [IssueStatus.OPEN]: ["CLOSE"],
- // Done/resolved issues cannot be reopened
- [IssueStatus.DONE]: [],
- [IssueStatus.CANCELED]: ["REOPEN"],
-
- // Only to make TypeScript compiler happy
- [IssueStatus.ISSUE_STATUS_UNSPECIFIED]: [],
-};
-
-export const getApplicableIssueStatusActionList = (
- issue: Issue
-): IssueStatusAction[] => {
- const list = PossibleIssueStatusActionMap[issue.status];
- return list.filter((action) => {
- if (
- isRoleGrantIssue(issue) ||
- isAccessGrantIssue(issue) ||
- isDatabaseDataExportIssue(issue)
- ) {
- // Don't show REOPEN for roleGrant/accessGrant/dataExport issues.
- if (action === "REOPEN") {
- return false;
- }
- }
- return true;
- });
-};
-
-export const issueStatusActionDisplayName = (
- action: IssueStatusAction,
- count: number = 1
-) => {
- let actionText = "";
- switch (action) {
- case "CLOSE":
- actionText = t("issue.batch-transition.close");
- break;
- case "REOPEN":
- actionText = t("issue.batch-transition.reopen");
- break;
- default:
- return "";
- }
- if (count <= 1) {
- return actionText;
- }
- return t("issue.batch-transition.action-n-issues", {
- action: actionText,
- n: count,
- });
-};
-
-export const issueStatusActionButtonProps = (
- action: IssueStatusAction
-): ButtonProps => {
- switch (action) {
- case "CLOSE":
- return {
- type: "default",
- };
- case "REOPEN":
- return {
- type: "default",
- };
- }
-};
diff --git a/frontend/src/components/IssueV1/components/index.ts b/frontend/src/components/IssueV1/components/index.ts
index cdc088b67d..9f5840b847 100644
--- a/frontend/src/components/IssueV1/components/index.ts
+++ b/frontend/src/components/IssueV1/components/index.ts
@@ -1,5 +1 @@
-import { IssueSearch } from "./IssueSearch";
-
export * from "./RoleGrant";
-export * from "./Panel";
-export { IssueSearch };
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index aa635859a5..eddde24fe0 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1159,14 +1159,9 @@
"self": "Approval flow"
},
"batch-transition": {
- "action-n-issues": "{action} {n} issue | {action} {n} issues",
- "canceled-cannot-close": "Canceled issues cannot be closed",
"close": "Close",
"closed": "closed",
- "done-cannot-close": "Done issues cannot be closed",
- "done-cannot-reopen": "Done issues cannot be reopened",
"not-allowed-tips": "Some of selected issues cannot be {operation}",
- "open-cannot-reopen": "Open issues cannot be reopened",
"reopen": "Reopen",
"reopened": "reopened"
},
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 318dcca14a..d5a7de8b4e 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1159,14 +1159,9 @@
"self": "Flujo de aprobación"
},
"batch-transition": {
- "action-n-issues": "{action} {n} incidencia | {action} {n} incidencias",
- "canceled-cannot-close": "Canceled issues cannot be closed",
"close": "Cerrar",
"closed": "cerrado",
- "done-cannot-close": "Los problemas aprobados no se pueden cerrar",
- "done-cannot-reopen": "Los problemas aprobados no se pueden reabrir",
"not-allowed-tips": "Algunos de las incidencias seleccionadas no se pueden {operation}",
- "open-cannot-reopen": "Open issues cannot be reopened",
"reopen": "Reabrir",
"reopened": "reabierto"
},
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index c70246593f..9f3d99c849 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1159,14 +1159,9 @@
"self": "承認の流れ"
},
"batch-transition": {
- "action-n-issues": "{action} {n} 個のイシュー",
- "canceled-cannot-close": "Canceled issues cannot be closed",
"close": "閉じる",
"closed": "閉まっている",
- "done-cannot-close": "承認済みのイシューはクローズできません",
- "done-cannot-reopen": "承認済みのイシューは再オープンできません",
"not-allowed-tips": "選択したイシューの一部を {operation} にすることはできません",
- "open-cannot-reopen": "Open issues cannot be reopened",
"reopen": "再開",
"reopened": "再開"
},
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 4f2193b7ef..3a6377baf7 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1159,14 +1159,9 @@
"self": "Quy trình phê duyệt"
},
"batch-transition": {
- "action-n-issues": "{action} {n} vấn đề | {action} {n} vấn đề",
- "canceled-cannot-close": "Canceled issues cannot be closed",
"close": "Đóng",
"closed": "đã đóng",
- "done-cannot-close": "Vấn đề đã phê duyệt không thể đóng",
- "done-cannot-reopen": "Vấn đề đã phê duyệt không thể mở lại",
"not-allowed-tips": "Một số vấn đề đã chọn không thể {operation}",
- "open-cannot-reopen": "Open issues cannot be reopened",
"reopen": "Mở lại",
"reopened": "đã mở lại"
},
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index f865047600..cf9584dea4 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1159,14 +1159,9 @@
"self": "审批流"
},
"batch-transition": {
- "action-n-issues": "{action} {n} 个工单",
- "canceled-cannot-close": "已取消的工单无法关闭",
"close": "关闭",
"closed": "关闭",
- "done-cannot-close": "已完成的工单无法关闭",
- "done-cannot-reopen": "已完成的工单无法重开",
"not-allowed-tips": "部分选中的工单无法被{operation}",
- "open-cannot-reopen": "打开中的工单无法重开",
"reopen": "重开",
"reopened": "重开"
},
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index 4d2310ae66..0b3a899647 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -76,7 +76,7 @@ const planRoutes: RouteRecordRaw[] = [
},
];
-// Issue routes — uses IssueLayout (issue-only)
+// Issue routes
const issueRoutes: RouteRecordRaw[] = [
{
path: "issues/:issueId(\\d+)",
diff --git a/frontend/src/views/project/IssueDetailV1View.vue b/frontend/src/views/project/IssueDetailV1View.vue
deleted file mode 100644
index 240641848d..0000000000
--- a/frontend/src/views/project/IssueDetailV1View.vue
+++ /dev/null
@@ -1,69 +0,0 @@
-<template>
- <div v-if="isLoading" class="flex items-center justify-center h-full">
- <BBSpin />
- </div>
- <IssueBaseLayout v-else>
- <!-- Database Create View -->
- <DatabaseCreateView v-if="issueType === IssueType.CREATE_DATABASE" />
-
- <!-- Database Export View -->
- <DatabaseExportView v-else-if="issueType === IssueType.EXPORT_DATA" />
-
- <!-- Grant Request View -->
- <RoleGrantView v-else-if="issueType === IssueType.ROLE_GRANT" />
-
- <!-- Access Grant View -->
- <AccessGrantView v-else-if="issueType === IssueType.ACCESS_GRANT" />
-
- <!-- Database Change View -->
- <DatabaseChangeView v-else-if="issueType === IssueType.DATABASE_CHANGE" />
- </IssueBaseLayout>
-</template>
-
-<script lang="ts" setup>
-import { computed, onMounted, ref } from "vue";
-import { BBSpin } from "@/bbkit";
-import { usePlanContextWithIssue } from "@/components/Plan";
-import AccessGrantView from "@/components/Plan/components/IssueReviewView/AccessGrantView.vue";
-import { DatabaseChangeView } from "@/components/Plan/components/IssueReviewView/DatabaseChangeView";
-import DatabaseCreateView from "@/components/Plan/components/IssueReviewView/DatabaseCreateView.vue";
-import DatabaseExportView from "@/components/Plan/components/IssueReviewView/DatabaseExportView.vue";
-import IssueBaseLayout from "@/components/Plan/components/IssueReviewView/IssueBaseLayout.vue";
-import RoleGrantView from "@/components/Plan/components/IssueReviewView/RoleGrantView.vue";
-import { Issue_Type } from "@/types/proto-es/v1/issue_service_pb";
-
-enum IssueType {
- CREATE_DATABASE = "CREATE_DATABASE",
- EXPORT_DATA = "EXPORT_DATA",
- ROLE_GRANT = "ROLE_GRANT",
- ACCESS_GRANT = "ACCESS_GRANT",
- DATABASE_CHANGE = "DATABASE_CHANGE",
-}
-
-defineProps<{
- projectId: string;
- issueId: string;
-}>();
-
-const { plan, issue } = usePlanContextWithIssue();
-const isLoading = ref(true);
-
-const issueType = computed(() => {
- if (issue.value.type === Issue_Type.ROLE_GRANT) return IssueType.ROLE_GRANT;
- if (issue.value.type === Issue_Type.ACCESS_GRANT)
- return IssueType.ACCESS_GRANT;
-
- const specs = plan.value.specs;
- if (specs.every((s) => s.config.case === "createDatabaseConfig"))
- return IssueType.CREATE_DATABASE;
- if (specs.every((s) => s.config.case === "exportDataConfig"))
- return IssueType.EXPORT_DATA;
- if (specs.some((s) => s.config.case === "changeDatabaseConfig"))
- return IssueType.DATABASE_CHANGE;
- return undefined;
-});
-
-onMounted(() => {
- isLoading.value = false;
-});
-</script>
diff --git a/frontend/src/views/project/IssueLayout.vue b/frontend/src/views/project/IssueLayout.vue
deleted file mode 100644
index 83a1f67ef3..0000000000
--- a/frontend/src/views/project/IssueLayout.vue
+++ /dev/null
@@ -1,117 +0,0 @@
-<template>
- <div ref="containerRef" class="relative overflow-x-hidden h-full">
- <template v-if="ready">
- <PollerProvider>
- <div class="h-full flex flex-col">
- <HeaderSection />
-
- <div class="flex-1 flex border-t border-gray-100">
- <router-view v-slot="{ Component }">
- <keep-alive :max="3">
- <component :is="Component" />
- </keep-alive>
- </router-view>
- </div>
- </div>
- </PollerProvider>
- </template>
- <div v-else class="w-full h-full flex flex-col items-center justify-center">
- <NSpin />
- </div>
- </div>
-</template>
-
-<script lang="tsx" setup>
-import { NSpin } from "naive-ui";
-import { computed, ref, toRef, watch } from "vue";
-import { onBeforeRouteLeave, onBeforeRouteUpdate } from "vue-router";
-import {
- providePlanContext,
- useBasePlanContext,
- useInitializePlan,
-} from "@/components/Plan";
-import { HeaderSection } from "@/components/Plan/components";
-import { provideSidebarContext } from "@/components/Plan/logic/sidebar";
-import { useNavigationGuard } from "@/components/Plan/logic/useNavigationGuard";
-import PollerProvider from "@/components/Plan/PollerProvider.vue";
-import { useProjectByName } from "@/store";
-import { projectNamePrefix } from "@/store/modules/v1/common";
-import { setDocumentTitle } from "@/utils";
-
-const props = defineProps<{
- projectId: string;
- issueId?: string;
-}>();
-
-const {
- isCreating,
- plan,
- planCheckRuns,
- issue,
- rollout,
- taskRuns,
- isInitializing,
-} = useInitializePlan(
- toRef(props, "projectId"),
- undefined,
- toRef(props, "issueId")
-);
-const planBaseContext = useBasePlanContext({
- isCreating,
- plan,
- issue,
-});
-const containerRef = ref<HTMLElement>();
-
-const ready = computed(() => {
- return (!!issue.value || !!plan.value) && !isInitializing.value;
-});
-
-const { confirmNavigation } = useNavigationGuard();
-
-providePlanContext({
- isCreating,
- plan,
- planCheckRuns,
- issue,
- rollout,
- taskRuns,
- ...planBaseContext,
-});
-
-provideSidebarContext(containerRef);
-
-const projectName = computed(() => `${projectNamePrefix}${props.projectId}`);
-const { project } = useProjectByName(projectName);
-
-watch(
- [
- isCreating,
- ready,
- () => issue.value?.title,
- () => plan.value?.title,
- () => project.value.title,
- ],
- () => {
- if (ready.value) {
- const entityTitle = issue.value?.title || plan.value?.title;
- if (entityTitle) {
- setDocumentTitle(entityTitle, project.value.title);
- }
- }
- },
- { immediate: true }
-);
-
-const handleRouteNavigation = async (
- _to: unknown,
- _from: unknown,
- next: (proceed?: boolean) => void
-) => {
- const canNavigate = await confirmNavigation();
- next(canNavigate);
-};
-
-onBeforeRouteLeave(handleRouteNavigation);
-onBeforeRouteUpdate(handleRouteNavigation);
-</script>