From a2f8d8b1e8ca0d05f3b71b6b23f49c568a325b06 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 13 Jul 2023 08:03:16 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=82=20Support=20for=20showing=20import?= =?UTF-8?q?=20progress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/client/actions/comicinfo.actions.tsx | 2 +- src/client/components/Dashboard/Dashboard.tsx | 47 ++++++++++++++++++- src/client/components/Dashboard/PullList.tsx | 10 ++-- src/client/components/Header.tsx | 22 +++++++++ src/client/reducers/fileops.reducer.ts | 4 +- src/client/store/index.ts | 2 +- yarn.lock | 18 +++---- 8 files changed, 86 insertions(+), 21 deletions(-) create mode 100644 src/client/components/Header.tsx diff --git a/package.json b/package.json index 87bb2f3..cc8544f 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@fortawesome/fontawesome-free": "^6.3.0", "@redux-devtools/extension": "^3.2.2", "@rollup/plugin-node-resolve": "^15.0.1", - "@tanstack/react-table": "^8.5.11", + "@tanstack/react-table": "^8.9.3", "@types/axios": "^0.14.0", "@types/mime-types": "^2.1.0", "@types/react-router-dom": "^5.3.3", diff --git a/src/client/actions/comicinfo.actions.tsx b/src/client/actions/comicinfo.actions.tsx index 5224eb9..715ae34 100644 --- a/src/client/actions/comicinfo.actions.tsx +++ b/src/client/actions/comicinfo.actions.tsx @@ -127,7 +127,7 @@ export const analyzeLibrary = (issues) => async (dispatch) => { queryObjects, }, }); - + dispatch({ type: CV_ISSUES_MATCHES_IN_LIBRARY_FETCHED, matches: foo.data, diff --git a/src/client/components/Dashboard/Dashboard.tsx b/src/client/components/Dashboard/Dashboard.tsx index 4978d23..1ded75e 100644 --- a/src/client/components/Dashboard/Dashboard.tsx +++ b/src/client/components/Dashboard/Dashboard.tsx @@ -12,6 +12,7 @@ import { } from "../../actions/fileops.actions"; import { getLibraryStatistics } from "../../actions/comicinfo.actions"; import { isEmpty, isNil } from "lodash"; +import Header from "../Header"; export const Dashboard = (): ReactElement => { const dispatch = useDispatch(); @@ -64,6 +65,48 @@ export const Dashboard = (): ReactElement => { <> {/* Pull List */} + <> +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PosTeamPldWDLGFGAGDPtsQualification or relegation
1Leicester City (C) + 38231236836+3281Qualification for the Champions League group stage
+ {/* Stats */} {!isEmpty(libraryStatistics) && ( @@ -74,8 +117,8 @@ export const Dashboard = (): ReactElement => { )} {/* Recent imports */} - - + + {/* Volumes */} {!isEmpty(volumeGroups) && ( diff --git a/src/client/components/Dashboard/PullList.tsx b/src/client/components/Dashboard/PullList.tsx index 00fc9c7..a60ec47 100644 --- a/src/client/components/Dashboard/PullList.tsx +++ b/src/client/components/Dashboard/PullList.tsx @@ -1,6 +1,7 @@ import { isNil, map } from "lodash"; import React, { createRef, ReactElement, useCallback, useEffect } from "react"; import Card from "../Carda"; +import Header from "../Header"; import Masonry from "react-masonry-css"; import { useDispatch, useSelector } from "react-redux"; import { getWeeklyPullList } from "../../actions/comicinfo.actions"; @@ -88,12 +89,9 @@ export const PullList = ({ issues }: PullListProps): ReactElement => { return ( <>
-

- Discover -

-

- Pull List aggregated for the week from League Of Comic Geeks -

+
{/* select week */}
diff --git a/src/client/components/Header.tsx b/src/client/components/Header.tsx new file mode 100644 index 0000000..af76c39 --- /dev/null +++ b/src/client/components/Header.tsx @@ -0,0 +1,22 @@ +import React, { ReactElement } from "react"; + +type IHeaderProps = { + headerContent: string; + subHeaderContent: string; + iconClassNames: string; +} + +export const Header = (props: IHeaderProps): ReactElement => { + + return (<> +

+ {props.headerContent} +

+

+ {props.subHeaderContent} +

+ ) + +} + +export default Header; \ No newline at end of file diff --git a/src/client/reducers/fileops.reducer.ts b/src/client/reducers/fileops.reducer.ts index 78cac4b..c18e848 100644 --- a/src/client/reducers/fileops.reducer.ts +++ b/src/client/reducers/fileops.reducer.ts @@ -62,9 +62,11 @@ const initialState = { librarySearchError: {}, libraryServiceStatus: {}, }; - function fileOpsReducer(state = initialState, action) { switch (action.type) { + case "sessionId": + console.log(action); + break; case IMS_COMICBOOK_METADATA_FETCHED: return { ...state, diff --git a/src/client/store/index.ts b/src/client/store/index.ts index b93fdec..2ff4813 100644 --- a/src/client/store/index.ts +++ b/src/client/store/index.ts @@ -8,7 +8,7 @@ import { reducers } from "../reducers/index"; import { io } from "socket.io-client"; import socketIoMiddleware from "redux-socket.io-middleware"; import { SOCKET_BASE_URI } from "../constants/endpoints"; -const socketConnection = io(SOCKET_BASE_URI, { transports: ["websocket"] }); +const socketConnection = io(SOCKET_BASE_URI, { transports: ["websocket"], withCredentials: true, }); const { createReduxHistory, routerMiddleware, routerReducer } = createReduxHistoryContext({ diff --git a/yarn.lock b/yarn.lock index b28c944..b65c5aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3294,17 +3294,17 @@ "@types/express" "^4.7.0" file-system-cache "^2.0.0" -"@tanstack/react-table@^8.5.11": - version "8.5.11" - resolved "https://registry.yarnpkg.com/@tanstack/react-table/-/react-table-8.5.11.tgz#544f551f15412087edfc2df01bed9697aab4651f" - integrity sha512-bIegBJ3VPUX3Z7rMnFEnTRCRgPccTsciilQA1ib/pA6M7Qq1boTNPjNjSbEHmBKytaxPrPfcUfzkZLogYtvu3g== +"@tanstack/react-table@^8.9.3": + version "8.9.3" + resolved "https://registry.yarnpkg.com/@tanstack/react-table/-/react-table-8.9.3.tgz#03a52e9e15f65c82a8c697a445c42bfca0c5cfc4" + integrity sha512-Ng9rdm3JPoSCi6cVZvANsYnF+UoGVRxflMb270tVj0+LjeT/ZtZ9ckxF6oLPLcKesza6VKBqtdF9mQ+vaz24Aw== dependencies: - "@tanstack/table-core" "8.5.11" + "@tanstack/table-core" "8.9.3" -"@tanstack/table-core@8.5.11": - version "8.5.11" - resolved "https://registry.yarnpkg.com/@tanstack/table-core/-/table-core-8.5.11.tgz#a23178a097df4b0b64bdfa6f79e6d8933e97c7f7" - integrity sha512-ZN61ockLaIAiiPbZfMKT2S03nbWx28OHg/nAiDnNfmN4QmAMcdwVajPn2QQwnNVGAr4jS4nbhbYzCcjq8livXQ== +"@tanstack/table-core@8.9.3": + version "8.9.3" + resolved "https://registry.yarnpkg.com/@tanstack/table-core/-/table-core-8.9.3.tgz#991da6b015f6200fdc841c48048bee5e197f6a46" + integrity sha512-NpHZBoHTfqyJk0m/s/+CSuAiwtebhYK90mDuf5eylTvgViNOujiaOaxNDxJkQQAsVvHWZftUGAx1EfO1rkKtLg== "@testing-library/dom@^8.3.0": version "8.20.0"