Skip to content

Commit

Permalink
Merge branch 'master' into test-full-text-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 authored May 28, 2024
2 parents 4968574 + f1bd75c commit a4f0c62
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 27 deletions.
8 changes: 4 additions & 4 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 @@ -57,7 +57,7 @@
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
"@redhat-cloud-services/eslint-config-redhat-cloud-services": "^1.3.0",
"@redhat-cloud-services/frontend-components-config-utilities": "^3.0.4",
"@redhat-cloud-services/types": "^1.0.9",
"@redhat-cloud-services/types": "^1.0.10",
"@simonsmith/cypress-image-snapshot": "^8.1.2",
"@swc/core": "^1.3.102",
"@swc/jest": "^0.2.29",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppFilter/useAppFilter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('useAppFilter', () => {
await act(async () => {
result.current.setIsOpen(true);
});
expect(axiosGetSpy).toHaveBeenCalledTimes(10);
expect(axiosGetSpy).toHaveBeenCalledTimes(9);
for (let index = 0; index < 8; index++) {
expect(axiosGetSpy.mock.calls[index]).toEqual([
`/api/chrome-service/v1/static/stable/stage/navigation/${requiredBundles[index]}-navigation.json?ts=666`,
Expand Down
15 changes: 1 addition & 14 deletions src/components/AppFilter/useAppFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,13 @@ export const requiredBundles = [
'settings',
'iam',
'quay',
'business-services',
'subscriptions',
...(!isProd() ? previewBundles : isBeta() ? previewBundles : []),
].filter(Boolean);

export const itLessBundles = ['openshift', 'insights', 'settings', 'iam'];

const bundlesOrder = [
'application-services',
'openshift',
'rhel',
'edge',
'ansible',
'settings',
'cost-management',
'subscriptions',
'iam',
'quay',
'business-services',
];
const bundlesOrder = ['application-services', 'openshift', 'rhel', 'edge', 'ansible', 'settings', 'cost-management', 'subscriptions', 'iam', 'quay'];

function findModuleByLink(href: string, { modules }: Pick<ChromeModule, 'modules'> = { modules: [] }) {
const routes = (modules || [])
Expand Down
4 changes: 0 additions & 4 deletions src/components/Routes/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ const redirects = [
path: '/subscriptions',
to: '/subscriptions/overview',
},
{
path: '/business-services',
to: '/business-services/hybrid-committed-spend',
},
{
path: '/docs',
to: '/docs/api',
Expand Down
7 changes: 4 additions & 3 deletions src/pdf/requestPdf.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PDFRequestOptions } from '@redhat-cloud-services/types';
import axios from 'axios';

const downloadPDF = async (url: string, filename = 'report.pdf') => {
Expand Down Expand Up @@ -42,12 +43,12 @@ const pollStatus = async (statusID: string) => {
});
};

const requestPdf = async (options: { service: string; template: string; filename?: string; [key: string]: any }) => {
const { filename, ...rest } = options;
const requestPdf = async (options: PDFRequestOptions) => {
const { filename, payload } = options;
try {
const {
data: { statusID },
} = await axios.post<{ statusID: string }>(`/api/crc-pdf-generator/v2/create`, rest);
} = await axios.post<{ statusID: string }>(`/api/crc-pdf-generator/v2/create`, { payload });
const { status } = await pollStatus(statusID);
if (status === 'Generated') {
return downloadPDF(`/api/crc-pdf-generator/v2/download/${statusID}`, filename);
Expand Down

0 comments on commit a4f0c62

Please sign in to comment.