From 85efddd57ccafd28286603c105ee0d6be9d065d0 Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Thu, 28 Nov 2024 12:01:38 +0500 Subject: [PATCH 01/13] added pagination in the rider flow --- .../src/apollo/queries.js | 25 +++--- .../src/views/Coupons.jsx | 4 +- .../src/views/Riders.jsx | 79 ++++++++++++------- 3 files changed, 67 insertions(+), 41 deletions(-) diff --git a/enatega-multivendor-admin/src/apollo/queries.js b/enatega-multivendor-admin/src/apollo/queries.js index 13b54145..1c0fc49d 100644 --- a/enatega-multivendor-admin/src/apollo/queries.js +++ b/enatega-multivendor-admin/src/apollo/queries.js @@ -759,20 +759,23 @@ export const getUsers = `query{ } }` -export const getRiders = `query{ - riders{ - _id - name - username - password - phone - available - zone{ + export const getRiders = `query Riders($page: Int, $rowsPerPage: Int, $search: String) { + riders(page: $page, rowsPerPage: $rowsPerPage, search: $search) { + riders { _id - title + name + username + password + phone + available + zone { + _id + title + } } + totalCount } - }` + }`; export const getAvailableRiders = `query{ availableRiders{ diff --git a/enatega-multivendor-admin/src/views/Coupons.jsx b/enatega-multivendor-admin/src/views/Coupons.jsx index 298381a8..bc482e6a 100644 --- a/enatega-multivendor-admin/src/views/Coupons.jsx +++ b/enatega-multivendor-admin/src/views/Coupons.jsx @@ -67,12 +67,10 @@ const Coupon = props => { } ) - console.log("🚀 ~ Coupon ~ data:", data) const coupons = data?.coupons.coupons || [] - console.log("🚀 ~ Coupon ~ coupons:", coupons) + const totalCount = data?.coupons.totalCount || 0 - console.log("🚀 ~ Coupon ~ totalCount:", totalCount) const toggleModal = coupon => { setEditModal(!editModal) diff --git a/enatega-multivendor-admin/src/views/Riders.jsx b/enatega-multivendor-admin/src/views/Riders.jsx index c921c610..adbf4b86 100644 --- a/enatega-multivendor-admin/src/views/Riders.jsx +++ b/enatega-multivendor-admin/src/views/Riders.jsx @@ -50,11 +50,13 @@ const GET_AVAILABLE_RIDERS = gql` ` function Riders(props) { - const {PAID_VERSION} = ConfigurableValues() + const { PAID_VERSION } = ConfigurableValues() const [editModal, setEditModal] = useState(false) const [rider, setRider] = useState(null) const [searchQuery, setSearchQuery] = useState('') const [isOpen, setIsOpen] = useState(false) + const [page, setPage] = useState(0) + const [rowsPerPage, setRowsPerPage] = useState(10) const onChangeSearch = e => setSearchQuery(e.target.value) const [mutateToggle] = useMutation(TOGGLE_RIDER, { refetchQueries: [{ query: GET_RIDERS }, { query: GET_AVAILABLE_RIDERS }] @@ -63,7 +65,15 @@ function Riders(props) { refetchQueries: [{ query: GET_RIDERS }] }) const { data, error: errorQuery, loading: loadingQuery, refetch } = useQuery( - GET_RIDERS + GET_RIDERS, + { + variables: { + page: page, + rowsPerPage, + search: searchQuery.length > 2 ? searchQuery : null + }, + fetchPolicy: 'network-only' + } ) const toggleModal = rider => { @@ -71,6 +81,16 @@ function Riders(props) { setRider(rider) } + const handlePageChange = currentPage => { + setPage(currentPage - 1) // DataTable uses 1-based indexing + } + + const handlePerRowsChange = (newPerPage, currentPage) => { + setRowsPerPage(newPerPage) + setPage(currentPage - 1) + } + + const closeEditModal = () => { setEditModal(false) } @@ -174,15 +194,14 @@ function Riders(props) { { e.preventDefault() - - if(PAID_VERSION) - toggleModal(row) - else{ - setIsOpen(true) - setTimeout(() => { - setIsOpen(false) - }, 5000) - } + + if (PAID_VERSION) toggleModal(row) + else { + setIsOpen(true) + setTimeout(() => { + setIsOpen(false) + }, 5000) + } }} style={{ height: 25 }}> @@ -193,15 +212,14 @@ function Riders(props) { { e.preventDefault() - - if(PAID_VERSION) - mutateDelete({ variables: { id: row._id } }) - else{ - setIsOpen(true) - setTimeout(() => { - setIsOpen(false) - }, 5000) - } + + if (PAID_VERSION) mutateDelete({ variables: { id: row._id } }) + else { + setIsOpen(true) + setTimeout(() => { + setIsOpen(false) + }, 5000) + } }} style={{ height: 25 }}> @@ -219,16 +237,17 @@ function Riders(props) { searchQuery.length > 2 ? new RegExp(searchQuery.toLowerCase(), 'g') : null const filtered = searchQuery.length < 3 - ? data && data.riders - : data && - data.riders.filter(rider => { + ? data?.riders?.riders || [] // Use optional chaining and provide fallback + : (data?.riders?.riders || []).filter(rider => { return ( - rider.name.toLowerCase().search(regex) > -1 || - rider.username.toLowerCase().search(regex) > -1 || - rider.phone.toLowerCase().search(regex) > -1 || - rider.zone.title.toLowerCase().search(regex) > -1 + rider.name?.toLowerCase().includes(searchQuery.toLowerCase()) || + rider.username?.toLowerCase().includes(searchQuery.toLowerCase()) || + rider.phone?.toLowerCase().includes(searchQuery.toLowerCase()) || + rider.zone?.title?.toLowerCase().includes(searchQuery.toLowerCase()) ) }) + + const totalCount = data?.riders?.totalCount || 0 const globalClasses = useGlobalStyles() return ( <> @@ -272,11 +291,17 @@ function Riders(props) { columns={columns} data={filtered} pagination + paginationServer + paginationPerPage={rowsPerPage} + onChangePage={handlePageChange} + onChangeRowsPerPage={handlePerRowsChange} + paginationTotalRows={totalCount} progressPending={loadingQuery} progressComponent={} onSort={handleSort} sortFunction={customSort} selectableRows + paginationDefaultPage={page + 1} customStyles={customStyles} /> )} From 8ac54d801d1b349e1f94917b6801015f8e14c255 Mon Sep 17 00:00:00 2001 From: Kashif Shehzad Baloch Date: Thu, 28 Nov 2024 15:29:17 +0500 Subject: [PATCH 02/13] max 15 characters for phone number --- enatega-multivendor-admin/src/components/Rider/Rider.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enatega-multivendor-admin/src/components/Rider/Rider.jsx b/enatega-multivendor-admin/src/components/Rider/Rider.jsx index a2ffc839..11e02497 100644 --- a/enatega-multivendor-admin/src/components/Rider/Rider.jsx +++ b/enatega-multivendor-admin/src/components/Rider/Rider.jsx @@ -156,7 +156,7 @@ function Rider(props) { const globalClasses = useGlobalStyles() const handlePhoneInput = (e) => { - const value = e.target.value.replace(/[^0-9]/g, ''); + const value = e.target.value.replace(/[^0-9]/g, '')?.slice(0, 15); e.target.value = value; }; @@ -304,7 +304,7 @@ function Rider(props) { id="input-phone" name="input-phone" placeholder={t('PhoneNumber')} - type="number" + type="tel" defaultValue={phone} onInput={handlePhoneInput} onBlur={event => From bdda99ac88bced819f46c24e83a2e8c0ad32760d Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Thu, 28 Nov 2024 19:36:29 +0500 Subject: [PATCH 03/13] added pagination in the withdraw request --- .../src/apollo/queries.js | 60 ++++++------------- .../src/views/WithdrawRequest.jsx | 51 +++++++++++++--- 2 files changed, 60 insertions(+), 51 deletions(-) diff --git a/enatega-multivendor-admin/src/apollo/queries.js b/enatega-multivendor-admin/src/apollo/queries.js index 1c0fc49d..bdced6d0 100644 --- a/enatega-multivendor-admin/src/apollo/queries.js +++ b/enatega-multivendor-admin/src/apollo/queries.js @@ -759,7 +759,7 @@ export const getUsers = `query{ } }` - export const getRiders = `query Riders($page: Int, $rowsPerPage: Int, $search: String) { +export const getRiders = `query Riders($page: Int, $rowsPerPage: Int, $search: String) { riders(page: $page, rowsPerPage: $rowsPerPage, search: $search) { riders { _id @@ -775,7 +775,7 @@ export const getUsers = `query{ } totalCount } - }`; + }` export const getAvailableRiders = `query{ availableRiders{ @@ -790,46 +790,22 @@ export const getAvailableRiders = `query{ } }` -export const withdrawRequestQuery = `query GetWithdrawRequests($offset:Int){ - getAllWithdrawRequests(offset:$offset){ - success - message - data{ - _id - requestId - requestAmount - requestTime - rider{ - _id - name - currentWalletAmount - } - status - } - pagination{ - total - } - } - }` - - export const withdrawRequestQueryWithPagination = `query GetWithdrawRequests($offset:Int, $page: Int, $rowsPerPage: Int, $search: String){ - getAllWithdrawRequests(offset:$offset, $page: Int, $rowsPerPage: Int, $search: String){ - success - message - data{ +export const withdrawRequestQuery = ` + query GetWithdrawRequests($page: Int, $rowsPerPage: Int, $search: String) { + withdrawRequests(page: $page, rowsPerPage: $rowsPerPage, search: $search) { + requests { + _id + requestId + requestAmount + requestTime + rider { _id - requestId - requestAmount - requestTime - rider{ - _id - name - currentWalletAmount - } - status - } - pagination{ - total + name + currentWalletAmount } + status + } + totalCount } -}` \ No newline at end of file + } +` diff --git a/enatega-multivendor-admin/src/views/WithdrawRequest.jsx b/enatega-multivendor-admin/src/views/WithdrawRequest.jsx index 4e536290..61cb24ea 100644 --- a/enatega-multivendor-admin/src/views/WithdrawRequest.jsx +++ b/enatega-multivendor-admin/src/views/WithdrawRequest.jsx @@ -12,15 +12,38 @@ import { ReactComponent as WithdrawIcon } from '../assets/svg/svg/Request.svg' import TableHeader from '../components/TableHeader' import { withTranslation, useTranslation } from 'react-i18next' +const GET_ALL_WITHDRAW_REQUEST = gql` + ${withdrawRequestQuery} +` + function WithdrawRequest() { const { t } = useTranslation() const [searchQuery, setSearchQuery] = useState('') + const [page, setPage] = useState(0) + const [rowsPerPage, setRowsPerPage] = useState(10) + + const handlePageChange = (currentPage) => { + setPage(currentPage - 1) // DataTable uses 1-based indexing + } + + const handlePerRowsChange = (newPerPage, currentPage) => { + setRowsPerPage(newPerPage) + setPage(currentPage - 1) + } + const onChangeSearch = e => setSearchQuery(e.target.value) const { loading, error, data } = useQuery( - gql` - ${withdrawRequestQuery} - ` + GET_ALL_WITHDRAW_REQUEST, + { + variables: { + page: page, + rowsPerPage, + search: searchQuery.length > 2 ? searchQuery : null + }, + fetchPolicy: 'network-only', + } ) + const [updateStatus] = useMutation( gql` ${updateWithdrawReqStatus} @@ -66,16 +89,19 @@ function WithdrawRequest() { const regex = searchQuery.length > 2 ? new RegExp(searchQuery.toLowerCase(), 'g') : null - const filtered = + const filtered = searchQuery.length < 3 - ? data && data.getAllWithdrawRequests.data - : data && - data.getAllWithdrawRequests.data.filter(request => { + ? data?.withdrawRequests?.requests || [] + : (data?.withdrawRequests?.requests || []).filter((request) => { return ( request.requestId.toLowerCase().search(regex) > -1 || request.rider.name.toLowerCase().search(regex) > -1 - ) - }) + ); + }); + + const totalCount = data?.withdrawRequests?.totalCount; + console.log("🚀 ~ WithdrawRequest ~ totalCount:", totalCount) + const updateRequestStatus = row => { return ( @@ -167,10 +193,17 @@ function WithdrawRequest() { columns={columns} data={filtered} pagination + paginationServer + paginationPerPage={rowsPerPage} + onChangePage={handlePageChange} + onChangeRowsPerPage={handlePerRowsChange} + pointerOnHover + paginationTotalRows={totalCount} progressPending={loading} progressComponent={} onSort={handleSort} selectableRows + paginationDefaultPage={page + 1} customStyles={customStyles} /> )} From ff9c9ed3eee748d465ea15b37d38c8de97ec843b Mon Sep 17 00:00:00 2001 From: Kashif Shehzad Baloch Date: Fri, 29 Nov 2024 12:49:56 +0500 Subject: [PATCH 04/13] update initial location and install missed dependency --- .../src/screens/CurrentLocation/CurrentLocation.js | 10 +++++----- enatega-multivendor-rider/package.json | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/enatega-multivendor-app/src/screens/CurrentLocation/CurrentLocation.js b/enatega-multivendor-app/src/screens/CurrentLocation/CurrentLocation.js index eb76c296..c067a034 100644 --- a/enatega-multivendor-app/src/screens/CurrentLocation/CurrentLocation.js +++ b/enatega-multivendor-app/src/screens/CurrentLocation/CurrentLocation.js @@ -36,12 +36,12 @@ export default function CurrentLocation() { StatusBar.setBarStyle( 'dark-content') }) const initialRegion = { - latitude: 31.0461, - longitude: 34.8516, - latitudeDelta: 1, - longitudeDelta: 1 + latitude: 36.7378, + longitude: -119.7871, + latitudeDelta: 0.3, + longitudeDelta: 0.3 } - const markerCoordinate = { latitude: 31.0461, longitude: 34.8516 } + const markerCoordinate = { latitude: 36.7378, longitude: -119.7871 } const setCurrentLocation = async() => { setLoading(true) diff --git a/enatega-multivendor-rider/package.json b/enatega-multivendor-rider/package.json index 62e03fd9..417b174f 100644 --- a/enatega-multivendor-rider/package.json +++ b/enatega-multivendor-rider/package.json @@ -76,6 +76,7 @@ "react-native-countdown-component": "^2.7.1", "react-native-flash-message": "^0.1.21", "react-native-gesture-handler": "~2.16.1", + "react-native-get-random-values": "^1.11.0", "react-native-gifted-chat": "^2.4.0", "react-native-loading-spinner-overlay": "^3.0.0", "react-native-maps": "1.14.0", From 26eca88d4b52341441e76f17f02a093714f0788c Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Fri, 29 Nov 2024 15:29:27 +0500 Subject: [PATCH 05/13] added pagination in the user flow --- .../src/apollo/queries.js | 27 ++++++---- enatega-multivendor-admin/src/views/Users.jsx | 53 +++++++++++-------- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/enatega-multivendor-admin/src/apollo/queries.js b/enatega-multivendor-admin/src/apollo/queries.js index bdced6d0..0987faaf 100644 --- a/enatega-multivendor-admin/src/apollo/queries.js +++ b/enatega-multivendor-admin/src/apollo/queries.js @@ -746,18 +746,25 @@ query PageCount($restaurant:String!){ pageCount(restaurant:$restaurant) } ` -export const getUsers = `query{ - users{ - _id - name - email - phone - addresses{ - location{coordinates} - deliveryAddress +export const getUsers = ` + query Users($page: Int, $rowsPerPage: Int, $search: String) { + users(page: $page, rowsPerPage: $rowsPerPage, search: $search) { + users { + _id + name + email + phone + addresses { + location { + coordinates + } + deliveryAddress + } } + totalCount } - }` + } +`; export const getRiders = `query Riders($page: Int, $rowsPerPage: Int, $search: String) { riders(page: $page, rowsPerPage: $rowsPerPage, search: $search) { diff --git a/enatega-multivendor-admin/src/views/Users.jsx b/enatega-multivendor-admin/src/views/Users.jsx index d23c099a..83b23f8b 100644 --- a/enatega-multivendor-admin/src/views/Users.jsx +++ b/enatega-multivendor-admin/src/views/Users.jsx @@ -21,13 +21,32 @@ const Users = props => { const [searchQuery, setSearchQuery] = useState('') const onChangeSearch = e => setSearchQuery(e.target.value) + const [page, setPage] = useState(0) + const [rowsPerPage, setRowsPerPage] = useState(10) + const { data, error: errorQuery, loading: loadingQuery, refetch } = useQuery( GET_USERS, { - variables: { page: 0 }, - - } + variables: { + page: page, + rowsPerPage, + search: searchQuery.length > 3 ? searchQuery : null + }, + fetchPolicy: 'network-only', + } ) + + console.log("🚀 ~ Users ~ data:", data?.users) + + const handlePageChange = (currentPage) => { + setPage(currentPage - 1) // DataTable uses 1-based indexing + } + + const handlePerRowsChange = (newPerPage, currentPage) => { + setRowsPerPage(newPerPage) + setPage(currentPage - 1) + } + console.log("errorQuery",errorQuery); const columns = [ { @@ -78,22 +97,9 @@ const Users = props => { const handleSort = (column, sortDirection) => console.log(column.selector, sortDirection) - const regex = - searchQuery.length > 2 ? new RegExp(searchQuery.toLowerCase(), 'g') : null + const userData = data?.users?.users + const totalCount = data?.users?.totalCount - const filtered = - searchQuery.length < 3 - ? data && data.users - : data && - data.users.filter(user => { - return ( - user.name.toLowerCase().search(regex) > -1 || - user.phone.toLowerCase().search(regex) > -1 || - (user.email !== null - ? user.email.toLowerCase().search(regex) > -1 - : false) - ) - }) const globalClasses = useGlobalStyles() return ( <> @@ -121,16 +127,21 @@ const Users = props => { } title={} columns={columns} - data={filtered} + data={userData} pagination + paginationServer + paginationPerPage={rowsPerPage} + onChangePage={handlePageChange} + onChangeRowsPerPage={handlePerRowsChange} + pointerOnHover progressPending={loadingQuery} + paginationTotalRows={totalCount} progressComponent={} onSort={handleSort} sortFunction={customSort} + paginationDefaultPage={page + 1} customStyles={customStyles} selectableRows - paginationIconLastPage="" - paginationIconFirstPage="" /> )} From 21f3260b245843d0f5362d91d4d0c7e71ec01540 Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Mon, 2 Dec 2024 15:13:55 +0500 Subject: [PATCH 06/13] added debounce, added pagination in the restaurant page --- .../src/apollo/queries.js | 43 ++++--- .../src/utils/debounce.js | 17 +++ .../src/views/RestaurantList.jsx | 108 +++++++++++++----- 3 files changed, 121 insertions(+), 47 deletions(-) create mode 100644 enatega-multivendor-admin/src/utils/debounce.js diff --git a/enatega-multivendor-admin/src/apollo/queries.js b/enatega-multivendor-admin/src/apollo/queries.js index 0987faaf..9c25365f 100644 --- a/enatega-multivendor-admin/src/apollo/queries.js +++ b/enatega-multivendor-admin/src/apollo/queries.js @@ -608,27 +608,32 @@ export const restaurantList = `query RestaurantList{ } }` -export const restaurants = `query Restaurants{ - restaurants{ - _id - name - image - orderPrefix - slug - address - deliveryTime - minimumOrder - isActive - commissionRate - tax - owner{ - _id - email +export const restaurants = ` + query Restaurants($page: Int, $rowsPerPage: Int, $search: String) { + restaurants(page: $page, rowsPerPage: $rowsPerPage, search: $search) { + restaurants { + _id + name + image + orderPrefix + slug + address + deliveryTime + minimumOrder + isActive + commissionRate + tax + owner { + _id + email + } + shopType + } + totalCount } - shopType } -} -` +`; + export const getRestaurantProfile = `query Restaurant($id:String){ restaurant(id:$id) diff --git a/enatega-multivendor-admin/src/utils/debounce.js b/enatega-multivendor-admin/src/utils/debounce.js new file mode 100644 index 00000000..7f7f09c6 --- /dev/null +++ b/enatega-multivendor-admin/src/utils/debounce.js @@ -0,0 +1,17 @@ +import { useState, useEffect } from 'react' + +export function useDebounce(value, delay) { + const [debouncedValue, setDebouncedValue] = useState(value) + + useEffect(() => { + const handler = setTimeout(() => { + setDebouncedValue(value) + }, delay || 500) + + return () => { + clearTimeout(handler) + } + }, [value, delay]) + + return debouncedValue +} \ No newline at end of file diff --git a/enatega-multivendor-admin/src/views/RestaurantList.jsx b/enatega-multivendor-admin/src/views/RestaurantList.jsx index adc92db5..6f5e3863 100644 --- a/enatega-multivendor-admin/src/views/RestaurantList.jsx +++ b/enatega-multivendor-admin/src/views/RestaurantList.jsx @@ -15,6 +15,7 @@ import { customStyles } from '../utils/tableCustomStyles' import useGlobalStyles from '../utils/globalStyles' import { ReactComponent as RestIcon } from '../assets/svg/svg/Restaurant.svg' import TableHeader from '../components/TableHeader' +import { useDebounce } from '../utils/debounce' const GET_RESTAURANTS = gql` ${restaurants} @@ -26,24 +27,46 @@ const DELETE_RESTAURANT = gql` const Restaurants = props => { const { t } = props const [searchQuery, setSearchQuery] = useState('') + const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const [error, setError] = useState(null) const onChangeSearch = e => setSearchQuery(e.target.value) + const [page, setPage] = useState(0) + const [rowsPerPage, setRowsPerPage] = useState(10) const globalClasses = useGlobalStyles() const [mutate, { loading }] = useMutation(DELETE_RESTAURANT, { - onError: (error)=> { - setError(error.graphQLErrors[0].message || 'Something went wrong') + onError: error => { + setError(error.graphQLErrors[0].message || 'Something went wrong') } }) - const { - data, - loading: loadingQuery, - refetch, - networkStatus - } = useQuery(GET_RESTAURANTS, { fetchPolicy: 'network-only' }) + + const { data, loading: loadingQuery, refetch, networkStatus } = useQuery( + GET_RESTAURANTS, + { + variables: { + page: page, + rowsPerPage, + search: debouncedSearchQuery.length > 3 ? debouncedSearchQuery : null + }, + fetchPolicy: 'network-only' + } + ) + + const handlePageChange = (currentPage) => { + setPage(currentPage - 1) // DataTable uses 1-based indexing + } + + const handlePerRowsChange = (newPerPage, currentPage) => { + setRowsPerPage(newPerPage) + setPage(currentPage - 1) + } + + const totalCount = data?.restaurants?.totalCount + const onClickRefetch = cb => { cb() } + const customSort = (rows, field, direction) => { const handleField = row => { if (row[field]) { @@ -153,24 +176,46 @@ const Restaurants = props => { } ] - const regex = useMemo(()=>( - searchQuery.length > 2 ? new RegExp(searchQuery.toLowerCase(), 'g') : null - ),[searchQuery]) - - const filtered = useMemo(()=>( - searchQuery.length < 3 - ? data && data.restaurants - : data && - data.restaurants.filter(restaurant => { - return ( - (restaurant.name && restaurant.name.toLowerCase().search(regex) > -1) || - (restaurant.orderPrefix && restaurant.orderPrefix.toLowerCase().search(regex) > -1) || - (restaurant.owner && restaurant.owner.email.toLowerCase().search(regex) > -1) || - (restaurant.address && restaurant.address.toLowerCase().search(regex) > -1) - ) - }) - ), [searchQuery, data, regex]) - + const regex = useMemo( + () => + searchQuery.length > 2 + ? new RegExp(searchQuery.toLowerCase(), 'g') + : null, + [searchQuery] + ) + + + const restaurants = data?.restaurants?.restaurants; + + // const filtered = useMemo(() => { + // if (!data || !data.restaurants || !data.restaurants.restaurants) return [] + + // const restaurantList = data.restaurants.restaurants + + // return searchQuery.length < 3 + // ? restaurantList + // : restaurantList.filter(restaurant => { + // return ( + // (restaurant.name && + // restaurant.name + // .toLowerCase() + // .includes(searchQuery.toLowerCase())) || + // (restaurant.orderPrefix && + // restaurant.orderPrefix + // .toLowerCase() + // .includes(searchQuery.toLowerCase())) || + // (restaurant.owner && + // restaurant.owner.email + // .toLowerCase() + // .includes(searchQuery.toLowerCase())) || + // (restaurant.address && + // restaurant.address + // .toLowerCase() + // .includes(searchQuery.toLowerCase())) + // ) + // }) + // }, [searchQuery, data]) + return ( <>
@@ -193,11 +238,18 @@ const Restaurants = props => { } title={} columns={columns} - data={filtered} + data={restaurants} pagination + paginationServer + paginationPerPage={rowsPerPage} + onChangePage={handlePageChange} + onChangeRowsPerPage={handlePerRowsChange} progressPending={loading || networkStatus === 4} progressComponent={} + pointerOnHover + paginationTotalRows={totalCount} sortFunction={customSort} + paginationDefaultPage={page + 1} defaultSortField="name" onRowClicked={row => { localStorage.setItem('restaurantId', row._id) @@ -212,7 +264,7 @@ const Restaurants = props => { setError(null)} + onClose={() => setError(null)} message={error} /> From 6db4d2955e504ed4f698f83ea206cbda74985885 Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Mon, 2 Dec 2024 17:57:39 +0500 Subject: [PATCH 07/13] added debounce and double checked the 5 flows --- enatega-multivendor-admin/src/views/Coupons.jsx | 13 +++---------- enatega-multivendor-admin/src/views/Dispatch.jsx | 4 +++- .../src/views/RestaurantList.jsx | 2 +- enatega-multivendor-admin/src/views/Riders.jsx | 4 +++- enatega-multivendor-admin/src/views/Users.jsx | 6 ++++-- .../src/views/WithdrawRequest.jsx | 6 +++--- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/enatega-multivendor-admin/src/views/Coupons.jsx b/enatega-multivendor-admin/src/views/Coupons.jsx index bc482e6a..2a396966 100644 --- a/enatega-multivendor-admin/src/views/Coupons.jsx +++ b/enatega-multivendor-admin/src/views/Coupons.jsx @@ -27,6 +27,7 @@ import { } from '@mui/material' import { ReactComponent as CouponsIcon } from '../assets/svg/svg/Coupons.svg' import TableHeader from '../components/TableHeader' +import { useDebounce } from '../utils/debounce' const GET_COUPONS_WITH_PAGINATION = gql` @@ -44,6 +45,7 @@ const Coupon = props => { const [editModal, setEditModal] = useState(false) const [coupon, setCoupon] = useState(null) const [searchQuery, setSearchQuery] = useState('') + const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const onChangeSearch = e => setSearchQuery(e.target.value) const [mutateEdit] = useMutation(EDIT_COUPON) const [page, setPage] = useState(0) @@ -61,7 +63,7 @@ const Coupon = props => { variables: { page: page, rowsPerPage, - search: searchQuery.length > 2 ? searchQuery : null + search: debouncedSearchQuery.length > 3 ? debouncedSearchQuery : null }, fetchPolicy: 'network-only', } @@ -119,15 +121,6 @@ const Coupon = props => { cell: row => <>{actionButtons(row)} } ] - const regex = - searchQuery.length > 2 ? new RegExp(searchQuery.toLowerCase(), 'g') : null - const filtered = - searchQuery.length < 3 - ? data && data.coupons - : data && - data.coupons.filter(coupon => { - return coupon.title.toLowerCase().search(regex) > -1 - }) const statusChanged = row => { return ( diff --git a/enatega-multivendor-admin/src/views/Dispatch.jsx b/enatega-multivendor-admin/src/views/Dispatch.jsx index e01edb41..44a27062 100644 --- a/enatega-multivendor-admin/src/views/Dispatch.jsx +++ b/enatega-multivendor-admin/src/views/Dispatch.jsx @@ -21,6 +21,7 @@ import { ReactComponent as DispatchIcon } from '../assets/svg/svg/Dispatch.svg' import TableHeader from '../components/TableHeader' import { NotificationContainer, NotificationManager } from 'react-notifications' import 'react-notifications/lib/notifications.css' +import { useDebounce } from '../utils/debounce' const SUBSCRIPTION_ORDER = gql` ${subscriptionOrder} @@ -50,6 +51,7 @@ const Orders = props => { const [mutateAssign] = useMutation(ASSIGN_RIDER) const [page, setPage] = useState(0) const [rowsPerPage, setRowsPerPage] = useState(10) + const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const riderFunc = row => { const { data: dataZone } = useQuery(GET_RIDERS_BY_ZONE, { @@ -109,7 +111,7 @@ const Orders = props => { variables: { page, rowsPerPage, - search: searchQuery.length > 5 ? searchQuery : '' + search: debouncedSearchQuery.length > 3 ? debouncedSearchQuery : null }, pollInterval: 100000 }) diff --git a/enatega-multivendor-admin/src/views/RestaurantList.jsx b/enatega-multivendor-admin/src/views/RestaurantList.jsx index 6f5e3863..7db909f5 100644 --- a/enatega-multivendor-admin/src/views/RestaurantList.jsx +++ b/enatega-multivendor-admin/src/views/RestaurantList.jsx @@ -30,7 +30,7 @@ const Restaurants = props => { const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const [error, setError] = useState(null) const onChangeSearch = e => setSearchQuery(e.target.value) - const [page, setPage] = useState(0) + const [page, setPage] = useState(1) const [rowsPerPage, setRowsPerPage] = useState(10) const globalClasses = useGlobalStyles() diff --git a/enatega-multivendor-admin/src/views/Riders.jsx b/enatega-multivendor-admin/src/views/Riders.jsx index adbf4b86..762f6c5a 100644 --- a/enatega-multivendor-admin/src/views/Riders.jsx +++ b/enatega-multivendor-admin/src/views/Riders.jsx @@ -35,6 +35,7 @@ import { ReactComponent as RiderIcon } from '../assets/svg/svg/Rider.svg' import TableHeader from '../components/TableHeader' import Alert from '../components/Alert' import ConfigurableValues from '../config/constants' +import { useDebounce } from '../utils/debounce' const GET_RIDERS = gql` ${getRiders} @@ -58,6 +59,7 @@ function Riders(props) { const [page, setPage] = useState(0) const [rowsPerPage, setRowsPerPage] = useState(10) const onChangeSearch = e => setSearchQuery(e.target.value) + const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const [mutateToggle] = useMutation(TOGGLE_RIDER, { refetchQueries: [{ query: GET_RIDERS }, { query: GET_AVAILABLE_RIDERS }] }) @@ -70,7 +72,7 @@ function Riders(props) { variables: { page: page, rowsPerPage, - search: searchQuery.length > 2 ? searchQuery : null + search: debouncedSearchQuery.length > 3 ? debouncedSearchQuery : null }, fetchPolicy: 'network-only' } diff --git a/enatega-multivendor-admin/src/views/Users.jsx b/enatega-multivendor-admin/src/views/Users.jsx index 83b23f8b..fce4daac 100644 --- a/enatega-multivendor-admin/src/views/Users.jsx +++ b/enatega-multivendor-admin/src/views/Users.jsx @@ -12,6 +12,7 @@ import useGlobalStyles from '../utils/globalStyles' import { Box, Container } from '@mui/material' import { ReactComponent as UserIcon } from '../assets/svg/svg/User.svg' import TableHeader from '../components/TableHeader' +import { useDebounce } from '../utils/debounce' const GET_USERS = gql` ${getUsers} @@ -20,8 +21,9 @@ const Users = props => { const { t } = props const [searchQuery, setSearchQuery] = useState('') + const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const onChangeSearch = e => setSearchQuery(e.target.value) - const [page, setPage] = useState(0) + const [page, setPage] = useState(1) const [rowsPerPage, setRowsPerPage] = useState(10) const { data, error: errorQuery, loading: loadingQuery, refetch } = useQuery( @@ -30,7 +32,7 @@ const Users = props => { variables: { page: page, rowsPerPage, - search: searchQuery.length > 3 ? searchQuery : null + search: debouncedSearchQuery.length > 3 ? debouncedSearchQuery : null }, fetchPolicy: 'network-only', } diff --git a/enatega-multivendor-admin/src/views/WithdrawRequest.jsx b/enatega-multivendor-admin/src/views/WithdrawRequest.jsx index 61cb24ea..64cd63ea 100644 --- a/enatega-multivendor-admin/src/views/WithdrawRequest.jsx +++ b/enatega-multivendor-admin/src/views/WithdrawRequest.jsx @@ -11,6 +11,7 @@ import SearchBar from '../components/TableHeader/SearchBar' import { ReactComponent as WithdrawIcon } from '../assets/svg/svg/Request.svg' import TableHeader from '../components/TableHeader' import { withTranslation, useTranslation } from 'react-i18next' +import { useDebounce } from '../utils/debounce' const GET_ALL_WITHDRAW_REQUEST = gql` ${withdrawRequestQuery} @@ -21,6 +22,7 @@ function WithdrawRequest() { const [searchQuery, setSearchQuery] = useState('') const [page, setPage] = useState(0) const [rowsPerPage, setRowsPerPage] = useState(10) + const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const handlePageChange = (currentPage) => { setPage(currentPage - 1) // DataTable uses 1-based indexing @@ -38,7 +40,7 @@ function WithdrawRequest() { variables: { page: page, rowsPerPage, - search: searchQuery.length > 2 ? searchQuery : null + search: debouncedSearchQuery.length > 3 ? debouncedSearchQuery : null }, fetchPolicy: 'network-only', } @@ -100,8 +102,6 @@ function WithdrawRequest() { }); const totalCount = data?.withdrawRequests?.totalCount; - console.log("🚀 ~ WithdrawRequest ~ totalCount:", totalCount) - const updateRequestStatus = row => { return ( From 519d1261b93e81aa37e5a4088537716f2225d87a Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Mon, 2 Dec 2024 18:37:31 +0500 Subject: [PATCH 08/13] fixed the commission rate issue --- enatega-multivendor-admin/src/config/constants.js | 8 ++++---- enatega-multivendor-admin/src/views/Commission.jsx | 6 ++++-- enatega-multivendor-admin/src/views/Users.jsx | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/enatega-multivendor-admin/src/config/constants.js b/enatega-multivendor-admin/src/config/constants.js index 5b84e35c..b7492c7d 100644 --- a/enatega-multivendor-admin/src/config/constants.js +++ b/enatega-multivendor-admin/src/config/constants.js @@ -4,10 +4,10 @@ import ConfigurationContext from '../context/Configuration' const ConfigurableValues = () => { const configuration = useContext(ConfigurationContext) - const SERVER_URL = 'https://enatega-multivendor.up.railway.app' - const WS_SERVER_URL = 'wss://enatega-multivendor.up.railway.app' - // const SERVER_URL = 'http://localhost:8001' - // const WS_SERVER_URL = 'ws://localhost:8001' + // const SERVER_URL = 'https://enatega-multivendor.up.railway.app' + // const WS_SERVER_URL = 'wss://enatega-multivendor.up.railway.app' + const SERVER_URL = 'http://localhost:8001' + const WS_SERVER_URL = 'ws://localhost:8001' const GOOGLE_MAPS_KEY = configuration.googleApiKey const FIREBASE_KEY = configuration.firebaseKey const APP_ID = configuration.appId diff --git a/enatega-multivendor-admin/src/views/Commission.jsx b/enatega-multivendor-admin/src/views/Commission.jsx index 843d4dde..6d3775e5 100644 --- a/enatega-multivendor-admin/src/views/Commission.jsx +++ b/enatega-multivendor-admin/src/views/Commission.jsx @@ -27,7 +27,9 @@ const Commission = () => { const { data, error: errorQuery, loading: loadingQuery } = useQuery( GET_RESTAURANTS ) - console.log(data) + + console.log("🚀 ~ Commission ~ data:", data) + const globalClasses = useGlobalStyles() const classes = useStyles() const { t } = useTranslation() @@ -90,7 +92,7 @@ const Commission = () => { ) : ( data && ( <> - {data.restaurants.map(restaurant => ( + {data.restaurants.restaurants.map(restaurant => ( {restaurant.name} diff --git a/enatega-multivendor-admin/src/views/Users.jsx b/enatega-multivendor-admin/src/views/Users.jsx index fce4daac..9e0ec571 100644 --- a/enatega-multivendor-admin/src/views/Users.jsx +++ b/enatega-multivendor-admin/src/views/Users.jsx @@ -23,7 +23,7 @@ const Users = props => { const [searchQuery, setSearchQuery] = useState('') const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const onChangeSearch = e => setSearchQuery(e.target.value) - const [page, setPage] = useState(1) + const [page, setPage] = useState(0) const [rowsPerPage, setRowsPerPage] = useState(10) const { data, error: errorQuery, loading: loadingQuery, refetch } = useQuery( From a461f9b6ed78aaf0d6f30d6ce4025fb271ed0c93 Mon Sep 17 00:00:00 2001 From: Fatima Date: Tue, 3 Dec 2024 10:38:42 +0500 Subject: [PATCH 09/13] bug fixing of about us broken link in the customer app and the text field getting hide by keypad while typing in ios --- enatega-multivendor-app/environment.js | 12 ++++++------ .../src/screens/ItemDetail/ItemDetail.js | 10 ++++++++-- enatega-multivendor-restaurant/environment.js | 8 ++++---- .../src/utilities/enums.js | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/enatega-multivendor-app/environment.js b/enatega-multivendor-app/environment.js index cc85bab4..c3586f34 100644 --- a/enatega-multivendor-app/environment.js +++ b/enatega-multivendor-app/environment.js @@ -29,12 +29,12 @@ const useEnvVars = (env = Updates.channel) => { } return { - GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', - WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', - SERVER_URL: 'https://enatega-multivendor.up.railway.app/', - // GRAPHQL_URL: 'http://192.168.0.106:8001/graphql', - // WS_GRAPHQL_URL: 'ws://192.168.0.106:8001/graphql', - // SERVER_URL: 'http://192.168.0.106:8001:8001/', + // GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', + // WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', + // SERVER_URL: 'https://enatega-multivendor.up.railway.app/', + GRAPHQL_URL: 'http://192.168.0.109:8001/graphql', + WS_GRAPHQL_URL: 'ws://192.168.0.109:8001/graphql', + SERVER_URL: 'http://192.168.0.109:8001:8001/', IOS_CLIENT_ID_GOOGLE: configuration.iOSClientID, ANDROID_CLIENT_ID_GOOGLE: configuration.androidClientID, AMPLITUDE_API_KEY: configuration.appAmplitudeApiKey, diff --git a/enatega-multivendor-app/src/screens/ItemDetail/ItemDetail.js b/enatega-multivendor-app/src/screens/ItemDetail/ItemDetail.js index 64f7525b..52d3d664 100644 --- a/enatega-multivendor-app/src/screens/ItemDetail/ItemDetail.js +++ b/enatega-multivendor-app/src/screens/ItemDetail/ItemDetail.js @@ -392,6 +392,11 @@ function ItemDetail(props) { return ( <> + @@ -404,7 +409,7 @@ function ItemDetail(props) { scrollEventThrottle={1} contentContainerStyle={{ paddingTop: HEADER_MAX_HEIGHT, - paddingBottom: scale(height * 0.09), + paddingBottom: scale(height * 0.001), backgroundColor: currentTheme.themeBackground, }} > @@ -442,7 +447,7 @@ function ItemDetail(props) { - + + ) diff --git a/enatega-multivendor-restaurant/environment.js b/enatega-multivendor-restaurant/environment.js index 2c83d1cd..71643790 100644 --- a/enatega-multivendor-restaurant/environment.js +++ b/enatega-multivendor-restaurant/environment.js @@ -20,10 +20,10 @@ const getEnvVars = (env = Updates.releaseChannel) => { } } return { - // GRAPHQL_URL: 'http://192.168.0.106:8001/graphql', - // WS_GRAPHQL_URL: 'ws://192.168.0.106:8001/graphql', - GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', - WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', + GRAPHQL_URL: 'http://192.168.0.106:8001/graphql', + WS_GRAPHQL_URL: 'ws://192.168.0.106:8001/graphql', + // GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', + // WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', SENTRY_DSN: configuration.restaurantAppSentryUrl // SENTRY_DSN: // 'https://91b55f514a2c4708845789d6e79abf10@o1103026.ingest.sentry.io/6131933' diff --git a/enatega-multivendor-restaurant/src/utilities/enums.js b/enatega-multivendor-restaurant/src/utilities/enums.js index d8465628..584c0e73 100644 --- a/enatega-multivendor-restaurant/src/utilities/enums.js +++ b/enatega-multivendor-restaurant/src/utilities/enums.js @@ -4,5 +4,5 @@ export const PRODUCT_URL = 'https://enatega.com/enatega-multi-vendor/' export const PRIVACY_URL = 'https://enatega.com/privacy-policy/' -export const ABOUT_URL = 'https://ninjascode.com/about-us/' +export const ABOUT_URL = 'https://ninjascode.com/' export const MAX_TIME = 120 From d324703c9a4e55ab02edab0c7403af4c006ce3ba Mon Sep 17 00:00:00 2001 From: Talha2502 Date: Tue, 3 Dec 2024 11:45:57 +0500 Subject: [PATCH 10/13] handled issue in the restaurant api --- enatega-multivendor-admin/src/views/RestaurantList.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enatega-multivendor-admin/src/views/RestaurantList.jsx b/enatega-multivendor-admin/src/views/RestaurantList.jsx index 7db909f5..6f5e3863 100644 --- a/enatega-multivendor-admin/src/views/RestaurantList.jsx +++ b/enatega-multivendor-admin/src/views/RestaurantList.jsx @@ -30,7 +30,7 @@ const Restaurants = props => { const debouncedSearchQuery = useDebounce(searchQuery, 500) // Debounce search query const [error, setError] = useState(null) const onChangeSearch = e => setSearchQuery(e.target.value) - const [page, setPage] = useState(1) + const [page, setPage] = useState(0) const [rowsPerPage, setRowsPerPage] = useState(10) const globalClasses = useGlobalStyles() From 892af41342dbf39567d4d4e12ee48f4c6f285af1 Mon Sep 17 00:00:00 2001 From: Fatima Date: Wed, 4 Dec 2024 12:42:11 +0500 Subject: [PATCH 11/13] Optional Message in Customer App Not Fetched by Restaurant App #586 --- enatega-multivendor-app/src/context/User.js | 2 +- enatega-multivendor-restaurant/environment.js | 8 +++--- .../src/apollo/queries.js | 1 + .../components/OrderDetails/OrderDetails.js | 27 +++++++++++++++++++ .../src/screens/OrderDetail/OrderDetail.js | 1 + 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/enatega-multivendor-app/src/context/User.js b/enatega-multivendor-app/src/context/User.js index 4bcf9694..d42c9601 100644 --- a/enatega-multivendor-app/src/context/User.js +++ b/enatega-multivendor-app/src/context/User.js @@ -51,7 +51,7 @@ export const UserProvider = props => { const [restaurant, setRestaurant] = useState(null) const [isPickup, setIsPickup] = useState(false) const [instructions, setInstructions] = useState('') - + const { called: calledProfile, loading: loadingProfile, diff --git a/enatega-multivendor-restaurant/environment.js b/enatega-multivendor-restaurant/environment.js index 71643790..fd7bd38f 100644 --- a/enatega-multivendor-restaurant/environment.js +++ b/enatega-multivendor-restaurant/environment.js @@ -20,10 +20,10 @@ const getEnvVars = (env = Updates.releaseChannel) => { } } return { - GRAPHQL_URL: 'http://192.168.0.106:8001/graphql', - WS_GRAPHQL_URL: 'ws://192.168.0.106:8001/graphql', - // GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', - // WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', + // GRAPHQL_URL: 'http://192.168.0.109:8001/graphql', + // WS_GRAPHQL_URL: 'ws://192.168.0.109:8001/graphql', + GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', + WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', SENTRY_DSN: configuration.restaurantAppSentryUrl // SENTRY_DSN: // 'https://91b55f514a2c4708845789d6e79abf10@o1103026.ingest.sentry.io/6131933' diff --git a/enatega-multivendor-restaurant/src/apollo/queries.js b/enatega-multivendor-restaurant/src/apollo/queries.js index f3833a94..c21c406b 100644 --- a/enatega-multivendor-restaurant/src/apollo/queries.js +++ b/enatega-multivendor-restaurant/src/apollo/queries.js @@ -73,6 +73,7 @@ export const orders = `query Orders{ preparationTime acceptedAt isRinged + instructions rider{ _id name diff --git a/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js b/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js index d521a05d..037cfce0 100644 --- a/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js +++ b/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js @@ -42,17 +42,43 @@ export default function OrderDetails({ orderData }) { ) } function OrderItems({ orderData }) { + console.log("OrderData",orderData) const { t } = useTranslation() const { + instructions, items, orderAmount, tipping, deliveryCharges, taxationAmount } = orderData + console.log("instructions",instructions) const configuration = useContext(Configuration.Context) let subTotal = 0 return ( + + {instructions && instructions.trim() !== "" && ( + + + + Special Order Instructions + + + + + + {instructions} + + + + + )} {items && items.map((item, index) => { @@ -135,5 +161,6 @@ function OrderItems({ orderData }) { + ) } diff --git a/enatega-multivendor-restaurant/src/screens/OrderDetail/OrderDetail.js b/enatega-multivendor-restaurant/src/screens/OrderDetail/OrderDetail.js index a9e26ccc..080e953d 100644 --- a/enatega-multivendor-restaurant/src/screens/OrderDetail/OrderDetail.js +++ b/enatega-multivendor-restaurant/src/screens/OrderDetail/OrderDetail.js @@ -108,6 +108,7 @@ export default function OrderDetail({ navigation, route }) { style={{ width: 25, height: 25 }} /> + {activeBar === 2 ? t('prepared') : t('preparing')} From 0bb0a30404164e4dbe891258ec8d640748b137e5 Mon Sep 17 00:00:00 2001 From: Fatima Date: Wed, 4 Dec 2024 12:44:58 +0500 Subject: [PATCH 12/13] local link updated --- enatega-multivendor-app/environment.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/enatega-multivendor-app/environment.js b/enatega-multivendor-app/environment.js index c3586f34..56ec3658 100644 --- a/enatega-multivendor-app/environment.js +++ b/enatega-multivendor-app/environment.js @@ -29,12 +29,12 @@ const useEnvVars = (env = Updates.channel) => { } return { - // GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', - // WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', - // SERVER_URL: 'https://enatega-multivendor.up.railway.app/', - GRAPHQL_URL: 'http://192.168.0.109:8001/graphql', - WS_GRAPHQL_URL: 'ws://192.168.0.109:8001/graphql', - SERVER_URL: 'http://192.168.0.109:8001:8001/', + GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', + WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', + SERVER_URL: 'https://enatega-multivendor.up.railway.app/', + // GRAPHQL_URL: 'http://192.168.0.109:8001/graphql', + // WS_GRAPHQL_URL: 'ws://192.168.0.109:8001/graphql', + // SERVER_URL: 'http://192.168.0.109:8001:8001/', IOS_CLIENT_ID_GOOGLE: configuration.iOSClientID, ANDROID_CLIENT_ID_GOOGLE: configuration.androidClientID, AMPLITUDE_API_KEY: configuration.appAmplitudeApiKey, From 1b6ae94cdd5848ebfe7e7f36c736e9aaf53776d7 Mon Sep 17 00:00:00 2001 From: Fatima Date: Wed, 4 Dec 2024 16:00:22 +0500 Subject: [PATCH 13/13] Oversized Logout Button Area Leading to Accidental Logouts in Enatega Multivendor Rider App --- .../components/OrderDetails/OrderDetails.js | 4 +-- enatega-multivendor-rider/environment.js | 2 ++ enatega-multivendor-rider/package-lock.json | 32 +++++++++++++++++++ .../src/components/Sidebar/Sidebar.js | 2 +- .../src/components/Sidebar/styles.js | 3 +- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js b/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js index 037cfce0..ba5295af 100644 --- a/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js +++ b/enatega-multivendor-restaurant/src/components/OrderDetails/OrderDetails.js @@ -42,7 +42,7 @@ export default function OrderDetails({ orderData }) { ) } function OrderItems({ orderData }) { - console.log("OrderData",orderData) + // // console.log("OrderData",orderData) const { t } = useTranslation() const { instructions, @@ -52,7 +52,7 @@ function OrderItems({ orderData }) { deliveryCharges, taxationAmount } = orderData - console.log("instructions",instructions) + // console.log("instructions",instructions) const configuration = useContext(Configuration.Context) let subTotal = 0 return ( diff --git a/enatega-multivendor-rider/environment.js b/enatega-multivendor-rider/environment.js index 7a8471dc..781e5734 100644 --- a/enatega-multivendor-rider/environment.js +++ b/enatega-multivendor-rider/environment.js @@ -16,6 +16,8 @@ const getEnvVars = (env = Updates.releaseChannel) => { } } return { + // GRAPHQL_URL: 'http://192.168.0.109:8001/graphql', + // WS_GRAPHQL_URL: 'ws://192.168.0.109:8001/graphql', GRAPHQL_URL: 'https://enatega-multivendor.up.railway.app/graphql', WS_GRAPHQL_URL: 'wss://enatega-multivendor.up.railway.app/graphql', SENTRY_DSN: configuration.riderAppSentryUrl, diff --git a/enatega-multivendor-rider/package-lock.json b/enatega-multivendor-rider/package-lock.json index 1e4162c6..c4dbef71 100644 --- a/enatega-multivendor-rider/package-lock.json +++ b/enatega-multivendor-rider/package-lock.json @@ -52,6 +52,7 @@ "react-native-countdown-component": "^2.7.1", "react-native-flash-message": "^0.1.21", "react-native-gesture-handler": "~2.16.1", + "react-native-get-random-values": "^1.11.0", "react-native-gifted-chat": "^2.4.0", "react-native-loading-spinner-overlay": "^3.0.0", "react-native-maps": "1.14.0", @@ -8823,6 +8824,12 @@ "node": ">=10" } }, + "node_modules/fast-base64-decode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz", + "integrity": "sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==", + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -14491,6 +14498,18 @@ "react-native": "*" } }, + "node_modules/react-native-get-random-values": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/react-native-get-random-values/-/react-native-get-random-values-1.11.0.tgz", + "integrity": "sha512-4BTbDbRmS7iPdhYLRcz3PGFIpFJBwNZg9g42iwa2P6FOv9vZj/xJc678RZXnLNZzd0qd7Q3CCF6Yd+CU2eoXKQ==", + "license": "MIT", + "dependencies": { + "fast-base64-decode": "^1.0.0" + }, + "peerDependencies": { + "react-native": ">=0.56" + } + }, "node_modules/react-native-gifted-chat": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/react-native-gifted-chat/-/react-native-gifted-chat-2.4.0.tgz", @@ -24115,6 +24134,11 @@ "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.16.2.tgz", "integrity": "sha512-929XBU70q5ELxkKADj1xL0UIm3HvhYhNAOZv5DSk7rrKvLo7QDdPyl+JVnwZm9LrkNbH4wuE2rLoKu1KMgZ+9A==" }, + "fast-base64-decode": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz", + "integrity": "sha512-qwaScUgUGBYeDNRnbc/KyllVU88Jk1pRHPStuF/lO7B0/RTRLj7U0lkdTAutlBblY08rwZDff6tNU9cjv6j//Q==" + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -28254,6 +28278,14 @@ "prop-types": "^15.7.2" } }, + "react-native-get-random-values": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/react-native-get-random-values/-/react-native-get-random-values-1.11.0.tgz", + "integrity": "sha512-4BTbDbRmS7iPdhYLRcz3PGFIpFJBwNZg9g42iwa2P6FOv9vZj/xJc678RZXnLNZzd0qd7Q3CCF6Yd+CU2eoXKQ==", + "requires": { + "fast-base64-decode": "^1.0.0" + } + }, "react-native-gifted-chat": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/react-native-gifted-chat/-/react-native-gifted-chat-2.4.0.tgz", diff --git a/enatega-multivendor-rider/src/components/Sidebar/Sidebar.js b/enatega-multivendor-rider/src/components/Sidebar/Sidebar.js index b7f7c170..446446a1 100644 --- a/enatega-multivendor-rider/src/components/Sidebar/Sidebar.js +++ b/enatega-multivendor-rider/src/components/Sidebar/Sidebar.js @@ -62,7 +62,7 @@ function SidebBar() { ))} - + logout()} icon="sign-out" diff --git a/enatega-multivendor-rider/src/components/Sidebar/styles.js b/enatega-multivendor-rider/src/components/Sidebar/styles.js index a4f1038d..5a0f1237 100644 --- a/enatega-multivendor-rider/src/components/Sidebar/styles.js +++ b/enatega-multivendor-rider/src/components/Sidebar/styles.js @@ -47,7 +47,8 @@ const styles = { }, opacity: { backgroundColor: colors.black, - opacity: 0.8 + opacity: 0.8, + height: 60, } }