Skip to content

Commit

Permalink
Prevent useHead warning
Browse files Browse the repository at this point in the history
  • Loading branch information
MWedl committed Dec 12, 2023
1 parent 398c878 commit ae802bc
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script setup lang="ts">
const route = useRoute();
useHead({
useHeadExtended({
titleTemplate: title => rootTitleTemplate(title, route),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/composables/lockedit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function useProjectTypeLockEdit(options: {

const baseUrl = computed(() => `/api/v1/projecttypes/${projectType.value.id}/`);
// const projectType = await useFetchE<ProjectType>(baseUrl.value, { method: 'GET' });
useHead({
useHeadExtended({
title: projectType.value.name
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/designs/[projectTypeId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const projectTypeStore = useProjectTypeStore();
await useAsyncDataE(async () => await projectTypeStore.getById(route.params.projectTypeId as string), { key: 'projectTypeMenu:projectType' });
const projectType = computed(() => projectTypeStore.projectType(route.params.projectTypeId as string));
useHead({
useHeadExtended({
titleTemplate: title => designTitleTemplate(projectType.value, title, route),
breadcrumbs: () => designDetailBreadcrumbs(projectType.value),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/designs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ definePageMeta({
title: 'Designs',
toplevel: true,
});
useHead({
useHeadExtended({
breadcrumbs: () => designListBreadcrumbs(),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/license.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ definePageMeta({
title: 'License',
toplevel: true,
});
useHead({
useHeadExtended({
breadcrumbs: () => [{ title: 'License', to: '/license/' }],
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/notes/personal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const route = useRoute();
const localSettings = useLocalSettings();
const userNotesStore = useUserNotesStore();
useHead({
useHeadExtended({
titleTemplate: (title?: string|null) => userNotesTitleTemplate(title, route),
breadcrumbs: () => [{ title: 'Notes', to: '/notes/personal/' }],
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/[projectId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ watch(() => project.value?.project_type, async () => {
projectType.value = await projectTypeStore.getById(project.value.project_type);
});
useHead({
useHeadExtended({
titleTemplate: title => projectTitleTemplate(project.value, title, route),
breadcrumbs: () => projectDetailBreadcrumbs(project.value),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/archived/[archiveId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const restoreUntilDate = computed(() => {
return 'in the next ' + formatDistanceToNowStrict(date, { unit: 'day' });
})
useHead({
useHeadExtended({
title: archive.value.name,
breadcrumbs: () => archivedProjectDetailBreadcrumbs(archive.value),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/archived/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ definePageMeta({
title: 'Projects',
toplevel: true,
});
useHead({
useHeadExtended({
breadcrumbs: () => archivedProjectListBreadcrumbs(),
});
</script>
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ definePageMeta({
title: 'Projects',
toplevel: true,
});
useHead({
useHeadExtended({
breadcrumbs: () => projectListBreadcrumbs(),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/projects/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script setup lang="ts">
import type { VForm } from "vuetify/lib/components/index.mjs";
useHead({
useHeadExtended({
title: 'Projects',
breadcrumbs: () => projectListBreadcrumbs().concat([{ title: 'New', to: '/projects/new/' }]),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const template = computed(() => fetchState.data.value);
const mainTranslation = computed(() => template.value?.translations?.find(tr => tr.is_main));
const title = computed(() => mainTranslation.value?.data?.title || null);
useHead({
useHeadExtended({
title
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/templates/[templateId]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const template = computed({
const mainTranslation = computed(() => template.value?.translations?.find(tr => tr.is_main));
const title = computed(() => mainTranslation.value?.data?.title || null);
useHead({
useHeadExtended({
title,
breadcrumbs: () => templateDetailBreadcrumbs(template.value),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/templates/fromfinding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const localSettings = useLocalSettings();
const projectStore = useProjectStore();
const templateStore = useTemplateStore();
useHead({
useHeadExtended({
title: 'Templates',
breadcrumbs: () => templateListBreadcrumbs().concat([{ title: 'New', to: route.fullPath }]),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/templates/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ definePageMeta({
title: 'Templates',
toplevel: true,
});
useHead({
useHeadExtended({
breadcrumbs: () => templateListBreadcrumbs(),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/templates/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
useHead({
useHeadExtended({
title: 'Templates',
breadcrumbs: () => templateListBreadcrumbs().concat([{ title: 'New', to: '/templates/new/' }]),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/users/[userId].vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const route = useRoute();
const apiSettings = useApiSettings();
const user = await useFetchE<User>(`/api/v1/pentestusers/${route.params.userId}/`, { method: 'GET' });
useHead({
useHeadExtended({
breadcrumbs: () => userDetailBreadcrumbs(user.value),
});
</script>
2 changes: 1 addition & 1 deletion frontend/src/pages/users/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ definePageMeta({
title: 'Users',
toplevel: true,
});
useHead({
useHeadExtended({
breadcrumbs: () => userListBreadcrumbs(),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/users/new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<script setup lang="ts">
import type { VForm } from "vuetify/lib/components/index.mjs";
useHead({
useHeadExtended({
breadcrumbs: () => userListBreadcrumbs().concat([{ title: 'New', to: '/users/new/' }]),
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/users/self.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import { profileTitleTemplate } from "~/utils/title";
const route = useRoute();
useHead({
useHeadExtended({
titleTemplate: (title?: string|null) => profileTitleTemplate(title, route),
breadcrumbs: () => [{ title: 'Profile', to: '/users/self/' }],
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useHead as useHeadOriginal } from '@unhead/vue';
import type { ReactiveHead } from '@unhead/vue';
import type { Breadcrumbs } from './types';

export function useHead(options: ReactiveHead & { breadcrumbs?: () => Breadcrumbs }) {
export function useHeadExtended(options: ReactiveHead & { breadcrumbs?: () => Breadcrumbs }) {
// Extend useHead to accept more options and prevent TypeScript errors
return useHeadOriginal(options);
}

0 comments on commit ae802bc

Please sign in to comment.