From e3cd36f25fc0499a6b46fd8b4582cfa030be58ba Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 11 Oct 2022 14:21:56 +1100 Subject: [PATCH] Use primary tag name as marker title where title is empty (#2994) * Fix display of marker popovers * Use primary tag as title where marker title empty --- graphql/documents/data/scene-slim.graphql | 4 ++++ .../Scenes/SceneDetails/PrimaryTags.tsx | 3 ++- ui/v2.5/src/components/Shared/TagLink.tsx | 15 ++++++++++----- ui/v2.5/src/components/Wall/WallItem.tsx | 9 ++++----- ui/v2.5/src/core/markers.ts | 17 +++++++++++++++++ ui/v2.5/src/utils/navigation.ts | 8 +++++--- 6 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 ui/v2.5/src/core/markers.ts diff --git a/graphql/documents/data/scene-slim.graphql b/graphql/documents/data/scene-slim.graphql index 36b903409..362ac4092 100644 --- a/graphql/documents/data/scene-slim.graphql +++ b/graphql/documents/data/scene-slim.graphql @@ -31,6 +31,10 @@ fragment SlimSceneData on Scene { id title seconds + primary_tag { + id + name + } } galleries { diff --git a/ui/v2.5/src/components/Scenes/SceneDetails/PrimaryTags.tsx b/ui/v2.5/src/components/Scenes/SceneDetails/PrimaryTags.tsx index 6cbca4ae0..f658d34b1 100644 --- a/ui/v2.5/src/components/Scenes/SceneDetails/PrimaryTags.tsx +++ b/ui/v2.5/src/components/Scenes/SceneDetails/PrimaryTags.tsx @@ -3,6 +3,7 @@ import { FormattedMessage } from "react-intl"; import * as GQL from "src/core/generated-graphql"; import { Button, Badge, Card } from "react-bootstrap"; import TextUtils from "src/utils/text"; +import { markerTitle } from "src/core/markers"; interface IPrimaryTags { sceneMarkers: GQL.SceneMarkerDataFragment[]; @@ -40,7 +41,7 @@ export const PrimaryTags: React.FC = ({