Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 61d982d8
authored
2024-05-15 17:35:32 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
enquiries
1 parent
2fb6bccd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
236 additions
and
95 deletions
components/detail/DetailGallery.js
components/detail/DetailInfo.js
components/gift-card/GiftCard.js
components/layout/VendorDashboardSidebar.js
components/vendor/ActivityListingRBAC.js
components/vendor/OrderListing.js
pages/vendor/orders/index.js → pages/vendor/enquiries/index.js
redux/actions/activityAction.js
redux/actions/enquiryAction.js
redux/actions/userActions.js
redux/constants/enquiryConstants.js
redux/reducers/enquiryReducer.js
redux/reducers/reducers.js
components/detail/DetailGallery.js
View file @
61d982d
...
...
@@ -95,57 +95,59 @@ const DetailGallery = ({ activityById }) => {
<
/div
>
<
/div
>
<
div
className
=
"row hide-on-mobile"
>
<
div
className
=
"col-12"
>
<
ul
className
=
"availability-wrappper"
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/month.svg"
/>
<
/span
>
From
:
{
activityById
.
data
.
attributes
.
fromDate
}
To
:
{
activityById
.
data
.
attributes
.
toDate
}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/time.svg"
/>
<
/span
>
Time
:
{
activityById
.
data
.
attributes
.
fromTime
}
-
{
activityById
.
data
.
attributes
.
toTime
}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/duration.svg"
/>
<
/span
>
Duration
:
{
activityById
.
data
.
attributes
.
minimumDuration
}
-
{
activityById
.
data
.
attributes
.
maximumDuration
}
Hours
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/contact.svg"
/>
<
/span
>
Contact
:
{
activityById
.
data
.
attributes
.
phoneNumber
}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/date.svg"
/>
<
/span
>
Active
on
:{
" "
}
{
returnAvilablleDaysArray
({
data
:
activityById
.
data
})
.
map
(
item
=>
{
return
item
.
name
;
})
.
join
(
", "
)}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/age.svg"
/>
<
/span
>
Age
:
{
activityById
.
data
.
attributes
.
ageLowerLimit
}
+
<
div
className
=
"info-div"
>
<
a
className
=
"image-container info"
onMouseEnter
=
{
handleMouseEnter
}
onMouseLeave
=
{
handleMouseLeave
}
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/icons/info.svg"
/>
<
/a
>
{
showInfo
&&
<
div
className
=
"info-text"
>
13
+
.
Climbers
aged
13
-
17
must
be
accompanied
by
an
adult
(
18
+
)
<
/div>
}
<
/div
>
<
/li
>
<
/ul
>
<
/div
>
{
activityById
&&
(
<
div
className
=
"col-12"
>
<
ul
className
=
"availability-wrappper"
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/month.svg"
/>
<
/span
>
From
:
{
activityById
.
data
.
attributes
.
fromDate
}
To
:
{
activityById
.
data
.
attributes
.
toDate
}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/time.svg"
/>
<
/span
>
Time
:
{
activityById
.
data
.
attributes
.
fromTime
}
-
{
activityById
.
data
.
attributes
.
toTime
}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/duration.svg"
/>
<
/span
>
Duration
:
{
activityById
.
data
.
attributes
.
minimumDuration
}
-
{
activityById
.
data
.
attributes
.
maximumDuration
}
Hours
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/contact.svg"
/>
<
/span
>
Contact
:
{
activityById
.
data
.
attributes
.
phoneNumber
}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/date.svg"
/>
<
/span
>
Active
on
:{
" "
}
{
returnAvilablleDaysArray
({
data
:
activityById
.
data
})
.
map
(
item
=>
{
return
item
.
name
;
})
.
join
(
", "
)}
<
/li
>
<
li
>
<
span
className
=
"image-container"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/availability/age.svg"
/>
<
/span
>
Age
:
{
activityById
.
data
.
attributes
.
ageLowerLimit
}
+
<
div
className
=
"info-div"
>
<
a
className
=
"image-container info"
onMouseEnter
=
{
handleMouseEnter
}
onMouseLeave
=
{
handleMouseLeave
}
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/icons/info.svg"
/>
<
/a
>
{
showInfo
&&
<
div
className
=
"info-text"
>
13
+
.
Climbers
aged
13
-
17
must
be
accompanied
by
an
adult
(
18
+
)
<
/div>
}
<
/div
>
<
/li
>
<
/ul
>
<
/div
>
)}
<
/div
>
<
/div
>
<
/
>
...
...
components/detail/DetailInfo.js
View file @
61d982d
This diff is collapsed.
Click to expand it.
components/gift-card/GiftCard.js
View file @
61d982d
...
...
@@ -8,6 +8,7 @@ import axios from "axios";
import
{
toast
}
from
"react-toastify"
;
import
{
Loader
}
from
"react-bootstrap-typeahead"
;
import
{
finishVendorOtpVerification
}
from
"../../redux/actions/vendorActions"
;
import
{
useRouter
}
from
"next/router"
;
// import { getCurrentEndUser } from "../../redux/actions/userActions";
const
validationSchema
=
Yup
.
object
().
shape
({
...
...
@@ -21,6 +22,7 @@ const validationSchema = Yup.object().shape({
let
formik1
;
const
GiftCard
=
()
=>
{
const
router
=
useRouter
()
const
dispatch
=
useDispatch
();
// useEffect(() => {
// dispatch(getCurrentEndUser());
...
...
@@ -389,11 +391,13 @@ const GiftCard = () => {
<
div
className
=
"col-12"
>
<
div
className
=
"result-box"
>
<
p
>
“
Sorry
,
unable
to
process
the
Gift
Card
now
.
<
br
/>
Th
is
feature
will
be
available
shortly
.
”
Gift
card
sent
for
approval
,
please
wait
till
the
vendor
contacts
you
<
br
/>
Th
ank
you
.
<
/p
>
<
div
>
<
button
className
=
"btn btn-primary"
type
=
"button"
onClick
=
{
handleclose
}
>
<
button
className
=
"btn btn-primary"
type
=
"button"
onClick
=
{()
=>
{
router
.
push
(
"/listing"
)
}}
>
Browse
Experiences
<
/button
>
<
/div
>
...
...
components/layout/VendorDashboardSidebar.js
View file @
61d982d
import
Image
from
"next/image"
;
import
Link
from
"next/link"
;
import
{
useRouter
}
from
"next/router"
;
import
React
,
{
useState
}
from
"react"
;
import
{
ToastContainer
}
from
"react-toastify"
;
...
...
@@ -21,22 +22,28 @@ const Sidebar = () => {
</button> */
}
<
ul
>
<
li
className
=
{
router
.
pathname
===
"/vendor/dashboard"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/dashboard"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-dashboard.svg"
/>
<
span
>
Dashboard
<
/span
>
<
/a
>
<
span
className
=
"d-flex"
>
<
Image
className
=
""
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-dashboard.svg"
/>
<
div
className
=
"mx-2 text-center"
>
<
Link
href
=
"/vendor/dashboard"
>
Dashboard
<
/Link
>
<
/div
>
<
/span
>
<
/li
>
<
li
className
=
{
router
.
pathname
===
"/vendor/
order
s"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/orders
"
>
<
li
className
=
{
router
.
pathname
===
"/vendor/
enquirie
s"
?
"active"
:
""
}
>
<
span
className
=
"d-flex
"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-orders.svg"
/>
<
span
>
Orders
<
/span
>
<
/a
>
<
div
className
=
"mx-2 text-center"
>
<
Link
href
=
"/vendor/enquiries"
>
Enquiries
<
/Link
>
<
/div
>
<
/span
>
<
/li
>
<
li
className
=
{
router
.
pathname
===
"/vendor/activities"
?
"active"
:
""
}
>
<
a
href
=
"/vendor/activities
"
>
<
span
className
=
"d-flex
"
>
<
Image
alt
=
""
width
=
{
22
}
height
=
{
15
}
src
=
"/images/vendor/icon-activities.svg"
/>
<
span
>
Activities
<
/span
>
<
/a
>
<
div
className
=
"mx-2 text-center"
>
<
Link
href
=
"/vendor/activities"
>
Activities
<
/Link
>
<
/div
>
<
/span
>
<
/li
>
<
/ul
>
<
/div
>
...
...
components/vendor/ActivityListingRBAC.js
View file @
61d982d
...
...
@@ -170,10 +170,10 @@ export const ActivityListingRBAC = ({ setactivityDetailInfo, setShowActivityDeta
};
});
const
categoryFilterArray
=
categories
.
data
.
map
((
item
,
index
)
=>
{
const
categoryFilterArray
=
categories
?
.
data
.
map
((
item
,
index
)
=>
{
return
{
text
:
item
.
attributes
.
name
,
value
:
item
.
attributes
.
name
};
});
const
subCategoryFilterArray
=
subCategories
.
data
.
map
((
item
,
index
)
=>
{
const
subCategoryFilterArray
=
subCategories
?
.
data
.
map
((
item
,
index
)
=>
{
return
{
text
:
item
.
attributes
.
name
,
value
:
item
.
attributes
.
name
};
});
setdata
(
initialData
);
...
...
components/vendor/OrderListing.js
View file @
61d982d
This diff is collapsed.
Click to expand it.
pages/vendor/
order
s/index.js
→
pages/vendor/
enquirie
s/index.js
View file @
61d982d
...
...
@@ -6,30 +6,28 @@ import Sidebar from "../../../components/layout/VendorDashboardSidebar";
// import { loadUser } from "../redux/actions/userActions";
// import { wrapper } from "../redux/store";
export
default
function
OrderListingPage
()
{
return
(
<
Layout
>
<
div
className
=
"sidebarContainer"
>
<
Sidebar
/>
<
div
className
=
"content"
>
<
OrderListing
/>
<
/div
>
<
/div
>
<
/Layout
>
);
const
OrderListingPage
=
()
=>
{
return
(
<
Layout
>
<
div
className
=
"sidebarContainer"
>
<
Sidebar
/>
<
div
className
=
"content"
>
<
OrderListing
/>
<
/div
>
<
/div
>
<
/Layout
>
);
};
export
default
OrderListingPage
;
/** For server side rendering */
export
const
getServerSideProps
=
wrapper
.
getServerSideProps
(
store
=>
async
({
req
,
query
})
=>
{
// Get the menu data.
// get the locations data.
// await store.dispatch(getVendorDetails())
// Get the menu data.
return
{
props
:
{},
// get the locations data.
// await store.dispatch(loadUser());
};
return
{
props
:
{}
};
});
redux/actions/activityAction.js
View file @
61d982d
...
...
@@ -82,7 +82,7 @@ export const getActivitiesByVendor = () => async dispatch => {
const
vendorResponse
=
await
axios
.
get
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/vendors/?
${
vendorQueryString
}
`
,
vendorConfig
);
console
.
log
(
"vendorResponse"
,
vendorResponse
.
data
.
data
[
0
].
id
);
//
console.log("vendorResponse", vendorResponse.data.data[0].id);
// const loggedinVendor = await getLoggedInVendor()
// console.log("loggedinVendor", loggedinVendor);
if
(
!
session
)
{
...
...
redux/actions/enquiryAction.js
View file @
61d982d
import
axios
from
"axios"
;
import
{
CLEAR_ERRORS
,
ENQUIRY_SUBMIT_FAIL
,
ENQUIRY_SUBMIT_REQUEST
,
ENQUIRY_SUBMIT_SUCCESS
}
from
"../constants/enquiryConstants"
;
import
{
getSession
}
from
"next-auth/react"
;
import
{
CLEAR_ERRORS
,
ENQUIRY_SUBMIT_FAIL
,
ENQUIRY_SUBMIT_REQUEST
,
ENQUIRY_SUBMIT_SUCCESS
,
GET_ENQUIRIES_BY_VENDOR_FAIL
,
GET_ENQUIRIES_BY_VENDOR_REQUEST
,
GET_ENQUIRIES_BY_VENDOR_SUCCESS
}
from
"../constants/enquiryConstants"
;
import
qs
from
"qs"
;
export
const
sendEnquiry
=
async
({
activityId
,
userId
,
date
,
vendorId
})
=>
{
export
const
sendEnquiry
=
async
({
activityId
,
userId
,
date
,
vendorId
,
quantity
})
=>
{
const
data
=
{
data
:
{
experience
:
activityId
,
end
U
ser
:
userId
,
end
_u
ser
:
userId
,
vendor
:
vendorId
,
date
,
status
:
"pending"
status
:
"pending"
,
quantity
}
};
const
config
=
{
...
...
@@ -28,3 +39,85 @@ export const clearErrors = () => async dispatch => {
type
:
CLEAR_ERRORS
});
};
export
const
getEnquiriesByVendor
=
()
=>
async
dispatch
=>
{
try
{
const
session
=
await
getSession
();
if
(
!
session
)
{
return
;
}
const
vendorConfig
=
{
headers
:
{
"Content-Type"
:
"application/json"
,
Authorization
:
`Bearer
${
session
.
jwt
}
`
}
};
const
vendorQuery
=
{
filters
:
{
user
:
{
id
:
{
$eq
:
session
.
id
}
}
}
};
const
vendorQueryString
=
qs
.
stringify
(
vendorQuery
,
{
encodeValuesOnly
:
true
});
const
vendorResponse
=
await
axios
.
get
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/vendors/?
${
vendorQueryString
}
`
,
vendorConfig
);
console
.
log
(
"session"
,
vendorResponse
.
data
.
data
[
0
].
id
);
dispatch
({
type
:
GET_ENQUIRIES_BY_VENDOR_REQUEST
});
const
config
=
{
headers
:
{
"Content-type"
:
"application/json"
,
Authorization
:
`Bearer
${
session
.
jwt
}
`
}
};
const
query
=
{
filters
:
{
vendor
:
{
id
:
{
$eq
:
vendorResponse
.
data
.
data
[
0
].
id
}
}
},
populate
:
[
"vendor"
,
"experience"
,
"end_user"
]
};
const
queryString
=
qs
.
stringify
(
query
,
{
encodeValuesOnly
:
true
});
// console.log("querystring", query);
const
response
=
await
axios
.
get
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/enquires/?
${
queryString
}
`
,
config
);
console
.
log
(
"response"
,
response
);
dispatch
({
type
:
GET_ENQUIRIES_BY_VENDOR_SUCCESS
,
payload
:
response
.
data
.
data
});
}
catch
(
error
)
{
dispatch
({
type
:
GET_ENQUIRIES_BY_VENDOR_FAIL
,
payload
:
error
.
response
.
data
});
}
};
export
const
changeEnquiryStatus
=
async
({
status
,
id
})
=>
{
try
{
const
session
=
await
getSession
();
if
(
!
session
)
{
return
;
}
const
config
=
{
headers
:
{
"Content-type"
:
"application/json"
,
Authorization
:
`Bearer
${
session
.
jwt
}
`
}
};
const
response
=
await
axios
.
put
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/enquires/
${
id
}
`
,
{
data
:
{
status
}
},
config
);
return
response
.
data
;
}
catch
(
error
)
{}
};
redux/actions/userActions.js
View file @
61d982d
...
...
@@ -403,6 +403,9 @@ export const getCurrentEndUser = () => async dispatch => {
try
{
console
.
log
(
"here action"
);
const
session
=
await
getSession
();
if
(
!
session
)
{
return
;
}
console
.
log
(
"session action"
,
session
);
dispatch
({
type
:
GET_END_USER_REQUEST
...
...
redux/constants/enquiryConstants.js
View file @
61d982d
...
...
@@ -2,6 +2,10 @@ export const ENQUIRY_SUBMIT_REQUEST = "ENQUIRY_SUBMIT_REQUEST";
export
const
ENQUIRY_SUBMIT_SUCCESS
=
"ENQUIRY_SUBMIT_SUCCESS"
;
export
const
ENQUIRY_SUBMIT_FAIL
=
"ENQUIRY_SUBMIT_FAIL"
;
export
const
GET_ENQUIRIES_BY_VENDOR_REQUEST
=
"GET_ENQUIRIES_BY_VENDOR_REQUEST"
;
export
const
GET_ENQUIRIES_BY_VENDOR_SUCCESS
=
"GET_ENQUIRIES_BY_VENDOR_SUCCESS"
;
export
const
GET_ENQUIRIES_BY_VENDOR_FAIL
=
"GET_ENQUIRIES_BY_VENDOR_FAIL"
;
export
const
CLEAR_ERRORS
=
"CLEAR_ERRORS"
;
// export const TOGGLE_SUCCESS
\ No newline at end of file
redux/reducers/enquiryReducer.js
View file @
61d982d
import
{
ENQUIRY_SUBMIT_FAIL
,
ENQUIRY_SUBMIT_REQUEST
,
ENQUIRY_SUBMIT_SUCCESS
}
from
"../constants/enquiryConstants"
;
import
{
ENQUIRY_SUBMIT_FAIL
,
ENQUIRY_SUBMIT_REQUEST
,
ENQUIRY_SUBMIT_SUCCESS
,
GET_ENQUIRIES_BY_VENDOR_FAIL
,
GET_ENQUIRIES_BY_VENDOR_REQUEST
,
GET_ENQUIRIES_BY_VENDOR_SUCCESS
}
from
"../constants/enquiryConstants"
;
export
const
enquiryReducer
=
(
state
=
{
enquiry
:
null
},
action
)
=>
{
switch
(
action
.
type
)
{
...
...
@@ -11,7 +18,7 @@ export const enquiryReducer = (state = { enquiry: null }, action) => {
return
{
loading
:
false
,
success
:
true
,
referral
:
action
.
payload
enquiry
:
action
.
payload
};
case
ENQUIRY_SUBMIT_FAIL
:
return
{
...
...
@@ -24,3 +31,25 @@ export const enquiryReducer = (state = { enquiry: null }, action) => {
return
state
;
}
};
export
const
getEnquiriesReducer
=
(
state
=
{
enquiriesByVendor
:
null
},
action
)
=>
{
switch
(
action
.
type
)
{
case
GET_ENQUIRIES_BY_VENDOR_REQUEST
:
return
{
loading
:
true
,
};
case
GET_ENQUIRIES_BY_VENDOR_SUCCESS
:
return
{
loading
:
false
,
enquiriesByVendor
:
action
.
payload
};
case
GET_ENQUIRIES_BY_VENDOR_FAIL
:
return
{
loading
:
false
,
error
:
action
.
payload
.
error
.
message
};
default
:
return
state
;
}
};
redux/reducers/reducers.js
View file @
61d982d
...
...
@@ -2,7 +2,7 @@ import { combineReducers } from "redux";
import
{
projectReducer
,
projectsReducer
,
similarProjectsReducer
}
from
"./projectsReducer"
;
import
{
townshipReducer
,
townshipsReducer
}
from
"./townshipsReducer"
;
import
{
authReducer
,
forgotPasswordReducer
,
getEndUserReducer
,
loadedUserReducer
,
resetPasswordReducer
,
userReducer
}
from
"./userReducers"
;
import
{
enquiryReducer
}
from
"./enquiryReducer"
;
import
{
enquiryReducer
,
getEnquiriesReducer
}
from
"./enquiryReducer"
;
import
{
displayEnquireNowReducer
}
from
"./enquireNowModalReducer"
;
import
{
getAllVendorsReducer
,
getVendorDetailsReducer
,
loggedInVendorReducer
,
updateVendorReducer
}
from
"./vendorReducers"
;
import
{
createActivityReducer
,
getActivitiesReducer
,
getActivityByIdReducer
,
updateActivityByIdReducer
}
from
"./activitiesReducer"
;
...
...
@@ -39,6 +39,7 @@ const reducers = combineReducers({
homeBanner
:
getAllHomeBannerReducer
,
allVendors
:
getAllVendorsReducer
,
endUser
:
getEndUserReducer
,
enquiriesByVendor
:
getEnquiriesReducer
,
});
export
default
reducers
;
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment