Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add v2 dir on project for and refactor for version branching #5700

Merged
merged 7 commits into from
Mar 19, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { SearchTab } from '@/common/modules/navigations/top-bar/modules/top

import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-constant';
import { DASHBOARDS_ROUTE } from '@/services/dashboards/routes/route-constant';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const queryHelper = new QueryHelper();

Expand All @@ -20,7 +20,7 @@ export const topBarSearchReferenceRouter = (type: Exclude<SearchTab, 'service'>,
};
case SEARCH_TAB.PROJECT:
return {
name: PROJECT_ROUTE.DETAIL._NAME,
name: PROJECT_ROUTE_V1.DETAIL._NAME,
params: { id: resourceId, workspaceId },
};
case SEARCH_TAB.DASHBOARD:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-c
import { COST_EXPLORER_ROUTE } from '@/services/cost-explorer/routes/route-constant';
import { useDashboardQuery } from '@/services/dashboards/composables/use-dashboard-query';
import { DASHBOARDS_ROUTE } from '@/services/dashboards/routes/route-constant';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const FAVORITE_LIMIT = 5;

Expand Down Expand Up @@ -244,7 +244,7 @@ const handleClickMenuButton = (type: FavoriteType) => {
// Dashboard and Cost Analysis are added after (Planning).
if (type === FAVORITE_TYPE.PROJECT) {
router.replace({
name: PROJECT_ROUTE._NAME,
name: PROJECT_ROUTE_V1._NAME,
});
}
emit('close');
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/common/modules/page-layouts/type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TranslateResult } from 'vue-i18n';
import type { Location } from 'vue-router';

import type { ProjectGroupTreeNodeData } from '@/services/project/types/project-tree-type';
import type { ProjectGroupTreeNodeData } from '@/services/project/v-shared/types/project-tree-type';

export interface Breadcrumb {
name: TranslateResult|string;
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/common/modules/project/ProjectLinkButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useUserWorkspaceStore } from '@/store/app-context/workspace/user-worksp
import { useProjectReferenceStore } from '@/store/reference/project-reference-store';


import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const props = defineProps<{
projectId: string;
Expand All @@ -25,7 +25,7 @@ const userWorkspaceStore = useUserWorkspaceStore();

const hasProjectReferenceLoaded = computed<boolean>(() => !!projectReferenceStore.getters.projectItems);
const projectPageLocation = computed<Location>(() => ({
name: PROJECT_ROUTE.DETAIL._NAME,
name: PROJECT_ROUTE_V1.DETAIL._NAME,
params: {
workspaceId: userWorkspaceStore.getters.currentWorkspaceId as string,
id: props.projectId,
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/common/modules/project/ProjectSelectDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import ErrorHandler from '@/common/composables/error/errorHandler';

import { indigo, peacock } from '@/styles/colors';

import type { ProjectTreeOptions } from '@/services/project/composables/use-project-tree';
import { useProjectTree } from '@/services/project/composables/use-project-tree';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import type { ProjectTreeOptions } from '@/services/project/v-shared/composables/use-project-tree';
import { useProjectTree } from '@/services/project/v-shared/composables/use-project-tree';
import type {
ProjectTreeItem, ProjectTreeNodeData, ProjectTreeRoot, ProjectTreeItemType,
ProjectTreeNode,
} from '@/services/project/types/project-tree-type';
} from '@/services/project/v-shared/types/project-tree-type';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

interface ProjectGroupSelectOptions {
id: string;
Expand Down Expand Up @@ -253,7 +253,7 @@ const refreshProjectTree = async () => {

const handleClickCreateButton = () => {
window.open(SpaceRouter.router.resolve({
name: PROJECT_ROUTE._NAME,
name: PROJECT_ROUTE_V1._NAME,
...(props.workspaceId ? { params: { workspaceId: props.workspaceId } } : {}),
}).href);
state.visibleMenu = false;
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/lib/helper/router-recent-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-c
import { MANAGED_COST_QUERY_SET_ID_LIST } from '@/services/cost-explorer/constants/managed-cost-analysis-query-sets';
import { COST_EXPLORER_ROUTE } from '@/services/cost-explorer/routes/route-constant';
import { DASHBOARDS_ROUTE } from '@/services/dashboards/routes/route-constant';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

interface RecentConfig {
itemType: RecentType;
Expand Down Expand Up @@ -49,15 +49,15 @@ export const getRecentConfig = (to: Route): RecentConfig | undefined => {
}

/* PROJECT GROUP */
if (to.name === PROJECT_ROUTE._NAME) {
if (to.name === PROJECT_ROUTE_V1._NAME) {
const projectGroupId = to?.params?.projectGroupId;
if (projectGroupId?.length) {
return { itemType: RECENT_TYPE.PROJECT_GROUP, workspaceId, itemId: projectGroupId as string };
}
}

/* PROJECT */
if (to.name === PROJECT_ROUTE.DETAIL.TAB.SUMMARY._NAME) {
if (to.name === PROJECT_ROUTE_V1.DETAIL.TAB.SUMMARY._NAME) {
const projectId = to?.params?.id;
if (!projectId) return undefined;
return { itemType: RECENT_TYPE.PROJECT, workspaceId, itemId: projectId };
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/lib/menu/menu-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { INFO_ROUTE } from '@/services/info/routes/route-constant';
import { MY_PAGE_ROUTE } from '@/services/my-page/routes/route-constant';
import { ADMIN_OPS_FLOW_ROUTE } from '@/services/ops-flow/routes/admin/route-constant';
import { OPS_FLOW_ROUTE } from '@/services/ops-flow/routes/route-constant';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';
import { WORKSPACE_HOME_ROUTE } from '@/services/workspace-home/routes/route-constant';

export const MENU_INFO_MAP: Record<MenuId, MenuInfo> = Object.freeze({
Expand All @@ -33,7 +33,7 @@ export const MENU_INFO_MAP: Record<MenuId, MenuInfo> = Object.freeze({
},
[MENU_ID.PROJECT]: {
menuId: MENU_ID.PROJECT,
routeName: PROJECT_ROUTE._NAME,
routeName: PROJECT_ROUTE_V1._NAME,
translationId: 'MENU.PROJECT',
icon: 'ic_service_project',
},
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/lib/reference/referenceRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { Reference, ResourceType } from '@/lib/reference/type';

import { ADMIN_ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/admin/route-constant';
import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-constant';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

interface LinkFormatter {
(baseUrl: string, data: string, reference: Reference, query: Location['query']): Location;
Expand Down Expand Up @@ -108,12 +108,12 @@ const routerMap = (isAdminMode?: boolean): RouterMap => ({
},
'identity.Project':
{
name: PROJECT_ROUTE.DETAIL.TAB.SUMMARY._NAME,
name: PROJECT_ROUTE_V1.DETAIL.TAB.SUMMARY._NAME,
formatter: projectLinkFormatter,
},
'identity.ProjectGroup':
{
name: PROJECT_ROUTE._NAME,
name: PROJECT_ROUTE_V1._NAME,
formatter: projectGroupLinkFormatter,
},
'inventory.Collector':
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/router/alert-manager-v1-workspace-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import dashboardsRoute from '@/services/dashboards/routes/routes';
import iamRoutes from '@/services/iam/routes/routes';
import infoRoute from '@/services/info/routes/routes';
import opsFlowRoutes from '@/services/ops-flow/routes/routes';
import projectRoute from '@/services/project/routes/routes';
import projectRoute from '@/services/project/v1/routes/routes';
import workspaceHomeRoute from '@/services/workspace-home/routes/routes';


Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/router/workspace-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dashboardsRoute from '@/services/dashboards/routes/routes';
import iamRoutes from '@/services/iam/routes/routes';
import infoRoute from '@/services/info/routes/routes';
import opsFlowRoutes from '@/services/ops-flow/routes/routes';
import projectRoute from '@/services/project/routes/routes';
import projectRoute from '@/services/project/v1/routes/routes';
import workspaceHomeRoute from '@/services/workspace-home/routes/routes';


Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/services/advanced/components/BookmarkTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { gray } from '@/styles/colors';
import { getWorkspaceInfo } from '@/services/advanced/composables/refined-table-data';
import { ADMIN_ADVANCED_ROUTE } from '@/services/advanced/routes/admin/route-constant';
import { useBookmarkPageStore } from '@/services/advanced/store/bookmark-page-store';
import type { TreeNode } from '@/services/project/tree/type';
import type { TreeNode } from '@/services/project/v-shared/tree/type';

const gnbStore = useGnbStore();
const bookmarkPageStore = useBookmarkPageStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ErrorHandler from '@/common/composables/error/errorHandler';
import { BACKGROUND_COLOR } from '@/styles/colorsets';

import AlertDashboardProjectSearchWidgetAlertList from '@/services/alert-manager/v1/components/AlertDashboardProjectSearchWidgetAlertList.vue';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';


const props = defineProps<{
Expand Down Expand Up @@ -99,7 +99,7 @@ const onChange = async (options?: any) => {
await listAlertByProject();
};
const onClickProjectBox = (item) => {
router.push({ name: PROJECT_ROUTE.DETAIL.TAB.ALERT._NAME, params: { id: item.project_id } });
router.push({ name: PROJECT_ROUTE_V1.DETAIL.TAB.ALERT._NAME, params: { id: item.project_id } });
};

/* init */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { UserReferenceMap } from '@/store/reference/user-reference-store';
import ErrorHandler from '@/common/composables/error/errorHandler';

import AlertListItem from '@/services/alert-manager/v1/components/AlertListItem.vue';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const props = defineProps<{
projectId: string;
Expand Down Expand Up @@ -85,7 +85,7 @@ watch(() => props.projectId, async (projectId) => {
<div v-else
class="view-all-text"
>
<p-link :to="{ name: PROJECT_ROUTE.DETAIL.TAB.ALERT._NAME, params: { id: props.projectId } }"
<p-link :to="{ name: PROJECT_ROUTE_V1.DETAIL.TAB.ALERT._NAME, params: { id: props.projectId } }"
:text="$t('MONITORING.ALERT.DASHBOARD.VIEW_ALL_OPEN_ALERTS')"
highlight
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ErrorHandler from '@/common/composables/error/errorHandler';
import { useProxyValue } from '@/common/composables/proxy-state';
import ProjectSelectDropdown from '@/common/modules/project/ProjectSelectDropdown.vue';

import type { ProjectTreeNodeData } from '@/services/project/types/project-tree-type';
import type { ProjectTreeNodeData } from '@/services/project/v-shared/types/project-tree-type';

const props = defineProps<{
visible: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import AlertMainResolveModal from '@/services/alert-manager/v1/components/AlertM
import { useAlertStateI18n } from '@/services/alert-manager/v1/composables/alert-state-i18n';
import { useAlertUrgencyI18n } from '@/services/alert-manager/v1/composables/alert-urgency-i18n';
import { alertStateBadgeStyleTypeFormatter } from '@/services/alert-manager/v1/helpers/alert-badge-helper';
import { useProjectDetailPageStore } from '@/services/project/stores/project-detail-page-store';
import { useProjectDetailPageStore } from '@/services/project/v1/stores/project-detail-page-store';


const DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useUserWorkspaceStore } from '@/store/app-context/workspace/user-worksp
import type { ReferenceItem } from '@/store/reference/type';


import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const props = defineProps<{
value?: string;
Expand All @@ -35,7 +35,7 @@ const state = reactive({
if (props.disableLink) return undefined;
if (props.webhookReference) {
return {
name: PROJECT_ROUTE.DETAIL.TAB.ALERT._NAME,
name: PROJECT_ROUTE_V1.DETAIL.TAB.ALERT._NAME,
params: {
id: props.projectId ?? '',
workspaceId: userWorkspaceStore.getters.currentWorkspaceId,
Expand All @@ -47,7 +47,7 @@ const state = reactive({
};
} if (props.userReference) {
return {
name: PROJECT_ROUTE.DETAIL.TAB.SUMMARY._NAME,
name: PROJECT_ROUTE_V1.DETAIL.TAB.SUMMARY._NAME,
params: {
id: props.projectId ?? '',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import EscalationPolicyFormRulesInput from '@/services/alert-manager/v1/componen
import { ACTION } from '@/services/alert-manager/v1/constants/alert-constant';
import { useEscalationPolicyFormStore } from '@/services/alert-manager/v1/stores/escalation-policy-form-store';
import type { ActionMode } from '@/services/alert-manager/v1/types/alert-type';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import type { ProjectTreeNodeData } from '@/services/project/types/project-tree-type';
import type { ProjectTreeNodeData } from '@/services/project/v-shared/types/project-tree-type';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const props = withDefaults(defineProps<{
mode: ActionMode;
Expand Down Expand Up @@ -188,7 +188,7 @@ watch([() => escalationPolicyFormState.resourceGroup, () => invalidState.name, (
action-icon="internal-link"
new-tab
size="sm"
:to="{ name: PROJECT_ROUTE._NAME, params: { workspaceId: userWorkspaceStore.getters.currentWorkspaceId } }"
:to="{ name: PROJECT_ROUTE_V1._NAME, params: { workspaceId: userWorkspaceStore.getters.currentWorkspaceId } }"
:text="$t('MONITORING.ALERT.ESCALATION_POLICY.FORM.GO_CREATE_PROJECT')"
highlight
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ import { useUserWorkspaceStore } from '@/store/app-context/workspace/user-worksp
import ErrorHandler from '@/common/composables/error/errorHandler';
import { useFormValidator } from '@/common/composables/form-validator';


import ProjectChannelList from '@/services/alert-manager/v1/components/ProjectChannelList.vue';
import { useEscalationPolicyFormStore } from '@/services/alert-manager/v1/stores/escalation-policy-form-store';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';

import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const NOTIFICATION_LEVELS: {name: EscalationPolicyRule['notification_level']; label: string}[] = [
{ name: 'ALL', label: 'All' },
Expand Down Expand Up @@ -173,7 +171,7 @@ watch(() => isAllValid.value, (_isAllValid) => {
action-icon="internal-link"
new-tab
:text="$t('MONITORING.ALERT.ESCALATION_POLICY.FORM.NOTIFICATIONS_SETTINGS')"
:to="{ name: PROJECT_ROUTE.DETAIL.TAB.NOTIFICATIONS._NAME, params: {
:to="{ name: PROJECT_ROUTE_V1.DETAIL.TAB.NOTIFICATIONS._NAME, params: {
id: escalationPolicyFormState.projectId,
workspaceId: userWorkspaceStore.getters.currentWorkspaceId
} }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { gray } from '@/styles/colors';
import { SERVICE_DETAIL_TABS } from '@/services/alert-manager/v2/constants/common-constant';
import { ALERT_MANAGER_ROUTE } from '@/services/alert-manager/v2/routes/route-constant';
import { useServiceDetailPageStore } from '@/services/alert-manager/v2/stores/service-detail-page-store';
import type { TreeNode } from '@/services/project/tree/type';
import type { TreeNode } from '@/services/project/v-shared/tree/type';

interface Props {
hideSidebar: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import ErrorHandler from '@/common/composables/error/errorHandler';

import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-constant';
import { useCloudServiceDetailPageStore } from '@/services/asset-inventory/stores/cloud-service-detail-page-store';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

interface Props {
cloudServiceId: string;
Expand Down Expand Up @@ -143,7 +143,7 @@ const handleClickLinkButton = async (type: string, id: string) => {
}
} else {
window.open(router.resolve({
name: PROJECT_ROUTE.DETAIL._NAME,
name: PROJECT_ROUTE_V1.DETAIL._NAME,
params: { id, workspaceId: state.data.workspace_id },
}).href, '_blank');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import ErrorHandler from '@/common/composables/error/errorHandler';
import { BASE_INFORMATION } from '@/services/asset-inventory/constants/cloud-service-detail-constant';
import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-constant';
import { useCloudServiceDetailPageStore } from '@/services/asset-inventory/stores/cloud-service-detail-page-store';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

interface Props {
cloudServiceIdList: string[];
Expand Down Expand Up @@ -137,7 +137,7 @@ const handleClickLinkButton = async (type: string, workspaceId: string, id: stri
}
} else {
window.open(router.resolve({
name: PROJECT_ROUTE.DETAIL._NAME,
name: PROJECT_ROUTE_V1.DETAIL._NAME,
params: { id, workspaceId },
}).href, '_blank');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import BoardTaskTable from '@/services/ops-flow/components/BoardTaskTable.vue';
import {
useTaskManagementTemplateStore,
} from '@/services/ops-flow/task-management-templates/stores/use-task-management-template-store';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

interface Props {
tableState: any;
Expand Down Expand Up @@ -131,7 +131,7 @@ const handleClickLinkButton = async (type: string, workspaceId: string, id: stri
}
} else {
window.open(router.resolve({
name: PROJECT_ROUTE.DETAIL._NAME,
name: PROJECT_ROUTE_V1.DETAIL._NAME,
params: { id, workspaceId },
}).href, '_blank');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { getAccountFields, stateFormatter } from '@/services/asset-inventory/hel
import { ASSET_INVENTORY_ROUTE } from '@/services/asset-inventory/routes/route-constant';
import { useServiceAccountPageStore } from '@/services/asset-inventory/stores/service-account-page-store';
import { useServiceAccountSchemaStore } from '@/services/asset-inventory/stores/service-account-schema-store';
import { PROJECT_ROUTE } from '@/services/project/routes/route-constant';
import { PROJECT_ROUTE_V1 } from '@/services/project/v1/routes/route-constant';

const props = withDefaults(defineProps<{
serviceAccountId: string;
Expand Down Expand Up @@ -360,7 +360,7 @@ watch(() => state.trustedAccountId, async (ta) => {
</template>
<template #col-project_id-format="{value, item}">
<span class="project-id-wrapper">
<router-link :to="{ name: PROJECT_ROUTE.DETAIL._NAME, params: { id: value, workspaceId: item.workspace_id } }"
<router-link :to="{ name: PROJECT_ROUTE_V1.DETAIL._NAME, params: { id: value, workspaceId: item.workspace_id } }"
target="_blank"
>
<span>{{ state.project[value]?.label }}</span>
Expand Down
Loading
Loading