Sha256: 97ddda1057e4f1f89b9ca5aa4d3ae0898ad4003e3006172d7a703224218dff93

Contents?: true

Size: 1.65 KB

Versions: 40

Compression:

Stored size: 1.65 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Route, Switch, Redirect } from 'react-router-dom';

import AnsibleVariableOverrides from './AnsibleVariableOverrides';
import RolesTab from './RolesTab';
import JobsTab from './JobsTab';
import TabLayout from './TabLayout';

import WrappedAnsibleHostInventory from './AnsibleHostInventory';
import { ANSIBLE_KEY } from '../constants';
import { route } from '../helpers';

const SecondaryTabRoutes = ({ response, router, history }) => (
  <Switch ouiaId="switch">
    <Route exact path={`/${ANSIBLE_KEY}`}>
      <Redirect to={route('roles')} />
    </Route>
    <Route path={route('roles')}>
      <TabLayout>
        <RolesTab
          hostId={response.id}
          history={history}
          canEditHost={response.permissions.edit_hosts}
        />
      </TabLayout>
    </Route>
    <Route path={route('variables')}>
      <TabLayout>
        <AnsibleVariableOverrides
          hostId={response.id}
          hostAttrs={response}
          history={history}
        />
      </TabLayout>
    </Route>
    <Route path={route('inventory')}>
      <TabLayout>
        <WrappedAnsibleHostInventory hostId={response.id} />
      </TabLayout>
    </Route>
    <Route path={route('jobs')}>
      <TabLayout>
        <JobsTab
          resourceId={response.id}
          resourceName="host"
          hostGroupId={response.hostgroup_id}
          history={history}
        />
      </TabLayout>
    </Route>
  </Switch>
);

SecondaryTabRoutes.propTypes = {
  response: PropTypes.object.isRequired,
  router: PropTypes.object.isRequired,
  history: PropTypes.object.isRequired,
};

export default SecondaryTabRoutes;

Version data entries

40 entries across 40 versions & 1 rubygems

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