-
-
- {ellipsize(group.data[0].name, 18)}
-
-
-
-
- Issues
-
- {group.data[0].count_of_issues}
-
+ {map(props.volumeGroups, (data) => {
+ return map(data.data, (group) => {
+ return (
+
+

+
+
+
+ {ellipsize(group.volume.name, 18)}
+
+
+
+
+ Issues
+
+ {group.volume.count_of_issues}
-
+
- );
- }
- })}
+
+ );
+ });
+ })}
);
diff --git a/src/client/components/Dashboard/WantedComicsList.tsx b/src/client/components/Dashboard/WantedComicsList.tsx
new file mode 100644
index 0000000..5ecc1ec
--- /dev/null
+++ b/src/client/components/Dashboard/WantedComicsList.tsx
@@ -0,0 +1,93 @@
+import React, { ReactElement } from "react";
+import Card from "../Carda";
+import { Link } from "react-router-dom";
+import ellipsize from "ellipsize";
+import { isEmpty, isNil, isUndefined, map } from "lodash";
+import { detectIssueTypes } from "../../shared/utils/tradepaperback.utils";
+import Masonry from "react-masonry-css";
+
+type WantedComicsListProps = {
+ comics: any;
+};
+
+export const WantedComicsList = ({
+ comics,
+}: WantedComicsListProps): ReactElement => {
+ const breakpointColumnsObj = {
+ default: 5,
+ 1100: 4,
+ 700: 2,
+ 600: 2,
+ };
+
+ return (
+ <>
+
+
Wanted Comics
+
+ Comics marked as wanted from various sources.
+
+
+
+ {map(comics, ({ _id, rawFileDetails, sourcedMetadata }) => {
+ const isComicBookMetadataAvailable =
+ sourcedMetadata &&
+ !isUndefined(sourcedMetadata.comicvine) &&
+ !isUndefined(sourcedMetadata.comicvine.volumeInformation) &&
+ !isEmpty(sourcedMetadata);
+ let imagePath = "";
+ let comicName = "";
+ if (isComicBookMetadataAvailable) {
+ imagePath = sourcedMetadata.comicvine.image.small_url;
+ comicName = sourcedMetadata.comicvine.name;
+ }
+ const titleElement = (
+ {ellipsize(comicName, 20)}
+ );
+ return (
+ No Name}
+ >
+
+ {isComicBookMetadataAvailable && (
+
+
+
+ )}
+ {/* Raw file presence */}
+ {isEmpty(rawFileDetails.cover) && (
+
+
+
+ )}
+ {/* Issue type */}
+ {isComicBookMetadataAvailable &&
+ !isNil(
+ detectIssueTypes(
+ sourcedMetadata.comicvine.volumeInformation.description,
+ ),
+ ) ? (
+
+ {
+ detectIssueTypes(
+ sourcedMetadata.comicvine.volumeInformation.description,
+ ).displayName
+ }
+
+ ) : null}
+
+
+ );
+ })}
+
+ >
+ );
+};
diff --git a/src/client/constants/action-types.ts b/src/client/constants/action-types.ts
index be8d735..51cd229 100644
--- a/src/client/constants/action-types.ts
+++ b/src/client/constants/action-types.ts
@@ -41,6 +41,9 @@ export const IMS_COMIC_BOOK_DB_OBJECT_CALL_IN_PROGRESS =
export const IMS_COMIC_BOOK_DB_OBJECT_CALL_FAILED =
"IMS_COMIC_BOOK_DB_OBJECT_CALL_FAILED";
+// wanted comics from CV, LoCG and other sources
+export const IMS_WANTED_COMICS_FETCHED = "IMS_WANTED_COMICS_FETCHED";
+
// volume groups
export const IMS_COMIC_BOOK_GROUPS_FETCHED = "IMS_COMIC_BOOK_GROUPS_FETCHED";
export const IMS_COMIC_BOOK_GROUPS_CALL_IN_PROGRESS =
diff --git a/src/client/reducers/fileops.reducer.ts b/src/client/reducers/fileops.reducer.ts
index f44ebff..ce6e75d 100644
--- a/src/client/reducers/fileops.reducer.ts
+++ b/src/client/reducers/fileops.reducer.ts
@@ -5,6 +5,7 @@ import {
IMS_RAW_IMPORT_SUCCESSFUL,
IMS_RAW_IMPORT_FAILED,
IMS_RECENT_COMICS_FETCHED,
+ IMS_WANTED_COMICS_FETCHED,
IMS_CV_METADATA_IMPORT_SUCCESSFUL,
IMS_CV_METADATA_IMPORT_FAILED,
IMS_CV_METADATA_IMPORT_CALL_IN_PROGRESS,
@@ -32,6 +33,8 @@ const initialState = {
comicVineMetadataImportError: {},
rawImportError: {},
extractedComicBookArchive: [],
+ recentComics: [],
+ wantedComics: [],
};
function fileOpsReducer(state = initialState, action) {
@@ -65,6 +68,12 @@ function fileOpsReducer(state = initialState, action) {
...state,
recentComics: action.data,
};
+ case IMS_WANTED_COMICS_FETCHED:
+ console.log(action.data);
+ return {
+ ...state,
+ wantedComics: action.data,
+ };
case IMS_CV_METADATA_IMPORT_SUCCESSFUL:
return {
...state,