mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Minor gallery-related fixes (#3448)
* Fix gallery titles * Fix SceneListTable
This commit is contained in:
@@ -46,6 +46,9 @@ fragment SlimSceneData on Scene {
|
||||
files {
|
||||
path
|
||||
}
|
||||
folder {
|
||||
path
|
||||
}
|
||||
title
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,3 @@
|
||||
margin-right: 0.25em;
|
||||
}
|
||||
}
|
||||
|
||||
.field-options-table td:first-child {
|
||||
padding-left: 0.75rem;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ import {
|
||||
faTrashAlt,
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { objectTitle } from "src/core/files";
|
||||
import { galleryTitle } from "src/core/galleries";
|
||||
import { useRatingKeybinds } from "src/hooks/keybinds";
|
||||
|
||||
const SceneScrapeDialog = lazy(() => import("./SceneScrapeDialog"));
|
||||
@@ -100,7 +101,7 @@ export const SceneEditPanel: React.FC<IProps> = ({
|
||||
setGalleries(
|
||||
scene.galleries?.map((g) => ({
|
||||
id: g.id,
|
||||
title: objectTitle(g),
|
||||
title: galleryTitle(g),
|
||||
})) ?? []
|
||||
);
|
||||
}, [scene.galleries]);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable jsx-a11y/control-has-associated-label */
|
||||
import React from "react";
|
||||
import { Table, Button, Form } from "react-bootstrap";
|
||||
import { Table, Form } from "react-bootstrap";
|
||||
import { Link } from "react-router-dom";
|
||||
import * as GQL from "src/core/generated-graphql";
|
||||
import NavUtils from "src/utils/navigation";
|
||||
import TextUtils from "src/utils/text";
|
||||
import { Icon } from "src/components/Shared/Icon";
|
||||
import { FormattedMessage } from "react-intl";
|
||||
import { objectTitle } from "src/core/files";
|
||||
import { galleryTitle } from "src/core/galleries";
|
||||
import SceneQueue from "src/models/sceneQueue";
|
||||
|
||||
interface ISceneListTableProps {
|
||||
scenes: GQL.SlimSceneDataFragment[];
|
||||
@@ -20,14 +19,14 @@ interface ISceneListTableProps {
|
||||
export const SceneListTable: React.FC<ISceneListTableProps> = (
|
||||
props: ISceneListTableProps
|
||||
) => {
|
||||
const renderTags = (tags: GQL.SlimTagDataFragment[]) =>
|
||||
const renderTags = (tags: Partial<GQL.TagDataFragment>[]) =>
|
||||
tags.map((tag) => (
|
||||
<Link key={tag.id} to={NavUtils.makeTagScenesUrl(tag)}>
|
||||
<h6>{tag.name}</h6>
|
||||
</Link>
|
||||
));
|
||||
|
||||
const renderPerformers = (performers: Partial<GQL.Performer>[]) =>
|
||||
const renderPerformers = (performers: Partial<GQL.PerformerDataFragment>[]) =>
|
||||
performers.map((performer) => (
|
||||
<Link key={performer.id} to={NavUtils.makePerformerScenesUrl(performer)}>
|
||||
<h6>{performer.name}</h6>
|
||||
@@ -35,16 +34,21 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
||||
));
|
||||
|
||||
const renderMovies = (scene: GQL.SlimSceneDataFragment) =>
|
||||
scene.movies.map((sceneMovie) =>
|
||||
!sceneMovie.movie ? undefined : (
|
||||
scene.movies.map((sceneMovie) => (
|
||||
<Link
|
||||
key={sceneMovie.movie.id}
|
||||
to={NavUtils.makeMovieScenesUrl(sceneMovie.movie)}
|
||||
>
|
||||
<h6>{sceneMovie.movie.name}</h6>
|
||||
</Link>
|
||||
)
|
||||
);
|
||||
));
|
||||
|
||||
const renderGalleries = (scene: GQL.SlimSceneDataFragment) =>
|
||||
scene.galleries.map((gallery) => (
|
||||
<Link key={gallery.id} to={`/galleries/${gallery.id}`}>
|
||||
<h6>{galleryTitle(gallery)}</h6>
|
||||
</Link>
|
||||
));
|
||||
|
||||
const renderSceneRow = (scene: GQL.SlimSceneDataFragment, index: number) => {
|
||||
const sceneLink = props.queue
|
||||
@@ -64,7 +68,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
||||
type="checkbox"
|
||||
checked={props.selectedIds.has(scene.id)}
|
||||
onChange={() =>
|
||||
props.onSelectChange!(
|
||||
props.onSelectChange(
|
||||
scene.id,
|
||||
!props.selectedIds.has(scene.id),
|
||||
shiftKey
|
||||
@@ -106,15 +110,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
||||
)}
|
||||
</td>
|
||||
<td>{renderMovies(scene)}</td>
|
||||
<td>
|
||||
{scene.gallery && (
|
||||
<Button className="minimal">
|
||||
<Link to={`/galleries/${scene.gallery.id}`}>
|
||||
<Icon icon={faImage} />
|
||||
</Link>
|
||||
</Button>
|
||||
)}
|
||||
</td>
|
||||
<td>{renderGalleries(scene)}</td>
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
@@ -148,7 +144,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
|
||||
<FormattedMessage id="movies" />
|
||||
</th>
|
||||
<th>
|
||||
<FormattedMessage id="gallery" />
|
||||
<FormattedMessage id="galleries" />
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -126,14 +126,6 @@ hr {
|
||||
border: none;
|
||||
border-color: #414c53;
|
||||
padding: 0.25rem 0.75rem;
|
||||
|
||||
&:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user