Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make feedback modal open support case with product #2651

Merged
merged 5 commits into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading