diff --git a/package.json b/package.json index 72e09c3..c6d4443 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "slick-carousel": "^1.8.1", "socket.io-client": "^4.3.2", "styled-components": "^5.3.3", - "threetwo-ui-typings": "^1.0.13", + "threetwo-ui-typings": "^1.0.14", "voca": "^1.4.0", "websocket": "^1.0.34", "ws": "^7.5.3", diff --git a/src/client/assets/scss/App.scss b/src/client/assets/scss/App.scss index 5e7f81b..39d990d 100644 --- a/src/client/assets/scss/App.scss +++ b/src/client/assets/scss/App.scss @@ -187,23 +187,24 @@ pre { } } .card-container { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); - column-gap: 0.5em; - row-gap: 1.2em; + // display: grid; + // grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + // column-gap: 0.5em; + // row-gap: 1.2em; .card { margin: 0 0 15px 0; + .partial-rounded-card-image { img { - border-top-left-radius: 0.3rem; - border-top-right-radius: 0.3rem; + border-top-left-radius: 0.4rem; + border-top-right-radius: 0.4rem; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } } .rounded-card-image { - border-radius: 0.3rem; + border-radius: 0.4rem; } .is-horizontal { @@ -225,24 +226,20 @@ pre { } } .card-content { - align-self: center; + align-self: top; flex: 1; padding-left: 1em; - padding-top: 0; - padding-bottom: 0; - font-size: 0.8em; + padding-top: 0.5em; + padding-bottom: 0em; + .name { + font-size: 0.85em; + } ul { li.status { margin-top: 10px; } } - .truncate { - width: 400px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } } .is-divider { margin-top: 1.5rem; diff --git a/src/client/components/Import.tsx b/src/client/components/Import.tsx index 1a28cb2..a037620 100644 --- a/src/client/components/Import.tsx +++ b/src/client/components/Import.tsx @@ -119,7 +119,7 @@ export const Import = (props: IProps): ReactElement => { className="button is-warning is-light" onClick={toggleImport} > - {isImportQueuePaused ? pauseIconText : playIconText} + {!isImportQueuePaused ? pauseIconText : playIconText} diff --git a/src/client/components/Library/Library.tsx b/src/client/components/Library/Library.tsx index acb18db..46732bb 100644 --- a/src/client/components/Library/Library.tsx +++ b/src/client/components/Library/Library.tsx @@ -8,12 +8,13 @@ import React, { import PropTypes from "prop-types"; import { useNavigate } from "react-router-dom"; import { useTable, usePagination } from "react-table"; -import { isEmpty, isNil, isUndefined } from "lodash"; +import { flatten, isEmpty, isNil, isUndefined, map } from "lodash"; import RawFileDetails from "./RawFileDetails"; import ComicVineDetails from "./ComicVineDetails"; import SearchBar from "./SearchBar"; import { useDispatch } from "react-redux"; import { searchIssue } from "../../actions/fileops.actions"; +import ellipsize from "ellipsize"; interface IComicBookLibraryProps { data: { @@ -37,9 +38,35 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { const ImportStatus = ({ value }) => { return value ? ( - Imported +
+
+ + Series + {ellipsize(value.series[0], 25)} + +
+
+
+
+ + Pages + {value.pagecount[0]} + +
+ +
+ + Issue + {!isNil(value.number) && ( + {parseInt(value.number[0], 10)} + )} + +
+
+
+
) : ( - "Not Imported" + No ComicInfo.xml ); }; @@ -59,11 +86,14 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { id: "fileDetails", accessor: (row) => !isEmpty(row._source.rawFileDetails) - ? row._source.rawFileDetails + ? { + rawFileDetails: row._source.rawFileDetails, + inferredMetadata: row._source.inferredMetadata, + } : row._source.sourcedMetadata, Cell: ({ value }) => { // If no CV info available, use raw file metadata - if (!isNil(value.cover)) { + if (!isNil(value.rawFileDetails.cover)) { return ; } // If CV metadata available, show it @@ -75,7 +105,7 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { }, { Header: "Import Status", - accessor: "_source.importStatus.isImported", + accessor: "_source.sourcedMetadata.comicInfo", Cell: ImportStatus, }, ], @@ -83,23 +113,6 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { { Header: "Additional Metadata", columns: [ - { - Header: "Issue #", - accessor: "_source.inferredMetadata.issue", - Cell(props) { - return ( - !isUndefined(props.cell.value) && ( -
-
- Inferred - {props.cell.value.number} -
-
- ) - ); - }, - }, - { Header: "Publisher", accessor: @@ -110,44 +123,6 @@ export const Library = (data: IComicBookLibraryProps): ReactElement => { ); }, }, - - { - Header: "Type", - accessor: "_source.sourcedMetadata.comicvine", - Cell(props) { - return ( - !isEmpty(props.cell.value) && ( - - {props.cell.value.resource_type} - - ) - ); - }, - }, - - { - Header: "Volume", - accessor: "_source.sourcedMetadata.comicvine.volumeInformation", - Cell(props) { - return ( - !isNil(props.cell.value) &&
{props.cell.value.name}
- ); - }, - }, - - { - Header: "Match Score", - accessor: "_source.sourcedMetadata.comicvine.score", - Cell(props) { - return ( - !isNil(props.cell.value) && ( - - {parseInt(props.cell.value, 10)} - - ) - ); - }, - }, ], }, ], diff --git a/src/client/components/Library/LibraryContainer.tsx b/src/client/components/Library/LibraryContainer.tsx index b790ebd..bc21846 100644 --- a/src/client/components/Library/LibraryContainer.tsx +++ b/src/client/components/Library/LibraryContainer.tsx @@ -29,7 +29,7 @@ const LibraryContainer = () => { return !isEmpty(searchResults) ? ( ) : ( - "asdasd" + "No data found." ); }; diff --git a/src/client/components/Library/RawFileDetails.tsx b/src/client/components/Library/RawFileDetails.tsx index 3e871e9..9b231c1 100644 --- a/src/client/components/Library/RawFileDetails.tsx +++ b/src/client/components/Library/RawFileDetails.tsx @@ -7,9 +7,9 @@ import { LIBRARY_SERVICE_HOST } from "../../constants/endpoints"; // raw file details export const RawFileDetails = (rawFileData): ReactElement => { - const { data } = rawFileData; + const { rawFileDetails, inferredMetadata } = rawFileData.data; const encodedFilePath = encodeURI( - `${LIBRARY_SERVICE_HOST}/${data.cover.filePath}`, + `${LIBRARY_SERVICE_HOST}/${rawFileDetails.cover.filePath}`, ); const filePath = escapePoundSymbol(encodedFilePath); return ( @@ -23,17 +23,34 @@ export const RawFileDetails = (rawFileData): ReactElement => {