-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] [Endpoint] Add endpoint details activity log #99795
Changes from all commits
c26a7d4
b8fba34
a2eb777
24d392f
62e38fe
b6aa967
21fe79e
2dd22ed
567af29
13e8963
46c187d
691b90a
3859af9
3722552
923a157
c5ade7b
0f08908
f760aca
72c7b77
f2dd6cc
eb5f67e
fd390c8
f9b95b9
299dc91
0d907f8
1c54aaa
e38e202
31cf7af
33f7d0b
8d46a98
a77204e
8fb56f5
6a2cace
453d034
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,14 @@ | |
import React from 'react'; | ||
import { FormattedDate, FormattedTime, FormattedRelative } from '@kbn/i18n/react'; | ||
|
||
export const FormattedDateAndTime: React.FC<{ date: Date }> = ({ date }) => { | ||
export const FormattedDateAndTime: React.FC<{ date: Date; showRelativeTime?: boolean }> = ({ | ||
date, | ||
showRelativeTime = false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add the new prop? do you want relative time to always be shown? if so, you might just want to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see what you mean. I guess I misunderstood you earlier. I assumed that we always want to show relative time. At least that's what it looked like in the mocks. This UX is still going to be worked on more in subsequent PRs. So we've time to make this slicker. 🙏 |
||
}) => { | ||
// If date is greater than or equal to 1h (ago), then show it as a date | ||
// and if showRelativeTime is false | ||
// else, show it as relative to "now" | ||
return Date.now() - date.getTime() >= 3.6e6 ? ( | ||
return Date.now() - date.getTime() >= 3.6e6 && !showRelativeTime ? ( | ||
<> | ||
<FormattedDate value={date} year="numeric" month="short" day="2-digit" /> | ||
{' @'} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { Immutable } from '../../../../../common/endpoint/types'; | ||
import { DEFAULT_POLL_INTERVAL } from '../../../common/constants'; | ||
import { createUninitialisedResourceState } from '../../../state'; | ||
import { EndpointState } from '../types'; | ||
|
||
export const initialEndpointPageState = (): Immutable<EndpointState> => { | ||
return { | ||
hosts: [], | ||
pageSize: 10, | ||
pageIndex: 0, | ||
total: 0, | ||
loading: false, | ||
error: undefined, | ||
endpointDetails: { | ||
activityLog: createUninitialisedResourceState(), | ||
hostDetails: { | ||
details: undefined, | ||
detailsLoading: false, | ||
detailsError: undefined, | ||
}, | ||
}, | ||
policyResponse: undefined, | ||
policyResponseLoading: false, | ||
policyResponseError: undefined, | ||
location: undefined, | ||
policyItems: [], | ||
selectedPolicyId: undefined, | ||
policyItemsLoading: false, | ||
endpointPackageInfo: undefined, | ||
nonExistingPolicies: {}, | ||
agentPolicies: {}, | ||
endpointsExist: true, | ||
patterns: [], | ||
patternsError: undefined, | ||
isAutoRefreshEnabled: true, | ||
autoRefreshInterval: DEFAULT_POLL_INTERVAL, | ||
agentsWithEndpointsTotal: 0, | ||
agentsWithEndpointsTotalError: undefined, | ||
endpointsTotal: 0, | ||
endpointsTotalError: undefined, | ||
queryStrategyVersion: undefined, | ||
policyVersionInfo: undefined, | ||
hostStatus: undefined, | ||
isolationRequestState: createUninitialisedResourceState(), | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can either leave this off this PR until we add the query definition, or at least add a comment saying this is for yet-to-come pagination query params