mirror of
https://github.com/prymitive/karma
synced 2026-08-23 11:56:20 +00:00
Merge pull request #1108 from prymitive/silence-alert-count
feat(ui): show matched alert count on silence browser
This commit is contained in:
@@ -475,6 +475,25 @@ func silences(c *gin.Context) {
|
||||
return dedupedSilences[i].Silence.EndsAt.Before(dedupedSilences[j].Silence.EndsAt) == recentFirst
|
||||
})
|
||||
|
||||
silenceCounters := make(map[string]int, len(dedupedSilences))
|
||||
for _, silence := range dedupedSilences {
|
||||
silenceCounters[silence.Silence.ID] = 0
|
||||
}
|
||||
for _, alertGroup := range alertmanager.DedupAlerts() {
|
||||
for _, alert := range alertGroup.Alerts {
|
||||
for _, sID := range alert.SilencedBy {
|
||||
if _, ok := silenceCounters[sID]; ok {
|
||||
silenceCounters[sID]++
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for i := range dedupedSilences {
|
||||
if counter, ok := silenceCounters[dedupedSilences[i].Silence.ID]; ok {
|
||||
dedupedSilences[i].AlertCount = counter
|
||||
}
|
||||
}
|
||||
|
||||
data, err := json.Marshal(dedupedSilences)
|
||||
if err != nil {
|
||||
log.Error(err.Error())
|
||||
|
||||
@@ -27,7 +27,8 @@ type Silence struct {
|
||||
|
||||
// ManagedSilence is a standalone silence detached from any alert
|
||||
type ManagedSilence struct {
|
||||
Cluster string `json:"cluster"`
|
||||
IsExpired bool `json:"isExpired"`
|
||||
Silence Silence `json:"silence"`
|
||||
Cluster string `json:"cluster"`
|
||||
IsExpired bool `json:"isExpired"`
|
||||
AlertCount int `json:"alertCount"`
|
||||
Silence Silence `json:"silence"`
|
||||
}
|
||||
|
||||
Generated
+111
-113
@@ -1316,9 +1316,9 @@
|
||||
"integrity": "sha512-14ZVlsB9akwvydAdaEnVnvqu6J2P6ySv39hYyl/aoB6w/V+bXX0tay8cF6paqbgZsN2n5Xh15uF4pE+GvE+itw=="
|
||||
},
|
||||
"@emotion/is-prop-valid": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.3.tgz",
|
||||
"integrity": "sha512-We7VBiltAJ70KQA0dWkdPMXnYoizlxOXpvtjmu5/MBnExd+u0PGgV27WCYanmLAbCwAU30Le/xA0CQs/F/Otig==",
|
||||
"version": "0.8.4",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.4.tgz",
|
||||
"integrity": "sha512-QBW8h6wVQgeQ55F52rNaprEJxtVR+/ScOP8/V1ScSpPzKqHdFB9QVqby0Z50sqS8mcaeIl5vR1vQpKwJbIS6NQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/memoize": "0.7.3"
|
||||
@@ -1330,9 +1330,9 @@
|
||||
"integrity": "sha512-2Md9mH6mvo+ygq1trTeVp2uzAKwE2P7In0cRpD/M9Q70aH8L+rxMLbb3JCN2JoSWsV2O+DdFjfbbXoMoLBczow=="
|
||||
},
|
||||
"@emotion/serialize": {
|
||||
"version": "0.11.13",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.13.tgz",
|
||||
"integrity": "sha512-Tw+z6oIFCXeznoH25TozFoOUJ9BIyKBgZ9Gif3ej9aqPeP/Dzct8WIXSsz08xxyt1RPlKokvJ3fzMDq0UjL3RQ==",
|
||||
"version": "0.11.14",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.14.tgz",
|
||||
"integrity": "sha512-6hTsySIuQTbDbv00AnUO6O6Xafdwo5GswRlMZ5hHqiFx+4pZ7uGWXUQFW46Kc2taGhP89uXMXn/lWQkdyTosPA==",
|
||||
"requires": {
|
||||
"@emotion/hash": "0.7.3",
|
||||
"@emotion/memoize": "0.7.3",
|
||||
@@ -1347,24 +1347,24 @@
|
||||
"integrity": "sha512-c3Q6V7Df7jfwSq5AzQWbXHa5soeE4F5cbqi40xn0CzXxWW9/6Mxq48WJEtqfWzbZtW9odZdnRAkwCQwN12ob4A=="
|
||||
},
|
||||
"@emotion/styled": {
|
||||
"version": "10.0.22",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-10.0.22.tgz",
|
||||
"integrity": "sha512-3+dnBk8NjXnddI8Gi2VJLMmup0bCG8HQkZLaeNky+GSLl8VyxQfuaK5I5aDVvgQ3UzkxrcZrFB3vHYU/iUakBA==",
|
||||
"version": "10.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-10.0.23.tgz",
|
||||
"integrity": "sha512-gNr04eqBQ2iYUx8wFLZDfm3N8/QUOODu/ReDXa693uyQGy2OqA+IhPJk+kA7id8aOfwAsMuvZ0pJImEXXKtaVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@emotion/styled-base": "^10.0.22",
|
||||
"babel-plugin-emotion": "^10.0.22"
|
||||
"@emotion/styled-base": "^10.0.23",
|
||||
"babel-plugin-emotion": "^10.0.23"
|
||||
}
|
||||
},
|
||||
"@emotion/styled-base": {
|
||||
"version": "10.0.22",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/styled-base/-/styled-base-10.0.22.tgz",
|
||||
"integrity": "sha512-ikSuAcz86BcmlZM5EysqCH0EUssYm5ardrWNVM3Ri5ODpOlKPrT//jVozJU2uK3q5GRcqZHLqagP/nd9beNUfQ==",
|
||||
"version": "10.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@emotion/styled-base/-/styled-base-10.0.23.tgz",
|
||||
"integrity": "sha512-94QowN2S09nCXRz9dXBiMaEcUcXn9kHM8uFExpsspwswHWnkpFn6jTewotQEgI7RROnAXDZ8fvSTkCdqtn3sfw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"@emotion/is-prop-valid": "0.8.3",
|
||||
"@emotion/serialize": "^0.11.12",
|
||||
"@emotion/is-prop-valid": "0.8.4",
|
||||
"@emotion/serialize": "^0.11.14",
|
||||
"@emotion/utils": "0.11.2"
|
||||
}
|
||||
},
|
||||
@@ -1436,9 +1436,9 @@
|
||||
"integrity": "sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA=="
|
||||
},
|
||||
"@hapi/hoek": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.3.2.tgz",
|
||||
"integrity": "sha512-NP5SG4bzix+EtSMtcudp8TvI0lB46mXNo8uFpTDw6tqxGx4z5yx+giIunEFA0Z7oUO4DuWrOJV9xqR2tJVEdyA=="
|
||||
"version": "8.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.4.0.tgz",
|
||||
"integrity": "sha512-JLK+vNrtZSQy1PiAAvtaPGiZhFQo+BLywJkD4EHG8vCzlW9w7Y9yfb2be1GFKnZKczLgzHBpgMOBUZs1qBNB5g=="
|
||||
},
|
||||
"@hapi/joi": {
|
||||
"version": "15.1.1",
|
||||
@@ -3039,11 +3039,11 @@
|
||||
"integrity": "sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg=="
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.5.0.tgz",
|
||||
"integrity": "sha512-ddrJZxp5ns1Lh5ofZQYk3P8RyvKfyz/VcRR4ZiJLHO/ljnQAO8YvTfj268+WJOOadn99mvDiqJA65+HAKoeSPA==",
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.6.0.tgz",
|
||||
"integrity": "sha512-iCcXREU4RciLmLniwKLRPCOFVXrkF7z27XuHq5DrykpREv/mz6ztKAyLg2fdkM0hQC7659p5ZF5uStH7uzAJ/w==",
|
||||
"requires": {
|
||||
"@typescript-eslint/experimental-utils": "2.5.0",
|
||||
"@typescript-eslint/experimental-utils": "2.6.0",
|
||||
"eslint-utils": "^1.4.2",
|
||||
"functional-red-black-tree": "^1.0.1",
|
||||
"regexpp": "^2.0.1",
|
||||
@@ -3051,30 +3051,30 @@
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/experimental-utils": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.5.0.tgz",
|
||||
"integrity": "sha512-UgcQGE0GKJVChyRuN1CWqDW8Pnu7+mVst0aWrhiyuUD1J9c+h8woBdT4XddCvhcXDodTDVIfE3DzGHVjp7tUeQ==",
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.6.0.tgz",
|
||||
"integrity": "sha512-34BAFpNOwHXeqT+AvdalLxOvcPYnCxA5JGmBAFL64RGMdP0u65rXjii7l/nwpgk5aLEE1LaqF+SsCU0/Cb64xA==",
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.3",
|
||||
"@typescript-eslint/typescript-estree": "2.5.0",
|
||||
"@typescript-eslint/typescript-estree": "2.6.0",
|
||||
"eslint-scope": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/parser": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.5.0.tgz",
|
||||
"integrity": "sha512-9UBMiAwIDWSl79UyogaBdj3hidzv6exjKUx60OuZuFnJf56tq/UMpdPcX09YmGqE8f4AnAueYtBxV8IcAT3jdQ==",
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.6.0.tgz",
|
||||
"integrity": "sha512-AvLejMmkcjRTJ2KD72v565W4slSrrzUIzkReu1JN34b8JnsEsxx7S9Xx/qXEuMQas0mkdUfETr0j3zOhq2DIqQ==",
|
||||
"requires": {
|
||||
"@types/eslint-visitor-keys": "^1.0.0",
|
||||
"@typescript-eslint/experimental-utils": "2.5.0",
|
||||
"@typescript-eslint/typescript-estree": "2.5.0",
|
||||
"@typescript-eslint/experimental-utils": "2.6.0",
|
||||
"@typescript-eslint/typescript-estree": "2.6.0",
|
||||
"eslint-visitor-keys": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/typescript-estree": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.5.0.tgz",
|
||||
"integrity": "sha512-AXURyF8NcA3IsnbjNX1v9qbwa0dDoY9YPcKYR2utvMHoUcu3636zrz0gRWtVAyxbPCkhyKuGg6WZIyi2Fc79CA==",
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.6.0.tgz",
|
||||
"integrity": "sha512-A3lSBVIdj2Gp0lFEL6in2eSPqJ33uAc3Ko+Y4brhjkxzjbzLnwBH22CwsW2sCo+iwogfIyvb56/AJri15H0u5Q==",
|
||||
"requires": {
|
||||
"debug": "^4.1.1",
|
||||
"glob": "^7.1.4",
|
||||
@@ -3999,14 +3999,14 @@
|
||||
}
|
||||
},
|
||||
"babel-plugin-emotion": {
|
||||
"version": "10.0.22",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.0.22.tgz",
|
||||
"integrity": "sha512-e3Yo9+GD6ovrcZlt2Unjgfyy0gfdz0+8httltToWL+biFMhLPPT1PJlc0GHy9i+vtPSrTBNY2hawfPJnuG2L3g==",
|
||||
"version": "10.0.23",
|
||||
"resolved": "https://registry.npmjs.org/babel-plugin-emotion/-/babel-plugin-emotion-10.0.23.tgz",
|
||||
"integrity": "sha512-1JiCyXU0t5S2xCbItejCduLGGcKmF3POT0Ujbexog2MI4IlRcIn/kWjkYwCUZlxpON0O5FC635yPl/3slr7cKQ==",
|
||||
"requires": {
|
||||
"@babel/helper-module-imports": "^7.0.0",
|
||||
"@emotion/hash": "0.7.3",
|
||||
"@emotion/memoize": "0.7.3",
|
||||
"@emotion/serialize": "^0.11.12",
|
||||
"@emotion/serialize": "^0.11.14",
|
||||
"babel-plugin-macros": "^2.0.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"convert-source-map": "^1.5.0",
|
||||
@@ -4992,9 +4992,9 @@
|
||||
}
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001005",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001005.tgz",
|
||||
"integrity": "sha512-g78miZm1Z5njjYR216a5812oPiLgV1ssndgGxITHWUopmjUrCswMisA0a2kSB7a0vZRox6JOKhM51+efmYN8Mg=="
|
||||
"version": "1.0.30001006",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001006.tgz",
|
||||
"integrity": "sha512-MXnUVX27aGs/QINz+QG1sWSLDr3P1A3Hq5EUWoIt0T7K24DuvMxZEnh3Y5aHlJW6Bz2aApJdSewdYLd8zQnUuw=="
|
||||
},
|
||||
"capture-exit": {
|
||||
"version": "2.0.0",
|
||||
@@ -6026,12 +6026,9 @@
|
||||
"integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg=="
|
||||
},
|
||||
"console-browserify": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
|
||||
"integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
|
||||
"requires": {
|
||||
"date-now": "^0.1.4"
|
||||
}
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz",
|
||||
"integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA=="
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
@@ -6209,18 +6206,18 @@
|
||||
"integrity": "sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw=="
|
||||
},
|
||||
"core-js-compat": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.3.4.tgz",
|
||||
"integrity": "sha512-7OK3/LPP8R3Ovasf3GilEOp+o1w0ZKJ75FMou2RDfTwIV69G5RkKCGFnqgBv/ZhR6xo9GCzlfVALyHmydbE7DA==",
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.3.5.tgz",
|
||||
"integrity": "sha512-44ZORuapx0MUht0MUk0p9lcQPh7n/LDXehimTmjCs0CYblpKZcqVd5w0OQDUDq5OQjEbazWObHDQJWvvHYPNTg==",
|
||||
"requires": {
|
||||
"browserslist": "^4.7.2",
|
||||
"semver": "^6.3.0"
|
||||
}
|
||||
},
|
||||
"core-js-pure": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.3.4.tgz",
|
||||
"integrity": "sha512-hqxt6XpR4zIMNUY920oNyAtwaq4yg8IScmXumnfyRWF9+ur7wtjr/4eCdfTJzY64jmi8WRCwIqNBKzYeOKdvnw==",
|
||||
"version": "3.3.5",
|
||||
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.3.5.tgz",
|
||||
"integrity": "sha512-njLfaPe3tS+8Swgx/itYgJ1jiizCWtNXrK1VzMoXbT6LhiYbIAQioukPmZlB2wTieJY2g4fLRUh96WfXpN61oA==",
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
@@ -6487,12 +6484,19 @@
|
||||
"integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w=="
|
||||
},
|
||||
"css-tree": {
|
||||
"version": "1.0.0-alpha.33",
|
||||
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.33.tgz",
|
||||
"integrity": "sha512-SPt57bh5nQnpsTBsx/IXbO14sRc9xXu5MtMAVuo0BaQQmyf0NupNPPSoMaqiAF5tDFafYsTkfeH4Q/HCKXkg4w==",
|
||||
"version": "1.0.0-alpha.37",
|
||||
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz",
|
||||
"integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==",
|
||||
"requires": {
|
||||
"mdn-data": "2.0.4",
|
||||
"source-map": "^0.5.3"
|
||||
"source-map": "^0.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"css-unit-converter": {
|
||||
@@ -6598,27 +6602,11 @@
|
||||
"integrity": "sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q=="
|
||||
},
|
||||
"csso": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz",
|
||||
"integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/csso/-/csso-4.0.2.tgz",
|
||||
"integrity": "sha512-kS7/oeNVXkHWxby5tHVxlhjizRCSv8QdU7hB2FpdAibDU8FjTAolhNjKNTiLzXtUrKT6HwClE81yXwEk1309wg==",
|
||||
"requires": {
|
||||
"css-tree": "1.0.0-alpha.29"
|
||||
},
|
||||
"dependencies": {
|
||||
"css-tree": {
|
||||
"version": "1.0.0-alpha.29",
|
||||
"resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz",
|
||||
"integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==",
|
||||
"requires": {
|
||||
"mdn-data": "~1.1.0",
|
||||
"source-map": "^0.5.3"
|
||||
}
|
||||
},
|
||||
"mdn-data": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz",
|
||||
"integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA=="
|
||||
}
|
||||
"css-tree": "1.0.0-alpha.37"
|
||||
}
|
||||
},
|
||||
"cssom": {
|
||||
@@ -6711,11 +6699,6 @@
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.6.0.tgz",
|
||||
"integrity": "sha512-F55YxqRdEfP/eYQmQjLN798v0AwLjmZ8nMBjdQvNwEE3N/zWVrlkkqT+9seBlPlsbkybG4JmWg3Ee3dIV9BcGQ=="
|
||||
},
|
||||
"date-now": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
|
||||
"integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs="
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
@@ -7417,13 +7400,13 @@
|
||||
}
|
||||
},
|
||||
"es5-ext": {
|
||||
"version": "0.10.51",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.51.tgz",
|
||||
"integrity": "sha512-oRpWzM2WcLHVKpnrcyB7OW8j/s67Ba04JCm0WnNv3RiABSvs7mrQlutB8DBv793gKcp0XENR8Il8WxGTlZ73gQ==",
|
||||
"version": "0.10.52",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.52.tgz",
|
||||
"integrity": "sha512-bWCbE9fbpYQY4CU6hJbJ1vSz70EClMlDgJ7BmwI+zEJhxrwjesZRPglGJlsZhu0334U3hI+gaspwksH9IGD6ag==",
|
||||
"requires": {
|
||||
"es6-iterator": "~2.0.3",
|
||||
"es6-symbol": "~3.1.1",
|
||||
"next-tick": "^1.0.0"
|
||||
"es6-symbol": "~3.1.2",
|
||||
"next-tick": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"es5-shim": {
|
||||
@@ -7476,12 +7459,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"es6-symbol": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.2.tgz",
|
||||
"integrity": "sha512-/ZypxQsArlv+KHpGvng52/Iz8by3EQPxhmbuz8yFG89N/caTFBSbcXONDw0aMjy827gQg26XAjP4uXFvnfINmQ==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
|
||||
"integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
|
||||
"requires": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.51"
|
||||
"ext": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"escape-html": {
|
||||
@@ -8114,6 +8097,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ext": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.1.2.tgz",
|
||||
"integrity": "sha512-/KLjJdTNyDepCihrk4HQt57nAE1IRCEo5jUt+WgWGCr1oARhibDvmI2DMcSNWood1T9AUWwq+jaV1wvRqaXfnA==",
|
||||
"requires": {
|
||||
"type": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.0.0.tgz",
|
||||
"integrity": "sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
@@ -9169,9 +9167,9 @@
|
||||
"integrity": "sha512-d4sze1JNC454Wdo2fkuyzCr6aHcbL6PGGuFAz0Li/NcOm1tCHGnWDRmJP85dh9IhQErTc2svWFEX5xHIOo//kQ=="
|
||||
},
|
||||
"handlebars": {
|
||||
"version": "4.4.5",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.5.tgz",
|
||||
"integrity": "sha512-0Ce31oWVB7YidkaTq33ZxEbN+UDxMMgThvCe8ptgQViymL5DPis9uLdTA13MiRPhgvqyxIegugrP97iK3JeBHg==",
|
||||
"version": "4.5.1",
|
||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.1.tgz",
|
||||
"integrity": "sha512-C29UoFzHe9yM61lOsIlCE5/mQVGrnIOrOq7maQl76L7tYPCgC1og0Ajt6uWnX4ZTxBPnjw+CUvawphwCfJgUnA==",
|
||||
"requires": {
|
||||
"neo-async": "^2.6.0",
|
||||
"optimist": "^0.6.1",
|
||||
@@ -13444,9 +13442,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"percy-client": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/percy-client/-/percy-client-3.2.1.tgz",
|
||||
"integrity": "sha512-xnoLe1QNT5Y/1PEZqKdES9aOtvd1TyyaVdKPbq1sWh1ORLFhgPte3Yg9+vnmUyjplDsHEev32tzmEAx2PMMbOw==",
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/percy-client/-/percy-client-3.2.2.tgz",
|
||||
"integrity": "sha512-9VF5IOCsoWcVLUsE/0nSGe9/40yXuuIV98vmoHm1bh8wlZjeRnv6nFfwJahx0QYHnNTBwklD7nrKexpwXax3eA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"base64-js": "^1.2.3",
|
||||
@@ -13570,12 +13568,12 @@
|
||||
}
|
||||
},
|
||||
"polished": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/polished/-/polished-3.4.1.tgz",
|
||||
"integrity": "sha512-GflTnlP5rrpDoigjczEkS6Ye7NDA4sFvAnlr5hSDrEvjiVj97Xzev3hZlLi3UB27fpxyTS9rWU64VzVLWkG+mg==",
|
||||
"version": "3.4.2",
|
||||
"resolved": "https://registry.npmjs.org/polished/-/polished-3.4.2.tgz",
|
||||
"integrity": "sha512-9Rch6iMZckABr6EFCLPZsxodeBpXMo9H4fRlfR/9VjMEyy5xpo1/WgXlJGgSjPyVhEZNycbW7UmYMNyWS5MI0g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.4.5"
|
||||
"@babel/runtime": "^7.6.3"
|
||||
}
|
||||
},
|
||||
"popper.js": {
|
||||
@@ -15459,9 +15457,9 @@
|
||||
}
|
||||
},
|
||||
"react-textarea-autosize": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-7.1.0.tgz",
|
||||
"integrity": "sha512-c2FlR/fP0qbxmlrW96SdrbgP/v0XZMTupqB90zybvmDVDutytUgPl7beU35klwcTeMepUIQEpQUn3P3bdshGPg==",
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-7.1.2.tgz",
|
||||
"integrity": "sha512-uH3ORCsCa3C6LHxExExhF4jHoXYCQwE5oECmrRsunlspaDAbS4mGKNlWZqjLfInWtFQcf0o1n1jC/NGXFdUBCg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
@@ -16978,9 +16976,9 @@
|
||||
}
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.13",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz",
|
||||
"integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==",
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz",
|
||||
"integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==",
|
||||
"requires": {
|
||||
"buffer-from": "^1.0.0",
|
||||
"source-map": "^0.6.0"
|
||||
@@ -17518,16 +17516,16 @@
|
||||
"integrity": "sha512-1gtApepKFweigFZj3sGO8KT8LvVZK8io146EzXrpVuWCDAbISz/yMucco3hWTkpZNoPabM+dnMOpy6Swue68Zg=="
|
||||
},
|
||||
"svgo": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.0.tgz",
|
||||
"integrity": "sha512-MLfUA6O+qauLDbym+mMZgtXCGRfIxyQoeH6IKVcFslyODEe/ElJNwr0FohQ3xG4C6HK6bk3KYPPXwHVJk3V5NQ==",
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",
|
||||
"integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==",
|
||||
"requires": {
|
||||
"chalk": "^2.4.1",
|
||||
"coa": "^2.0.2",
|
||||
"css-select": "^2.0.0",
|
||||
"css-select-base-adapter": "^0.1.1",
|
||||
"css-tree": "1.0.0-alpha.33",
|
||||
"csso": "^3.5.1",
|
||||
"css-tree": "1.0.0-alpha.37",
|
||||
"csso": "^4.0.2",
|
||||
"js-yaml": "^3.13.1",
|
||||
"mkdirp": "~0.5.1",
|
||||
"object.values": "^1.1.0",
|
||||
|
||||
+29
-29
@@ -290,7 +290,7 @@ exports[`<GroupFooter /> mathes snapshot when silence is rendered 1`] = `
|
||||
<div class=\\"card my-1 components-managed-silence components-animation-fade-appear components-animation-fade-appear-active\\">
|
||||
<div class=\\"card-header border-bottom-0 px-3\\">
|
||||
<div class=\\"d-flex flex-row\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0 mr-2\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
@@ -306,39 +306,39 @@ exports[`<GroupFooter /> mathes snapshot when silence is rendered 1`] = `
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"mx-2 flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"font-italic text-truncate overflow-hidden\\">
|
||||
Mocked Silence
|
||||
</div>
|
||||
<div class=\\"components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
<span class=\\"badge badge-danger align-text-bottom p-1\\">
|
||||
Expired
|
||||
<time datetime=\\"946688400000\\">
|
||||
14 hours ago
|
||||
</time>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\\"pt-1 d-flex flex-row justify-content-between\\">
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
<span class=\\"badge badge-danger align-text-bottom p-1\\">
|
||||
Expired
|
||||
<time datetime=\\"946688400000\\">
|
||||
14 hours ago
|
||||
</time>
|
||||
</span>
|
||||
</div>
|
||||
<div class=\\"flex-grow-0 flex-shrink-0 mt-auto mb-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-up\\"
|
||||
class=\\"svg-inline--fa fa-chevron-up fa-w-14 ml-2 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\\"
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<div class=\\"d-flex flex-column flex-sm-row justify-content-between\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-up\\"
|
||||
class=\\"svg-inline--fa fa-chevron-up fa-w-14 my-sm-auto mt-2 mb-0 ml-sm-2 ml-auto mr-sm-0 mr-1 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -46,6 +46,8 @@ const RenderSilence = (
|
||||
<ManagedSilence
|
||||
key={silenceID}
|
||||
cluster={cluster}
|
||||
alertCount={0}
|
||||
alertCountAlwaysVisible={false}
|
||||
silence={silence}
|
||||
alertStore={alertStore}
|
||||
silenceFormStore={silenceFormStore}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { storiesOf } from "@storybook/react";
|
||||
|
||||
import moment from "moment";
|
||||
|
||||
import { MockAlert, MockAlertGroup } from "__mocks__/Alerts.js";
|
||||
import { MockAlert, MockAlertGroup, MockSilence } from "__mocks__/Alerts.js";
|
||||
import { AlertStore } from "Stores/AlertStore";
|
||||
import { Settings } from "Stores/Settings";
|
||||
import { SilenceFormStore } from "Stores/SilenceFormStore";
|
||||
@@ -83,6 +83,12 @@ storiesOf("Grid", module)
|
||||
const settingsStore = new Settings();
|
||||
const silenceFormStore = new SilenceFormStore();
|
||||
|
||||
const silence = MockSilence();
|
||||
silence.startsAt = "2018-08-14T12:00:00Z";
|
||||
silence.endsAt = "2018-08-14T18:00:00Z";
|
||||
alertStore.data.silences = { am: {} };
|
||||
alertStore.data.silences["am"][silence.id] = silence;
|
||||
|
||||
alertStore.data.colors = {
|
||||
group: {
|
||||
group1: {
|
||||
@@ -127,6 +133,26 @@ storiesOf("Grid", module)
|
||||
const id = `id${i}`;
|
||||
const hash = `hash${i}`;
|
||||
const group = MockGroup(`group${i}`, i, active, suppressed, unprocessed);
|
||||
|
||||
for (let j = 0; j < group.alerts.length; j++) {
|
||||
if (group.alerts[j].state === "suppressed") {
|
||||
group.alerts[j].silencedBy = [silence.id];
|
||||
group.alerts[j].alertmanager = [
|
||||
{
|
||||
name: "am1",
|
||||
cluster: "am",
|
||||
state: "suppressed",
|
||||
startsAt: "2018-08-14T17:36:40.017867056Z",
|
||||
source: "localhost/prometheus",
|
||||
silencedBy: [
|
||||
j < 2 ? "'Fake Silence ID / Should be fallback'" : silence.id
|
||||
],
|
||||
inhibitedBy: []
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
group.id = id;
|
||||
group.hash = hash;
|
||||
group.stateCount.active = active;
|
||||
|
||||
@@ -19,13 +19,14 @@ const FilteringCounterBadge = observer(
|
||||
name: PropTypes.string.isRequired,
|
||||
value: PropTypes.string.isRequired,
|
||||
counter: PropTypes.number.isRequired,
|
||||
themed: PropTypes.bool.isRequired
|
||||
themed: PropTypes.bool.isRequired,
|
||||
alwaysVisible: PropTypes.bool
|
||||
};
|
||||
|
||||
render() {
|
||||
const { name, value, counter, themed } = this.props;
|
||||
const { name, value, counter, themed, alwaysVisible } = this.props;
|
||||
|
||||
if (counter === 0) return null;
|
||||
if (!alwaysVisible && counter === 0) return null;
|
||||
|
||||
const cs = this.getClassAndStyle(
|
||||
name,
|
||||
@@ -35,7 +36,7 @@ const FilteringCounterBadge = observer(
|
||||
|
||||
return (
|
||||
<TooltipWrapper
|
||||
title={`Click to only show ${value} alerts or Alt+Click to hide them`}
|
||||
title={`Click to only show ${name}=${value} alerts or Alt+Click to hide them`}
|
||||
>
|
||||
<Flash spy={counter}>
|
||||
<span
|
||||
@@ -43,7 +44,7 @@ const FilteringCounterBadge = observer(
|
||||
themed
|
||||
? cs.className
|
||||
: [
|
||||
"badge-light badge-pill components-label-with-hover",
|
||||
"badge-primary badge-pill components-label-with-hover",
|
||||
...cs.baseClassNames
|
||||
].join(" ")
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ describe("<FilteringCounterBadge />", () => {
|
||||
it("themed @state=suppressed counter badge should have className 'badge-secondary'", () => {
|
||||
validateClassName("suppressed", "badge-success", true);
|
||||
});
|
||||
it("unthemed @state=suppressed counter badge should have className 'badge-light'", () => {
|
||||
validateClassName("suppressed", "badge-light", false);
|
||||
it("unthemed @state=suppressed counter badge should have className 'badge-primary'", () => {
|
||||
validateClassName("suppressed", "badge-primary", false);
|
||||
});
|
||||
|
||||
it("@state=unprocessed counter badge should have empty style", () => {
|
||||
|
||||
@@ -8,13 +8,18 @@ import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons/faExternalL
|
||||
import { faBellSlash } from "@fortawesome/free-solid-svg-icons/faBellSlash";
|
||||
|
||||
import { APISilence } from "Models/API";
|
||||
import { AlertStore } from "Stores/AlertStore";
|
||||
import { FilteringCounterBadge } from "Components/Labels/FilteringCounterBadge";
|
||||
import { SilenceProgress } from "./SilenceProgress";
|
||||
|
||||
const SilenceComment = ({
|
||||
silence,
|
||||
alertCount,
|
||||
alertCountAlwaysVisible,
|
||||
collapsed,
|
||||
collapseToggle,
|
||||
afterUpdate
|
||||
afterUpdate,
|
||||
alertStore
|
||||
}) => {
|
||||
const comment = silence.jiraURL ? (
|
||||
<a href={silence.jiraURL} target="_blank" rel="noopener noreferrer">
|
||||
@@ -28,10 +33,10 @@ const SilenceComment = ({
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="d-flex flex-row">
|
||||
<div className="flex-shrink-0 flex-grow-0 mr-2">
|
||||
<div className="flex-shrink-0 flex-grow-0">
|
||||
<FontAwesomeIcon icon={faBellSlash} className="text-muted" />
|
||||
</div>
|
||||
<div className="flex-shrink-1 flex-grow-1 mw-1p">
|
||||
<div className="mx-2 flex-shrink-1 flex-grow-1 mw-1p">
|
||||
<div
|
||||
className={`font-italic ${
|
||||
collapsed ? "text-truncate overflow-hidden" : ""
|
||||
@@ -39,21 +44,29 @@ const SilenceComment = ({
|
||||
>
|
||||
{comment}
|
||||
</div>
|
||||
<div className="components-managed-silence-cite">
|
||||
<span className="text-muted mr-2 font-italic">
|
||||
— {silence.createdBy}
|
||||
</span>
|
||||
{collapsed ? <SilenceProgress silence={silence} /> : null}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="pt-1 d-flex flex-row justify-content-between">
|
||||
<div className="flex-shrink-1 flex-grow-1 mw-1p components-managed-silence-cite">
|
||||
<span className="text-muted mr-2 font-italic">
|
||||
— {silence.createdBy}
|
||||
</span>
|
||||
{collapsed ? <SilenceProgress silence={silence} /> : null}
|
||||
</div>
|
||||
<div className="flex-grow-0 flex-shrink-0 mt-auto mb-0">
|
||||
<FontAwesomeIcon
|
||||
icon={collapsed ? faChevronUp : faChevronDown}
|
||||
className="ml-2 text-muted cursor-pointer"
|
||||
onClick={collapseToggle}
|
||||
/>
|
||||
<div className="flex-shrink-0 flex-grow-0">
|
||||
<div className="d-flex flex-column flex-sm-row justify-content-between">
|
||||
<FilteringCounterBadge
|
||||
alertStore={alertStore}
|
||||
name="@silence_id"
|
||||
value={silence.id}
|
||||
counter={alertCount}
|
||||
themed={false}
|
||||
alwaysVisible={alertCountAlwaysVisible}
|
||||
/>
|
||||
<FontAwesomeIcon
|
||||
icon={collapsed ? faChevronUp : faChevronDown}
|
||||
className="my-sm-auto mt-2 mb-0 ml-sm-2 ml-auto mr-sm-0 mr-1 text-muted cursor-pointer"
|
||||
onClick={collapseToggle}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
@@ -61,8 +74,10 @@ const SilenceComment = ({
|
||||
};
|
||||
SilenceComment.propTypes = {
|
||||
silence: APISilence.isRequired,
|
||||
alertCount: PropTypes.number.isRequired,
|
||||
collapsed: PropTypes.bool.isRequired,
|
||||
collapseToggle: PropTypes.func.isRequired
|
||||
collapseToggle: PropTypes.func.isRequired,
|
||||
alertStore: PropTypes.instanceOf(AlertStore).isRequired
|
||||
};
|
||||
|
||||
export { SilenceComment };
|
||||
|
||||
@@ -5,12 +5,15 @@ import { mount } from "enzyme";
|
||||
import toDiffableHtml from "diffable-html";
|
||||
|
||||
import { MockSilence } from "__mocks__/Alerts";
|
||||
import { AlertStore } from "Stores/AlertStore";
|
||||
import { SilenceComment } from "./SilenceComment";
|
||||
|
||||
let silence;
|
||||
let alertStore;
|
||||
|
||||
beforeEach(() => {
|
||||
silence = MockSilence();
|
||||
alertStore = new AlertStore([]);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -23,6 +26,8 @@ const CollapseMock = jest.fn();
|
||||
const MountedSilenceComment = collapsed => {
|
||||
return mount(
|
||||
<SilenceComment
|
||||
alertStore={alertStore}
|
||||
alertCount={123}
|
||||
silence={silence}
|
||||
collapsed={collapsed}
|
||||
collapseToggle={CollapseMock}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
exports[`<SilenceComment /> Matches snapshot when collapsed 1`] = `
|
||||
"
|
||||
<div class=\\"d-flex flex-row\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0 mr-2\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
@@ -19,39 +19,51 @@ exports[`<SilenceComment /> Matches snapshot when collapsed 1`] = `
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"mx-2 flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"font-italic text-truncate overflow-hidden\\">
|
||||
Mocked Silence
|
||||
</div>
|
||||
<div class=\\"components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
<span class=\\"badge badge-danger align-text-bottom p-1\\">
|
||||
Expired
|
||||
<time datetime=\\"946688400000\\">
|
||||
20 years ago
|
||||
</time>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\\"pt-1 d-flex flex-row justify-content-between\\">
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
<span class=\\"badge badge-danger align-text-bottom p-1\\">
|
||||
Expired
|
||||
<time datetime=\\"946688400000\\">
|
||||
20 years ago
|
||||
</time>
|
||||
</span>
|
||||
</div>
|
||||
<div class=\\"flex-grow-0 flex-shrink-0 mt-auto mb-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-up\\"
|
||||
class=\\"svg-inline--fa fa-chevron-up fa-w-14 ml-2 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\\"
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<div class=\\"d-flex flex-column flex-sm-row justify-content-between\\">
|
||||
<div class
|
||||
style=\\"display: inline-block; max-width: 100%;\\"
|
||||
data-tooltipped
|
||||
aria-describedby=\\"tippy-tooltip-1\\"
|
||||
data-original-title=\\"Click to only show @silence_id=04d37636-2350-4878-b382-e0b50353230f alerts or Alt+Click to hide them\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<span class=\\" badge-primary badge-pill components-label-with-hover components-label badge\\"
|
||||
style=\\"opacity: 1;\\"
|
||||
>
|
||||
123
|
||||
</span>
|
||||
</div>
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-up\\"
|
||||
class=\\"svg-inline--fa fa-chevron-up fa-w-14 my-sm-auto mt-2 mb-0 ml-sm-2 ml-auto mr-sm-0 mr-1 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
"
|
||||
@@ -60,7 +72,7 @@ exports[`<SilenceComment /> Matches snapshot when collapsed 1`] = `
|
||||
exports[`<SilenceComment /> Matches snapshot when expanded 1`] = `
|
||||
"
|
||||
<div class=\\"d-flex flex-row\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0 mr-2\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
@@ -76,33 +88,45 @@ exports[`<SilenceComment /> Matches snapshot when expanded 1`] = `
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"mx-2 flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"font-italic \\">
|
||||
Mocked Silence
|
||||
</div>
|
||||
<div class=\\"components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\\"pt-1 d-flex flex-row justify-content-between\\">
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
</div>
|
||||
<div class=\\"flex-grow-0 flex-shrink-0 mt-auto mb-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-down\\"
|
||||
class=\\"svg-inline--fa fa-chevron-down fa-w-14 ml-2 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\\"
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<div class=\\"d-flex flex-column flex-sm-row justify-content-between\\">
|
||||
<div class
|
||||
style=\\"display: inline-block; max-width: 100%;\\"
|
||||
data-tooltipped
|
||||
aria-describedby=\\"tippy-tooltip-2\\"
|
||||
data-original-title=\\"Click to only show @silence_id=04d37636-2350-4878-b382-e0b50353230f alerts or Alt+Click to hide them\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<span class=\\" badge-primary badge-pill components-label-with-hover components-label badge\\"
|
||||
style=\\"opacity: 1;\\"
|
||||
>
|
||||
123
|
||||
</span>
|
||||
</div>
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-down\\"
|
||||
class=\\"svg-inline--fa fa-chevron-down fa-w-14 my-sm-auto mt-2 mb-0 ml-sm-2 ml-auto mr-sm-0 mr-1 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
"
|
||||
|
||||
@@ -5,7 +5,7 @@ exports[`<ManagedSilence /> matches snapshot when collapsed 1`] = `
|
||||
<div class=\\"card my-1 components-managed-silence components-animation-fade-appear components-animation-fade-appear-active\\">
|
||||
<div class=\\"card-header border-bottom-0 px-3\\">
|
||||
<div class=\\"d-flex flex-row\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0 mr-2\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
@@ -21,49 +21,61 @@ exports[`<ManagedSilence /> matches snapshot when collapsed 1`] = `
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"mx-2 flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"font-italic text-truncate overflow-hidden\\">
|
||||
Mocked Silence
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\\"pt-1 d-flex flex-row justify-content-between\\">
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
<span class=\\"badge badge-light nmb-05 align-text-bottom p-1\\">
|
||||
Expires
|
||||
<time datetime=\\"946688400000\\">
|
||||
in 30 minutes
|
||||
</time>
|
||||
<div class=\\"progress silence-progress bg-white\\">
|
||||
<div class=\\"progress-bar bg-success\\"
|
||||
role=\\"progressbar\\"
|
||||
style=\\"width: 50%;\\"
|
||||
aria-valuenow=\\"50\\"
|
||||
aria-valuemin=\\"0\\"
|
||||
aria-valuemax=\\"100\\"
|
||||
>
|
||||
<div class=\\"components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
<span class=\\"badge badge-light nmb-05 align-text-bottom p-1\\">
|
||||
Expires
|
||||
<time datetime=\\"946688400000\\">
|
||||
in 30 minutes
|
||||
</time>
|
||||
<div class=\\"progress silence-progress bg-white\\">
|
||||
<div class=\\"progress-bar bg-success\\"
|
||||
role=\\"progressbar\\"
|
||||
style=\\"width: 50%;\\"
|
||||
aria-valuenow=\\"50\\"
|
||||
aria-valuemin=\\"0\\"
|
||||
aria-valuemax=\\"100\\"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\\"flex-grow-0 flex-shrink-0 mt-auto mb-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-up\\"
|
||||
class=\\"svg-inline--fa fa-chevron-up fa-w-14 ml-2 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\\"
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<div class=\\"d-flex flex-column flex-sm-row justify-content-between\\">
|
||||
<div class
|
||||
style=\\"display: inline-block; max-width: 100%;\\"
|
||||
data-tooltipped
|
||||
aria-describedby=\\"tippy-tooltip-1\\"
|
||||
data-original-title=\\"Click to only show @silence_id=04d37636-2350-4878-b382-e0b50353230f alerts or Alt+Click to hide them\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<span class=\\" badge-primary badge-pill components-label-with-hover components-label badge\\"
|
||||
style=\\"opacity: 1;\\"
|
||||
>
|
||||
123
|
||||
</span>
|
||||
</div>
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-up\\"
|
||||
class=\\"svg-inline--fa fa-chevron-up fa-w-14 my-sm-auto mt-2 mb-0 ml-sm-2 ml-auto mr-sm-0 mr-1 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,7 +88,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
|
||||
<div class=\\"card my-1 components-managed-silence components-animation-fade-appear components-animation-fade-appear-active\\">
|
||||
<div class=\\"card-header border-bottom-0 px-3\\">
|
||||
<div class=\\"d-flex flex-row\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0 mr-2\\">
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
@@ -92,33 +104,45 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"mx-2 flex-shrink-1 flex-grow-1 mw-1p\\">
|
||||
<div class=\\"font-italic \\">
|
||||
Mocked Silence
|
||||
</div>
|
||||
<div class=\\"components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=\\"pt-1 d-flex flex-row justify-content-between\\">
|
||||
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p components-managed-silence-cite\\">
|
||||
<span class=\\"text-muted mr-2 font-italic\\">
|
||||
— me@example.com
|
||||
</span>
|
||||
</div>
|
||||
<div class=\\"flex-grow-0 flex-shrink-0 mt-auto mb-0\\">
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-down\\"
|
||||
class=\\"svg-inline--fa fa-chevron-down fa-w-14 ml-2 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\\"
|
||||
<div class=\\"flex-shrink-0 flex-grow-0\\">
|
||||
<div class=\\"d-flex flex-column flex-sm-row justify-content-between\\">
|
||||
<div class
|
||||
style=\\"display: inline-block; max-width: 100%;\\"
|
||||
data-tooltipped
|
||||
aria-describedby=\\"tippy-tooltip-3\\"
|
||||
data-original-title=\\"Click to only show @silence_id=04d37636-2350-4878-b382-e0b50353230f alerts or Alt+Click to hide them\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<span class=\\" badge-primary badge-pill components-label-with-hover components-label badge\\"
|
||||
style=\\"opacity: 1;\\"
|
||||
>
|
||||
123
|
||||
</span>
|
||||
</div>
|
||||
<svg aria-hidden=\\"true\\"
|
||||
focusable=\\"false\\"
|
||||
data-prefix=\\"fas\\"
|
||||
data-icon=\\"chevron-down\\"
|
||||
class=\\"svg-inline--fa fa-chevron-down fa-w-14 my-sm-auto mt-2 mb-0 ml-sm-2 ml-auto mr-sm-0 mr-1 text-muted cursor-pointer\\"
|
||||
role=\\"img\\"
|
||||
xmlns=\\"http://www.w3.org/2000/svg\\"
|
||||
viewbox=\\"0 0 448 512\\"
|
||||
>
|
||||
<path fill=\\"currentColor\\"
|
||||
d=\\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\\"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,6 +17,8 @@ const ManagedSilence = observer(
|
||||
class ManagedSilence extends Component {
|
||||
static propTypes = {
|
||||
cluster: PropTypes.string.isRequired,
|
||||
alertCount: PropTypes.number.isRequired,
|
||||
alertCountAlwaysVisible: PropTypes.bool.isRequired,
|
||||
silence: APISilence.isRequired,
|
||||
alertStore: PropTypes.instanceOf(AlertStore).isRequired,
|
||||
silenceFormStore: PropTypes.instanceOf(SilenceFormStore).isRequired,
|
||||
@@ -60,6 +62,8 @@ const ManagedSilence = observer(
|
||||
render() {
|
||||
const {
|
||||
cluster,
|
||||
alertCount,
|
||||
alertCountAlwaysVisible,
|
||||
silence,
|
||||
alertStore,
|
||||
silenceFormStore,
|
||||
@@ -71,7 +75,10 @@ const ManagedSilence = observer(
|
||||
<div className="card my-1 components-managed-silence">
|
||||
<div className="card-header border-bottom-0 px-3">
|
||||
<SilenceComment
|
||||
alertStore={alertStore}
|
||||
silence={silence}
|
||||
alertCount={alertCount}
|
||||
alertCountAlwaysVisible={alertCountAlwaysVisible}
|
||||
collapsed={this.collapse.value}
|
||||
collapseToggle={this.collapse.toggle}
|
||||
/>
|
||||
|
||||
@@ -54,6 +54,8 @@ const MountedManagedSilence = onDidUpdate => {
|
||||
return mount(
|
||||
<ManagedSilence
|
||||
cluster={cluster}
|
||||
alertCount={123}
|
||||
alertCountAlwaysVisible={true}
|
||||
silence={silence}
|
||||
alertStore={alertStore}
|
||||
silenceFormStore={silenceFormStore}
|
||||
|
||||
@@ -241,6 +241,8 @@ const Browser = observer(
|
||||
<ManagedSilence
|
||||
key={`${silence.cluster}/${silence.silence.id}`}
|
||||
cluster={silence.cluster}
|
||||
alertCount={silence.alertCount}
|
||||
alertCountAlwaysVisible={true}
|
||||
silence={silence.silence}
|
||||
alertStore={alertStore}
|
||||
silenceFormStore={silenceFormStore}
|
||||
|
||||
@@ -63,6 +63,7 @@ const MockSilenceList = count => {
|
||||
silence.id = `silence${index}`;
|
||||
silences.push({
|
||||
cluster: cluster,
|
||||
alertCount: 123,
|
||||
silence: silence
|
||||
});
|
||||
}
|
||||
@@ -86,6 +87,7 @@ describe("<Browser />", () => {
|
||||
JSON.stringify([
|
||||
{
|
||||
cluster: cluster,
|
||||
alertCount: 123,
|
||||
silence: silence
|
||||
}
|
||||
])
|
||||
@@ -102,6 +104,7 @@ describe("<Browser />", () => {
|
||||
JSON.stringify([
|
||||
{
|
||||
cluster: cluster,
|
||||
alertCount: 123,
|
||||
silence: silence
|
||||
}
|
||||
])
|
||||
@@ -123,6 +126,7 @@ describe("<Browser />", () => {
|
||||
JSON.stringify([
|
||||
{
|
||||
cluster: cluster,
|
||||
alertCount: 123,
|
||||
silence: silence
|
||||
}
|
||||
])
|
||||
@@ -172,6 +176,7 @@ describe("<Browser />", () => {
|
||||
JSON.stringify([
|
||||
{
|
||||
cluster: cluster,
|
||||
alertCount: 123,
|
||||
silence: silence
|
||||
}
|
||||
])
|
||||
|
||||
@@ -125,6 +125,7 @@ storiesOf("SilenceModal", module)
|
||||
silence.id = `silence${index}`;
|
||||
silences.push({
|
||||
cluster: "am",
|
||||
alertCount: (index - 1) * 9,
|
||||
silence: silence
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user