Skip to content

Commit

Permalink
Make feedback modal open support case with product (#2651)
Browse files Browse the repository at this point in the history
Co-authored-by: Karel Hala <[email protected]>
  • Loading branch information
fhlavac and karelhala authored Oct 6, 2023
1 parent f2b1fac commit 3854f33
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/components/Feedback/FeedbackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChromeUser>;
Expand All @@ -46,6 +48,7 @@ const FeedbackModal = memo(({ user }: FeedbackModalProps) => {
const dispatch = useDispatch();
const [modalPage, setModalPage] = useState<FeedbackPages>('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));
Expand Down Expand Up @@ -73,13 +76,7 @@ const FeedbackModal = memo(({ user }: FeedbackModalProps) => {
<CardBody>{intl.formatMessage(messages.describeBugUrgentCases)}</CardBody>
</Card>
<br />
<Card
isSelectableRaised
isCompact
onClick={() => {
window.open('https://access.redhat.com/support/cases/#/case/new/open-case?caseCreate=true', '_blank');
}}
>
<Card isSelectableRaised isCompact onClick={() => createSupportCase(user.identity, libjwt)}>
<CardTitle className="chr-c-feedback-card-title">
<Text>
{intl.formatMessage(messages.openSupportCase)} <ExternalLinkAltIcon />
Expand Down

0 comments on commit 3854f33

Please sign in to comment.