Sha256: eed396f09c1537a0d25b94c3645b304c15a7c306a53594e012b450e01aea45f6

Contents?: true

Size: 705 Bytes

Versions: 99

Compression:

Stored size: 705 Bytes

Contents

import React from 'react';
import { Col, Alert } from 'patternfly-react';
import PropTypes from 'prop-types';

const ErrorMsg = ({ error }) => {
  const status = error.statusText ? `${error.statusText}: ` : '';
  return `${status}${error.errorMsg}`;
};

const AnsibleRolesSwitcherError = ({ error }) =>
  error && error.errorMsg ? (
    <Col sm={12}>
      <Alert type="error">
        <ErrorMsg error={error} />
      </Alert>
    </Col>
  ) : (
    ''
  );

AnsibleRolesSwitcherError.propTypes = {
  error: PropTypes.shape({
    errorMsg: PropTypes.string,
    statusText: PropTypes.string,
  }),
};

AnsibleRolesSwitcherError.defaultProps = {
  error: {},
};

export default AnsibleRolesSwitcherError;

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
foreman_ansible-15.0.2 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-15.0.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-15.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-14.2.2 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-14.2.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.7 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-14.2.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-14.1.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-14.1.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.5 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-14.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.4 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.3 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.2 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-13.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-12.0.7 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-10.4.4 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.1.8 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-12.0.6 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js