Skip to content

Commit

Permalink
Added path column to tables in list view (#5005)
Browse files Browse the repository at this point in the history
  • Loading branch information
cj12312021 authored Jun 24, 2024
1 parent a4e25f3 commit 1f5377d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
15 changes: 15 additions & 0 deletions ui/v2.5/src/components/Galleries/GalleryListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ export const GalleryListTable: React.FC<IGalleryListTableProps> = (
</ul>
);

const PathCell = (scene: GQL.SlimGalleryDataFragment) => (
<ul className="newline-list overflowable TruncatedText">
{scene.files.map((file) => (
<li key={file.id}>
<span>{file.path}</span>
</li>
))}
</ul>
);

interface IColumnSpec {
value: string;
label: string;
Expand Down Expand Up @@ -211,6 +221,11 @@ export const GalleryListTable: React.FC<IGalleryListTableProps> = (
label: intl.formatMessage({ id: "photographer" }),
render: (s) => <>{s.photographer}</>,
},
{
value: "path",
label: intl.formatMessage({ id: "path" }),
render: PathCell,
},
];

const defaultColumns = allColumns
Expand Down
35 changes: 34 additions & 1 deletion ui/v2.5/src/components/List/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,42 @@ input[type="range"].zoom-slider {
}
}

.newline-list {
list-style: none;
margin: 0;
padding: 4px 2px;

li {
display: inline;
white-space: pre-wrap;
}

li::after {
content: "\A";
}

li:last-child::after {
content: "";
}
}

.newline-list.overflowable,
.comma-list.overflowable {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.comma-list.overflowable {
width: 190px;
}

.newline-list.overflowable {
-webkit-line-clamp: 1;
width: 700px;
}

.newline-list.overflowable:hover,
.comma-list.overflowable:hover {
background: #28343c;
border: 1px solid #414c53;
Expand All @@ -459,7 +488,6 @@ input[type="range"].zoom-slider {
height: auto;
margin-left: -0.4rem;
margin-top: -0.9rem;
max-width: 40rem;
overflow: hidden;
padding: 0.1rem 0.5rem;
position: absolute;
Expand All @@ -469,6 +497,11 @@ input[type="range"].zoom-slider {
z-index: 100;
}

.comma-list.overflowable:hover {
max-width: 40rem;
}

.newline-list.overflowable li .ellips-data:hover,
.comma-list.overflowable li .ellips-data:hover {
max-width: fit-content;
}
Expand Down
17 changes: 16 additions & 1 deletion ui/v2.5/src/components/Scenes/SceneListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
);

const AudioCodecCell = (scene: GQL.SlimSceneDataFragment) => (
<ul className="comma-list">
<ul className="comma-list over">
{scene.files.map((file) => (
<li key={file.id}>
<span>{file.audio_codec}</span>
Expand All @@ -245,6 +245,16 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
</ul>
);

const PathCell = (scene: GQL.SlimSceneDataFragment) => (
<ul className="newline-list overflowable TruncatedText">
{scene.files.map((file) => (
<li key={file.id}>
<span>{file.path}</span>
</li>
))}
</ul>
);

interface IColumnSpec {
value: string;
label: string;
Expand Down Expand Up @@ -343,6 +353,11 @@ export const SceneListTable: React.FC<ISceneListTableProps> = (
label: intl.formatMessage({ id: "resolution" }),
render: ResolutionCell,
},
{
value: "path",
label: intl.formatMessage({ id: "path" }),
render: PathCell,
},
{
value: "filesize",
label: intl.formatMessage({ id: "filesize" }),
Expand Down

0 comments on commit 1f5377d

Please sign in to comment.