Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Itr9 frontend #2504

Merged
merged 4 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/common/AdvanceSearchFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
setSelectedCampFromAdvanceFilterAlgorithmRecords,
setSelectedCampStatementFromAdvanceFilterAlgorithmRecords,
setPageNumber,
setDetectPressEnterInSearch,
} from "src/store/slices/searchSlice";
import debounce from "lodash/debounce";
import { getTreesApi } from "src/network/api/campDetailApi";
Expand Down Expand Up @@ -114,7 +115,6 @@ export default function AdvanceFilter() {
searchMetaData: state?.searchSlice?.searchMetaData,
pageNumber: state?.searchSlice?.pageNumber,
}));
console.log(pageNumber, "pageNumber");

const { searchDataAll, searchData } = useSelector((state: RootState) => ({
searchDataAll: state?.searchSlice?.searchDataAll,
Expand Down Expand Up @@ -178,7 +178,7 @@ export default function AdvanceFilter() {
</div>
</>
);
console.log(searchMetaData?.search_ids?.topic_ids, "searchMetaData");

const extractNumbers = (dataArray) => {
return dataArray?.map((item) => {
// Split each string by hyphen
Expand All @@ -201,7 +201,7 @@ export default function AdvanceFilter() {
};
const reqBody = {
type: router?.pathname == "/search/nickname" ? "nickname" : "",
search: searchValue,
search: router?.query?.q,
query: searchQueryValue,
nick_ids: extractNumbers(findNicknameId),
};
Expand Down Expand Up @@ -370,7 +370,7 @@ export default function AdvanceFilter() {

const rebody = {
type: "topic",
search: searchValue,
search: router?.query?.q,
query: "",
algo: algorithm,
asof: asof,
Expand All @@ -395,7 +395,7 @@ export default function AdvanceFilter() {
// loadMore ? setPageNumber(pageNumber + 1) : setPageNumber(1);
const rebody = {
type: "camp",
search: searchValue,
search: router?.query?.q,
query: "",
algo: algorithm,
asof: asof,
Expand All @@ -421,7 +421,7 @@ export default function AdvanceFilter() {
// loadMore ? setPageNumber(pageNumber + 1) : setPageNumber(1);
const rebody = {
type: "statement",
search: searchValue,
search: router?.query?.q,
query: "",
algo: algorithm,
asof: asof,
Expand Down Expand Up @@ -728,6 +728,7 @@ export default function AdvanceFilter() {
);
// getTopicsApiCallWithReqBody()
dispatch(setPageNumber(1))
dispatch(setDetectPressEnterInSearch(false))
}}
>
Search include review
Expand Down Expand Up @@ -764,6 +765,7 @@ export default function AdvanceFilter() {
handleAsOfClick();
// getTopicsApiCallWithReqBody()
dispatch(setPageNumber(1))
dispatch(setDetectPressEnterInSearch(false))
}}
>
Search historical
Expand Down
23 changes: 17 additions & 6 deletions src/components/common/SearchSideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@ export default function SearchSideBar() {
const isCampPage = router?.pathname == "/search/camp";

const campTotal =
searchValue === ""
router?.query?.q === ""
? storeOnPressEnterSearchCountForMetaData?.camp_total
: isReviewOrByDate && isCampPage
? selectedCampFromAdvanceFilterAlgorithmRecords
: detectPressEnterInSearch
? searchCountForMetaData?.camp_total
: storeOnPressEnterSearchCountForMetaData?.camp_total;


console.log(storeOnPressEnterSearchCountForMetaData,"storeOnPressEnterSearchCountForMetaData")
return (
<>
<div className="leftSideBar_Card noFilter">
Expand Down Expand Up @@ -110,6 +107,14 @@ export default function SearchSideBar() {
router?.asPath.includes("/search?") ? "active" : "btn"
}`}
disabled={router?.pathname == "/search" ? true : false}
onClick={()=>{
dispatch(
setFilterCanonizedTopics({
asofdate: Date.now() / 1000,
asof: "default",
})
);
}}
>
All Results
</Button>
Expand Down Expand Up @@ -152,7 +157,7 @@ export default function SearchSideBar() {
<span>
{" "}
&nbsp;(
{searchValue === ""
{router?.query?.q === ""
? storeOnPressEnterSearchCountForMetaData?.topic_total
: (router.query.asof === "review" ||
router.query.asof === "bydate") &&
Expand Down Expand Up @@ -240,7 +245,7 @@ export default function SearchSideBar() {
<span>
{" "}
&nbsp;(
{searchValue == ""
{router?.query?.q === ""
? storeOnPressEnterSearchCountForMetaData?.statement_total
: (router.query.asof == "review" ||
router.query.asof == "bydate") &&
Expand Down Expand Up @@ -277,6 +282,12 @@ export default function SearchSideBar() {
}
onClick={() => {
dispatch(setClickAdvanceFilterOption(false));
dispatch(
setFilterCanonizedTopics({
asofdate: Date.now() / 1000,
asof: "default",
})
);
}}
>
{/* <Image
Expand Down
Loading