import SettingsNav from './nav/settings/SettingsNav';
interface Props {
- appState: Pick<T.AppState, 'adminPages' | 'canAdmin' | 'organizationsEnabled'>;
+ appState: Pick<T.AppState, 'adminPages' | 'canAdmin'>;
location: {};
setAdminPages: (adminPages: T.Extension[]) => void;
}
};
render() {
- const { adminPages, organizationsEnabled } = this.props.appState;
+ const { adminPages } = this.props.appState;
// Check that the adminPages are loaded
if (!adminPages) {
fetchPendingPlugins={this.fetchPendingPlugins}
fetchSystemStatus={this.fetchSystemStatus}
location={this.props.location}
- organizationsEnabled={organizationsEnabled}
pendingPlugins={pendingPlugins}
systemStatus={systemStatus}
/>
isPullRequest
} from '../../helpers/branch-like';
import { getPortfolioUrl } from '../../helpers/urls';
-import {
- fetchOrganization,
- registerBranchStatus,
- requireAuthorization
-} from '../../store/rootActions';
+import { registerBranchStatus, requireAuthorization } from '../../store/rootActions';
import { BranchLike } from '../../types/branch-like';
import { isPortfolioLike } from '../../types/component';
import { Task, TaskStatuses, TaskWarning } from '../../types/tasks';
interface Props {
children: React.ReactElement;
- fetchOrganization: (organization: string) => void;
location: Pick<Location, 'query' | 'pathname'>;
registerBranchStatus: (branchLike: BranchLike, component: string, status: T.Status) => void;
requireAuthorization: (router: Pick<Router, 'replace'>) => void;
}
}
-const mapDispatchToProps = { fetchOrganization, registerBranchStatus, requireAuthorization };
+const mapDispatchToProps = { registerBranchStatus, requireAuthorization };
export default withRouter(connect(null, mapDispatchToProps)(ComponentContainer));
<AdminContainer
appState={{
adminPages: [{ key: 'foo', name: 'Foo' }],
- canAdmin: true,
- organizationsEnabled: false
+ canAdmin: true
}}
location={mockLocation()}
setAdminPages={jest.fn()}
it('fetches status', async () => {
(getComponentData as jest.Mock<any>).mockResolvedValueOnce({
- component: { organization: 'org' }
+ component: {}
});
shallowRender();
function shallowRender(props: Partial<ComponentContainer['props']> = {}) {
return shallow<ComponentContainer>(
<ComponentContainer
- fetchOrganization={jest.fn()}
location={mockLocation({ query: { id: 'foo' } })}
registerBranchStatus={jest.fn()}
requireAuthorization={jest.fn()}
"state": Object {},
}
}
- organizationsEnabled={false}
pendingPlugins={
Object {
"installing": Array [],
fetchPendingPlugins: () => void;
fetchSystemStatus: () => void;
location: {};
- organizationsEnabled?: boolean;
pendingPlugins: PendingPluginResult;
systemStatus: T.SysStatus;
}
};
renderConfigurationTab() {
- const { organizationsEnabled } = this.props;
const extensionsWithoutSupport = this.props.extensions.filter(
extension => extension.key !== 'license/support'
);
{translate('custom_metrics.page')}
</IndexLink>
</li>
- {!organizationsEnabled && (
- <li>
- <IndexLink activeClassName="active" to="/admin/webhooks">
- {translate('webhooks.page')}
- </IndexLink>
- </li>
- )}
+ <li>
+ <IndexLink activeClassName="active" to="/admin/webhooks">
+ {translate('webhooks.page')}
+ </IndexLink>
+ </li>
{extensionsWithoutSupport.map(this.renderExtension)}
</ul>
}
}
renderProjectsTab() {
- const { organizationsEnabled } = this.props;
return (
<Dropdown
overlay={
<ul className="menu">
- {!organizationsEnabled && (
- <li>
- <IndexLink activeClassName="active" to="/admin/projects_management">
- {translate('management')}
- </IndexLink>
- </li>
- )}
+ <li>
+ <IndexLink activeClassName="active" to="/admin/projects_management">
+ {translate('management')}
+ </IndexLink>
+ </li>
<li>
<IndexLink activeClassName="active" to="/admin/background_tasks">
{translate('background_tasks.page')}
}
renderSecurityTab() {
- const { organizationsEnabled } = this.props;
return (
<Dropdown
overlay={
{translate('users.page')}
</IndexLink>
</li>
- {!organizationsEnabled && (
- <li>
- <IndexLink activeClassName="active" to="/admin/groups">
- {translate('user_groups.page')}
- </IndexLink>
- </li>
- )}
- {!organizationsEnabled && (
- <li>
- <IndexLink activeClassName="active" to="/admin/permissions">
- {translate('global_permissions.page')}
- </IndexLink>
- </li>
- )}
- {!organizationsEnabled && (
- <li>
- <IndexLink activeClassName="active" to="/admin/permission_templates">
- {translate('permission_templates')}
- </IndexLink>
- </li>
- )}
+ <li>
+ <IndexLink activeClassName="active" to="/admin/groups">
+ {translate('user_groups.page')}
+ </IndexLink>
+ </li>
+ <li>
+ <IndexLink activeClassName="active" to="/admin/permissions">
+ {translate('global_permissions.page')}
+ </IndexLink>
+ </li>
+ <li>
+ <IndexLink activeClassName="active" to="/admin/permission_templates">
+ {translate('permission_templates')}
+ </IndexLink>
+ </li>
</ul>
}
tagName="li">
it('should display a pending plugin notif', () => {
const wrapper = shallowRender({
- organizationsEnabled: false,
pendingPlugins: {
installing: [
{
fetchPendingPlugins={jest.fn()}
fetchSystemStatus={jest.fn()}
location={{}}
- organizationsEnabled={false}
pendingPlugins={{ installing: [], removing: [], updating: [] }}
systemStatus="UP"
{...props}
analysisDate: '2016-01-01',
breadcrumbs: [],
name: 'Foo',
- organization: 'org',
qualifier: 'TRK',
version: '0.0.1'
};
import * as React from 'react';
import Projects from '../Projects';
-const organization = { key: 'org', name: 'org', projectVisibility: 'public' };
const projects = [
{ key: 'a', name: 'A', qualifier: 'TRK', visibility: 'public' },
{ key: 'b', name: 'B', qualifier: 'TRK', visibility: 'public' }
currentUser={{ login: 'foo' }}
onProjectDeselected={jest.fn()}
onProjectSelected={jest.fn()}
- organization={organization}
selection={[]}
{...props}
/>