Skip to content

Commit

Permalink
Merge branch 'master' into scalprum-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 authored Oct 10, 2023
2 parents d8b8a15 + 6d9c5d8 commit 2f4bb8f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"swc-loader": "^0.2.3",
"terser-webpack-plugin": "^5.3.6",
"typescript": "^4.9.5",
"url": "^0.11.0",
"url": "^0.11.3",
"utility-types": "^3.10.0",
"wait-on": "^7.0.1",
"webpack": "^5.76.1",
Expand Down
3 changes: 2 additions & 1 deletion src/components/AppFilter/useAppFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type AppFilterBucket = {
links: NavItem[];
};

const previewBundles = ['business-services', 'subscriptions'];
const previewBundles = ['subscriptions'];

export const requiredBundles = [
'application-services',
Expand All @@ -23,6 +23,7 @@ export const requiredBundles = [
'settings',
'iam',
'quay',
'business-services',
...(!isProd() ? previewBundles : isBeta() ? previewBundles : []),
];

Expand Down
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
2 changes: 1 addition & 1 deletion src/components/Header/ToolbarToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ToolbarToggle = (props: ToolbarToggleProps) => {
<DropdownItem
key={title}
ouiaId={title}
disabled={isDisabled}
isDisabled={isDisabled}
component={
appId && url
? ({ className: itemClassName }) => (
Expand Down
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
8 changes: 8 additions & 0 deletions src/components/Routes/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ const redirects = [
path: '/subscriptions',
to: '/subscriptions/overview',
},
{
path: '/business-services',
to: '/business-services/hybrid-committed-spend',
},
{
path: '/docs',
to: '/docs/api',
},
];

export type RoutesProps = {
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 2f4bb8f

Please sign in to comment.