From fe512ff135353f79def769f65a10d1938a0a6f2c Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Thu, 23 May 2024 09:15:16 +0200 Subject: [PATCH 1/3] Remove business-services bundle references. --- src/components/AppFilter/useAppFilter.test.js | 2 +- src/components/AppFilter/useAppFilter.ts | 1 - src/components/Routes/Routes.tsx | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/AppFilter/useAppFilter.test.js b/src/components/AppFilter/useAppFilter.test.js index 9e7f2017d..a3ff799b8 100644 --- a/src/components/AppFilter/useAppFilter.test.js +++ b/src/components/AppFilter/useAppFilter.test.js @@ -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`, diff --git a/src/components/AppFilter/useAppFilter.ts b/src/components/AppFilter/useAppFilter.ts index 56e79d90c..bc0c8144a 100644 --- a/src/components/AppFilter/useAppFilter.ts +++ b/src/components/AppFilter/useAppFilter.ts @@ -25,7 +25,6 @@ export const requiredBundles = [ 'settings', 'iam', 'quay', - 'business-services', 'subscriptions', ...(!isProd() ? previewBundles : isBeta() ? previewBundles : []), ].filter(Boolean); diff --git a/src/components/Routes/Routes.tsx b/src/components/Routes/Routes.tsx index 6f8046460..dd30eb4b7 100644 --- a/src/components/Routes/Routes.tsx +++ b/src/components/Routes/Routes.tsx @@ -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', From 76ccaa5118c8ae0e9683dcba191b38be950148d1 Mon Sep 17 00:00:00 2001 From: Dan Labrecque Date: Thu, 23 May 2024 10:19:45 -0400 Subject: [PATCH 2/3] Remove old business-services filter --- src/components/AppFilter/useAppFilter.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/components/AppFilter/useAppFilter.ts b/src/components/AppFilter/useAppFilter.ts index bc0c8144a..75defc33e 100644 --- a/src/components/AppFilter/useAppFilter.ts +++ b/src/components/AppFilter/useAppFilter.ts @@ -31,19 +31,7 @@ export const requiredBundles = [ 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 = { modules: [] }) { const routes = (modules || []) From c5da8d1ad583e5acf6dff40f668cb1e866f5c210 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Tue, 28 May 2024 10:36:29 +0200 Subject: [PATCH 3/3] Adjust PDF API --- package-lock.json | 8 ++++---- package.json | 2 +- src/pdf/requestPdf.ts | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index f1ce22958..718be4cc0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,7 +68,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", @@ -5216,9 +5216,9 @@ } }, "node_modules/@redhat-cloud-services/types": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@redhat-cloud-services/types/-/types-1.0.9.tgz", - "integrity": "sha512-dKYYSLU0cwNkOSq5kSvdKWzgwFGBk45uwAwoHGi44PMQdWkuz+tXhYLrKKAXoSXVahR6VFjBDONlaxok8Lzkcw==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@redhat-cloud-services/types/-/types-1.0.10.tgz", + "integrity": "sha512-4geiWnE60jYpRcNwxbx+dZBSv9Mh5VXPPcS0E9UGE4pszAsy25rgZvJ/C8tP9HymsH/Q1rn/3DKvBBulXAPGAg==", "dev": true }, "node_modules/@remix-run/router": { diff --git a/package.json b/package.json index bb3693365..32c585cc4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/pdf/requestPdf.ts b/src/pdf/requestPdf.ts index 90f3f0533..887937cca 100644 --- a/src/pdf/requestPdf.ts +++ b/src/pdf/requestPdf.ts @@ -1,3 +1,4 @@ +import { PDFRequestOptions } from '@redhat-cloud-services/types'; import axios from 'axios'; const downloadPDF = async (url: string, filename = 'report.pdf') => { @@ -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);