mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Update moment related packages (#46849)
* Update moment related packages * unify moment version in yarn.lock * adapt ro pluralization fixes * update some bad pluralization in fixtures/snapshots
This commit is contained in:
parent
6d23793489
commit
5b375df8e9
13 changed files with 52 additions and 67 deletions
|
@ -198,8 +198,8 @@
|
|||
"markdown-it": "^8.4.1",
|
||||
"mini-css-extract-plugin": "0.8.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"moment": "^2.20.1",
|
||||
"moment-timezone": "^0.5.14",
|
||||
"moment": "^2.24.0",
|
||||
"moment-timezone": "^0.5.27",
|
||||
"mustache": "2.3.2",
|
||||
"ngreact": "0.5.1",
|
||||
"node-fetch": "1.7.3",
|
||||
|
@ -320,7 +320,7 @@
|
|||
"@types/markdown-it": "^0.0.7",
|
||||
"@types/minimatch": "^2.0.29",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/moment-timezone": "^0.5.8",
|
||||
"@types/moment-timezone": "^0.5.12",
|
||||
"@types/mustache": "^0.8.31",
|
||||
"@types/node": "^10.12.27",
|
||||
"@types/opn": "^5.1.0",
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
"@babel/cli": "^7.5.5",
|
||||
"@babel/preset-env": "^7.5.5",
|
||||
"babel-plugin-add-module-exports": "^1.0.2",
|
||||
"moment": "^2.13.0"
|
||||
"moment": "^2.24.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^1.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"moment": "^2.13.0"
|
||||
"moment": "^2.24.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"joi": "^13.5.2",
|
||||
"moment": "^2.20.1",
|
||||
"moment": "^2.24.0",
|
||||
"type-detect": "^4.0.8"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"execa": "^3.2.0",
|
||||
"exit-hook": "^2.2.0",
|
||||
"getopts": "^2.2.5",
|
||||
"moment": "^2.20.1",
|
||||
"moment": "^2.24.0",
|
||||
"rxjs": "^6.2.1",
|
||||
"tree-kill": "^1.2.1",
|
||||
"tslib": "^1.9.3"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"lodash": "npm:@elastic/lodash@3.10.1-kibana3",
|
||||
"moment-timezone": "^0.5.14",
|
||||
"moment-timezone": "^0.5.27",
|
||||
"@kbn/i18n": "1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
"imports-loader": "^0.8.0",
|
||||
"jquery": "^3.4.1",
|
||||
"keymirror": "0.1.1",
|
||||
"moment": "^2.20.1",
|
||||
"moment": "^2.24.0",
|
||||
"node-sass": "^4.9.4",
|
||||
"postcss": "^7.0.5",
|
||||
"postcss-loader": "^3.0.0",
|
||||
|
|
|
@ -23,22 +23,22 @@ describe('formatTimestampToDuration', () => {
|
|||
expect(formatTimestampToDuration(fiftyNineSeconds, CALCULATE_DURATION_SINCE, getTestTime())).to.be('59 seconds');
|
||||
|
||||
const fiveMins = getTestTime().subtract(5, 'minutes').subtract(30, 'seconds');
|
||||
expect(formatTimestampToDuration(fiveMins, CALCULATE_DURATION_SINCE, getTestTime())).to.be('5 min');
|
||||
expect(formatTimestampToDuration(fiveMins, CALCULATE_DURATION_SINCE, getTestTime())).to.be('6 mins');
|
||||
|
||||
const sixHours = getTestTime().subtract(6, 'hours').subtract(30, 'minutes');
|
||||
expect(formatTimestampToDuration(sixHours, CALCULATE_DURATION_SINCE, getTestTime())).to.be('6 hrs 30 min');
|
||||
expect(formatTimestampToDuration(sixHours, CALCULATE_DURATION_SINCE, getTestTime())).to.be('6 hrs 30 mins');
|
||||
|
||||
const sevenDays = getTestTime().subtract(7, 'days').subtract(6, 'hours').subtract(18, 'minutes');
|
||||
expect(formatTimestampToDuration(sevenDays, CALCULATE_DURATION_SINCE, getTestTime())).to.be('7 days 6 hrs 18 min');
|
||||
expect(formatTimestampToDuration(sevenDays, CALCULATE_DURATION_SINCE, getTestTime())).to.be('7 days 6 hrs 18 mins');
|
||||
|
||||
const eightWeeks = getTestTime().subtract(8, 'weeks').subtract(7, 'days').subtract(6, 'hours').subtract(18, 'minutes');
|
||||
expect(formatTimestampToDuration(eightWeeks, CALCULATE_DURATION_SINCE, getTestTime())).to.be('2 months 2 days');
|
||||
|
||||
const oneHour = getTestTime().subtract(1, 'hour'); // should trim 0 min
|
||||
expect(formatTimestampToDuration(oneHour, CALCULATE_DURATION_SINCE, getTestTime())).to.be('1 hrs');
|
||||
expect(formatTimestampToDuration(oneHour, CALCULATE_DURATION_SINCE, getTestTime())).to.be('1 hr');
|
||||
|
||||
const oneDay = getTestTime().subtract(1, 'day'); // should trim 0 hrs
|
||||
expect(formatTimestampToDuration(oneDay, CALCULATE_DURATION_SINCE, getTestTime())).to.be('1 days');
|
||||
expect(formatTimestampToDuration(oneDay, CALCULATE_DURATION_SINCE, getTestTime())).to.be('1 day');
|
||||
|
||||
const twoMonths = getTestTime().subtract(2, 'month'); // should trim 0 days
|
||||
expect(formatTimestampToDuration(twoMonths, CALCULATE_DURATION_SINCE, getTestTime())).to.be('2 months');
|
||||
|
@ -52,22 +52,22 @@ describe('formatTimestampToDuration', () => {
|
|||
expect(formatTimestampToDuration(fiftyNineSeconds, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('59 seconds');
|
||||
|
||||
const fiveMins = getTestTime().add(10, 'minutes');
|
||||
expect(formatTimestampToDuration(fiveMins, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('10 min');
|
||||
expect(formatTimestampToDuration(fiveMins, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('10 mins');
|
||||
|
||||
const sixHours = getTestTime().add(6, 'hours').add(30, 'minutes');
|
||||
expect(formatTimestampToDuration(sixHours, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('6 hrs 30 min');
|
||||
expect(formatTimestampToDuration(sixHours, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('6 hrs 30 mins');
|
||||
|
||||
const sevenDays = getTestTime().add(7, 'days').add(6, 'hours').add(18, 'minutes');
|
||||
expect(formatTimestampToDuration(sevenDays, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('7 days 6 hrs 18 min');
|
||||
expect(formatTimestampToDuration(sevenDays, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('7 days 6 hrs 18 mins');
|
||||
|
||||
const eightWeeks = getTestTime().add(8, 'weeks').add(7, 'days').add(6, 'hours').add(18, 'minutes');
|
||||
expect(formatTimestampToDuration(eightWeeks, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('2 months 2 days');
|
||||
|
||||
const oneHour = getTestTime().add(1, 'hour'); // should trim 0 min
|
||||
expect(formatTimestampToDuration(oneHour, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('1 hrs');
|
||||
expect(formatTimestampToDuration(oneHour, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('1 hr');
|
||||
|
||||
const oneDay = getTestTime().add(1, 'day'); // should trim 0 hrs
|
||||
expect(formatTimestampToDuration(oneDay, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('1 days');
|
||||
expect(formatTimestampToDuration(oneDay, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('1 day');
|
||||
|
||||
const twoMonths = getTestTime().add(2, 'month'); // should trim 0 days
|
||||
expect(formatTimestampToDuration(twoMonths, CALCULATE_DURATION_UNTIL, getTestTime())).to.be('2 months');
|
||||
|
|
|
@ -48,7 +48,7 @@ export function formatTimestampToDuration(timestamp, calculationFlag, initialTim
|
|||
}
|
||||
|
||||
return duration
|
||||
.replace(/ 0 min$/, '')
|
||||
.replace(/ 0 mins$/, '')
|
||||
.replace(/ 0 hrs$/, '')
|
||||
.replace(/ 0 days$/, ''); // See https://github.com/jsmreese/moment-duration-format/issues/64
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ exports[`getMetrics and getSeries should return metrics with derivative metric 1
|
|||
Object {
|
||||
"cluster_search_request_rate": Array [
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -388,7 +388,7 @@ exports[`getMetrics and getSeries should return metrics with metric containing c
|
|||
Object {
|
||||
"cluster_index_latency": Array [
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -767,7 +767,7 @@ exports[`getMetrics and getSeries should return metrics with metric that uses de
|
|||
Object {
|
||||
"kibana_max_response_times": Array [
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -1143,7 +1143,7 @@ exports[`getMetrics and getSeries should return metrics with non-derivative metr
|
|||
Object {
|
||||
"node_cpu_utilization": Array [
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -1518,7 +1518,7 @@ exports[`getMetrics and getSeries should return metrics with object structure fo
|
|||
Object {
|
||||
"index_1": Array [
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -1887,7 +1887,7 @@ Object {
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -2256,7 +2256,7 @@ Object {
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
@ -2625,7 +2625,7 @@ Object {
|
|||
},
|
||||
},
|
||||
Object {
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"data": Array [
|
||||
Array [
|
||||
1498968000000,
|
||||
|
|
|
@ -280,9 +280,9 @@
|
|||
"markdown-it": "^8.4.1",
|
||||
"memoize-one": "^5.0.0",
|
||||
"mime": "^2.4.4",
|
||||
"moment": "^2.20.1",
|
||||
"moment-duration-format": "^1.3.0",
|
||||
"moment-timezone": "^0.5.14",
|
||||
"moment": "^2.24.0",
|
||||
"moment-duration-format": "^2.3.2",
|
||||
"moment-timezone": "^0.5.27",
|
||||
"monaco-editor": "~0.17.0",
|
||||
"ngreact": "^0.5.1",
|
||||
"nock": "10.0.6",
|
||||
|
@ -311,7 +311,7 @@
|
|||
"react-dropzone": "^4.2.9",
|
||||
"react-fast-compare": "^2.0.4",
|
||||
"react-markdown": "^3.4.1",
|
||||
"react-moment-proptypes": "^1.6.0",
|
||||
"react-moment-proptypes": "^1.7.0",
|
||||
"react-monaco-editor": "~0.27.0",
|
||||
"react-portal": "^3.2.0",
|
||||
"react-redux": "^5.1.1",
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
require('../scripts/mocha');
|
||||
require('../../scripts/mocha');
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"formattedLeader": "leader",
|
||||
"metrics": {
|
||||
"ccr_sync_lag_time": [{
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"timeRange": {
|
||||
"min": 1537315200000,
|
||||
"max": 1537401599000
|
||||
|
@ -22,7 +22,7 @@
|
|||
"data": []
|
||||
}],
|
||||
"ccr_sync_lag_ops": [{
|
||||
"bucket_size": "10 min",
|
||||
"bucket_size": "10 mins",
|
||||
"timeRange": {
|
||||
"min": 1537315200000,
|
||||
"max": 1537401599000
|
||||
|
|
49
yarn.lock
49
yarn.lock
|
@ -3630,10 +3630,10 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea"
|
||||
integrity sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==
|
||||
|
||||
"@types/moment-timezone@^0.5.8":
|
||||
version "0.5.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/moment-timezone/-/moment-timezone-0.5.8.tgz#92aba9bc238cabf69a27a1a4f52e0ebb8f10f896"
|
||||
integrity sha512-FpC+fLd/Hmxxcl4cxeb5HTyCmEvl3b4TeX8w9J+0frdzH+UCEkexKe4WZ3DTALwLj2/hyujn8tp3zl1YdgLrxQ==
|
||||
"@types/moment-timezone@^0.5.12":
|
||||
version "0.5.12"
|
||||
resolved "https://registry.yarnpkg.com/@types/moment-timezone/-/moment-timezone-0.5.12.tgz#0fb680c03db194fe8ff4551eaeb1eec8d3d80e9f"
|
||||
integrity sha512-hnHH2+Efg2vExr/dSz+IX860nSiyk9Sk4pJF2EmS11lRpMcNXeB4KBW5xcgw2QPsb9amTXdsVNEe5IoJXiT0uw==
|
||||
dependencies:
|
||||
moment ">=2.14.0"
|
||||
|
||||
|
@ -19390,38 +19390,23 @@ module-not-found-error@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/module-not-found-error/-/module-not-found-error-1.0.1.tgz#cf8b4ff4f29640674d6cdd02b0e3bc523c2bbdc0"
|
||||
integrity sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=
|
||||
|
||||
moment-duration-format@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/moment-duration-format/-/moment-duration-format-1.3.0.tgz#541771b5f87a049cc65540475d3ad966737d6908"
|
||||
integrity sha1-VBdxtfh6BJzGVUBHXTrZZnN9aQg=
|
||||
moment-duration-format@^2.3.2:
|
||||
version "2.3.2"
|
||||
resolved "https://registry.yarnpkg.com/moment-duration-format/-/moment-duration-format-2.3.2.tgz#5fa2b19b941b8d277122ff3f87a12895ec0d6212"
|
||||
integrity sha512-cBMXjSW+fjOb4tyaVHuaVE/A5TqkukDWiOfxxAjY+PEqmmBQlLwn+8OzwPiG3brouXKY5Un4pBjAeB6UToXHaQ==
|
||||
|
||||
moment-timezone@^0.5.14:
|
||||
version "0.5.14"
|
||||
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.14.tgz#4eb38ff9538b80108ba467a458f3ed4268ccfcb1"
|
||||
integrity sha1-TrOP+VOLgBCLpGekWPPtQmjM/LE=
|
||||
moment-timezone@^0.5.27:
|
||||
version "0.5.27"
|
||||
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.27.tgz#73adec8139b6fe30452e78f210f27b1f346b8877"
|
||||
integrity sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==
|
||||
dependencies:
|
||||
moment ">= 2.9.0"
|
||||
|
||||
moment@2.24.0, moment@>=1.6.0:
|
||||
moment@2.24.0, "moment@>= 2.9.0", moment@>=1.6.0, moment@>=2.14.0, moment@^2.10.6, moment@^2.24.0:
|
||||
version "2.24.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
|
||||
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
|
||||
|
||||
"moment@>= 2.9.0", moment@^2.13.0, moment@^2.20.1:
|
||||
version "2.20.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd"
|
||||
integrity sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==
|
||||
|
||||
moment@>=2.14.0:
|
||||
version "2.22.2"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66"
|
||||
integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=
|
||||
|
||||
moment@^2.10.6:
|
||||
version "2.21.0"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.21.0.tgz#2a114b51d2a6ec9e6d83cf803f838a878d8a023a"
|
||||
integrity sha512-TCZ36BjURTeFTM/CwRcViQlfkMvL1/vFISuNLO5GkcVm1+QHfbSiNqZuWeMFjj1/3+uAjXswgRk30j1kkLYJBQ==
|
||||
|
||||
monaco-editor@~0.17.0:
|
||||
version "0.17.1"
|
||||
resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.17.1.tgz#8fbe96ca54bfa75262706e044f8f780e904aa45c"
|
||||
|
@ -22913,10 +22898,10 @@ react-markdown@^4.0.6:
|
|||
unist-util-visit "^1.3.0"
|
||||
xtend "^4.0.1"
|
||||
|
||||
react-moment-proptypes@^1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/react-moment-proptypes/-/react-moment-proptypes-1.6.0.tgz#8ec266ee392a08ba3412d2df2eebf833ab1046df"
|
||||
integrity sha512-4h7EuhDMTzQqZ+02KUUO+AVA7PqhbD88yXB740nFpNDyDS/bj9jiPyn2rwr9sa8oDyaE1ByFN9+t5XPyPTmN6g==
|
||||
react-moment-proptypes@^1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/react-moment-proptypes/-/react-moment-proptypes-1.7.0.tgz#89881479840a76c13574a86e3bb214c4ba564e7a"
|
||||
integrity sha512-ZbOn/P4u469WEGAw5hgkS/E+g1YZqdves2BjYsLluJobzUZCtManhjHiZKjniBVT7MSHM6D/iKtRVzlXVv3ikA==
|
||||
dependencies:
|
||||
moment ">=1.6.0"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue