Sha256: 53771d5edfe3d94dd8e768bc9b102bc0d13fc00e44f53981785a0e1252ef0f19

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

import PropTypes from 'prop-types';
import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
import { translate as __ } from 'foremanReact/common/I18n';
import { route } from './helpers';
import EmptyPage from './SubTabs/EmptyPage';
import Reports from './SubTabs/Reports';
import ENCPreview from './SubTabs/ENCPreview';

const SecondaryTabRoutes = ({ hostName, hostInfo, status }) => (
  <Switch>
    <Route path={route('reports')}>
      <Reports hostName={hostName} hostInfo={hostInfo} status={status} />
    </Route>
    <Route path={route('assigned')}>
      <EmptyPage
        header={__('Assigned classes')}
        description={__('This tab is still a work in progress')}
      />
    </Route>
    <Route path={route('smart-classes')}>
      <EmptyPage
        header={__('Smart class parameters')}
        description={__('This tab is still a work in progress')}
      />
    </Route>
    <Route path={route('yaml')}>
      <ENCPreview hostName={hostName} />
    </Route>
    <Redirect to={route('reports')} />
  </Switch>
);

SecondaryTabRoutes.propTypes = {
  hostName: PropTypes.string,
  hostInfo: PropTypes.object,
  status: PropTypes.string,
};

SecondaryTabRoutes.defaultProps = {
  hostName: '',
  hostInfo: {},
  status: undefined,
};

export default SecondaryTabRoutes;

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_puppet-4.1.1 webpack/src/Extends/Host/PuppetTab/Routes.js
foreman_puppet-4.1.0 webpack/src/Extends/Host/PuppetTab/Routes.js
foreman_puppet-4.0.4 webpack/src/Extends/Host/PuppetTab/Routes.js
foreman_puppet-4.0.3 webpack/src/Extends/Host/PuppetTab/Routes.js
foreman_puppet-4.0.2 webpack/src/Extends/Host/PuppetTab/Routes.js