diff --git a/website/src/App.vue b/website/src/App.vue index f4f91bf..921bf97 100644 --- a/website/src/App.vue +++ b/website/src/App.vue @@ -83,7 +83,7 @@ const navigation: { title: string; link: string; icon: string }[] = [ diff --git a/website/src/plugins/vuetify.ts b/website/src/plugins/vuetify.ts index 37e17ac..1ce407d 100644 --- a/website/src/plugins/vuetify.ts +++ b/website/src/plugins/vuetify.ts @@ -10,7 +10,7 @@ const lightTheme: ThemeDefinition = { dark: false, colors: { primary: '#008800', - 'primary-variant': '#007700', + secondary: '#007700', 'surface-subtle': '#f6f6f6', 'surface-medium': '#e6e6e6', 'surface-highlighted': '#efefef', @@ -29,7 +29,7 @@ const darkTheme: ThemeDefinition = { dark: true, colors: { primary: '#008800', - 'primary-variant': '#369d36', + secondary: '#369d36', 'surface-subtle': '#1c1c1c', 'surface-medium': '#262626', 'surface-highlighted': '#2c2c2c', @@ -94,7 +94,7 @@ const vuetify = createVuetify({ variant: 'text', }, VBtnSubscribe: { - color: 'primary-variant', + color: 'secondary', class: 'px-1 ms-n1 me-2', variant: 'text', }, @@ -115,16 +115,16 @@ const vuetify = createVuetify({ color: 'primary', }, VSwitch: { - color: 'primary-variant', + color: 'secondary', }, VCheckbox: { - color: 'primary-variant', + color: 'secondary', }, VRadioGroup: { - color: 'primary-variant', + color: 'secondary', }, VTextField: { - color: 'primary-variant', + color: 'secondary', }, VDialog: { width: '50rem', @@ -155,7 +155,7 @@ const vuetify = createVuetify({ class: 'pa-0', }, VBtn: { - color: 'primary-variant', + color: 'secondary', variant: 'text', }, }, diff --git a/website/src/registerSentry.ts b/website/src/registerSentry.ts index 5494393..5497703 100644 --- a/website/src/registerSentry.ts +++ b/website/src/registerSentry.ts @@ -8,7 +8,6 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, setHttpStatus, - spanToJSON, startBrowserTracingNavigationSpan, } from '@sentry/browser' import type { Integration, Span, SpanAttributes, TransactionSource } from '@sentry/types' @@ -202,7 +201,6 @@ function browserTracingIntegration(router: Router): Integration { router.beforeEach((to, from) => { const attributes: SpanAttributes = { - [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.vue', 'route.name': to.name as string, 'route.path': to.path as string, 'route.hash': to.hash as string, @@ -250,17 +248,14 @@ function browserTracingIntegration(router: Router): Integration { if (instrumentPageLoad && isPageLoadNavigation) { const activeRootSpan = getActiveRootSpan() if (activeRootSpan) { - // Replace the name of the existing root span if it was not custom set - const existingAttributes = spanToJSON(activeRootSpan).data || {} - if (existingAttributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] !== 'custom') { - activeRootSpan.updateName(transactionName) - activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, transactionSource) - } + // Replace the name of the existing root span + activeRootSpan.updateName(transactionName) // Set router attributes on the existing pageload transaction - // This will override the origin and add params & query attributes + // This will override the source and origin and add params & query attributes activeRootSpan.setAttributes({ ...attributes, + [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: transactionSource, [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.vue', }) @@ -294,14 +289,5 @@ function browserTracingIntegration(router: Router): Integration { function getActiveRootSpan(): Span | undefined { const span = getActiveSpan() - const rootSpan = span && getRootSpan(span) - - if (!rootSpan) { - return undefined - } - - const op = spanToJSON(rootSpan).op - - // Only use this root span if it is a pageload or navigation span - return op === 'navigation' || op === 'pageload' ? rootSpan : undefined + if (span) return getRootSpan(span) } diff --git a/website/src/router/guards.ts b/website/src/router/guards.ts index 855638b..40d5e0c 100644 --- a/website/src/router/guards.ts +++ b/website/src/router/guards.ts @@ -10,15 +10,15 @@ export function homeGuard(): NavigationGuardReturn { const { entityType } = useSettingsStore() // Redirect the user either to the timetable or welcome page - if (entityType === EntityType.None) return { name: 'welcome', replace: true } - else return { name: 'timetable', replace: true } + if (entityType === EntityType.None) return { name: 'welcome', replace: true, force: true } + else return { name: 'timetable', replace: true, force: true } } export function welcomeGuard(): NavigationGuardReturn { const { entityType } = useSettingsStore() // Redirect the user to the timetable page if it has the entity set - if (entityType !== EntityType.None) return { name: 'timetable', replace: true } + if (entityType !== EntityType.None) return { name: 'timetable', replace: true, force: true } } export async function timetableGuard(