Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reexport remaining components from PF #1938

Merged
merged 9 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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