Skip to content

Commit

Permalink
address comments, i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlog committed Jun 16, 2020
1 parent 9a1f17c commit af11a72
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {

const policyStatusClickHandler = useNavigateByRouterEventHandler(policyResponseRoutePath);

const [policyDetailsUri, policyDetailsRoutePath] = useMemo(() => {
const [policyDetailsRoutePath, policyDetailsRouteUrl] = useMemo(() => {
return [
getManagementUrl({
name: 'policyDetails',
Expand All @@ -107,7 +107,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {
];
}, [details.endpoint.policy.applied.id]);

const policyDetailsClickHandler = useNavigateByRouterEventHandler(policyDetailsUri);
const policyDetailsClickHandler = useNavigateByRouterEventHandler(policyDetailsRoutePath);

const detailsResultsPolicy = useMemo(() => {
return [
Expand All @@ -120,7 +120,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {
{/* eslint-disable-next-line @elastic/eui/href-or-on-click */}
<EuiLink
data-test-subj="policyDetailsValue"
href={policyDetailsRoutePath}
href={policyDetailsRouteUrl}
onClick={policyDetailsClickHandler}
>
{details.endpoint.policy.applied.name}
Expand Down Expand Up @@ -160,7 +160,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => {
policyResponseUri,
policyStatus,
policyStatusClickHandler,
policyDetailsRoutePath,
policyDetailsRouteUrl,
policyDetailsClickHandler,
]);
const detailsResultsLower = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';
import { HostStatus, HostPolicyResponseActionStatus } from '../../../../../common/endpoint/types';

export const HOST_STATUS_TO_HEALTH_COLOR = Object.freeze<
Expand All @@ -27,7 +28,13 @@ export const POLICY_STATUS_TO_HEALTH_COLOR = Object.freeze<
export const POLICY_STATUS_TO_TEXT = Object.freeze<
{ [key in keyof typeof HostPolicyResponseActionStatus]: string }
>({
success: 'Success',
warning: 'Warning',
failure: 'Failure',
success: i18n.translate('xpack.securitySolution.policyStatusText.success', {
defaultMessage: 'Success',
}),
warning: i18n.translate('xpack.securitySolution.policyStatusText.warning', {
defaultMessage: 'Warning',
}),
failure: i18n.translate('xpack.securitySolution.policyStatusText.failure', {
defaultMessage: 'Failure',
}),
});

0 comments on commit af11a72

Please sign in to comment.