-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 57813-table
- Loading branch information
Showing
23 changed files
with
533 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Unit } from '@elastic/datemath'; | ||
import moment from 'moment'; | ||
|
||
export const roundTimestamp = (timestamp: number, unit: Unit) => { | ||
const floor = moment(timestamp).startOf(unit).valueOf(); | ||
const ceil = moment(timestamp).add(1, unit).startOf(unit).valueOf(); | ||
if (Math.abs(timestamp - floor) <= Math.abs(timestamp - ceil)) return floor; | ||
return ceil; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { NewPackageConfig, PackageConfig } from './types/models/package_config'; | ||
|
||
export const createNewPackageConfigMock = () => { | ||
return { | ||
name: 'endpoint-1', | ||
description: '', | ||
namespace: 'default', | ||
enabled: true, | ||
config_id: '93c46720-c217-11ea-9906-b5b8a21b268e', | ||
output_id: '', | ||
package: { | ||
name: 'endpoint', | ||
title: 'Elastic Endpoint', | ||
version: '0.9.0', | ||
}, | ||
inputs: [], | ||
} as NewPackageConfig; | ||
}; | ||
|
||
export const createPackageConfigMock = () => { | ||
const newPackageConfig = createNewPackageConfigMock(); | ||
return { | ||
...newPackageConfig, | ||
id: 'c6d16e42-c32d-4dce-8a88-113cfe276ad1', | ||
version: 'abcd', | ||
revision: 1, | ||
updated_at: '2020-06-25T16:03:38.159292', | ||
updated_by: 'kibana', | ||
created_at: '2020-06-25T16:03:38.159292', | ||
created_by: 'kibana', | ||
inputs: [ | ||
{ | ||
config: {}, | ||
}, | ||
], | ||
} as PackageConfig; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.