From 5b1ed2bdb8ae214670bd473d6ebb8b9fee1042a1 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 1 Mar 2023 23:40:18 -0500 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20the=20response=20obj?= =?UTF-8?q?ect=20in=20reducers=20and=20components=20https://github.com/ris?= =?UTF-8?q?highan/threetwo/issues/64?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/actions/fileops.actions.tsx | 4 ++-- src/client/components/Library/Library.tsx | 4 ++-- src/client/components/Volumes/Volumes.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index bb54b2b..3f35c19 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -314,13 +314,13 @@ export const searchIssue = (query, options) => async (dispatch) => { case "libraryPage": dispatch({ type: SS_SEARCH_RESULTS_FETCHED, - data: response.data.body, + data: response.data.hits, }); break; case "volumesPage": dispatch({ type: VOLUMES_FETCHED, - data: response.data.body, + data: response.data.hits, }); break; diff --git a/src/client/components/Library/Library.tsx b/src/client/components/Library/Library.tsx index c808ec3..6099c51 100644 --- a/src/client/components/Library/Library.tsx +++ b/src/client/components/Library/Library.tsx @@ -221,9 +221,9 @@ export const Library = (): ReactElement => {
{
{}, previousPage: () => {}, -- 2.49.1 From 179e4122d7b03da465b6182b65bae9753115bc4a Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Wed, 1 Mar 2023 23:48:57 -0500 Subject: [PATCH 2/6] =?UTF-8?q?#=EF=B8=8F=E2=83=A3=20Added=20a=20key=20pro?= =?UTF-8?q?p=20to=20MetadataPanel=20in=20global=20search=20results?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/components/GlobalSearchBar/SearchBar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/components/GlobalSearchBar/SearchBar.tsx b/src/client/components/GlobalSearchBar/SearchBar.tsx index 3563359..bea5457 100644 --- a/src/client/components/GlobalSearchBar/SearchBar.tsx +++ b/src/client/components/GlobalSearchBar/SearchBar.tsx @@ -61,9 +61,10 @@ export const SearchBar = (data: ISearchBarProps): ReactElement => { margin: "60px 0 0 350px", }} > - {map(searchResults, (result) => ( + {map(searchResults, (result, idx) => ( Date: Thu, 2 Mar 2023 00:02:19 -0500 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20DOMNesting=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/components/Library/Library.tsx | 5 +---- src/client/components/shared/T2Table.tsx | 10 ++++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/client/components/Library/Library.tsx b/src/client/components/Library/Library.tsx index 6099c51..c966ab5 100644 --- a/src/client/components/Library/Library.tsx +++ b/src/client/components/Library/Library.tsx @@ -19,10 +19,7 @@ export const Library = (): ReactElement => { const searchResults = useSelector( (state: RootState) => state.fileOps.libraryComics, ); - const searchError = useSelector((state: RootState) => { - console.log(state); - return state.fileOps.librarySearchError; - }); + const searchError = useSelector((state: RootState) => state.fileOps.librarySearchError); const dispatch = useDispatch(); useEffect(() => { dispatch( diff --git a/src/client/components/shared/T2Table.tsx b/src/client/components/shared/T2Table.tsx index d066bc5..95472dc 100644 --- a/src/client/components/shared/T2Table.tsx +++ b/src/client/components/shared/T2Table.tsx @@ -20,8 +20,6 @@ export const T2Table = (tableOptions): ReactElement => { pageIndex: 1, pageSize: 15, }); - console.log(sourceData) - const pagination = useMemo( () => ({ @@ -81,12 +79,12 @@ export const T2Table = (tableOptions): ReactElement => { {/*

{totalPages} comics in all

*/}
-

+

goToPreviousPage()}>
-

-

+

+
goToNextPage()}>
-

+

-- 2.49.1 From a3359a84e33e3bb29ae075e8c3d30ed034bc2b03 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 2 Mar 2023 00:12:02 -0500 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20the=20response=20in?= =?UTF-8?q?=20wanted=20reducer=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/actions/fileops.actions.tsx | 2 +- src/client/components/WantedComics/WantedComics.tsx | 4 ++-- src/client/reducers/fileops.reducer.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index 3f35c19..d2669a5 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -301,7 +301,7 @@ export const searchIssue = (query, options) => async (dispatch) => { case "wantedComicsPage": dispatch({ type: WANTED_COMICS_FETCHED, - data: response.data.body, + data: response.data.hits, }); break; case "globalSearchBar": diff --git a/src/client/components/WantedComics/WantedComics.tsx b/src/client/components/WantedComics/WantedComics.tsx index 56f0513..e4de3c4 100644 --- a/src/client/components/WantedComics/WantedComics.tsx +++ b/src/client/components/WantedComics/WantedComics.tsx @@ -73,8 +73,8 @@ export const WantedComics = (props): ReactElement => { id: "downloadDetails", accessorKey: "acquisition", cell: data =>

    - {data.getValue().directconnect.downloads.map(download => { - return
  1. {download.name}
  2. ; + {data.getValue().directconnect.downloads.map((download, idx) => { + return
  3. {download.name}
  4. ; })}
}, diff --git a/src/client/reducers/fileops.reducer.ts b/src/client/reducers/fileops.reducer.ts index 50f048f..4c30a1e 100644 --- a/src/client/reducers/fileops.reducer.ts +++ b/src/client/reducers/fileops.reducer.ts @@ -244,9 +244,10 @@ function fileOpsReducer(state = initialState, action) { }; } case WANTED_COMICS_FETCHED: { + console.log(action); const foo = []; if (!isUndefined(action.data.hits)) { - map(action.data.hits.hits, ({ _source }) => { + map(action.data.hits, ({ _source }) => { foo.push(_source); }); } -- 2.49.1 From 145a5be9dc3be3f61275e055e09c370ec197e782 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 2 Mar 2023 00:12:25 -0500 Subject: [PATCH 5/6] =?UTF-8?q?=E2=9E=95=20Committing=20the=20reducer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/reducers/fileops.reducer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/reducers/fileops.reducer.ts b/src/client/reducers/fileops.reducer.ts index 4c30a1e..210c85c 100644 --- a/src/client/reducers/fileops.reducer.ts +++ b/src/client/reducers/fileops.reducer.ts @@ -244,7 +244,6 @@ function fileOpsReducer(state = initialState, action) { }; } case WANTED_COMICS_FETCHED: { - console.log(action); const foo = []; if (!isUndefined(action.data.hits)) { map(action.data.hits, ({ _source }) => { -- 2.49.1 From dd4bf31612be09764028d761f8985bdd64c8bd93 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 2 Mar 2023 00:20:23 -0500 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=94=A7=20Fixes=20for=20DOMNesting=20i?= =?UTF-8?q?ssues=20on=20the=20Downloads=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/components/Downloads/Downloads.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/client/components/Downloads/Downloads.tsx b/src/client/components/Downloads/Downloads.tsx index 7481340..a18eafe 100644 --- a/src/client/components/Downloads/Downloads.tsx +++ b/src/client/components/Downloads/Downloads.tsx @@ -3,7 +3,6 @@ import { getTransfers } from "../../actions/airdcpp.actions"; import { useDispatch, useSelector } from "react-redux"; import { AirDCPPSocketContext } from "../../context/AirDCPPSocket"; import { isEmpty, isNil, isUndefined } from "lodash"; -import { searchIssue } from "../../actions/fileops.actions"; import { determineCoverFile } from "../../shared/utils/metadata.utils"; import MetadataPanel from "../shared/MetadataPanel"; @@ -47,7 +46,6 @@ export const Downloads = (props: IDownloadsProps): ReactElement => { }) setBundles(foo); } - }, [issueBundles]) return !isNil(bundles) ? @@ -56,9 +54,9 @@ export const Downloads = (props: IDownloadsProps): ReactElement => {

Downloads

- {bundles.map(bundle => { + {bundles.map((bundle, idx) => { console.log(bundle); - return <> + return
{ margin: "0 0 8px 0", }} /> - +
+ - - {bundle.acquisition.directconnect.downloads.map((bundle) => { - return( + + + {bundle.acquisition.directconnect.downloads.map((bundle, idx) => { + return () })} -
Name Size Type Bundle ID
{bundle.name} {bundle.size} {bundle.type.str} {bundle.bundleId}
+ + {/*
{JSON.stringify(bundle.acquisition.directconnect.downloads, null, 2)}
*/} - +
})}
-
:
asd
; +
:
There are no downloads.
; }; export default Downloads; -- 2.49.1