Skip to content

Commit

Permalink
fix(fe2): improved page titles
Browse files Browse the repository at this point in the history
  • Loading branch information
fabis94 committed Oct 19, 2023
1 parent f057292 commit 6abc4d5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/frontend-2/pages/projects/[id]/discussions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ const { result } = useQuery(projectDiscussionsPageQuery, () => ({
useGeneralProjectPageUpdateTracking({ projectId })
const project = computed(() => result.value?.project)
const title = computed(() => 'Discussions - ' + (project.value?.name || 'Project'))
const title = computed(() =>
project.value?.name.length ? `Discussions - ${project.value.name}` : ''
)
useHead({
title
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend-2/pages/projects/[id]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ const { result: projectPageResult } = useQuery(
const project = computed(() => projectPageResult.value?.project)
const invite = computed(() => projectPageResult.value?.projectInvite)
const projectName = computed(() => project.value?.name || 'Project')
const projectName = computed(() =>
project.value?.name.length ? project.value.name : ''
)
useHead({
title: projectName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ graphql(`
}
`)
const title = computed(() => `Viewer - ${project.value?.name || 'Project'}`)
const title = computed(() =>
project.value?.name.length ? `Viewer - ${project.value.name}` : ''
)
useHead({ title })
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const { result: pageData } = useQuery(projectModelPageQuery, () => ({
const project = computed(() => pageData.value?.project)
const title = computed(() => `Versions - ${project.value?.model.name || 'Model'}`)
const title = computed(() =>
project.value?.model.name.length ? `Versions - ${project.value.model.name}` : ''
)
useHead({ title })
</script>
4 changes: 3 additions & 1 deletion packages/frontend-2/pages/projects/[id]/models/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ const clearSearch = () => {
selectedApps.value = []
}
const title = computed(() => 'Models - ' + (project.value?.name || 'Project'))
const title = computed(() =>
project.value?.name.length ? `Models - ${project.value.name}` : ''
)
useHead({
title
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend-2/pages/projects/[id]/webhooks/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ const { result: pageResult, refetch: refetchWebhooks } = useQuery(
})
)
const title = computed(
() => 'Webhooks - ' + (pageResult.value?.project.name || 'Project')
const title = computed(() =>
pageResult.value?.project.name ? `Webhooks - ${pageResult.value.project.name}` : ''
)
useHead({
Expand Down

0 comments on commit 6abc4d5

Please sign in to comment.