🍬 Removed hardcoded reference to import-service

TODO: Remove the repetitive use of thumbnail generating logic
This commit is contained in:
2021-10-21 12:03:58 -07:00
parent 419962c756
commit 116cbf2a62
8 changed files with 28 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ import {
} from "../shared/utils/formatting.utils";
import { isUndefined, isEmpty, isNil } from "lodash";
import { Link } from "react-router-dom";
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
import ellipsize from "ellipsize";
interface IProps {
@@ -26,7 +27,7 @@ class Card extends React.Component<IProps, IState> {
metadata: IExtractedComicBookCoverFile,
): JSX.Element => {
const encodedFilePath = encodeURI(
"http://localhost:3000" + removeLeadingPeriod(metadata.path),
`${IMPORT_SERVICE_HOST}` + removeLeadingPeriod(metadata.path),
);
const filePath = escapePoundSymbol(encodedFilePath);
return (

View File

@@ -29,6 +29,7 @@ import {
escapePoundSymbol,
} from "../shared/utils/formatting.utils";
import Sticky from "react-stickynode";
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
type ComicDetailProps = {};
/**
@@ -465,7 +466,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
let comicBookTitle = "";
if (!isNil(comicBookDetailData.rawFileDetails)) {
const encodedFilePath = encodeURI(
"http://localhost:3000" +
`${IMPORT_SERVICE_HOST}` +
removeLeadingPeriod(comicBookDetailData.rawFileDetails.cover.filePath),
);
imagePath = escapePoundSymbol(encodedFilePath);

View File

@@ -11,6 +11,7 @@ import ellipsize from "ellipsize";
import { useDispatch, useSelector } from "react-redux";
import { getComicBooks } from "../actions/fileops.actions";
import { isNil } from "lodash";
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
interface IComicBookLibraryProps {
matches?: unknown;
@@ -38,7 +39,7 @@ export const Library = ({}: IComicBookLibraryProps): ReactElement => {
const RawFileDetails = ({ value }) => {
if (!isNil(value.path)) {
const encodedFilePath = encodeURI(
"http://localhost:3000" + removeLeadingPeriod(value.cover.filePath),
`${IMPORT_SERVICE_HOST}` + removeLeadingPeriod(value.cover.filePath),
);
const filePath = escapePoundSymbol(encodedFilePath);
return (

View File

@@ -15,6 +15,7 @@ import Masonry from "react-masonry-css";
import Card from "./Carda";
import { detectIssueTypes } from "../shared/utils/tradepaperback.utils";
import { Link } from "react-router-dom";
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
interface ILibraryGridProps {}
@@ -47,7 +48,7 @@ export const LibraryGrid = (libraryGridProps: ILibraryGridProps) => {
let comicName = "";
if (!isNil(rawFileDetails)) {
const encodedFilePath = encodeURI(
"http://localhost:3000" +
`${IMPORT_SERVICE_HOST}` +
removeLeadingPeriod(rawFileDetails.cover.filePath),
);
imagePath = escapePoundSymbol(encodedFilePath);

View File

@@ -9,6 +9,7 @@ import {
import { isNil, isUndefined, map } from "lodash";
import { detectIssueTypes } from "../shared/utils/tradepaperback.utils";
import Masonry from "react-masonry-css";
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
type RecentlyImportedProps = {
comicBookCovers: any;
@@ -40,7 +41,7 @@ export const RecentlyImported = ({
let comicName = "";
if (!isNil(rawFileDetails)) {
const encodedFilePath = encodeURI(
"http://localhost:3000" +
`${IMPORT_SERVICE_HOST}` +
removeLeadingPeriod(rawFileDetails.cover.filePath),
);
imagePath = escapePoundSymbol(encodedFilePath);