mirror of
https://github.com/prymitive/karma
synced 2026-05-19 04:26:41 +00:00
chore(ui): user offset and raw filter from the api response
This commit is contained in:
@@ -4,7 +4,6 @@ import PropTypes from "prop-types";
|
||||
import { observer } from "mobx-react";
|
||||
|
||||
import { AlertStore } from "Stores/AlertStore";
|
||||
import { QueryOperators, FormatQuery } from "Common/Query";
|
||||
import { LabelWithPercent } from "Components/Labels/LabelWithPercent";
|
||||
|
||||
const LabelsTable = observer(({ alertStore }) => (
|
||||
@@ -24,26 +23,17 @@ const LabelsTable = observer(({ alertStore }) => (
|
||||
</span>
|
||||
</td>
|
||||
<td width="75%" className="mw-100 p-1">
|
||||
{nameStats.values.slice(0, 9).map((valueStats, i, array) => (
|
||||
{nameStats.values.slice(0, 9).map((valueStats, i) => (
|
||||
<LabelWithPercent
|
||||
key={valueStats.value}
|
||||
name={nameStats.name}
|
||||
value={valueStats.value}
|
||||
hits={valueStats.hits}
|
||||
percent={valueStats.percent}
|
||||
offset={array
|
||||
.slice(0, i)
|
||||
.map(ns => ns.percent)
|
||||
.reduce((a, b) => a + b, 0)}
|
||||
offset={valueStats.offset}
|
||||
isActive={
|
||||
alertStore.filters.values.filter(
|
||||
f =>
|
||||
f.raw ===
|
||||
FormatQuery(
|
||||
nameStats.name,
|
||||
QueryOperators.Equal,
|
||||
valueStats.value
|
||||
)
|
||||
f => f.raw === valueStats.raw
|
||||
).length > 0
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user