diff options
Diffstat (limited to 'server/sonar-web/src')
9 files changed, 31 insertions, 59 deletions
diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index 232a9fa9722..29a6a0ceb67 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -32,7 +32,7 @@ import AdminContext, { defaultPendingPlugins, defaultSystemStatus } from './Admi 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; } @@ -109,7 +109,7 @@ export class AdminContainer extends React.PureComponent<Props, State> { }; render() { - const { adminPages, organizationsEnabled } = this.props.appState; + const { adminPages } = this.props.appState; // Check that the adminPages are loaded if (!adminPages) { @@ -127,7 +127,6 @@ export class AdminContainer extends React.PureComponent<Props, State> { fetchPendingPlugins={this.fetchPendingPlugins} fetchSystemStatus={this.fetchSystemStatus} location={this.props.location} - organizationsEnabled={organizationsEnabled} pendingPlugins={pendingPlugins} systemStatus={systemStatus} /> diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index 02ac49bfea0..e32bd7bf28a 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -32,11 +32,7 @@ import { 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'; @@ -47,7 +43,6 @@ import ComponentNav from './nav/component/ComponentNav'; 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; @@ -379,6 +374,6 @@ export class ComponentContainer extends React.PureComponent<Props, State> { } } -const mapDispatchToProps = { fetchOrganization, registerBranchStatus, requireAuthorization }; +const mapDispatchToProps = { registerBranchStatus, requireAuthorization }; export default withRouter(connect(null, mapDispatchToProps)(ComponentContainer)); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx index 803e3a4d186..47d8301038e 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx @@ -32,8 +32,7 @@ function shallowRender(props: Partial<AdminContainer['props']> = {}) { <AdminContainer appState={{ adminPages: [{ key: 'foo', name: 'Foo' }], - canAdmin: true, - organizationsEnabled: false + canAdmin: true }} location={mockLocation()} setAdminPages={jest.fn()} diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx index 36bebb2c835..a06fc57eee2 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx @@ -121,7 +121,7 @@ it('updates branches on change', async () => { it('fetches status', async () => { (getComponentData as jest.Mock<any>).mockResolvedValueOnce({ - component: { organization: 'org' } + component: {} }); shallowRender(); @@ -293,7 +293,6 @@ it('should correctly reload last task warnings if anything got dismissed', async function shallowRender(props: Partial<ComponentContainer['props']> = {}) { return shallow<ComponentContainer>( <ComponentContainer - fetchOrganization={jest.fn()} location={mockLocation({ query: { id: 'foo' } })} registerBranchStatus={jest.fn()} requireAuthorization={jest.fn()} diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap index c7a5276bf45..e4af05833b4 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AdminContainer-test.tsx.snap @@ -30,7 +30,6 @@ exports[`should render correctly 1`] = ` "state": Object {}, } } - organizationsEnabled={false} pendingPlugins={ Object { "installing": Array [], diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx index 5bbda188e0e..b6b5912db04 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.tsx @@ -36,7 +36,6 @@ interface Props { fetchPendingPlugins: () => void; fetchSystemStatus: () => void; location: {}; - organizationsEnabled?: boolean; pendingPlugins: PendingPluginResult; systemStatus: T.SysStatus; } @@ -87,7 +86,6 @@ export default class SettingsNav extends React.PureComponent<Props> { }; renderConfigurationTab() { - const { organizationsEnabled } = this.props; const extensionsWithoutSupport = this.props.extensions.filter( extension => extension.key !== 'license/support' ); @@ -110,13 +108,11 @@ export default class SettingsNav extends React.PureComponent<Props> { {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> } @@ -146,18 +142,15 @@ export default class SettingsNav extends React.PureComponent<Props> { } 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')} @@ -182,7 +175,6 @@ export default class SettingsNav extends React.PureComponent<Props> { } renderSecurityTab() { - const { organizationsEnabled } = this.props; return ( <Dropdown overlay={ @@ -192,27 +184,21 @@ export default class SettingsNav extends React.PureComponent<Props> { {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"> diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx index ae23f2088ac..49fc38aa205 100644 --- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/SettingsNav-test.tsx @@ -29,7 +29,6 @@ it('should work with extensions', () => { it('should display a pending plugin notif', () => { const wrapper = shallowRender({ - organizationsEnabled: false, pendingPlugins: { installing: [ { @@ -58,7 +57,6 @@ function shallowRender(props: Partial<SettingsNav['props']> = {}) { fetchPendingPlugins={jest.fn()} fetchSystemStatus={jest.fn()} location={{}} - organizationsEnabled={false} pendingPlugins={{ installing: [], removing: [], updating: [] }} systemStatus="UP" {...props} diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx index 9951d9473f2..c1c069d13fe 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/App-test.tsx @@ -30,7 +30,6 @@ const component = { analysisDate: '2016-01-01', breadcrumbs: [], name: 'Foo', - organization: 'org', qualifier: 'TRK', version: '0.0.1' }; diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx index c87551e1ca3..76d80bb2450 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/Projects-test.tsx @@ -21,7 +21,6 @@ import { shallow } from 'enzyme'; 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' } @@ -56,7 +55,6 @@ function shallowRender(props?: any) { currentUser={{ login: 'foo' }} onProjectDeselected={jest.fn()} onProjectSelected={jest.fn()} - organization={organization} selection={[]} {...props} /> |