Skip to content
Merged
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"postcss-config-custom": "*",
"rollup-plugin-visualizer": "^5.9.0",
"tsconfig": "*",
"vite": "^4.5.10",
"vite": "^4.5.11",
"vite-plugin-stylelint": "^3.3.3",
"vite-plugin-vue-type-imports": "^0.2.4",
"vitest": "^3.0.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ const state = reactive({
const info = channelInfo as AlertHistoryNotificationChannelInfoType;
let target = '';
if (type === TYPE.SERVICE) {
target = storeState.service[storeState.alertInfo.service_id].label;
target = storeState.service[storeState.alertInfo.service_id]?.label || storeState.alertInfo.service_id;
} else if (type === TYPE.USER_GROUP) {
target = storeState.userGroup[info.user_group_id || ''].label;
target = storeState.userGroup[info.user_group_id || '']?.label || info.user_group_id;
} else if (type === TYPE.USER) {
target = storeState.user[info.user_id || ''].label;
target = storeState.user[info.user_id || '']?.label || info.user_id;
}
return {
type,
Expand Down
26 changes: 24 additions & 2 deletions apps/web/src/services/alert-manager/v2/pages/ServiceDetailPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ import {
} from 'vue';
import { useRouter } from 'vue-router/composables';

import { isEmpty } from 'lodash';

import type { Route } from '@cloudforet/mirinae/types/navigation/breadcrumbs/type';

import { i18n } from '@/translations';

import { useAllReferenceStore } from '@/store/reference/all-reference-store';
import type { ServiceReferenceMap } from '@/store/reference/service-reference-store';

import type { FavoriteOptions } from '@/common/modules/favorites/favorite-button/type';
import { FAVORITE_TYPE } from '@/common/modules/favorites/favorite-button/type';
import { useGnbStore } from '@/common/modules/navigations/stores/gnb-store';
Expand All @@ -14,7 +23,6 @@ import ServiceDetailTabs from '@/services/alert-manager/v2/components/ServiceDet
import { ALERT_MANAGER_ROUTE } from '@/services/alert-manager/v2/routes/route-constant';
import { useServiceDetailPageStore } from '@/services/alert-manager/v2/stores/service-detail-page-store';


interface Props {
serviceId: string;
}
Expand All @@ -24,15 +32,24 @@ const props = withDefaults(defineProps<Props>(), {

const gnbStore = useGnbStore();
const serviceDetailPageStore = useServiceDetailPageStore();
const allReferenceStore = useAllReferenceStore();
const allReferenceGetters = allReferenceStore.getters;

const router = useRouter();


const storeState = reactive({
serviceList: computed<ServiceReferenceMap>(() => allReferenceGetters.service),
});
const state = reactive({
favoriteOptions: computed<FavoriteOptions>(() => ({
type: FAVORITE_TYPE.SERVICE,
id: props.serviceId,
})),
pageNavigation: computed<Route[]>(() => [
{ name: i18n.t('MENU.ALERT_MANAGER') as string, to: { name: ALERT_MANAGER_ROUTE._NAME } },
{ name: i18n.t('MENU.ALERT_MANAGER_SERVICE') as string, to: { name: ALERT_MANAGER_ROUTE.SERVICE._NAME } },
{ name: storeState.serviceList[props.serviceId].label },
]),
});
watch(() => props.serviceId, async (serviceId) => {
if (!serviceId) return;
Expand All @@ -43,6 +60,10 @@ watch(() => props.serviceId, async (serviceId) => {
await serviceDetailPageStore.fetchServiceDetailData(serviceId);
await gnbStore.setFavoriteItemId(state.favoriteOptions);
}, { immediate: true });
watch(() => storeState.serviceList, async (serviceList) => {
if (isEmpty(serviceList)) return;
gnbStore.setBreadcrumbs(state.pageNavigation);
}, { immediate: true });

onMounted(() => {
if (!props.serviceId) {
Expand All @@ -52,6 +73,7 @@ onMounted(() => {

onUnmounted(() => {
serviceDetailPageStore.initState();
gnbStore.setBreadcrumbs([]);
});
</script>

Expand Down
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tsc-alias": "^1.6.11",
"tsc-watch": "^6.0.0",
"tsconfig": "*",
"vite": "^4.5.10"
"vite": "^4.5.11"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mirinae/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"tsc-alias": "^1.6.11",
"tsc-watch": "^6.0.0",
"tsconfig": "*",
"vite": "^4.5.10",
"vite": "^4.5.11",
"vite-plugin-stylelint": "^3.3.3",
"vue-router": "^3.6.5",
"vue-tsc": "^2.2.8"
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"tsc-alias": "^1.6.11",
"tsc-watch": "^6.0.0",
"tsconfig": "*",
"vite": "^4.5.10"
"vite": "^4.5.11"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"globalDependencies": [
"turbo.json", "package.json", "package-lock.json"
],
"globalEnv": ["VITE_VERCEL_EDGE_CONFIG"],
"tasks": {
"@cloudforet/utils#build": {
"outputs": ["./dist/**"],
Expand Down
Loading