@@ -15,7 +15,10 @@ import ReactQuill from "react-quill";
15
15
import 'react-quill/dist/quill.snow.css' ;
16
16
import { Spin } from "antd" ;
17
17
import LoadingOutlined from "@ant-design/icons/LoadingOutlined" ;
18
-
18
+ import { useSimpleSubscriptionContext } from "@lowcoder-ee/util/context/SimpleSubscriptionContext" ;
19
+ import { SubscriptionProductsEnum } from '@lowcoder-ee/constants/subscriptionConstants' ;
20
+ import { getDeploymentId } from "@lowcoder-ee/redux/selectors/configSelectors" ;
21
+ import { useSelector } from "react-redux" ;
19
22
20
23
const SupportWrapper = styled . div `
21
24
display: flex;
@@ -129,7 +132,7 @@ const handleEditClick = (ticketId: string) => {
129
132
} ;
130
133
131
134
export function SupportOverview ( ) {
132
- const { orgID, currentUser, domain } = useUserDetails ( ) ;
135
+ const { orgID, orgName , currentUser, domain } = useUserDetails ( ) ;
133
136
const [ supportTickets , setSupportTickets ] = useState < any > ( [ ] ) ;
134
137
const [ loading , setLoading ] = useState < boolean > ( true ) ;
135
138
const [ error , setError ] = useState < string | null > ( null ) ;
@@ -141,6 +144,12 @@ export function SupportOverview() {
141
144
const [ isSubmitting , setIsSubmitting ] = useState < boolean > ( false ) ;
142
145
const [ isReloadDisabled , setIsReloadDisabled ] = useState < boolean > ( false ) ; // State to disable/enable reload button
143
146
const [ lastReloadTime , setLastReloadTime ] = useState < number | null > ( null ) ;
147
+ const { subscriptions } = useSimpleSubscriptionContext ( ) ;
148
+ const deploymentId = useSelector ( getDeploymentId ) ;
149
+
150
+ const SupportSubscription = subscriptions . filter (
151
+ sub => sub . product === SubscriptionProductsEnum . SUPPORT && sub . status === 'active'
152
+ ) ;
144
153
145
154
// Capture global errors using window.onerror
146
155
useEffect ( ( ) => {
@@ -162,7 +171,7 @@ export function SupportOverview() {
162
171
const fetchSupportTickets = async ( ) => {
163
172
setLoading ( true ) ; // Set loading to true while fetching data
164
173
try {
165
- const ticketData = await searchCustomerTickets ( orgID , currentUser . id , domain ) ;
174
+ const ticketData = await searchCustomerTickets ( deploymentId , orgID , currentUser . id ) ;
166
175
setSupportTickets ( ticketData ) ;
167
176
} catch ( err ) {
168
177
setError ( "Failed to fetch support tickets." ) ;
@@ -210,7 +219,7 @@ export function SupportOverview() {
210
219
211
220
setIsSubmitting ( true ) ;
212
221
try {
213
- const result = await createTicket ( orgID , currentUser . id , 'subscription-id' , domain , summary , description , capturedErrors . join ( "\n" ) ) ;
222
+ const result = await createTicket ( domain , deploymentId , orgID , orgName , currentUser . id , SupportSubscription [ 0 ] ?. id , summary , description , capturedErrors . join ( "\n" ) ) ;
214
223
if ( result ) {
215
224
showCreateForm ( false ) ;
216
225
setSummary ( "" ) ;
0 commit comments