Skip to content

Commit

Permalink
[#131] remove link from preview-card bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Jun 4, 2024
1 parent 3fad6b1 commit 6c6889c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 31 deletions.
9 changes: 4 additions & 5 deletions src/entities/http-dump/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ type Props = {
const props = defineProps<Props>();
const eventLink = `/http-dumps/${props.event.id}`;
const uri = decodeURI(props.event.payload.request.uri);
</script>

<template>
<PreviewCard class="preview-card" :event="event">
<NuxtLink :to="eventLink" class="preview-card__link">
<div class="preview-card__content">
<span class="preview-card__method">
{{ event.payload.request.method }} </span
>:
<span class="preview-card__uri">/{{ uri }}</span>
</NuxtLink>
</div>
</PreviewCard>
</template>

Expand All @@ -31,8 +30,8 @@ const uri = decodeURI(props.event.payload.request.uri);
@apply flex flex-col text-2xs md:text-xs;
}
.preview-card__link {
@apply cursor-pointer p-2 md:p-3 bg-gray-200 dark:bg-gray-800;
.preview-card__content {
@apply p-2 md:p-3 bg-gray-200 dark:bg-gray-800;
}
.preview-card__method {
Expand Down
14 changes: 6 additions & 8 deletions src/entities/inspector/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { computed, defineProps } from "vue";
import { defineProps } from "vue";
import type { NormalizedEvent } from "~/src/shared/types";
import { PreviewCard } from "~/src/shared/ui";
import type { Inspector } from "../../types";
Expand All @@ -9,16 +9,14 @@ type Props = {
event: NormalizedEvent<Inspector>;
};
const props = defineProps<Props>();
const eventLink = computed(() => `/inspector/${props.event.id}`);
defineProps<Props>();
</script>

<template>
<PreviewCard class="preview-card" :event="event">
<NuxtLink :to="eventLink" class="preview-card__link">
<div class="preview-card__content">
<InspectorStatBoard :transaction="event.payload[0]" />
</NuxtLink>
</div>
</PreviewCard>
</template>

Expand All @@ -29,7 +27,7 @@ const eventLink = computed(() => `/inspector/${props.event.id}`);
@apply flex flex-col;
}
.preview-card__link {
@apply cursor-pointer pb-2 flex-grow;
.preview-card__content {
@apply pb-2 flex-grow;
}
</style>
9 changes: 3 additions & 6 deletions src/entities/profiler/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts" setup>
import { computed } from "vue";
import type { NormalizedEvent } from "~/src/shared/types";
import { PreviewCard, StatBoard } from "~/src/shared/ui";
import type { Profiler } from "../../types";
Expand All @@ -8,16 +7,14 @@ type Props = {
event: NormalizedEvent<Profiler>;
};
const props = defineProps<Props>();
const eventLink = computed(() => `/profiler/${props.event.id}`);
defineProps<Props>();
</script>

<template>
<PreviewCard class="profiler-preview" :event="event">
<NuxtLink tag="div" :to="eventLink" class="profiler-preview__link">
<div class="profiler-preview__link">
<StatBoard :cost="event.payload.peaks" />
</NuxtLink>
</div>
</PreviewCard>
</template>

Expand Down
14 changes: 6 additions & 8 deletions src/entities/sentry/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const props = withDefaults(defineProps<Props>(), {
maxFrames: 3,
});
const eventLink = computed(() => `/sentry/${props.event.id}`);
const exceptionValues = computed(
() => props.event?.payload?.exception?.values || []
);
Expand Down Expand Up @@ -45,19 +43,19 @@ const exception: Ref<Exception> = computed(() =>
:exception="exception"
:max-frames="maxFrames"
>
<NuxtLink :to="eventLink" class="preview-card__link">
<div class="preview-card__content">
<h3 class="preview-card__title">
{{ exception.type }}
</h3>

<pre class="preview-card__text" v-html="exception.value" />
</NuxtLink>
</div>
</SentryException>

<div v-if="message">
<NuxtLink :to="eventLink" class="preview-card__link">
<div class="preview-card__content">
<pre class="preview-card__text" v-html="message" />
</NuxtLink>
</div>
</div>
</PreviewCard>
</template>
Expand All @@ -68,8 +66,8 @@ const exception: Ref<Exception> = computed(() =>
@apply flex flex-col;
}
.preview-card__link {
@apply cursor-pointer block dark:bg-gray-900 bg-gray-100 p-3 rounded-t-md border border-purple-300 dark:border-gray-400;
.preview-card__content {
@apply block dark:bg-gray-900 bg-gray-100 p-3 rounded-t-md border border-purple-300 dark:border-gray-400;
}
.preview-card__title {
Expand Down
6 changes: 2 additions & 4 deletions src/entities/smtp/ui/preview-card/preview-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ type Props = {
const props = defineProps<Props>();
const dateFormat = computed(() => moment(props.event.date).fromNow());
const eventLink = computed(() => `/smtp/${props.event.id}`);
</script>

<template>
<PreviewCard class="smtp-preview" :event="event">
<NuxtLink :to="eventLink" class="smtp-preview__link">
<div class="smtp-preview__link">
<h3 class="smtp-preview__link-title">
{{ event.payload.subject }}
</h3>
Expand All @@ -28,7 +26,7 @@ const eventLink = computed(() => `/smtp/${props.event.id}`);

<span>{{ dateFormat }}</span>
</div>
</NuxtLink>
</div>
</PreviewCard>
</template>

Expand Down

0 comments on commit 6c6889c

Please sign in to comment.