Skip to content

Commit

Permalink
remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
parkiino committed Jun 12, 2020
1 parent 71d9056 commit 0eaefa7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { GetPackagesResponse } from '../../../../../../ingest_manager/common';
import { HostResultList } from '../../../../../common/endpoint/types';
import { ImmutableMiddlewareFactory } from '../../../../common/store';
import { isOnHostPage, hasSelectedHost, uiQueryParams, listData } from './selectors';
import { HostState } from '../types';
import { sendGetSecurityPackages } from '../../policy/store/policy_list/services/ingest';

export const hostMiddlewareFactory: ImmutableMiddlewareFactory<HostState> = (coreStart) => {
const http = coreStart.http;
return ({ getState, dispatch }) => (next) => async (action) => {
next(action);
const state = getState();
Expand Down Expand Up @@ -94,27 +91,6 @@ export const hostMiddlewareFactory: ImmutableMiddlewareFactory<HostState> = (cor
payload: error,
});
}

// call the policy package api
let endpointPackageInfo: GetPackagesResponse['response'][0] | undefined;
try {
const securityPackages: GetPackagesResponse = await sendGetSecurityPackages(http);
endpointPackageInfo = securityPackages.response.find(
(epmPackage) => epmPackage.name === 'endpoint'
);
if (!endpointPackageInfo) {
throw new Error('Endpoint package was not found.');
}
dispatch({
type: 'serverReturnedEndpointPackageVersion',
payload: endpointPackageInfo.version,
});
} catch (error) {
dispatch({
type: 'serverFailedToReturnEndpointPackageVersion',
payload: error,
});
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ const HostIds = styled(EuiListGroupItem)`

const LinkToExternalApp = styled.div`
margin-top: ${(props) => props.theme.eui.ruleMargins.marginMedium};
.hostDetailsLinkToExternalApp {
.linkToAppIcon {
margin-right: ${(props) => props.theme.eui.ruleMargins.marginXSmall};
}
.linkToAppPopoutIcon {
margin-left: ${(props) => props.theme.eui.ruleMargins.marginXSmall};
}
.linkToAppIcon {
margin-right: ${(props) => props.theme.eui.ruleMargins.marginXSmall};
}
.linkToAppPopoutIcon {
margin-left: ${(props) => props.theme.eui.ruleMargins.marginXSmall};
}
`;

Expand Down Expand Up @@ -176,7 +174,6 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {
/>
<LinkToExternalApp>
<LinkToApp
className="hostDetailsLinkToExternalApp"
appId={ingestAppId}
appPath={ingestAppPath}
href={ingestUrl}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
GetDatasourcesRequest,
GetAgentStatusResponse,
DATASOURCE_SAVED_OBJECT_TYPE,
GetPackagesResponse,
} from '../../../../../../../../ingest_manager/common';
import { GetPolicyListResponse, GetPolicyResponse, UpdatePolicyResponse } from '../../../types';
import { NewPolicyData } from '../../../../../../../common/endpoint/types';
Expand All @@ -18,7 +17,6 @@ const INGEST_API_ROOT = `/api/ingest_manager`;
export const INGEST_API_DATASOURCES = `${INGEST_API_ROOT}/datasources`;
const INGEST_API_FLEET = `${INGEST_API_ROOT}/fleet`;
const INGEST_API_FLEET_AGENT_STATUS = `${INGEST_API_FLEET}/agent-status`;
const INGEST_API_EPM_PACKAGES = `${INGEST_API_ROOT}/epm/packages`;

/**
* Retrieves a list of endpoint specific datasources (those created with a `package.name` of
Expand Down Expand Up @@ -95,11 +93,3 @@ export const sendGetFleetAgentStatusForConfig = (
},
});
};

/**
* Get all security EPM packages
*/
export const sendGetSecurityPackages = (http: HttpStart) => {
const options = { query: { category: 'security' } };
return http.get<GetPackagesResponse>(`${INGEST_API_EPM_PACKAGES}`, options);
};

0 comments on commit 0eaefa7

Please sign in to comment.