瀏覽代碼

Minor bug fixes and removing console logs

bugfix/740
djordjemitrovic00 3 年之前
父節點
當前提交
0a5b85c438
共有 34 個檔案被更改,包括 15 行新增55 行删除
  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 查看文件

@@ -26,7 +26,6 @@ const CompanyChoser = forwardRef((props, ref) => {
}
}, [filters.companies.selectedCompaniesLocally]);

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

+ 0
- 1
src/components/Cards/FilterCard/Choser/LocationChoser/LocationChoser.js 查看文件

@@ -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: () => {

+ 0
- 1
src/components/Cards/FilterCard/FilterCard.js 查看文件

@@ -23,7 +23,6 @@ const FilterCard = (props) => {
locationRef.current.closeSection();
companyRef.current.closeSection();
};
console.log(offers);
return (
<FilterCardContainer
filtersOpened={props.filtersOpened}

+ 0
- 1
src/components/Cards/MiniChatCard/MiniChatCard.js 查看文件

@@ -27,7 +27,6 @@ const MiniChatCard = (props) => {
})
);
};
console.log(props);
return (
<MiniChatCardContainer selected={props.selected} onClick={changeChat}>
<ProfileImage

+ 0
- 1
src/components/Cards/ProfileCard/BigProfileCard/BigProfileCard.js 查看文件

@@ -46,7 +46,6 @@ const BigProfileCard = (props) => {
type: USERS_DELETE_TYPE,
});
};
// console.log(props.profile);
const blockUser = () => {
setDeleteOrEditModal({
show: true,

+ 0
- 2
src/components/Cards/ProfileCard/ProfileMainInfo/ProfileMainInfo.js 查看文件

@@ -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>

+ 0
- 1
src/components/Cards/UserReviewsCard/UserReviewsCard.js 查看文件

@@ -9,7 +9,6 @@ const UserReviewsCard = (props) => {
const handleRemove = () => {
setRemoveModalOpened(true);
};
console.log(props);
const review = useMemo(() => {
if (props.givingReview) {
return {

+ 0
- 1
src/components/Cards/UserReviewsCard/UserReviewsSingleCard/GivenReviewsHeader/GivenReviewsHeader.js 查看文件

@@ -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")}&nbsp;</CompanyLabel>

+ 1
- 1
src/components/ChatColumn/ChatColumn.js 查看文件

@@ -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>

+ 0
- 1
src/components/DirectChat/DirectChatNewMessage/DirectChatNewMessage.js 查看文件

@@ -87,7 +87,6 @@ const DirectChatNewMessage = (props) => {
})
);
};
console.log("newm", props);
if (mineProfileBlocked) {
return <NotAllowedChat mineProfileBlocked />;
}

+ 1
- 2
src/components/Header/Header.js 查看文件

@@ -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 ? (

+ 2
- 0
src/components/Header/SearchInput/SearchInput.js 查看文件

@@ -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;

+ 1
- 0
src/components/Header/SearchInput/SearchInput.styled.js 查看文件

@@ -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;

+ 0
- 2
src/components/MarketPlace/Header/Header.js 查看文件

@@ -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 (
<>

+ 0
- 1
src/components/MarketPlace/MarketPlace.js 查看文件

@@ -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

+ 0
- 1
src/components/Modals/DeleteCategory/DeleteCategory.js 查看文件

@@ -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);
};

+ 0
- 1
src/components/Modals/EditCategory/EditCategory.js 查看文件

@@ -79,7 +79,6 @@ const EditCategory = (props) => {
if (next !== clickedOnNext) setClickedOnNext(next);
formik.handleSubmit();
};
console.log(props);
return (
<>
<BackdropComponent

+ 0
- 1
src/components/ProfileMini/ProfileMini.js 查看文件

@@ -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 ? (

+ 0
- 1
src/components/TextFields/SearchField/SearchField.js 查看文件

@@ -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 {

+ 0
- 3
src/components/UserReviews/ReviewsSorting/ReviewsSorting.js 查看文件

@@ -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 {

+ 0
- 4
src/components/UserReviews/UserReviews.js 查看文件

@@ -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 &&

+ 0
- 1
src/hooks/useOffers/useCompanyFilter.js 查看文件

@@ -18,7 +18,6 @@ const useCompaniesFilter = () => {
Array.isArray(selectedCompaniesRedux) ? selectedCompaniesRedux : []
);

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

+ 0
- 4
src/hooks/useOffers/useOffers.js 查看文件

@@ -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);
};

+ 0
- 1
src/pages/AdminHomePage/AdminCategoriesPage/AdminCategoriesPage.js 查看文件

@@ -38,7 +38,6 @@ const AdminCategoriesPage = () => {
};
}, []);
const handleSearch = (value) => {
console.log(value);
dispatch(setManualSearchString(value));
};
const categoriesToShow = useMemo(() => {

+ 0
- 1
src/pages/AdminHomePage/AdminLocationsPage/AdminLocationsPage.js 查看文件

@@ -35,7 +35,6 @@ const AdminLocationsPage = () => {
};
}, []);
const handleSearch = (value) => {
console.log(value);
dispatch(setManualSearchString(value));
};
const locationsToShow = useMemo(() => {

+ 0
- 2
src/pages/AdminHomePage/AdminSubcategoriesPage/AdminSubcategoriesPage.js 查看文件

@@ -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();
};

+ 0
- 1
src/pages/AdminHomePage/AdminUsersPage/AdminUsersPage.js 查看文件

@@ -47,7 +47,6 @@ const AdminUsersPage = () => {
};

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

+ 0
- 1
src/pages/ChatMessages/ChatMessages.js 查看文件

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

+ 0
- 2
src/store/reducers/loading/loadingReducer.js 查看文件

@@ -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]", "");

+ 4
- 2
src/store/saga/categoriesSaga.js 查看文件

@@ -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());

+ 3
- 2
src/store/saga/locationsSaga.js 查看文件

@@ -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());

+ 3
- 2
src/store/saga/offersSaga.js 查看文件

@@ -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);
// }

+ 0
- 3
src/util/helpers/adminSortHelper.js 查看文件

@@ -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;
});
}

+ 0
- 6
src/util/helpers/queryHelpers.js 查看文件

@@ -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 {

Loading…
取消
儲存