App: Drop permission check
This commit is contained in:
parent
28a76a6dcb
commit
af5f734328
2 changed files with 2 additions and 36 deletions
15
src/App.js
15
src/App.js
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Router } from './Router';
|
||||
import '@patternfly/patternfly/patternfly-addons.css';
|
||||
|
|
@ -8,11 +8,7 @@ import { getRegistry } from '@redhat-cloud-services/frontend-components-utilitie
|
|||
import NotificationsPortal from '@redhat-cloud-services/frontend-components-notifications/NotificationPortal';
|
||||
import { notificationsReducer } from '@redhat-cloud-services/frontend-components-notifications/redux';
|
||||
|
||||
import api from './api.js';
|
||||
import PermissionDenied from './Components/LandingPage/PermissionDenied';
|
||||
|
||||
const App = (props) => {
|
||||
const [ permission, setPermission ] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -20,13 +16,6 @@ const App = (props) => {
|
|||
registry.register({ notifications: notificationsReducer });
|
||||
insights.chrome.init();
|
||||
insights.chrome.identifyApp('image-builder');
|
||||
|
||||
api.getVersion().then(() => {
|
||||
setPermission(true);
|
||||
}).catch(() => {
|
||||
setPermission(false);
|
||||
});
|
||||
|
||||
const unregister = insights.chrome.on('APP_NAVIGATION', (event) =>
|
||||
navigate(`/${event.navId}`)
|
||||
);
|
||||
|
|
@ -38,7 +27,7 @@ const App = (props) => {
|
|||
return (
|
||||
<React.Fragment>
|
||||
<NotificationsPortal />
|
||||
{ permission ? <Router childProps={ props } /> : <PermissionDenied /> }
|
||||
<Router childProps={ props } />
|
||||
</React.Fragment>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import React from 'react';
|
||||
|
||||
import { InfoCircleIcon } from '@patternfly/react-icons';
|
||||
import { Button, EmptyState, EmptyStateVariant, EmptyStateIcon, EmptyStateBody, Title } from '@patternfly/react-core';
|
||||
|
||||
const PermissionDenied = () => {
|
||||
return (
|
||||
<EmptyState variant={ EmptyStateVariant.large } data-testid="empty-state-denied">
|
||||
<EmptyStateIcon icon={ InfoCircleIcon } />
|
||||
<Title headingLevel="h4" size="lg">
|
||||
Image Builder is not quite ready
|
||||
</Title>
|
||||
<EmptyStateBody>
|
||||
Image Builder is in early development and not ready for use yet.
|
||||
If you're interested in trying it out once it reaches beta,
|
||||
fill out your contact information in the sign up form, and we'll be in touch once it's ready.
|
||||
</EmptyStateBody>
|
||||
<Button id="beta-signup-button" variant="primary">Sign up</Button>
|
||||
</EmptyState>
|
||||
);
|
||||
};
|
||||
|
||||
export default PermissionDenied;
|
||||
Loading…
Add table
Add a link
Reference in a new issue