Explorar el Código

Minor bug fixes and removing console logs

bugfix/740
djordjemitrovic00 hace 3 años
padre
commit
0a5b85c438
Se han modificado 34 ficheros con 15 adiciones y 55 borrados
  1. 0
    1
      src/components/Cards/FilterCard/Choser/CompanyChoser/CompanyChoser.js
  2. 0
    1
      src/components/Cards/FilterCard/Choser/LocationChoser/LocationChoser.js
  3. 0
    1
      src/components/Cards/FilterCard/FilterCard.js
  4. 0
    1
      src/components/Cards/MiniChatCard/MiniChatCard.js
  5. 0
    1
      src/components/Cards/ProfileCard/BigProfileCard/BigProfileCard.js
  6. 0
    2
      src/components/Cards/ProfileCard/ProfileMainInfo/ProfileMainInfo.js
  7. 0
    1
      src/components/Cards/UserReviewsCard/UserReviewsCard.js
  8. 0
    1
      src/components/Cards/UserReviewsCard/UserReviewsSingleCard/GivenReviewsHeader/GivenReviewsHeader.js
  9. 1
    1
      src/components/ChatColumn/ChatColumn.js
  10. 0
    1
      src/components/DirectChat/DirectChatNewMessage/DirectChatNewMessage.js
  11. 1
    2
      src/components/Header/Header.js
  12. 2
    0
      src/components/Header/SearchInput/SearchInput.js
  13. 1
    0
      src/components/Header/SearchInput/SearchInput.styled.js
  14. 0
    2
      src/components/MarketPlace/Header/Header.js
  15. 0
    1
      src/components/MarketPlace/MarketPlace.js
  16. 0
    1
      src/components/Modals/DeleteCategory/DeleteCategory.js
  17. 0
    1
      src/components/Modals/EditCategory/EditCategory.js
  18. 0
    1
      src/components/ProfileMini/ProfileMini.js
  19. 0
    1
      src/components/TextFields/SearchField/SearchField.js
  20. 0
    3
      src/components/UserReviews/ReviewsSorting/ReviewsSorting.js
  21. 0
    4
      src/components/UserReviews/UserReviews.js
  22. 0
    1
      src/hooks/useOffers/useCompanyFilter.js
  23. 0
    4
      src/hooks/useOffers/useOffers.js
  24. 0
    1
      src/pages/AdminHomePage/AdminCategoriesPage/AdminCategoriesPage.js
  25. 0
    1
      src/pages/AdminHomePage/AdminLocationsPage/AdminLocationsPage.js
  26. 0
    2
      src/pages/AdminHomePage/AdminSubcategoriesPage/AdminSubcategoriesPage.js
  27. 0
    1
      src/pages/AdminHomePage/AdminUsersPage/AdminUsersPage.js
  28. 0
    1
      src/pages/ChatMessages/ChatMessages.js
  29. 0
    2
      src/store/reducers/loading/loadingReducer.js
  30. 4
    2
      src/store/saga/categoriesSaga.js
  31. 3
    2
      src/store/saga/locationsSaga.js
  32. 3
    2
      src/store/saga/offersSaga.js
  33. 0
    3
      src/util/helpers/adminSortHelper.js
  34. 0
    6
      src/util/helpers/queryHelpers.js

+ 0
- 1
src/components/Cards/FilterCard/Choser/CompanyChoser/CompanyChoser.js Ver fichero

} }
}, [filters.companies.selectedCompaniesLocally]); }, [filters.companies.selectedCompaniesLocally]);


console.log("Comapnies", filters.companies)
return ( return (
<FilterSubDropdown <FilterSubDropdown
searchPlaceholder={t("filters.company.placeholder")} searchPlaceholder={t("filters.company.placeholder")}

+ 0
- 1
src/components/Cards/FilterCard/Choser/LocationChoser/LocationChoser.js Ver fichero

const filters = props.filters; const filters = props.filters;


const allLocations = useMemo(() => filters.locations.allLocations || [], [filters.locations]) const allLocations = useMemo(() => filters.locations.allLocations || [], [filters.locations])
console.log("allLocations", allLocations);


useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
closeSection: () => { closeSection: () => {

+ 0
- 1
src/components/Cards/FilterCard/FilterCard.js Ver fichero

locationRef.current.closeSection(); locationRef.current.closeSection();
companyRef.current.closeSection(); companyRef.current.closeSection();
}; };
console.log(offers);
return ( return (
<FilterCardContainer <FilterCardContainer
filtersOpened={props.filtersOpened} filtersOpened={props.filtersOpened}

+ 0
- 1
src/components/Cards/MiniChatCard/MiniChatCard.js Ver fichero

}) })
); );
}; };
console.log(props);
return ( return (
<MiniChatCardContainer selected={props.selected} onClick={changeChat}> <MiniChatCardContainer selected={props.selected} onClick={changeChat}>
<ProfileImage <ProfileImage

+ 0
- 1
src/components/Cards/ProfileCard/BigProfileCard/BigProfileCard.js Ver fichero

type: USERS_DELETE_TYPE, type: USERS_DELETE_TYPE,
}); });
}; };
// console.log(props.profile);
const blockUser = () => { const blockUser = () => {
setDeleteOrEditModal({ setDeleteOrEditModal({
show: true, show: true,

+ 0
- 2
src/components/Cards/ProfileCard/ProfileMainInfo/ProfileMainInfo.js Ver fichero

const ProfileMainInfo = (props) => { const ProfileMainInfo = (props) => {
const { t } = useTranslation(); const { t } = useTranslation();
const { isMobile } = useIsMobile(); const { isMobile } = useIsMobile();
console.log(props.profile);
const goToUser = () => { const goToUser = () => {
if (isAdminRoute()) { if (isAdminRoute()) {
history.push( history.push(
); );
} }
}; };
console.log(props);
return ( return (
<ProfileMainInfoContainer isAdmin={props.isAdmin}> <ProfileMainInfoContainer isAdmin={props.isAdmin}>
<AvatarImageContainer> <AvatarImageContainer>

+ 0
- 1
src/components/Cards/UserReviewsCard/UserReviewsCard.js Ver fichero

const handleRemove = () => { const handleRemove = () => {
setRemoveModalOpened(true); setRemoveModalOpened(true);
}; };
console.log(props);
const review = useMemo(() => { const review = useMemo(() => {
if (props.givingReview) { if (props.givingReview) {
return { return {

+ 0
- 1
src/components/Cards/UserReviewsCard/UserReviewsSingleCard/GivenReviewsHeader/GivenReviewsHeader.js Ver fichero



const GivenReviewsHeader = (props) => { const GivenReviewsHeader = (props) => {
const { t } = useTranslation(); const { t } = useTranslation();
console.log(props);
return ( return (
<GivenReviewsHeaderContainer hasGivenReview={props.hasGivenReview}> <GivenReviewsHeaderContainer hasGivenReview={props.hasGivenReview}>
<CompanyLabel>{t("reviews.givenHeaderTitle")}&nbsp;</CompanyLabel> <CompanyLabel>{t("reviews.givenHeaderTitle")}&nbsp;</CompanyLabel>

+ 1
- 1
src/components/ChatColumn/ChatColumn.js Ver fichero

changePage={handleChangePage} changePage={handleChangePage}
> >
<ChatPagingText> <ChatPagingText>
{(paging.currentPage - 1) * 6 + 1}-
{chats?.length > 0 ? (paging.currentPage - 1) * 6 + 1 : 0}-
{(paging.currentPage - 1) * 6 + chats.length} {(paging.currentPage - 1) * 6 + chats.length}
</ChatPagingText> </ChatPagingText>
</Paging> </Paging>

+ 0
- 1
src/components/DirectChat/DirectChatNewMessage/DirectChatNewMessage.js Ver fichero

}) })
); );
}; };
console.log("newm", props);
if (mineProfileBlocked) { if (mineProfileBlocked) {
return <NotAllowedChat mineProfileBlocked />; return <NotAllowedChat mineProfileBlocked />;
} }

+ 1
- 2
src/components/Header/Header.js Ver fichero

// Handling search when user is on marketplace and when he is not // Handling search when user is on marketplace and when he is not
const handleSearch = (value) => { const handleSearch = (value) => {
if (isAdminRoute()) { if (isAdminRoute()) {
console.log("admin");
search.setSearchStringManually(value); search.setSearchStringManually(value);
} else { } else {
if (!routeMatches(HOME_PAGE) && !routeMatches(BASE_PAGE)) { if (!routeMatches(HOME_PAGE) && !routeMatches(BASE_PAGE)) {
<LogoHorizontal /> <LogoHorizontal />
</LogoContainer> </LogoContainer>


<SearchInput ref={searchRef} handleSearch={handleSearch} />
<SearchInput ref={searchRef} handleSearch={handleSearch} user={user} />
{routeMatches(ABOUT_PAGE) && <AboutHeader />} {routeMatches(ABOUT_PAGE) && <AboutHeader />}


{user ? ( {user ? (

+ 2
- 0
src/components/Header/SearchInput/SearchInput.js Ver fichero

return ( return (
<SearchInputContainer <SearchInputContainer
fullWidth fullWidth
wider={!props.user}
InputProps={{ InputProps={{
endAdornment: ( endAdornment: (
<EndIcon size="36px"> <EndIcon size="36px">


SearchInput.propTypes = { SearchInput.propTypes = {
handleSearch: PropTypes.func, handleSearch: PropTypes.func,
user: PropTypes.bool,
}; };


export default SearchInput; export default SearchInput;

+ 1
- 0
src/components/Header/SearchInput/SearchInput.styled.js Ver fichero

display: block; display: block;
width: 80%; width: 80%;
height: 46px; height: 46px;
${props => props.wider && `flex: 3;`}
font-family: ${selectedTheme.fonts.textFont}; font-family: ${selectedTheme.fonts.textFont};
& div { & div {
height: 46px; height: 46px;

+ 0
- 2
src/components/MarketPlace/Header/Header.js Ver fichero

}); });


const handleChangeSelect = (event) => { const handleChangeSelect = (event) => {
console.log(sorting);
sorting?.changeSorting(event.target.value); sorting?.changeSorting(event.target.value);
}; };
const handleClickCategory = () => { const handleClickCategory = () => {
const goBack = () => { const goBack = () => {
history.goBack(); history.goBack();
}; };
console.log(headerString);


return ( return (
<> <>

+ 0
- 1
src/components/MarketPlace/MarketPlace.js Ver fichero

const MarketPlace = (props) => { const MarketPlace = (props) => {
const [isGrid, setIsGrid] = useState(false); const [isGrid, setIsGrid] = useState(false);
const offers = props.offers; const offers = props.offers;
console.log("MARKETPLACE");
return ( return (
<MarketPlaceContainer> <MarketPlaceContainer>
<Header <Header

+ 0
- 1
src/components/Modals/DeleteCategory/DeleteCategory.js Ver fichero

const DeleteCategory = (props) => { const DeleteCategory = (props) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const { t } = useTranslation(); const { t } = useTranslation();
console.log(props.category);
const handleCancel = () => { const handleCancel = () => {
props.setOpenedDeleteModal(false); props.setOpenedDeleteModal(false);
}; };

+ 0
- 1
src/components/Modals/EditCategory/EditCategory.js Ver fichero

if (next !== clickedOnNext) setClickedOnNext(next); if (next !== clickedOnNext) setClickedOnNext(next);
formik.handleSubmit(); formik.handleSubmit();
}; };
console.log(props);
return ( return (
<> <>
<BackdropComponent <BackdropComponent

+ 0
- 1
src/components/ProfileMini/ProfileMini.js Ver fichero

if (offer?.offer?.userId?.toString() === userId?.toString()) return true; if (offer?.offer?.userId?.toString() === userId?.toString()) return true;
return false; return false;
}, [offer, userId]); }, [offer, userId]);
console.log(offer);
return ( return (
<> <>
{isLoadingOfferContent || isLoadingOfferContent === undefined ? ( {isLoadingOfferContent || isLoadingOfferContent === undefined ? (

+ 0
- 1
src/components/TextFields/SearchField/SearchField.js Ver fichero

}; };
const handleSearch = () => { const handleSearch = () => {
if (props.isAdmin) { if (props.isAdmin) {
console.log(searchRef.current.value);
if (props.handleSearch) props.handleSearch(searchRef.current.value); if (props.handleSearch) props.handleSearch(searchRef.current.value);
else search.searchOffersImmediately(searchRef.current.value); else search.searchOffersImmediately(searchRef.current.value);
} else { } else {

+ 0
- 3
src/components/UserReviews/ReviewsSorting/ReviewsSorting.js Ver fichero

const reviews = useSelector(selectSelectedReviews); const reviews = useSelector(selectSelectedReviews);
const dispatch = useDispatch(); const dispatch = useDispatch();
const [value, setValue] = useState(); const [value, setValue] = useState();
console.log(reviews);
const changeValue = (event) => { const changeValue = (event) => {
if (props.isAdmin) { if (props.isAdmin) {
console.log("sortiranje: ", event.target.value);

// if(event.target.value.value === 1) { // if(event.target.value.value === 1) {
// dispatch(setReviews(reviews.givenReviews)); // dispatch(setReviews(reviews.givenReviews));
// } else { // } else {

+ 0
- 4
src/components/UserReviews/UserReviews.js Ver fichero

// } // }
}, [props.profileReviews, routeMatch]); }, [props.profileReviews, routeMatch]);
const lastThreeReviews = useMemo(() => { const lastThreeReviews = useMemo(() => {
console.log("isGiven", isGiven);
if (props.isAdmin) { if (props.isAdmin) {
if (isGiven) { if (isGiven) {
return reviews.givenReviews; return reviews.givenReviews;
}, [props.profileReviews, offer, props.isProfileReviews, reviews, isGiven]); }, [props.profileReviews, offer, props.isProfileReviews, reviews, isGiven]);


const handleChangeSorting = (newSortOption) => { const handleChangeSorting = (newSortOption) => {
console.log("newSortOption",newSortOption);
listRef.current.scrollTo({ top: 0, behaviour: "smooth" }); listRef.current.scrollTo({ top: 0, behaviour: "smooth" });
if (props.isAdmin) { if (props.isAdmin) {
if (newSortOption.value === 1) { if (newSortOption.value === 1) {
} }
}; };


console.log(sortRef.current?.sortValue);
console.log(lastThreeReviews);
return ( return (
<UserReviewsContainer className={props.className}> <UserReviewsContainer className={props.className}>
{!props.givingReview && {!props.givingReview &&

+ 0
- 1
src/hooks/useOffers/useCompanyFilter.js Ver fichero

Array.isArray(selectedCompaniesRedux) ? selectedCompaniesRedux : [] Array.isArray(selectedCompaniesRedux) ? selectedCompaniesRedux : []
); );


console.log('allcompanies', allCompaniesRedux);
const allCompanies = useMemo(() => const allCompanies = useMemo(() =>
Array.isArray(allCompaniesRedux) ? allCompaniesRedux : [] Array.isArray(allCompaniesRedux) ? allCompaniesRedux : []
); );

+ 0
- 4
src/hooks/useOffers/useOffers.js Ver fichero



const apply = () => { const apply = () => {
filters.apply(); filters.apply();
console.log("ovde");
const newQueryString = makeQueryStringHelper( const newQueryString = makeQueryStringHelper(
filters, filters,
paging, paging,
}; };


const applyFilters = () => { const applyFilters = () => {
console.log("applyfilters");
setFiltersCleared(true); setFiltersCleared(true);
}; };


const clearFiltersAndApply = () => { const clearFiltersAndApply = () => {
clear(); clear();
console.log("clearfiltersandapply filterscleared");
setFiltersCleared(true); setFiltersCleared(true);
}; };


const clearOnlyFiltersAndApply = () => { const clearOnlyFiltersAndApply = () => {
filters.clear(); filters.clear();
paging.changePage(1); paging.changePage(1);
console.log("clearonlyfiltersandapply filterscleared");


setFiltersCleared(true); setFiltersCleared(true);
}; };

+ 0
- 1
src/pages/AdminHomePage/AdminCategoriesPage/AdminCategoriesPage.js Ver fichero

}; };
}, []); }, []);
const handleSearch = (value) => { const handleSearch = (value) => {
console.log(value);
dispatch(setManualSearchString(value)); dispatch(setManualSearchString(value));
}; };
const categoriesToShow = useMemo(() => { const categoriesToShow = useMemo(() => {

+ 0
- 1
src/pages/AdminHomePage/AdminLocationsPage/AdminLocationsPage.js Ver fichero

}; };
}, []); }, []);
const handleSearch = (value) => { const handleSearch = (value) => {
console.log(value);
dispatch(setManualSearchString(value)); dispatch(setManualSearchString(value));
}; };
const locationsToShow = useMemo(() => { const locationsToShow = useMemo(() => {

+ 0
- 2
src/pages/AdminHomePage/AdminSubcategoriesPage/AdminSubcategoriesPage.js Ver fichero

}, []); }, []);


const handleSearch = (value) => { const handleSearch = (value) => {
console.log(value);
dispatch(setManualSearchString(value)); dispatch(setManualSearchString(value));
}; };


} }
return []; return [];
}, [category, manualSearchString, sorting.selectedSortOptionLocally]); }, [category, manualSearchString, sorting.selectedSortOptionLocally]);
console.log("subc", categories);
const goBack = () => { const goBack = () => {
history.goBack(); history.goBack();
}; };

+ 0
- 1
src/pages/AdminHomePage/AdminUsersPage/AdminUsersPage.js Ver fichero

}; };


const handleSearch = (data) => { const handleSearch = (data) => {
console.log(data);
paging.changePage(1); paging.changePage(1);
setSearchValue(data); setSearchValue(data);
}; };

+ 0
- 1
src/pages/ChatMessages/ChatMessages.js Ver fichero

import { useHistory } from "react-router-dom"; import { useHistory } from "react-router-dom";
export const ChatMessagesPage = () => { export const ChatMessagesPage = () => {
const history = useHistory(); const history = useHistory();
console.log("rerender");
const goBack = () => { const goBack = () => {
history.goBack(); history.goBack();
}; };

+ 0
- 2
src/store/reducers/loading/loadingReducer.js Ver fichero

); );


function addLoader(state, action) { function addLoader(state, action) {
// console.log("ADD", "state: ", state, "action: ", action);
let loaderCount = state.loaderCount; let loaderCount = state.loaderCount;
let actionType = action.payload.replace("[FETCH]", ""); let actionType = action.payload.replace("[FETCH]", "");
if (!state[actionType]) { if (!state[actionType]) {
} }


function removeLoader(state, action) { function removeLoader(state, action) {
// console.log("REMOVE", "state: ", state, "action: ", action);
let actionType = action.payload let actionType = action.payload
.replace("[SUCCESS]", "") .replace("[SUCCESS]", "")
.replace("[ERROR]", ""); .replace("[ERROR]", "");

+ 4
- 2
src/store/saga/categoriesSaga.js Ver fichero



function* fetchCategories() { function* fetchCategories() {
try { 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()); yield put(fetchCategoriesSuccess());
} catch (e) { } catch (e) {
yield put(fetchCategoriesError()); yield put(fetchCategoriesError());

+ 3
- 2
src/store/saga/locationsSaga.js Ver fichero



function* fetchLocations() { function* fetchLocations() {
try { 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()); yield put(fetchLocationsSuccess());
} catch (e) { } catch (e) {
yield put(fetchLocationsError()); yield put(fetchLocationsError());

+ 3
- 2
src/store/saga/offersSaga.js Ver fichero

function* fetchOneOffer(payload) { function* fetchOneOffer(payload) {
try { try {
const data = yield call(attemptFetchOneOffer, payload.payload); 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) { } catch (e) {
console.log(e.response.status);
console.log(e?.response?.status);
// if (e.response.status === 400) { // if (e.response.status === 400) {
// yield call(history.push, NOT_FOUND_PAGE); // yield call(history.push, NOT_FOUND_PAGE);
// } // }

+ 0
- 3
src/util/helpers/adminSortHelper.js Ver fichero

import { sortCategoriesEnum } from "../../enums/sortEnum"; import { sortCategoriesEnum } from "../../enums/sortEnum";


export const adminSortMethod = (arrayOfItems, manualSearchString, sorting) => { export const adminSortMethod = (arrayOfItems, manualSearchString, sorting) => {
console.log(arrayOfItems);
console.log(sorting);
let arrayOfItemsToReturn = [...arrayOfItems]; let arrayOfItemsToReturn = [...arrayOfItems];
if (manualSearchString) if (manualSearchString)
arrayOfItemsToReturn = arrayOfItems.filter( arrayOfItemsToReturn = arrayOfItems.filter(
const secondCreated = new Date( const secondCreated = new Date(
b?._created || new Date(1970, 1).toISOString() b?._created || new Date(1970, 1).toISOString()
); );
console.log(firstCreated);
return firstCreated - secondCreated; return firstCreated - secondCreated;
}); });
} }

+ 0
- 6
src/util/helpers/queryHelpers.js Ver fichero

); );
arrayOfProperties.forEach((property) => { arrayOfProperties.forEach((property) => {
if (!secondQueryObject.has(property)) { if (!secondQueryObject.has(property)) {
// console.log("ovde je doslo query: ", property);
// thirdQueryObject.append(property, secondQueryObject.get(property));
thirdQueryObject.append(property, firstQueryObject.get(property)); thirdQueryObject.append(property, firstQueryObject.get(property));
} else {
// console.log("ovde ispod: ", property);
} }
}); });


if (queryObject.has(KEY_COMPANY)) { if (queryObject.has(KEY_COMPANY)) {
const arrayOfCompanies = queryObject.getAll(KEY_COMPANY); const arrayOfCompanies = queryObject.getAll(KEY_COMPANY);
arrayOfCompanies.forEach((item) => { arrayOfCompanies.forEach((item) => {
console.log(item);
newQueryObject.append(KEY_COMPANY, item); newQueryObject.append(KEY_COMPANY, item);
}); });
} }


filters.companies.selectedCompanies.forEach((company, index) => { filters.companies.selectedCompanies.forEach((company, index) => {
// Checking if item is last // Checking if item is last
console.log(company);
if (index + 1 === filters.companies.selectedCompanies.length) { if (index + 1 === filters.companies.selectedCompanies.length) {
companiesString += company.companyName; companiesString += company.companyName;
} else { } else {

Cargando…
Cancelar
Guardar