Skip to content
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

Use terms aggs instead of composite refactor of Authentications Table based on feedback #29283

Merged

Conversation

FrankHassanabad
Copy link
Contributor

@FrankHassanabad FrankHassanabad commented Jan 24, 2019

  • Made it sort by desc of number of failures
  • Reduced type usages where possible to ECS based types
  • Added newer fields to the Authentications based on feedback which is based on last success and last failure.
  • Removed the upperLimit from uncommon process and refactored to be the same terms patter that Authentications is using
  • Fixed the bug with uncommon process where it could not re-limit its self back to 5 rows if you expanded it.
  • Added a new extendMap for ECS mapping fields to make things easier
  • Replaced ares where unit tests as it( in favor of test(
  • Added a escapeDataProviderId and consolidated code to use that
  • Replaced Types that were incorrect in areas from functions to ActionCreator
  • Pushed up higher the Types of Edges in the code to remove less boilerplate
  • Introduced a few functions and unit tests to reduce boiler plate in a few areas
  • Made all appropriate cells of AuthenticationTable draggable
  • Replaced areas that use moment().valueOf() for Date.now() as it's more semantic and we can remove moment where that's all we were using it for.
  • Added unit tests for all the above or refactored existing unit tests.
  • https://github.com/elastic/ingest-dev/issues/218

After:
after

After in dark mode where other columns are draggable:
other-columns-draggable

Before:
before

@elasticmachine
Copy link
Contributor

Pinging @elastic/secops

@elasticmachine

This comment has been minimized.

@andrew-goldstein

This comment has been minimized.

  * Made it sort by desc of number of failures
  * Reduced type usages where possible to Ecs based types
  * Added newer fields to the Authentications based on feedback
@elasticmachine

This comment has been minimized.

@@ -204,7 +205,7 @@ describe('Flyout', () => {
});

test('should call the onOpen when the mouse is clicked for rendering', () => {
const showTimeline = jest.fn();
const showTimeline = (jest.fn() as unknown) as ActionCreator<{ id: string; show: boolean }>;
Copy link
Contributor Author

@FrankHassanabad FrankHassanabad Jan 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: with stricter types using ActionCreator, jest.fn() needs me to use this ugly casting to work? If there's another way I would like to know.

@@ -234,7 +235,7 @@ describe('Flyout', () => {
const stateShowIsTrue = set('local.timeline.timelineById.test.show', true, state);
const storeShowIsTrue = createStore(stateShowIsTrue);

const showTimeline = jest.fn();
const showTimeline = (jest.fn() as unknown) as ActionCreator<{ id: string; show: boolean }>;
Copy link
Contributor Author

@FrankHassanabad FrankHassanabad Jan 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: with stricter types using ActionCreator, jest.fn() needs me to use this ugly casting to work? If there's another way I would like to know.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

},
queryDate: {
from: startDate,
to: moment().valueOf(),
to: Date.now(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this a few other places (like in HostsTable), but what's the intent of using the current time for queryDate.to? Why would this not be the to value of the GlobalTime component that sets the time constraints for the widget itself?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be constrained to the global date time. The Date.now() kind of shows the bug more clearly it looks like.

<DraggableWrapper
dataProvider={{
and: [],
enabled: true,
id: node._id!,
id: escapeDataProviderId(`events-table-${node._id!}-hostName-${hostName}`),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much appreciated!

<DraggableWrapper
dataProvider={{
and: [],
enabled: true,
excluded: false,
id: node._id!,
id: escapeDataProviderId(`hosts-table-${node._id!}-hostName-${hostName}`),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding this

Copy link
Contributor

@andrew-goldstein andrew-goldstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The additional query capabilities in the form of draggable content to the timeline, fixes to make provider IDs globally unique, and type safety in this PR are all appreciated @FrankHassanabad !

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Echoing Andrew -- the type cleanup (especially in regards to ActionCreator) is greatly appreciated. As well with the introduction of escapeDataProviderId() for dataprovider id generation -- will use this going forward. LGTM!

@FrankHassanabad FrankHassanabad merged commit 43b02a3 into elastic:feature-secops Jan 28, 2019
@FrankHassanabad FrankHassanabad deleted the use-terms-aggs branch January 28, 2019 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
loe:medium Medium Level of Effort Team:SIEM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants