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-10.2.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-10.1.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-10.0.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-10.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.1.4 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-9.0.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.1.3 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-9.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.1.2 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.1.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-8.0.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-8.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.0.4 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.1.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.0.3 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.0.2 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.0.1 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-7.0.0 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-6.3.4 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js
foreman_ansible-6.3.3 webpack/components/AnsibleRolesSwitcher/components/AnsibleRolesSwitcherError.js