From 6abc4d550424d541450a4316e6f9c3a533d6637a Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Thu, 19 Oct 2023 15:23:45 +0300 Subject: [PATCH] fix(fe2): improved page titles --- packages/frontend-2/pages/projects/[id]/discussions.vue | 4 +++- packages/frontend-2/pages/projects/[id]/index.vue | 4 +++- .../frontend-2/pages/projects/[id]/models/[modelId]/index.vue | 4 +++- .../pages/projects/[id]/models/[modelId]/versions.vue | 4 +++- packages/frontend-2/pages/projects/[id]/models/index.vue | 4 +++- packages/frontend-2/pages/projects/[id]/webhooks/index.vue | 4 ++-- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/frontend-2/pages/projects/[id]/discussions.vue b/packages/frontend-2/pages/projects/[id]/discussions.vue index e15a9e996e..e303a983d3 100644 --- a/packages/frontend-2/pages/projects/[id]/discussions.vue +++ b/packages/frontend-2/pages/projects/[id]/discussions.vue @@ -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 diff --git a/packages/frontend-2/pages/projects/[id]/index.vue b/packages/frontend-2/pages/projects/[id]/index.vue index e22f7027cb..bb3800ac36 100644 --- a/packages/frontend-2/pages/projects/[id]/index.vue +++ b/packages/frontend-2/pages/projects/[id]/index.vue @@ -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 diff --git a/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue b/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue index aa0b5c9bde..362adc9fab 100644 --- a/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue +++ b/packages/frontend-2/pages/projects/[id]/models/[modelId]/index.vue @@ -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 }) diff --git a/packages/frontend-2/pages/projects/[id]/models/[modelId]/versions.vue b/packages/frontend-2/pages/projects/[id]/models/[modelId]/versions.vue index 18006893af..030c503bdf 100644 --- a/packages/frontend-2/pages/projects/[id]/models/[modelId]/versions.vue +++ b/packages/frontend-2/pages/projects/[id]/models/[modelId]/versions.vue @@ -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 }) diff --git a/packages/frontend-2/pages/projects/[id]/models/index.vue b/packages/frontend-2/pages/projects/[id]/models/index.vue index 17ba8e1b12..77d773cfe8 100644 --- a/packages/frontend-2/pages/projects/[id]/models/index.vue +++ b/packages/frontend-2/pages/projects/[id]/models/index.vue @@ -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 diff --git a/packages/frontend-2/pages/projects/[id]/webhooks/index.vue b/packages/frontend-2/pages/projects/[id]/webhooks/index.vue index cc0c1a50f1..f61f5a89ac 100644 --- a/packages/frontend-2/pages/projects/[id]/webhooks/index.vue +++ b/packages/frontend-2/pages/projects/[id]/webhooks/index.vue @@ -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({