Add tags to studios (#4858)

* Fix makeTagFilter mode

* Remove studio_tags filter criterion

This is handled by studios_filter. The support for this still needs to be added in the UI, so I have removed the criterion options in the short-term.
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
bob123491234
2024-06-18 00:55:20 -05:00
committed by GitHub
parent f26766033e
commit b3d35dfae4
51 changed files with 844 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
import React from "react";
import { TagLink } from "src/components/Shared/TagLink";
import * as GQL from "src/core/generated-graphql";
import { DetailItem } from "src/components/Shared/DetailItem";
import { StashIDPill } from "src/components/Shared/StashID";
@@ -15,6 +16,19 @@ export const StudioDetailsPanel: React.FC<IStudioDetailsPanel> = ({
collapsed,
fullWidth,
}) => {
function renderTagsField() {
if (!studio.tags.length) {
return;
}
return (
<ul className="pl-0">
{(studio.tags ?? []).map((tag) => (
<TagLink key={tag.id} linkType="studio" tag={tag} />
))}
</ul>
);
}
function renderStashIDs() {
if (!studio.stash_ids?.length) {
return;
@@ -36,11 +50,18 @@ export const StudioDetailsPanel: React.FC<IStudioDetailsPanel> = ({
function maybeRenderExtraDetails() {
if (!collapsed) {
return (
<DetailItem
id="stash_ids"
value={renderStashIDs()}
fullWidth={fullWidth}
/>
<>
<DetailItem
id="tags"
value={renderTagsField()}
fullWidth={fullWidth}
/>
<DetailItem
id="stash_ids"
value={renderStashIDs()}
fullWidth={fullWidth}
/>
</>
);
}
}