-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #161 from buggregator/improve/event-groups
Improve/event groups
- Loading branch information
Showing
24 changed files
with
397 additions
and
122 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
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,83 @@ | ||
<script lang="ts" setup> | ||
import { computed, onMounted, ref } from "vue"; | ||
import { MonologPage } from "~/src/screens/monolog"; | ||
import { useFetch, useHead, useNuxtApp, useRoute, useRouter } from "#app"; // eslint-disable-line @conarti/feature-sliced/layers-slices | ||
import { PageEventHeader } from "~/src/widgets/ui"; | ||
import { useMonolog } from "~/src/entities/monolog"; | ||
import type { Monolog } from "~/src/entities/monolog/types"; | ||
import { useEvents } from "~/src/shared/lib/use-events"; | ||
import type { EventId, ServerEvent } from "~/src/shared/types"; | ||
const { normalizeMonologEvent } = useMonolog(); | ||
const { params } = useRoute(); | ||
const { $authToken } = useNuxtApp(); | ||
const router = useRouter(); | ||
const eventId = params.id as EventId; | ||
useHead({ | ||
title: `Monolog > ${eventId} | Buggregator`, | ||
}); | ||
const { events } = useEvents(); | ||
const isLoading = ref(false); | ||
const serverEvent = ref<ServerEvent<Monolog> | null>(null); | ||
const event = computed(() => | ||
serverEvent.value ? normalizeMonologEvent(serverEvent.value) : null | ||
); | ||
const getEvent = async () => { | ||
isLoading.value = true; | ||
await useFetch(events.getUrl(eventId), { | ||
headers: { "X-Auth-Token": $authToken.token || "" }, | ||
onResponse({ response: { _data } }) { | ||
serverEvent.value = _data; | ||
isLoading.value = false; | ||
}, | ||
onResponseError() { | ||
router.push("/404"); | ||
}, | ||
onRequestError() { | ||
router.push("/404"); | ||
}, | ||
}); | ||
}; | ||
onMounted(getEvent); | ||
</script> | ||
|
||
<template> | ||
<main class="monolog"> | ||
<PageEventHeader title="Monolog" :event-id="eventId" /> | ||
|
||
<div v-if="isLoading && !event" class="monolog__loading"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
|
||
<div v-if="event" class="monolog__body"> | ||
<MonologPage :event="event" /> | ||
</div> | ||
</main> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@import "src/assets/mixins"; | ||
.monolog { | ||
@include layout; | ||
} | ||
.monolog__loading { | ||
@include loading; | ||
@include layout-body; | ||
} | ||
.monolog__body { | ||
@include layout-body; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script lang="ts" setup> | ||
import { PageLayout } from "~/src/widgets/ui/page-layout"; | ||
import { PAGE_TYPES } from "~/src/shared/constants"; | ||
</script> | ||
|
||
<template> | ||
<PageLayout :type="PAGE_TYPES.MONOLOG" title="Monolog" /> | ||
</template> |
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
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
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
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 @@ | ||
export * from './ui' |
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 @@ | ||
export * from './monolog-page' |
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 @@ | ||
export { default as MonologPage } from './monolog-page.vue'; |
18 changes: 18 additions & 0 deletions
18
src/screens/monolog/ui/monolog-page/monolog-page.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,18 @@ | ||
import type { Meta, StoryObj } from "@storybook/vue3"; | ||
import { useMonolog } from "~/src/entities/monolog"; | ||
import { monologMock } from '~/src/entities/monolog/mocks'; | ||
import Monolog from './monolog-page.vue'; | ||
|
||
const { normalizeMonologEvent } = useMonolog(); | ||
|
||
export default { | ||
title: "Screens/Monolog/MonologPage", | ||
component: Monolog | ||
} as Meta<typeof Monolog>; | ||
|
||
|
||
export const Default: StoryObj<typeof Monolog> = { | ||
args: { | ||
event: normalizeMonologEvent(monologMock), | ||
} | ||
} |
Oops, something went wrong.