-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Issue/#103 extend sentry report
- Loading branch information
Showing
8 changed files
with
293 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import SentryPageExtra from './sentry-page-extra.vue' | ||
|
||
export { SentryPageExtra } |
23 changes: 23 additions & 0 deletions
23
src/screens/sentry/ui/sentry-page-extra/sentry-page-extra.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
import { useSentry } from "~/src/entities/sentry"; | ||
import { sentryLaravelMock, sentrySpiralMock } from '~/src/entities/sentry/mocks'; | ||
import SentryPageExtra from './sentry-page-extra.vue'; | ||
|
||
const { normalizeSentryEvent } = useSentry(); | ||
|
||
export default { | ||
title: "Screens/sentry/SentryPageExtra", | ||
component: SentryPageExtra | ||
} as Meta<typeof SentryPageExtra>; | ||
|
||
export const Laravel: StoryObj<typeof SentryPageExtra> = { | ||
args: { | ||
extra: normalizeSentryEvent(sentryLaravelMock).payload.extra, | ||
} | ||
}; | ||
|
||
export const Spiral: StoryObj<typeof SentryPageExtra> = { | ||
args: { | ||
extra: normalizeSentryEvent(sentrySpiralMock).payload.extra, | ||
} | ||
}; |
113 changes: 113 additions & 0 deletions
113
src/screens/sentry/ui/sentry-page-extra/sentry-page-extra.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<script lang="ts" setup> | ||
import { ref } from "vue"; | ||
import type { Sentry } from "~/src/entities/sentry/types"; | ||
import { IconSvg, TableBase, TableBaseRow } from "~/src/shared/ui"; | ||
type Props = { | ||
extra: Sentry["extra"]; | ||
}; | ||
const props = defineProps<Props>(); | ||
const ddStates = ref( | ||
Object.keys(props.extra || {}).reduce( | ||
(acc, key) => { | ||
acc[key] = false; | ||
return acc; | ||
}, | ||
{} as Record<string, boolean>, | ||
), | ||
); | ||
</script> | ||
|
||
<template> | ||
<section class="sentry-page-extra"> | ||
<h3 class="sentry-page-extra__head">Extra</h3> | ||
|
||
<div class="sentry-page-extra__in"> | ||
<div | ||
v-for="(value, key) in extra" | ||
:key="key" | ||
class="sentry-page-extra__wrapper" | ||
:class="{ | ||
'sentry-page-extra__wrapper--open': ddStates[key], | ||
}" | ||
> | ||
<h3 | ||
class="sentry-page-extra__title" | ||
@click="ddStates[key] = !ddStates[key]" | ||
> | ||
{{ key }} | ||
|
||
<IconSvg | ||
class="sentry-page-extra__title-dd" | ||
:class="{ | ||
'sentry-page-extra__title-dd--open': ddStates[key], | ||
}" | ||
name="dd" | ||
/> | ||
</h3> | ||
|
||
<TableBase v-if="value" class="sentry-page-extra__content"> | ||
<TableBaseRow | ||
v-for="(v, t) in value" | ||
:key="t" | ||
:title="String(t || '')" | ||
> | ||
{{ JSON.stringify(v) }} | ||
</TableBaseRow> | ||
</TableBase> | ||
</div> | ||
</div> | ||
</section> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "src/assets/mixins"; | ||
.sentry-page-extra { | ||
} | ||
.sentry-page-extra__wrapper { | ||
@apply dark:bg-gray-900 bg-gray-100 p-3 border border-purple-300 dark:border-gray-400; | ||
&:first-child { | ||
@apply rounded-t-md; | ||
} | ||
&:last-child { | ||
@apply rounded-b-md; | ||
} | ||
} | ||
.sentry-page-extra__head { | ||
@include text-muted; | ||
@apply font-bold uppercase text-sm flex justify-between mb-3; | ||
} | ||
.sentry-page-extra__title { | ||
@include text-muted; | ||
@apply font-bold uppercase text-sm flex justify-between; | ||
} | ||
.sentry-page-extra__url { | ||
@apply mb-1 text-lg font-medium; | ||
} | ||
.sentry-page-extra__title-dd { | ||
@apply ml-2 w-5 ml-auto transform rotate-180; | ||
} | ||
.sentry-page-extra__title-dd--open { | ||
@apply rotate-0; | ||
} | ||
.sentry-page-extra__content { | ||
display: none; | ||
@apply mt-3; | ||
.sentry-page-extra__wrapper--open & { | ||
display: block; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.