Skip to content
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

Added path column to tables in list view #5005

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -429,13 +429,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 @@ -444,7 +473,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 @@ -454,6 +482,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
Loading