Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { RouterView } from 'vue-router'
import { RouterView, useRoute } from 'vue-router'
import MainLayout from '@/shared/components/layout/MainLayout.vue'
import { Toaster } from '@/shared/ui/sonner'
import { useAuthStore } from '@/modules/auth/stores/useAuthStore'
Expand All @@ -9,6 +9,7 @@ import { useEnhancedToast } from './shared/composables/useEnhancedToast'
import { queryClient } from './shared/plugins/vue-query'

const auth = useAuthStore()
const route = useRoute()
const { showError } = useEnhancedToast()

const globalErrorHandler = (error: unknown) => {
Expand Down Expand Up @@ -43,7 +44,7 @@ window.addEventListener('message', async event => {
<MainLayout>
<RouterView v-slot="{ Component }">
<Transition name="page" mode="out-in" appear>
<component :is="Component" />
<component :is="Component" :key="route.fullPath" />
</Transition>
</RouterView>
</MainLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ function removeLink(index: number) {
<Input
type="url"
placeholder="https://..."
autocomplete="off"
:model-value="link.url"
@update:model-value="val => update(i, { url: String(val) })"
/>

<!-- Label -->
<Input
placeholder="Label"
autocomplete="off"
:model-value="link.label"
@update:model-value="val => update(i, { label: String(val) })"
/>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/modules/tags/components/TagsDataGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const handleSearchKeydown = (event: KeyboardEvent) => {
<div class="flex-1">
<Input
v-model="localSearchValue"
autocomplete="off"
placeholder="Search tags..."
class="max-w-xs"
@keydown="handleSearchKeydown"
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { routes } from './routes'

const publicPages = ['/login', '/signup', '/landing', '/oauth/callback']
const authPages = ['/login', '/signup']

Check warning on line 6 in frontend/src/router/index.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

`authPages` should be a `Set`, and use `authPages.has()` to check existence or non-existence.

See more on https://sonarcloud.io/project/issues?id=ivanskv2000_evsy&issues=AZ5Aw4GYinvO25WaQZXJ&open=AZ5Aw4GYinvO25WaQZXJ&pullRequest=48

const router = createRouter({
history: createWebHistory(),
Expand All @@ -19,8 +20,11 @@
router.beforeEach((to, _from, next) => {
const auth = useAuthStore()
const isPublic = publicPages.includes(to.path)
const isAuthPage = authPages.includes(to.path)

if (!isPublic && !auth.token) {
if (auth.token && isAuthPage) {
next({ path: '/events' })
} else if (!isPublic && !auth.token) {
next({ path: '/login', query: { redirect: to.fullPath } })
} else {
next()
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/shared/components/data/DataTableInputFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,10 @@ export default {
</script>

<template>
<Input v-model="inputValue" :placeholder="placeholder" @keydown="handleKeydown" />
<Input
v-model="inputValue"
:placeholder="placeholder"
@keydown="handleKeydown"
autocomplete="off"
/>
</template>
Loading