| @@ -26,7 +26,6 @@ const CompanyChoser = forwardRef((props, ref) => { | |||
| } | |||
| }, [filters.companies.selectedCompaniesLocally]); | |||
| console.log("Comapnies", filters.companies) | |||
| return ( | |||
| <FilterSubDropdown | |||
| searchPlaceholder={t("filters.company.placeholder")} | |||
| @@ -10,7 +10,6 @@ const LocationChoser = forwardRef((props, ref) => { | |||
| const filters = props.filters; | |||
| const allLocations = useMemo(() => filters.locations.allLocations || [], [filters.locations]) | |||
| console.log("allLocations", allLocations); | |||
| useImperativeHandle(ref, () => ({ | |||
| closeSection: () => { | |||
| @@ -23,7 +23,6 @@ const FilterCard = (props) => { | |||
| locationRef.current.closeSection(); | |||
| companyRef.current.closeSection(); | |||
| }; | |||
| console.log(offers); | |||
| return ( | |||
| <FilterCardContainer | |||
| filtersOpened={props.filtersOpened} | |||
| @@ -27,7 +27,6 @@ const MiniChatCard = (props) => { | |||
| }) | |||
| ); | |||
| }; | |||
| console.log(props); | |||
| return ( | |||
| <MiniChatCardContainer selected={props.selected} onClick={changeChat}> | |||
| <ProfileImage | |||
| @@ -46,7 +46,6 @@ const BigProfileCard = (props) => { | |||
| type: USERS_DELETE_TYPE, | |||
| }); | |||
| }; | |||
| // console.log(props.profile); | |||
| const blockUser = () => { | |||
| setDeleteOrEditModal({ | |||
| show: true, | |||
| @@ -25,7 +25,6 @@ import BlockedProfile from "../BlockedProfile/BlockedProfile"; | |||
| const ProfileMainInfo = (props) => { | |||
| const { t } = useTranslation(); | |||
| const { isMobile } = useIsMobile(); | |||
| console.log(props.profile); | |||
| const goToUser = () => { | |||
| if (isAdminRoute()) { | |||
| history.push( | |||
| @@ -35,7 +34,6 @@ const ProfileMainInfo = (props) => { | |||
| ); | |||
| } | |||
| }; | |||
| console.log(props); | |||
| return ( | |||
| <ProfileMainInfoContainer isAdmin={props.isAdmin}> | |||
| <AvatarImageContainer> | |||
| @@ -9,7 +9,6 @@ const UserReviewsCard = (props) => { | |||
| const handleRemove = () => { | |||
| setRemoveModalOpened(true); | |||
| }; | |||
| console.log(props); | |||
| const review = useMemo(() => { | |||
| if (props.givingReview) { | |||
| return { | |||
| @@ -9,7 +9,6 @@ import { useTranslation } from "react-i18next"; | |||
| const GivenReviewsHeader = (props) => { | |||
| const { t } = useTranslation(); | |||
| console.log(props); | |||
| return ( | |||
| <GivenReviewsHeaderContainer hasGivenReview={props.hasGivenReview}> | |||
| <CompanyLabel>{t("reviews.givenHeaderTitle")} </CompanyLabel> | |||
| @@ -141,7 +141,7 @@ export const ChatColumn = (props) => { | |||
| changePage={handleChangePage} | |||
| > | |||
| <ChatPagingText> | |||
| {(paging.currentPage - 1) * 6 + 1}- | |||
| {chats?.length > 0 ? (paging.currentPage - 1) * 6 + 1 : 0}- | |||
| {(paging.currentPage - 1) * 6 + chats.length} | |||
| </ChatPagingText> | |||
| </Paging> | |||
| @@ -87,7 +87,6 @@ const DirectChatNewMessage = (props) => { | |||
| }) | |||
| ); | |||
| }; | |||
| console.log("newm", props); | |||
| if (mineProfileBlocked) { | |||
| return <NotAllowedChat mineProfileBlocked />; | |||
| } | |||
| @@ -79,7 +79,6 @@ const Header = () => { | |||
| // Handling search when user is on marketplace and when he is not | |||
| const handleSearch = (value) => { | |||
| if (isAdminRoute()) { | |||
| console.log("admin"); | |||
| search.setSearchStringManually(value); | |||
| } else { | |||
| if (!routeMatches(HOME_PAGE) && !routeMatches(BASE_PAGE)) { | |||
| @@ -128,7 +127,7 @@ const Header = () => { | |||
| <LogoHorizontal /> | |||
| </LogoContainer> | |||
| <SearchInput ref={searchRef} handleSearch={handleSearch} /> | |||
| <SearchInput ref={searchRef} handleSearch={handleSearch} user={user} /> | |||
| {routeMatches(ABOUT_PAGE) && <AboutHeader />} | |||
| {user ? ( | |||
| @@ -46,6 +46,7 @@ const SearchInput = forwardRef((props, ref) => { | |||
| return ( | |||
| <SearchInputContainer | |||
| fullWidth | |||
| wider={!props.user} | |||
| InputProps={{ | |||
| endAdornment: ( | |||
| <EndIcon size="36px"> | |||
| @@ -66,6 +67,7 @@ SearchInput.displayName = "SearchInput"; | |||
| SearchInput.propTypes = { | |||
| handleSearch: PropTypes.func, | |||
| user: PropTypes.bool, | |||
| }; | |||
| export default SearchInput; | |||
| @@ -25,6 +25,7 @@ export const SearchInputContainer = styled(TextField)` | |||
| display: block; | |||
| width: 80%; | |||
| height: 46px; | |||
| ${props => props.wider && `flex: 3;`} | |||
| font-family: ${selectedTheme.fonts.textFont}; | |||
| & div { | |||
| height: 46px; | |||
| @@ -105,7 +105,6 @@ const Header = (props) => { | |||
| }); | |||
| const handleChangeSelect = (event) => { | |||
| console.log(sorting); | |||
| sorting?.changeSorting(event.target.value); | |||
| }; | |||
| const handleClickCategory = () => { | |||
| @@ -120,7 +119,6 @@ const Header = (props) => { | |||
| const goBack = () => { | |||
| history.goBack(); | |||
| }; | |||
| console.log(headerString); | |||
| return ( | |||
| <> | |||
| @@ -7,7 +7,6 @@ import Offers from "./Offers/Offers"; | |||
| const MarketPlace = (props) => { | |||
| const [isGrid, setIsGrid] = useState(false); | |||
| const offers = props.offers; | |||
| console.log("MARKETPLACE"); | |||
| return ( | |||
| <MarketPlaceContainer> | |||
| <Header | |||
| @@ -24,7 +24,6 @@ import { fetchProfile } from "../../../store/actions/profile/profileActions"; | |||
| const DeleteCategory = (props) => { | |||
| const dispatch = useDispatch(); | |||
| const { t } = useTranslation(); | |||
| console.log(props.category); | |||
| const handleCancel = () => { | |||
| props.setOpenedDeleteModal(false); | |||
| }; | |||
| @@ -79,7 +79,6 @@ const EditCategory = (props) => { | |||
| if (next !== clickedOnNext) setClickedOnNext(next); | |||
| formik.handleSubmit(); | |||
| }; | |||
| console.log(props); | |||
| return ( | |||
| <> | |||
| <BackdropComponent | |||
| @@ -26,7 +26,6 @@ const ProfileMini = () => { | |||
| if (offer?.offer?.userId?.toString() === userId?.toString()) return true; | |||
| return false; | |||
| }, [offer, userId]); | |||
| console.log(offer); | |||
| return ( | |||
| <> | |||
| {isLoadingOfferContent || isLoadingOfferContent === undefined ? ( | |||
| @@ -27,7 +27,6 @@ const SearchField = (props) => { | |||
| }; | |||
| const handleSearch = () => { | |||
| if (props.isAdmin) { | |||
| console.log(searchRef.current.value); | |||
| if (props.handleSearch) props.handleSearch(searchRef.current.value); | |||
| else search.searchOffersImmediately(searchRef.current.value); | |||
| } else { | |||
| @@ -17,11 +17,8 @@ const ReviewsSorting = forwardRef((props, ref) => { | |||
| const reviews = useSelector(selectSelectedReviews); | |||
| const dispatch = useDispatch(); | |||
| const [value, setValue] = useState(); | |||
| console.log(reviews); | |||
| const changeValue = (event) => { | |||
| if (props.isAdmin) { | |||
| console.log("sortiranje: ", event.target.value); | |||
| // if(event.target.value.value === 1) { | |||
| // dispatch(setReviews(reviews.givenReviews)); | |||
| // } else { | |||
| @@ -70,7 +70,6 @@ const UserReviews = (props) => { | |||
| // } | |||
| }, [props.profileReviews, routeMatch]); | |||
| const lastThreeReviews = useMemo(() => { | |||
| console.log("isGiven", isGiven); | |||
| if (props.isAdmin) { | |||
| if (isGiven) { | |||
| return reviews.givenReviews; | |||
| @@ -99,7 +98,6 @@ const UserReviews = (props) => { | |||
| }, [props.profileReviews, offer, props.isProfileReviews, reviews, isGiven]); | |||
| const handleChangeSorting = (newSortOption) => { | |||
| console.log("newSortOption",newSortOption); | |||
| listRef.current.scrollTo({ top: 0, behaviour: "smooth" }); | |||
| if (props.isAdmin) { | |||
| if (newSortOption.value === 1) { | |||
| @@ -110,8 +108,6 @@ const UserReviews = (props) => { | |||
| } | |||
| }; | |||
| console.log(sortRef.current?.sortValue); | |||
| console.log(lastThreeReviews); | |||
| return ( | |||
| <UserReviewsContainer className={props.className}> | |||
| {!props.givingReview && | |||
| @@ -18,7 +18,6 @@ const useCompaniesFilter = () => { | |||
| Array.isArray(selectedCompaniesRedux) ? selectedCompaniesRedux : [] | |||
| ); | |||
| console.log('allcompanies', allCompaniesRedux); | |||
| const allCompanies = useMemo(() => | |||
| Array.isArray(allCompaniesRedux) ? allCompaniesRedux : [] | |||
| ); | |||
| @@ -130,7 +130,6 @@ const useOffers = () => { | |||
| const apply = () => { | |||
| filters.apply(); | |||
| console.log("ovde"); | |||
| const newQueryString = makeQueryStringHelper( | |||
| filters, | |||
| paging, | |||
| @@ -141,13 +140,11 @@ const useOffers = () => { | |||
| }; | |||
| const applyFilters = () => { | |||
| console.log("applyfilters"); | |||
| setFiltersCleared(true); | |||
| }; | |||
| const clearFiltersAndApply = () => { | |||
| clear(); | |||
| console.log("clearfiltersandapply filterscleared"); | |||
| setFiltersCleared(true); | |||
| }; | |||
| @@ -177,7 +174,6 @@ const useOffers = () => { | |||
| const clearOnlyFiltersAndApply = () => { | |||
| filters.clear(); | |||
| paging.changePage(1); | |||
| console.log("clearonlyfiltersandapply filterscleared"); | |||
| setFiltersCleared(true); | |||
| }; | |||
| @@ -38,7 +38,6 @@ const AdminCategoriesPage = () => { | |||
| }; | |||
| }, []); | |||
| const handleSearch = (value) => { | |||
| console.log(value); | |||
| dispatch(setManualSearchString(value)); | |||
| }; | |||
| const categoriesToShow = useMemo(() => { | |||
| @@ -35,7 +35,6 @@ const AdminLocationsPage = () => { | |||
| }; | |||
| }, []); | |||
| const handleSearch = (value) => { | |||
| console.log(value); | |||
| dispatch(setManualSearchString(value)); | |||
| }; | |||
| const locationsToShow = useMemo(() => { | |||
| @@ -44,7 +44,6 @@ const AdminSubcategoriesPage = () => { | |||
| }, []); | |||
| const handleSearch = (value) => { | |||
| console.log(value); | |||
| dispatch(setManualSearchString(value)); | |||
| }; | |||
| @@ -66,7 +65,6 @@ const AdminSubcategoriesPage = () => { | |||
| } | |||
| return []; | |||
| }, [category, manualSearchString, sorting.selectedSortOptionLocally]); | |||
| console.log("subc", categories); | |||
| const goBack = () => { | |||
| history.goBack(); | |||
| }; | |||
| @@ -47,7 +47,6 @@ const AdminUsersPage = () => { | |||
| }; | |||
| const handleSearch = (data) => { | |||
| console.log(data); | |||
| paging.changePage(1); | |||
| setSearchValue(data); | |||
| }; | |||
| @@ -10,7 +10,6 @@ import { | |||
| import { useHistory } from "react-router-dom"; | |||
| export const ChatMessagesPage = () => { | |||
| const history = useHistory(); | |||
| console.log("rerender"); | |||
| const goBack = () => { | |||
| history.goBack(); | |||
| }; | |||
| @@ -17,7 +17,6 @@ export default createReducer( | |||
| ); | |||
| function addLoader(state, action) { | |||
| // console.log("ADD", "state: ", state, "action: ", action); | |||
| let loaderCount = state.loaderCount; | |||
| let actionType = action.payload.replace("[FETCH]", ""); | |||
| if (!state[actionType]) { | |||
| @@ -31,7 +30,6 @@ function addLoader(state, action) { | |||
| } | |||
| function removeLoader(state, action) { | |||
| // console.log("REMOVE", "state: ", state, "action: ", action); | |||
| let actionType = action.payload | |||
| .replace("[SUCCESS]", "") | |||
| .replace("[ERROR]", ""); | |||
| @@ -9,8 +9,10 @@ import { | |||
| function* fetchCategories() { | |||
| try { | |||
| const { data } = yield call(attemptFetchCategories); | |||
| yield put(setCategories(data)); | |||
| const data = yield call(attemptFetchCategories); | |||
| console.log("ASDFASDF", data); | |||
| if (!data?.data) throw new Error(); | |||
| yield put(setCategories(data.data)); | |||
| yield put(fetchCategoriesSuccess()); | |||
| } catch (e) { | |||
| yield put(fetchCategoriesError()); | |||
| @@ -9,8 +9,9 @@ import { | |||
| function* fetchLocations() { | |||
| try { | |||
| const { data } = yield call(attemptFetchLocations); | |||
| yield put(setLocations(data.value)); | |||
| const data = yield call(attemptFetchLocations); | |||
| if (!data?.data) throw new Error(); | |||
| yield put(setLocations(data.data.value)); | |||
| yield put(fetchLocationsSuccess()); | |||
| } catch (e) { | |||
| yield put(fetchLocationsError()); | |||
| @@ -185,9 +185,10 @@ function* createOffer(payload) { | |||
| function* fetchOneOffer(payload) { | |||
| try { | |||
| const data = yield call(attemptFetchOneOffer, payload.payload); | |||
| yield put(fetchOneOfferSuccess(data.data)); | |||
| if (!data?.data) throw new Error() | |||
| yield put(fetchOneOfferSuccess(data?.data)); | |||
| } catch (e) { | |||
| console.log(e.response.status); | |||
| console.log(e?.response?.status); | |||
| // if (e.response.status === 400) { | |||
| // yield call(history.push, NOT_FOUND_PAGE); | |||
| // } | |||
| @@ -1,8 +1,6 @@ | |||
| import { sortCategoriesEnum } from "../../enums/sortEnum"; | |||
| export const adminSortMethod = (arrayOfItems, manualSearchString, sorting) => { | |||
| console.log(arrayOfItems); | |||
| console.log(sorting); | |||
| let arrayOfItemsToReturn = [...arrayOfItems]; | |||
| if (manualSearchString) | |||
| arrayOfItemsToReturn = arrayOfItems.filter( | |||
| @@ -22,7 +20,6 @@ export const adminSortMethod = (arrayOfItems, manualSearchString, sorting) => { | |||
| const secondCreated = new Date( | |||
| b?._created || new Date(1970, 1).toISOString() | |||
| ); | |||
| console.log(firstCreated); | |||
| return firstCreated - secondCreated; | |||
| }); | |||
| } | |||
| @@ -70,11 +70,7 @@ export const combineQueryStrings = (firstQuery, secondQuery) => { | |||
| ); | |||
| arrayOfProperties.forEach((property) => { | |||
| if (!secondQueryObject.has(property)) { | |||
| // console.log("ovde je doslo query: ", property); | |||
| // thirdQueryObject.append(property, secondQueryObject.get(property)); | |||
| thirdQueryObject.append(property, firstQueryObject.get(property)); | |||
| } else { | |||
| // console.log("ovde ispod: ", property); | |||
| } | |||
| }); | |||
| @@ -121,7 +117,6 @@ export const convertQueryStringForBackend = (queryURL) => { | |||
| if (queryObject.has(KEY_COMPANY)) { | |||
| const arrayOfCompanies = queryObject.getAll(KEY_COMPANY); | |||
| arrayOfCompanies.forEach((item) => { | |||
| console.log(item); | |||
| newQueryObject.append(KEY_COMPANY, item); | |||
| }); | |||
| } | |||
| @@ -236,7 +231,6 @@ export const makeHeaderStringHelper = (filters) => { | |||
| filters.companies.selectedCompanies.forEach((company, index) => { | |||
| // Checking if item is last | |||
| console.log(company); | |||
| if (index + 1 === filters.companies.selectedCompanies.length) { | |||
| companiesString += company.companyName; | |||
| } else { | |||