diff --git a/api-catalog-ui/frontend/src/components/Error/Error.jsx b/api-catalog-ui/frontend/src/components/Error/Error.jsx index 9fc657b5d2..8000f9dc35 100644 --- a/api-catalog-ui/frontend/src/components/Error/Error.jsx +++ b/api-catalog-ui/frontend/src/components/Error/Error.jsx @@ -1,5 +1,6 @@ import { Component } from 'react'; -import { Dialog, DialogBody, DialogHeader, DialogTitle, DialogFooter, DialogActions, Button, Text } from 'mineral-ui'; +import { Dialog, DialogContent, DialogContentText, DialogTitle, DialogActions, IconButton } from '@material-ui/core'; + import formatError from './ErrorFormatter'; export default class Error extends Component { @@ -10,37 +11,35 @@ export default class Error extends Component { render() { const { errors } = this.props; - const isTrue = true; - const isFalse = false; return (
{errors && errors.length > 0 && ( - 0} - > - - Error - - + 0}> + Error + {errors !== null && errors !== undefined && errors.length > 0 ? ( errors.map(error => formatError(error)) ) : ( - No Errors Found + No Errors Found )} - - - - - - + + + + Close + + )}
diff --git a/api-catalog-ui/frontend/src/components/Error/Error.test.jsx b/api-catalog-ui/frontend/src/components/Error/Error.test.jsx index 7136271946..089f20839e 100644 --- a/api-catalog-ui/frontend/src/components/Error/Error.test.jsx +++ b/api-catalog-ui/frontend/src/components/Error/Error.test.jsx @@ -10,8 +10,8 @@ describe('>>> Error component tests', () => { const errorResponse = 'Could not determine error'; const apiError = new ApiError('ABC123', 123, new MessageType(40, 'ERROR', 'E'), 'Bad stuff happened'); const wrapper = enzyme.shallow(); - expect(wrapper.find('DialogBody').exists()).toEqual(true); - expect(wrapper.find('Text').prop('children')).toBe(errorResponse); + expect(wrapper.find('[data-testid="dialog-content"]').exists()).toEqual(true); + expect(wrapper.find('[data-testid="dialog-content"]').children().text()).toBe(errorResponse); }); it('Should display the dialog and the error message for Ajax error', () => { @@ -26,8 +26,8 @@ describe('>>> Error component tests', () => { null ); const wrapper = enzyme.shallow(); - expect(wrapper.find('DialogBody').exists()).toEqual(true); - expect(wrapper.find('Text').prop('children')).toBe(errorResponse); + expect(wrapper.find('[data-testid="dialog-content"]').exists()).toEqual(true); + expect(wrapper.find('[data-testid="dialog-content"]').children().text()).toBe(errorResponse); }); it('Should not display the dialog if there are no errors', () => { diff --git a/api-catalog-ui/frontend/src/components/Error/ErrorDialog.jsx b/api-catalog-ui/frontend/src/components/Error/ErrorDialog.jsx index 254b0cf272..196a37c483 100644 --- a/api-catalog-ui/frontend/src/components/Error/ErrorDialog.jsx +++ b/api-catalog-ui/frontend/src/components/Error/ErrorDialog.jsx @@ -1,5 +1,5 @@ import { Component } from 'react'; -import { Dialog, DialogBody, DialogHeader, DialogTitle, DialogFooter, DialogActions, Button, Text } from 'mineral-ui'; +import { Dialog, DialogContent, DialogContentText, DialogTitle, DialogActions, IconButton } from '@material-ui/core'; export default class ErrorDialog extends Component { // eslint-disable-next-line react/sort-comp @@ -32,33 +32,30 @@ export default class ErrorDialog extends Component { render() { const { refreshedStaticApisError } = this.props; const refreshError = this.getCorrectRefreshMessage(refreshedStaticApisError); - const isTrue = true; - const isFalse = false; return (
{refreshedStaticApisError && (refreshedStaticApisError.status || typeof refreshedStaticApisError === 'object') && ( - - - Error - - - {refreshError} - - - - - - + + Error + + {refreshError} + + + + Close + + )}
diff --git a/api-catalog-ui/frontend/src/components/Error/ErrorDialog.test.jsx b/api-catalog-ui/frontend/src/components/Error/ErrorDialog.test.jsx index ec08806754..e423873b56 100644 --- a/api-catalog-ui/frontend/src/components/Error/ErrorDialog.test.jsx +++ b/api-catalog-ui/frontend/src/components/Error/ErrorDialog.test.jsx @@ -12,7 +12,7 @@ describe('>>> ErrorDialog component tests', () => { messageType: 'ERROR', }; const wrapper = shallow(); - expect(wrapper.find('DialogBody').exists()).toEqual(true); + expect(wrapper.find('[data-testid="dialog-content"]').exists()).toEqual(true); }); it('should not render the ErrorDialog if there is not an error while refreshing apis', () => { diff --git a/api-catalog-ui/frontend/src/components/Error/ErrorFormatter.jsx b/api-catalog-ui/frontend/src/components/Error/ErrorFormatter.jsx index c34ca6132f..c74b01dabe 100644 --- a/api-catalog-ui/frontend/src/components/Error/ErrorFormatter.jsx +++ b/api-catalog-ui/frontend/src/components/Error/ErrorFormatter.jsx @@ -1,4 +1,4 @@ -import { Text } from 'mineral-ui'; +import { Typography } from '@material-ui/core'; import renderHTML from 'react-render-html'; import uuidv4 from 'uuid/v4'; @@ -24,9 +24,9 @@ function extractAjaxError(error) { function formaHtmlError(message, color) { return ( - + {renderHTML(message)} - + ); } diff --git a/api-catalog-ui/frontend/src/components/ErrorBoundary/BigShield/BigShield.jsx b/api-catalog-ui/frontend/src/components/ErrorBoundary/BigShield/BigShield.jsx index c9a4058ef5..78a344f2c8 100644 --- a/api-catalog-ui/frontend/src/components/ErrorBoundary/BigShield/BigShield.jsx +++ b/api-catalog-ui/frontend/src/components/ErrorBoundary/BigShield/BigShield.jsx @@ -1,8 +1,7 @@ /* eslint-disable react/destructuring-assignment */ import { Component } from 'react'; -import Text from 'mineral-ui/Text'; -import { Button } from 'mineral-ui'; -import IconChevronLeft from 'mineral-ui-icons/IconChevronLeft'; +import { Typography, Button } from '@material-ui/core'; +import ArrowBackIosNewIcon from '@material-ui/icons/ArrowBackIos'; import '../../Dashboard/Dashboard.css'; import './BigShield.css'; @@ -29,7 +28,7 @@ export default class BigShield extends Component { }; render() { - const iconBack = ; + const iconBack = ; const { history } = this.props; let disableButton = true; if (history !== undefined && history !== null) { @@ -61,11 +60,11 @@ export default class BigShield extends Component { )}
- + An unexpected browser error occurred - +
- + You are seeing this page because an unexpected error occurred while rendering your page.

@@ -75,12 +74,12 @@ export default class BigShield extends Component { {!disableButton && ( You can return to the Dashboard by clicking on the button above. )} -
- + +
                                     {this.state.error.message}
                                 
-
+
@@ -90,11 +89,11 @@ export default class BigShield extends Component {
- +
                                                 {stack}
                                             
-
+
@@ -108,11 +107,11 @@ export default class BigShield extends Component {
- +
                                                 {componentStack}
                                             
-
+
diff --git a/api-catalog-ui/frontend/src/components/ErrorBoundary/Shield/Shield.jsx b/api-catalog-ui/frontend/src/components/ErrorBoundary/Shield/Shield.jsx index 030615e7f0..519d643f7d 100644 --- a/api-catalog-ui/frontend/src/components/ErrorBoundary/Shield/Shield.jsx +++ b/api-catalog-ui/frontend/src/components/ErrorBoundary/Shield/Shield.jsx @@ -1,6 +1,6 @@ /* eslint-disable react/destructuring-assignment */ import { Component } from 'react'; -import Text from 'mineral-ui/Text'; +import { Typography } from '@material-ui/core'; import '../BigShield/BigShield.css'; export default class Shield extends Component { @@ -34,11 +34,11 @@ export default class Shield extends Component {
- +
                                     {this.state.error.stack}
                                 
-
+
diff --git a/api-catalog-ui/frontend/src/components/ServiceTab/InstanceInfo.jsx b/api-catalog-ui/frontend/src/components/ServiceTab/InstanceInfo.jsx index 626182f5f5..35a132ca99 100644 --- a/api-catalog-ui/frontend/src/components/ServiceTab/InstanceInfo.jsx +++ b/api-catalog-ui/frontend/src/components/ServiceTab/InstanceInfo.jsx @@ -1,4 +1,4 @@ -import { Text, Tooltip, ThemeProvider } from 'mineral-ui'; +import { Typography, Tooltip } from '@material-ui/core'; import { Component } from 'react'; import './InstanceInfo.css'; import Shield from '../ErrorBoundary/Shield/Shield'; @@ -11,36 +11,34 @@ export default class InstanceInfo extends Component { selectedService.apiId[selectedVersion || selectedService.defaultApiVersion] || selectedService.apiId.default; return ( - - -
- - - {/* eslint-disable-next-line jsx-a11y/label-has-for */} - - {selectedService.baseUrl} - - -
-
- - - {/* eslint-disable-next-line jsx-a11y/label-has-for */} - - {apiId} - - -
-
-
+ +
+ + + {/* eslint-disable-next-line jsx-a11y/label-has-for */} + + {selectedService.baseUrl} + + +
+
+ + + {/* eslint-disable-next-line jsx-a11y/label-has-for */} + + {apiId} + + +
+
); } }