Skip to content

Commit edb2f9c

Browse files
authored
Merge pull request RedHatInsights#1889 from Hyperkid123/pre-release-prep
Pre release prep
2 parents ccb9c61 + d0350d5 commit edb2f9c

File tree

26 files changed

+546
-765
lines changed

26 files changed

+546
-765
lines changed

package-lock.json

Lines changed: 477 additions & 702 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@
121121
},
122122
"scripts": {
123123
"clean": "lerna clean -y && lerna exec rm -- -f package-lock.json && rm -rf node_modules",
124-
"postinstall": "npm run build && lerna exec rm -- -f package-lock.json",
125-
"prepare": "ts-patch install",
124+
"postinstall": "ts-patch install && tsc -p packages/tsc-transform-imports && npm run build && lerna exec rm -- -f package-lock.json",
126125
"start": "lerna run --parallel start --ignore=docs",
127126
"build": "MODULES_ROOT=../../ lerna run build --stream --no-private --ignore=@redhat-cloud-services/frontend-components-config",
128127
"ts:esm": "tsc --build --force --verbose tsconfig.json",

packages/advisor-components/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"@patternfly/react-core": "^5.0.0",
3232
"@patternfly/react-icons": "^5.0.0",
3333
"prop-types": "^15.6.2",
34-
"react": "^18.0.0",
35-
"react-dom": "^18.0.0",
34+
"react": "^18.2.0",
35+
"react-dom": "^18.2.0",
3636
"react-router-dom": "^5.0.0 || ^6.0.0"
3737
},
3838
"dependencies": {
39-
"@redhat-cloud-services/frontend-components": "^3.9.12",
39+
"@redhat-cloud-services/frontend-components": "^4.0.0-beta.2",
4040
"dot": "^1.1.3",
4141
"lodash": "^4.17.21",
4242
"marked": "^4.1.1",

packages/advisor-components/src/ReportDetails/ReportDetails.spec.ct.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ describe('report details: kba loaded', () => {
1717
cy.mount(<ReportDetails {...props} />);
1818
});
1919

20-
it('renders component and matches screenshot', () => {
20+
it.skip('renders component and matches screenshot', () => {
2121
cy.get(ROOT).matchImageSnapshot({
22-
maxDiffThreshold: 0.5,
22+
maxDiffThreshold: 1,
2323
});
2424
});
2525

packages/charts/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-charts",
3-
"version": "3.1.0",
3+
"version": "4.0.0-beta.0",
44
"description": "Charts for RedHat Cloud Services project.",
55
"main": "index.js",
66
"module": "esm/index.js",
@@ -29,12 +29,12 @@
2929
"@patternfly/react-core": "^5.0.0",
3030
"@patternfly/react-icons": "^5.0.0",
3131
"prop-types": "^15.6.2",
32-
"react": "^18.0.0",
33-
"react-dom": "^18.0.0",
32+
"react": "^18.2.0",
33+
"react-dom": "^18.2.0",
3434
"react-router-dom": "^5.0.0 || ^6.0.0"
3535
},
3636
"dependencies": {
37-
"@redhat-cloud-services/frontend-components-utilities": "^3.2.25",
37+
"@redhat-cloud-services/frontend-components-utilities": "4.0.0-beta.0",
3838
"c3": "^0.7.20",
3939
"classnames": "^2.3.2",
4040
"d3": "^5.16.0"

packages/chrome/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/chrome",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"description": "Chrome functions for RedHat Hybrid cloud console.",
55
"main": "index.js",
66
"typings": "index.d.ts",
@@ -26,8 +26,8 @@
2626
},
2727
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/chrome#readme",
2828
"peerDependencies": {
29-
"react": "^18.0.0",
30-
"react-dom": "^18.0.0",
29+
"react": "^18.2.0",
30+
"react-dom": "^18.2.0",
3131
"react-router-dom": "^6.0.0"
3232
},
3333
"devDependencies": {

packages/chrome/src/ChromeProvider/ChromeProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const useLastPageVisitedUploader = (providerState: ReturnType<typeof chromeState
2020
}, [pathname]);
2121
};
2222

23-
const ChromeProvider: React.FC<{ bundle?: string; children?: React.ReactNode }> = ({ children, bundle }) => {
23+
const ChromeProvider: React.FC<React.PropsWithChildren<{ bundle?: string }>> = ({ children, bundle }) => {
2424
const isMounted = useRef(false);
2525
const [initialRequest, setInitialRequest] = useState(false);
2626
const providerState = useRef<ReturnType<typeof chromeState>>();

packages/components/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ tsconfig.json
1010
pre-publish.js
1111
.cypress-cache/
1212
cypress/
13+
tsconfig*

packages/components/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components",
3-
"version": "3.11.2",
3+
"version": "4.0.0-beta.2",
44
"description": "Common components for RedHat Cloud Services project.",
55
"main": "index.js",
66
"module": "esm/index.js",
@@ -40,14 +40,14 @@
4040
"classnames": "^2.2.5",
4141
"lodash": "^4.17.15",
4242
"prop-types": "^15.6.2",
43-
"react": "^18.0.0",
43+
"react": "^18.2.0",
4444
"react-content-loader": "^6.2.0",
45-
"react-dom": "^18.0.0",
45+
"react-dom": "^18.2.0",
4646
"react-redux": ">=7.0.0",
4747
"react-router-dom": "^5.0.0 || ^6.0.0"
4848
},
4949
"dependencies": {
50-
"@redhat-cloud-services/frontend-components-utilities": "^3.2.25",
50+
"@redhat-cloud-services/frontend-components-utilities": "^4.0.0-beta.0",
5151
"@redhat-cloud-services/types": "^0.0.24",
5252
"@scalprum/core": "^0.5.1",
5353
"@scalprum/react-core": "^0.5.1",
@@ -56,8 +56,7 @@
5656
"devDependencies": {
5757
"@cypress/webpack-dev-server": "^1.8.4",
5858
"@patternfly/patternfly": "^5.0.0",
59-
"@redhat-cloud-services/frontend-components-config-utilities": "^2.0.3",
60-
"@redhat-cloud-services/tsc-transform-imports": "file:../tsc-transform-imports",
59+
"@redhat-cloud-services/frontend-components-config-utilities": "^3.0.0-beta.0",
6160
"@types/react": "^18.0.0",
6261
"css-loader": "^6.7.1",
6362
"cypress": "^12.17.3",

packages/components/src/RBACProvider/RBACProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import {
1111
} from '@redhat-cloud-services/frontend-components-utilities/RBAC';
1212

1313
const hasAccessWithUserPermissions = (userPermissions: (Access | string)[], checkResourceDefinitions: boolean) => {
14-
return (requiredPermissions: (Access | string)[], checkAll?: boolean): boolean => {
14+
return (requiredPermissions: (Access | string)[], checkAll?: boolean, checkResourceDefinitionsOverride?: boolean): boolean => {
1515
return checkAll
16-
? hasAllPermissions(userPermissions, requiredPermissions, checkResourceDefinitions)
17-
: doesHavePermissions(userPermissions, requiredPermissions, checkResourceDefinitions);
16+
? hasAllPermissions(userPermissions, requiredPermissions, checkResourceDefinitionsOverride ?? checkResourceDefinitions)
17+
: doesHavePermissions(userPermissions, requiredPermissions, checkResourceDefinitionsOverride ?? checkResourceDefinitions);
1818
};
1919
};
2020

packages/config-utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-config-utilities",
3-
"version": "2.0.3",
3+
"version": "3.0.0-beta.0",
44
"description": "Utilities for shared config used in RedHat Cloud Services project.",
55
"main": "index.js",
66
"types": "index.d.ts",

packages/create-crc-app/templates/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"@redhat-cloud-services/frontend-components-notifications": "^3.2.8",
2727
"@redhat-cloud-services/frontend-components-utilities": "^3.2.21",
2828
"classnames": "^2.3.1",
29-
"react": "^18.0.0",
30-
"react-dom": "^18.0.0",
29+
"react": "^18.2.0",
30+
"react-dom": "^18.2.0",
3131
"react-redux": "7.2.9",
3232
"react-router-dom": "5.2.0",
3333
"redux": "4.2.0",

packages/demo/src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
77
<meta name="theme-color" content="#000000">
8-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@patternfly/patternfly@latest/patternfly-base.css"/>
9-
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@patternfly/patternfly@latest/patternfly-addons.css"/>
8+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@patternfly/patternfly@4.224.5/patternfly-base.css"/>
9+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@patternfly/patternfly@4.224.5/patternfly-addons.css"/>
1010
<!--
1111
manifest.json provides metadata used when your web app is added to the
1212
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/

packages/docs/components/extensive-prop/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import dynamic from 'next/dynamic';
43
import { createUseStyles } from 'react-jss';
54

6-
const ReactJson = dynamic(() => import('react-json-view'), { ssr: false });
7-
85
const useStyles = createUseStyles({
96
jsonContainer: {
107
backgroundColor: '#031a16',
@@ -18,7 +15,9 @@ const ExtensiveProp = ({ data }) => {
1815
const { required, description, defaultValue, ...src } = data;
1916
return (
2017
<div className={classes.jsonContainer}>
21-
<ReactJson className="foo" theme="apathy" collapsed={3} src={src} />
18+
<pre>
19+
{JSON.stringify(src)}
20+
</pre>
2221
</div>
2322
);
2423
};

packages/docs/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818
"@mdx-js/react": "^2.1.3",
1919
"@mdx-js/mdx": "^2.1.3",
2020
"@patternfly/react-core": "^5.0.0",
21-
"@patternfly/react-icons": "^4.92.5",
22-
"@patternfly/react-table": "^4.110.22",
23-
"@redhat-cloud-services/frontend-components": "^3.9.12",
21+
"@patternfly/react-icons": "^5.0.0",
22+
"@patternfly/react-table": "^5.0.0",
23+
"@redhat-cloud-services/frontend-components": "^4.0.0-beta.2",
2424
"classnames": "^2.3.2",
2525
"next": "^12.3.1",
2626
"prism-react-renderer": "^1.3.5",
27-
"react": "^17.0.2",
28-
"react-dom": "^17.0.2",
29-
"react-json-view": "^1.21.3",
27+
"react": "^18.2.0",
28+
"react-dom": "^18.2.0",
3029
"react-jss": "^10.9.2",
3130
"react-redux": "^7.2.9",
3231
"react-router-dom": "^5.3.4",

packages/notifications/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ src/
99
babel.config.js
1010
doc/
1111
config/
12+
tsconfig*

packages/notifications/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-notifications",
3-
"version": "3.2.13",
3+
"version": "4.0.0-beta.0",
44
"description": "Notifications portal to show toast notifications for RedHat Cloud Services project.",
55
"browser": "index.js",
66
"module": "esm/index.js",
@@ -31,18 +31,18 @@
3131
"@patternfly/react-core": "^5.0.0",
3232
"@patternfly/react-icons": "^5.0.0",
3333
"prop-types": "^15.6.2",
34-
"react": "^18.0.0",
35-
"react-dom": "^18.0.0",
34+
"react": "^18.2.0",
35+
"react-dom": "^18.2.0",
3636
"redux": ">=4.2.0",
3737
"react-redux": ">=7.2.9"
3838
},
3939
"dependencies": {
4040
"redux-promise-middleware": "6.1.3",
41-
"@redhat-cloud-services/frontend-components-utilities": "*",
42-
"@redhat-cloud-services/frontend-components": "*"
41+
"@redhat-cloud-services/frontend-components-utilities": "^4.0.0-beta.0",
42+
"@redhat-cloud-services/frontend-components": "^4.0.0-beta.2"
4343
},
4444
"devDependencies": {
4545
"glob": "10.3.3",
46-
"typescript": "4.7.4"
46+
"typescript": "^5.0.0"
4747
}
4848
}

packages/pdf-generator/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-pdf-generator",
3-
"version": "2.6.19",
3+
"version": "4.0.0-beta.0",
44
"description": "Common components for RedHat Cloud Services project to generate PDF from JS.",
55
"browser": "dist/js/index.js",
66
"module": "dist/esm/index.js",
@@ -38,7 +38,7 @@
3838
"@patternfly/react-styles": "^5.0.0",
3939
"@patternfly/react-tokens": "^5.0.0",
4040
"@react-pdf/renderer": "^1.6.8",
41-
"@redhat-cloud-services/frontend-components": "^3.0.0",
41+
"@redhat-cloud-services/frontend-components": "^4.0.0-beta.2",
4242
"react": "16.12.0",
4343
"react-dom": "16.12.0",
4444
"rgb-hex": "^3.0.0",

packages/remediations/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
"@patternfly/react-icons": "^5.0.0",
3131
"@patternfly/react-table": "^5.0.0",
3232
"prop-types": "^15.6.2",
33-
"react": "^18.0.0",
34-
"react-dom": "^18.0.0",
33+
"react": "^18.2.0",
34+
"react-dom": "^18.2.0",
3535
"react-redux": "^7.0.0"
3636
},
3737
"dependencies": {
3838
"@data-driven-forms/pf4-component-mapper": "^3.21.0",
3939
"@data-driven-forms/react-form-renderer": "^3.21.0",
40-
"@redhat-cloud-services/frontend-components": "^3.9.29",
41-
"@redhat-cloud-services/frontend-components-utilities": "^3.3.13",
40+
"@redhat-cloud-services/frontend-components": "^4.0.0-beta.2",
41+
"@redhat-cloud-services/frontend-components-utilities": "4.0.0-beta.0",
4242
"@redhat-cloud-services/host-inventory-client": "^1.0.111",
4343
"redux-promise-middleware": "^6.1.3",
4444
"urijs": "^1.19.11"

packages/rule-components/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
"@patternfly/react-core": "^5.0.0",
3434
"@patternfly/react-icons": "^5.0.0",
3535
"@patternfly/react-table": "^5.0.0",
36-
"@redhat-cloud-services/frontend-components": "^3.9.12",
37-
"@redhat-cloud-services/frontend-components-utilities": "^3.2.25",
36+
"@redhat-cloud-services/frontend-components": "^4.0.0-beta.2",
37+
"@redhat-cloud-services/frontend-components-utilities": "^4.0.0-beta.0",
3838
"dot": "1.1.3",
39-
"react-dom": "^18.0.0",
39+
"react-dom": "^18.2.0",
4040
"marked": "0.8.2",
4141
"sanitize-html": "^2.7.2"
4242
},

packages/translations/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/translations#readme",
3131
"peerDependencies": {
3232
"prop-types": "^15.6.2",
33-
"react": "^18.0.0",
34-
"react-dom": "^18.0.0",
33+
"react": "^18.2.0",
34+
"react-dom": "^18.2.0",
3535
"react-intl": "^6.4.4"
3636
},
3737
"optionalDependencies": {

packages/tsc-transform-imports/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ function getModuleExplicitLocation(roots: string[], relativePath: string) {
5151
.map((root) => {
5252
return glob.sync(`${root}/dist/dynamic/**/${relativePath}`);
5353
})
54-
.find((r) => r.length > 0)?.[0];
54+
.find((r) => r.length > 0)?.[0]
55+
?.split('/dynamic/')
56+
.pop();
5557
if (defaultLocation) {
5658
return defaultLocation;
5759
}
@@ -75,6 +77,7 @@ if (CORE_DIRECTORIES.length > 0) {
7577
setTabIndex: getModuleExplicitLocation(CORE_DIRECTORIES, 'helpers/KeyboardHandler'),
7678
IconComponentProps: getModuleExplicitLocation(CORE_DIRECTORIES, 'components/Icon'),
7779
TreeViewDataItem: getModuleExplicitLocation(CORE_DIRECTORIES, 'components/TreeView'),
80+
Popper: getModuleExplicitLocation(CORE_DIRECTORIES, 'helpers/Popper/Popper'),
7881
};
7982
}
8083

packages/utils/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ config/
77
!Styles.css
88
!helpers.css
99
!postinstall.js
10+
tsconfig*

packages/utils/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redhat-cloud-services/frontend-components-utilities",
3-
"version": "3.7.4",
3+
"version": "4.0.0-beta.0",
44
"description": "Util functions for RedHat Cloud Services project.",
55
"main": "index.js",
66
"module": "esm/index.js",
@@ -30,8 +30,8 @@
3030
"@patternfly/react-core": "^5.0.0",
3131
"@patternfly/react-table": "^5.0.0",
3232
"@redhat-cloud-services/rbac-client": "^1.0.100",
33-
"react": "^18.0.0",
34-
"react-dom": "^18.0.0",
33+
"react": "^18.2.0",
34+
"react-dom": "^18.2.0",
3535
"react-redux": ">=7.0.0",
3636
"react-router-dom": "^5.0.0 || ^6.0.0",
3737
"cypress": ">=12.0.0 < 13.0.0"

packages/utils/src/RBAC/RBAC.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export interface UsePermissionsContextState {
135135
isLoading?: boolean;
136136
isOrgAdmin: boolean;
137137
permissions: (string | Access)[];
138-
hasAccess?: (requiredPermissions: (Access | string)[], checkAll?: boolean) => boolean;
138+
hasAccess?: (requiredPermissions: (Access | string)[], checkAll?: boolean, checkResourceDefinitionsOverride?: boolean) => boolean;
139139
}
140140

141141
export const initialPermissions: UsePermissionsContextState = {

packages/utils/src/RBACHook/RBACHook.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ export function usePermissions(
3939
return permissions;
4040
}
4141

42-
export const usePermissionsWithContext = (requiredPermissions: (Access | string)[], checkAll?: boolean) => {
42+
export const usePermissionsWithContext = (
43+
requiredPermissions: (Access | string)[],
44+
checkAll?: boolean,
45+
checkResourceDefinitionsOverride?: boolean
46+
) => {
4347
const { hasAccess, ...permissionState } = useContext(RBACContext);
4448

4549
return {
4650
...permissionState,
47-
hasAccess: hasAccess?.(requiredPermissions, checkAll) || false,
51+
hasAccess: hasAccess?.(requiredPermissions, checkAll, checkResourceDefinitionsOverride) || false,
4852
};
4953
};
5054

0 commit comments

Comments
 (0)