Skip to content

Commit

Permalink
remove things not or not yet needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mattapperson committed Jul 23, 2019
1 parent 4c4a09b commit 8b6320f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 69 deletions.
2 changes: 2 additions & 0 deletions x-pack/legacy/plugins/fleet/common/types/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
*/

export type FlatObject<T> = { [Key in keyof T]: string };
export type RendererResult = React.ReactElement<any> | null;
export type RendererFunction<RenderArgs, Result = RendererResult> = (args: RenderArgs) => Result;
3 changes: 1 addition & 2 deletions x-pack/legacy/plugins/fleet/public/hooks/with_url_state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import { parse, stringify } from 'querystring';
import React from 'react';
import { withRouter } from 'react-router-dom';
import { FlatObject } from '../frontend_types';
import { RendererFunction } from '../utils/typed_react';
import { FlatObject, RendererFunction } from '../../common/types/helpers';

type StateCallback<T> = (previousState: T) => T;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/fleet/public/lib/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ElasticsearchLib {
});
}

return hiddenFieldsCheck.reduce((isvalid, field) => {
return hiddenFieldsCheck.reduce((isvalid: boolean, field) => {
if (!isvalid) {
return false;
}
Expand Down
16 changes: 1 addition & 15 deletions x-pack/legacy/plugins/fleet/public/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { get } from 'lodash';
import React, { Component } from 'react';
import { Redirect, Route, Switch } from 'react-router-dom';
import { REQUIRED_ROLES } from '../common/constants/security';
import { Loading } from './components/loading';
import { ChildRoutes } from './components/navigation/child_routes';
import { URLStateProps, WithURLState } from './hooks/with_url_state';
Expand Down Expand Up @@ -59,19 +58,6 @@ export class AppRoutes extends Component<RouterProps, RouterState> {
/>
)}

{/* Make sure the user has correct permissions */}
{!this.props.libs.framework.currentUserHasOneOfRoles(
REQUIRED_ROLES.concat(this.props.libs.framework.info.settings.defaultUserRoles)
) && (
<Route
render={props =>
!props.location.pathname.includes('/error') ? (
<Redirect to="/error/no_access" />
) : null
}
/>
)}

{/* This app does not make use of a homepage. The mainpage is overview/enrolled_agents */}
<Route path="/" exact={true} render={() => <Redirect to="/overview/enrolled_agents" />} />
</Switch>
Expand All @@ -80,7 +66,7 @@ export class AppRoutes extends Component<RouterProps, RouterState> {
<WithURLState>
{(URLProps: URLStateProps) => (
<ChildRoutes
routes={routeMap}
routes={[]}
{...URLProps}
{...{
libs: this.props.libs,
Expand Down
51 changes: 0 additions & 51 deletions x-pack/legacy/plugins/ingest/server/libs/compose/testing.ts

This file was deleted.

0 comments on commit 8b6320f

Please sign in to comment.