Skip to content

Commit

Permalink
Fix "Open support case" in masthead
Browse files Browse the repository at this point in the history
  • Loading branch information
fhlavac committed Oct 5, 2023
1 parent 5494633 commit 1cafd8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/components/Header/Tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,33 +131,33 @@ const Tools = () => {
/* list out the items for the about menu */
const aboutMenuDropdownItems = [
{
title: `${intl.formatMessage(messages.apiDocumentation)}`,
title: intl.formatMessage(messages.apiDocumentation),
onClick: () => window.open('https://developers.redhat.com/api-catalog/', '_blank'),
isHidden: isITLessEnv,
},
{
title: `${intl.formatMessage(messages.openSupportCase)}`,
title: intl.formatMessage(messages.openSupportCase),
onClick: () => createSupportCase(user.identity, libjwt),
isDisabled: window.location.href.includes('/application-services') && !isRhosakEntitled,
isHidden: isITLessEnv,
},
{
title: `${intl.formatMessage(messages.statusPage)}`,
title: intl.formatMessage(messages.statusPage),
onClick: () => window.open('https://status.redhat.com/', '_blank'),
isHidden: isITLessEnv,
},
{
title: `${intl.formatMessage(messages.supportOptions)}`,
title: intl.formatMessage(messages.supportOptions),
url: isITLessEnv ? 'https://redhatgov.servicenowservices.com/css' : 'https://access.redhat.com/support',
},
{
title: `${intl.formatMessage(messages.insightsRhelDocumentation)}`,
title: intl.formatMessage(messages.insightsRhelDocumentation),
onClick: () => window.open('https://access.redhat.com/documentation/en-us/red_hat_insights', '_blank'),
isHidden: getSection() !== 'insights' || isITLessEnv,
},

{
title: `${intl.formatMessage(messages.demoMode)}`,
title: intl.formatMessage(messages.demoMode),
onClick: () => cookie.set('cs_demo', 'true') && window.location.reload(),
isHidden: !isDemoAcc,
},
Expand Down
4 changes: 3 additions & 1 deletion src/utils/createCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export async function createSupportCase(
}
) {
const currentProduct = registerProduct() || 'Other';
const { src_hash, app_name } = await getProductData();
const productData = await getProductData();
// a temporary fallback to getUrl() until all apps are redeployed, which will fix getProductData() - remove after some time
const { src_hash, app_name } = { src_hash: productData?.src_hash, app_name: productData?.app_name ?? getUrl('app') };
const portalUrl = `${getEnvDetails()?.portal}`;
const caseUrl = `${portalUrl}${HYDRA_ENDPOINT}`;

Expand Down

0 comments on commit 1cafd8a

Please sign in to comment.