From 3854f331b6917d7292e5c53d49c2152f8eab13c2 Mon Sep 17 00:00:00 2001 From: Filip Hlavac <50696716+fhlavac@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:57:58 +0200 Subject: [PATCH] Make feedback modal open support case with product (#2651) Co-authored-by: Karel Hala --- src/components/Feedback/FeedbackModal.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/Feedback/FeedbackModal.tsx b/src/components/Feedback/FeedbackModal.tsx index e01fac42b..82b142c96 100644 --- a/src/components/Feedback/FeedbackModal.tsx +++ b/src/components/Feedback/FeedbackModal.tsx @@ -22,8 +22,10 @@ import FeedbackSuccess from './FeedbackSuccess'; import messages from '../../locales/Messages'; import FeedbackError from './FeedbackError'; -import './Feedback.scss'; import InternalChromeContext from '../../utils/internalChromeContext'; +import LibtJWTContext from '../LibJWTContext'; +import { createSupportCase } from '../../utils/createCase'; +import './Feedback.scss'; export type FeedbackModalProps = { user: DeepRequired; @@ -46,6 +48,7 @@ const FeedbackModal = memo(({ user }: FeedbackModalProps) => { const dispatch = useDispatch(); const [modalPage, setModalPage] = useState('feedbackHome'); const { getEnvironment } = useContext(InternalChromeContext); + const libjwt = useContext(LibtJWTContext); const env = getEnvironment(); const isAvailable = env === 'prod' || env === 'stage'; const setIsModalOpen = (isOpen: boolean) => dispatch(toggleFeedbackModal(isOpen)); @@ -73,13 +76,7 @@ const FeedbackModal = memo(({ user }: FeedbackModalProps) => { {intl.formatMessage(messages.describeBugUrgentCases)}
- { - window.open('https://access.redhat.com/support/cases/#/case/new/open-case?caseCreate=true', '_blank'); - }} - > + createSupportCase(user.identity, libjwt)}> {intl.formatMessage(messages.openSupportCase)}