-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Icons to tags if they have parent/child tags #3931
Changes from 3 commits
e1650d5
257705a
d195ad1
2fde238
97ef26c
6bd8959
7e0afd8
cd51732
01c0639
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,10 @@ fragment SceneMarkerData on SceneMarker { | |
primary_tag { | ||
id | ||
name | ||
aliases | ||
} | ||
|
||
tags { | ||
id | ||
name | ||
aliases | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ fragment SlimTagData on Tag { | |
name | ||
aliases | ||
image_path | ||
parent_count | ||
child_count | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import React from "react"; | ||
import { Badge } from "react-bootstrap"; | ||
import { Badge, OverlayTrigger, Tooltip } from "react-bootstrap"; | ||
import { FormattedMessage } from "react-intl"; | ||
import { Link } from "react-router-dom"; | ||
import { Icon } from "../../Shared/Icon"; | ||
import * as GQL from "src/core/generated-graphql"; | ||
import { faFolderTree } from "@fortawesome/free-solid-svg-icons"; | ||
|
||
interface ITagDetails { | ||
tag: GQL.TagDataFragment; | ||
|
@@ -41,9 +43,28 @@ export const TagDetailsPanel: React.FC<ITagDetails> = ({ tag }) => { | |
<FormattedMessage id="parent_tags" /> | ||
</dt> | ||
<dd className="col-9 col-xl-10"> | ||
{tag.parents.map((p) => ( | ||
{tag.children.map((p) => ( | ||
<Badge key={p.id} className="tag-item" variant="secondary"> | ||
<Link to={`/tags/${p.id}`}>{p.name}</Link> | ||
<Link to={`/tags/${p.id}`}> | ||
{p.name} | ||
{p.child_count !== 0 && ( | ||
<> | ||
<span className="icon-wrapper"> | ||
<span className="vertical-line">|</span> | ||
<OverlayTrigger | ||
placement="top" | ||
overlay={ | ||
<Tooltip id="tag-hierarchy-tooltip"> | ||
Explore tag hierarchy | ||
</Tooltip> | ||
} | ||
> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why this overlay is here. Clicking on the icon doesn't do anything different than clicking elsewhere on the badge. The text needs to be internationalised as well. |
||
<Icon icon={faFolderTree} className="tag-icon" /> | ||
</OverlayTrigger> | ||
</span> | ||
</> | ||
)} | ||
</Link> | ||
</Badge> | ||
))} | ||
</dd> | ||
|
@@ -64,7 +85,26 @@ export const TagDetailsPanel: React.FC<ITagDetails> = ({ tag }) => { | |
<dd className="col-9 col-xl-10"> | ||
{tag.children.map((c) => ( | ||
<Badge key={c.id} className="tag-item" variant="secondary"> | ||
<Link to={`/tags/${c.id}`}>{c.name}</Link> | ||
<Link to={`/tags/${c.id}`}> | ||
{c.name} | ||
{c.child_count !== 0 && ( | ||
<> | ||
<span className="icon-wrapper"> | ||
<span className="vertical-line">|</span> | ||
<OverlayTrigger | ||
placement="top" | ||
overlay={ | ||
<Tooltip id="tag-hierarchy-tooltip"> | ||
Explore tag hierarchy | ||
</Tooltip> | ||
} | ||
> | ||
<Icon icon={faFolderTree} className="tag-icon" /> | ||
</OverlayTrigger> | ||
</span> | ||
</> | ||
)} | ||
</Link> | ||
</Badge> | ||
))} | ||
</dd> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed? Shouldn't this be
parents
?