Skip to content

Commit

Permalink
Reexport remaining components from PF (#1938)
Browse files Browse the repository at this point in the history
* Bump component-groups package

* Reexport TagCount component

* Reexport SkeletonTable

* Reexport Unavailable

* Deprecate DateFormat

* Reexport and deprecate InvalidObject

* Deprecate a Truncate component

* Remove unused files

* Remove unused icon404 references
  • Loading branch information
fhlavac authored Nov 15, 2023
1 parent 8723726 commit 27f56da
Show file tree
Hide file tree
Showing 29 changed files with 55 additions and 1,306 deletions.
16 changes: 8 additions & 8 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 packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"dependencies": {
"@redhat-cloud-services/frontend-components-utilities": "^4.0.0",
"@redhat-cloud-services/types": "^0.0.24",
"@patternfly/react-component-groups": "^5.0.0-prerelease.5",
"@patternfly/react-component-groups": "^5.0.0-prerelease.7",
"@scalprum/core": "^0.5.4",
"@scalprum/react-core": "^0.5.4",
"sanitize-html": "^2.7.2"
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/DateFormat/DateFormat.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { dateByType } from './helper';
import { TooltipProps } from '@patternfly/react-core';
import { TooltipProps } from '@patternfly/react-core/dist/dynamic/components/Tooltip';
import { DateType } from './helper';

export interface DateFormatProps {
Expand All @@ -20,6 +20,7 @@ export interface DateFormatProps {
}

/**
* @deprecated Do not use deprecated DateFormat component, use official PatternFly Timestamp instead
* A component that formats date to a unified CRC format.
* Relative date format adds a tooltip with a full date string.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/ErrorState/DefaultErrorMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const DefaultErrorMessage = () => {
const DefaultErrorMessage: React.FunctionComponent = () => {
const redirectLink = 'https://access.redhat.com/support';
const statusLink = 'https://status.redhat.com';

Expand Down
11 changes: 0 additions & 11 deletions packages/components/src/InvalidObject/InvalidObject.test.js

This file was deleted.

30 changes: 8 additions & 22 deletions packages/components/src/InvalidObject/InvalidObject.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import React from 'react';
import Icon404 from './icon-404';
import { Button, Title } from '@patternfly/react-core';
import './invalidObject.scss';
import InvalidObjectPF, { InvalidObjectProps } from '@patternfly/react-component-groups/dist/dynamic/InvalidObject';

// Don't use chrome here because the 404 page on landing does not use chrome
const isBeta = () => {
return window.location.pathname.split('/')[1] === 'beta' ? '/beta' : '';
};
const isBeta = () => (window.location.pathname.split('/')[1] === 'beta' ? '/beta' : '');

const InvalidObject: React.FunctionComponent = ({ ...props }) => {
return (
<section {...props} className="pf-v5-l-page__main-section pf-v5-c-page__main-section ins-c-component_invalid-component">
<Title headingLevel="h1" size="3xl">
We lost that page
</Title>
<Icon404 />
<Title headingLevel="h1" size="xl" className="ins-c-text__sorry">
Let&apos;s find you a new one. Try a new search or return home.
</Title>
<Button variant="link" component="a" href={`${window.location.origin}${isBeta()}`}>
Return to homepage
</Button>
</section>
);
};
/**
* @deprecated Do not use deprecated InvalidObject import, the component has been moved to @patternfly/react-component-groups
*/
const InvalidObject: React.FunctionComponent<InvalidObjectProps> = (props) => (
<InvalidObjectPF toLandingPageUrl={`${window.location.origin}${isBeta()}`} {...props} />
);

export default InvalidObject;
Loading

0 comments on commit 27f56da

Please sign in to comment.