@riosst100/pwa-marketplace 3.2.8 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/LiveChat/MessagesModal.js +34 -147
- package/src/components/Messages/index.js +1 -0
- package/src/components/Messages/messages.js +335 -0
- package/src/components/Messages/messages.module.css +51 -0
- package/src/components/Messages/messagesPage.js +345 -0
- package/src/components/MessagesPage/index.js +1 -0
- package/src/components/MessagesPage/messagesPage.js +50 -0
- package/src/components/MessagesPage/messagesPage.module.css +35 -0
- package/src/components/RFQ/modalRfq.js +90 -18
- package/src/components/RFQPage/quoteDetail.js +74 -38
- package/src/intercept.js +7 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +8 -2
- package/src/talons/Messages/useMessages.js +0 -0
- package/src/talons/MessagesPage/messagesPage.gql.js +303 -0
- package/src/talons/MessagesPage/useMessagesPage.js +87 -0
- package/src/talons/RFQ/rfq.gql.js +21 -0
- package/src/talons/RFQ/useRFQ.js +31 -6
- package/src/talons/Seller/useSeller.js +7 -2
|
@@ -70,6 +70,11 @@ export const GET_QUICK_RFQ_LIST_QUERY = gql`
|
|
|
70
70
|
export const GET_QUICK_RFQ_DETAIL_QUERY = gql`
|
|
71
71
|
query getQuickRfqDetail($quickrfqId: Int!) {
|
|
72
72
|
quickrfqDetail(quickrfq_id: $quickrfqId) {
|
|
73
|
+
admin_price {
|
|
74
|
+
currency
|
|
75
|
+
value
|
|
76
|
+
}
|
|
77
|
+
admin_quantity
|
|
73
78
|
attachment
|
|
74
79
|
attachments {
|
|
75
80
|
created_at
|
|
@@ -84,8 +89,12 @@ export const GET_QUICK_RFQ_DETAIL_QUERY = gql`
|
|
|
84
89
|
cart_id
|
|
85
90
|
comment
|
|
86
91
|
contact_name
|
|
92
|
+
coupon_code
|
|
87
93
|
create_date
|
|
94
|
+
date_need_quote
|
|
88
95
|
email
|
|
96
|
+
expiry
|
|
97
|
+
image_url
|
|
89
98
|
info_buy_request
|
|
90
99
|
messages {
|
|
91
100
|
created_at
|
|
@@ -103,12 +112,17 @@ export const GET_QUICK_RFQ_DETAIL_QUERY = gql`
|
|
|
103
112
|
}
|
|
104
113
|
product_id
|
|
105
114
|
product_name
|
|
115
|
+
product_sku
|
|
106
116
|
quantity
|
|
107
117
|
quickrfq_id
|
|
118
|
+
seller_id
|
|
119
|
+
seller_name
|
|
108
120
|
status
|
|
109
121
|
store_currency_code
|
|
110
122
|
store_id
|
|
111
123
|
update_date
|
|
124
|
+
user_id
|
|
125
|
+
user_name
|
|
112
126
|
website_id
|
|
113
127
|
}
|
|
114
128
|
}
|
|
@@ -153,7 +167,14 @@ export const CONVERT_QUICK_RFQ_TO_CART_MUTATION = gql`
|
|
|
153
167
|
}
|
|
154
168
|
`;
|
|
155
169
|
|
|
170
|
+
export const CREATE_CART = gql`
|
|
171
|
+
mutation createCart {
|
|
172
|
+
cartId: createEmptyCart
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
|
|
156
176
|
export default {
|
|
177
|
+
createCartMutation: CREATE_CART,
|
|
157
178
|
convertQuickrfqToCartMutation: CONVERT_QUICK_RFQ_TO_CART_MUTATION,
|
|
158
179
|
sendRfqMessageMutation: SEND_RFQ_MESSAGE_MUTATION,
|
|
159
180
|
getQuickRfqDetailQuery: GET_QUICK_RFQ_DETAIL_QUERY,
|
package/src/talons/RFQ/useRFQ.js
CHANGED
|
@@ -4,14 +4,23 @@ import { useCallback } from 'react';
|
|
|
4
4
|
import mergeOperations from '@magento/peregrine/lib/util/shallowMerge';
|
|
5
5
|
import DEFAULT_OPERATIONS from './rfq.gql';
|
|
6
6
|
|
|
7
|
+
import { useLocation } from 'react-router-dom';
|
|
8
|
+
|
|
7
9
|
export const useRFQ = props => {
|
|
10
|
+
const { pathname } = useLocation();
|
|
11
|
+
const rfqQuoteId = pathname.split('/')[2];
|
|
12
|
+
|
|
13
|
+
console.log('rfqQuoteId',rfqQuoteId)
|
|
14
|
+
|
|
8
15
|
const operations = mergeOperations(DEFAULT_OPERATIONS, props?.operations);
|
|
16
|
+
|
|
9
17
|
const {
|
|
10
18
|
getQuickRfqListQuery,
|
|
11
19
|
getQuickRfqDetailQuery,
|
|
12
20
|
createQuickRfqMutation,
|
|
13
21
|
sendRfqMessageMutation,
|
|
14
|
-
convertQuickrfqToCartMutation
|
|
22
|
+
convertQuickrfqToCartMutation,
|
|
23
|
+
createCartMutation
|
|
15
24
|
} = operations;
|
|
16
25
|
|
|
17
26
|
const [fetchRfqList, rfqListState] = useLazyQuery(getQuickRfqListQuery, {
|
|
@@ -28,7 +37,20 @@ export const useRFQ = props => {
|
|
|
28
37
|
|
|
29
38
|
const [createQuickRfq, createState] = useMutation(createQuickRfqMutation);
|
|
30
39
|
const [sendRfqMessage, sendMessageState] = useMutation(sendRfqMessageMutation);
|
|
31
|
-
|
|
40
|
+
|
|
41
|
+
const [fetchCartId] = useMutation(createCartMutation);
|
|
42
|
+
// const [convertQuickrfqToCart, convertState] = useMutation(convertQuickrfqToCartMutation);
|
|
43
|
+
|
|
44
|
+
const convertState = null;
|
|
45
|
+
|
|
46
|
+
const [
|
|
47
|
+
convertQuickrfqToCart,
|
|
48
|
+
{
|
|
49
|
+
data: addToCartResponseData,
|
|
50
|
+
error: errorAddingProductToCart,
|
|
51
|
+
loading: isAddProductLoading
|
|
52
|
+
}
|
|
53
|
+
] = useMutation(convertQuickrfqToCartMutation);
|
|
32
54
|
|
|
33
55
|
const loadRfqList = useCallback(
|
|
34
56
|
variables => fetchRfqList({ variables }),
|
|
@@ -57,12 +79,15 @@ export const useRFQ = props => {
|
|
|
57
79
|
[sendRfqMessage]
|
|
58
80
|
);
|
|
59
81
|
|
|
60
|
-
const handleConvertQuickrfqToCart = useCallback(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
82
|
+
const handleConvertQuickrfqToCart = useCallback(() => {
|
|
83
|
+
convertQuickrfqToCart({ variables: { quickrfqId: rfqQuoteId } })
|
|
84
|
+
}, [convertQuickrfqToCart, rfqQuoteId]);
|
|
64
85
|
|
|
65
86
|
return {
|
|
87
|
+
fetchCartId,
|
|
88
|
+
addToCartResponseData,
|
|
89
|
+
isAddProductLoading,
|
|
90
|
+
errorAddingProductToCart,
|
|
66
91
|
loadRfqList,
|
|
67
92
|
rfqListState,
|
|
68
93
|
loadRfqDetail,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useQuery, useMutation } from '@apollo/client';
|
|
2
2
|
import { useEffect, useMemo, useCallback, useState } from 'react';
|
|
3
3
|
import { useToasts } from '@magento/peregrine/lib/Toasts/useToasts';
|
|
4
|
-
import { useLocation } from 'react-router-dom';
|
|
4
|
+
import { useLocation, useHistory } from 'react-router-dom';
|
|
5
5
|
import { useAppContext } from '@magento/peregrine/lib/context/app';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
|
|
@@ -13,6 +13,8 @@ export const useSeller = props => {
|
|
|
13
13
|
|
|
14
14
|
const { formatMessage } = useIntl();
|
|
15
15
|
|
|
16
|
+
const history = useHistory();
|
|
17
|
+
|
|
16
18
|
const operations = mergeOperations(DEFAULT_OPERATIONS, props.operations);
|
|
17
19
|
const {
|
|
18
20
|
getStoreConfigData,
|
|
@@ -152,7 +154,10 @@ export const useSeller = props => {
|
|
|
152
154
|
}),
|
|
153
155
|
timeout: 3000
|
|
154
156
|
});
|
|
155
|
-
|
|
157
|
+
if (result) {
|
|
158
|
+
var messageId = result?.data?.customerSendMessage.message_id;
|
|
159
|
+
history.push('/messages?id=' + messageId);
|
|
160
|
+
}
|
|
156
161
|
return result?.data?.customerSendMessage;
|
|
157
162
|
}, [sendMessage, refetchMessages, addToast, formatMessage]);
|
|
158
163
|
|