Skip to content

Commit

Permalink
fix type errors with call-stat-board
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Sep 21, 2024
1 parent 8d26048 commit 824939a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
10 changes: 1 addition & 9 deletions src/entities/profiler/ui/call-graph/call-graph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,7 @@ const percentLabel = computed(() => (metric.value === GraphTypes.CALLS ? 'Min ca
:height="graphHeight"
>
<template #default="{ data }">
<CallStatBoard
:edge="{
callee: data?.callee,
caller: '',
cost: data?.cost,
id: '',
parent: data?.parent
}"
/>
<CallStatBoard :title="data?.callee" :cost="data?.cost" />
</template>
</RenderGraph>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default {

export const Default: StoryObj<typeof CallStatBoard> = {
args: {
edge: profilerEdgesMock.e5
title: profilerEdgesMock.e5.caller,
cost: profilerEdgesMock.e5.cost
}
};
10 changes: 5 additions & 5 deletions src/entities/profiler/ui/call-stat-board/call-stat-board.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { defineProps } from 'vue'
import { StatBoard, StatBoardSize } from '@/shared/ui'
import type { ProfilerEdge } from '../../types'
import { StatBoard, type StatBoardCost, StatBoardSize } from '@/shared/ui'
type Props = {
edge: ProfilerEdge
cost: StatBoardCost
title: string
}
defineProps<Props>()
Expand All @@ -13,10 +13,10 @@ defineProps<Props>()
<template>
<div class="call-stat-board">
<h4 class="call-stat-board__title">
{{ edge.callee }}
{{ title }}
</h4>

<StatBoard class="call-stat-board__body" :cost="edge.cost" :size="StatBoardSize.Small" />
<StatBoard class="call-stat-board__body" :cost="cost" :size="StatBoardSize.Small" />
</div>
</template>

Expand Down
3 changes: 2 additions & 1 deletion src/entities/profiler/ui/profiler-page/profiler-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const tabChange = (selectedTab: { tab: { name: string } }) => {
<CallStatBoard
v-if="activeEdge"
class="profiler-page__hover-edge"
:edge="activeEdge"
:title="activeEdge.callee"
:cost="activeEdge.cost"
:style="activeEdgeStyle"
/>
</main>
Expand Down

0 comments on commit 824939a

Please sign in to comment.