mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
parent
5daaa05c6c
commit
69344a0e53
12 changed files with 6 additions and 31 deletions
|
@ -206,8 +206,6 @@ module.exports = {
|
|||
files: ['x-pack/legacy/plugins/ml/**/*.{js,ts,tsx}'],
|
||||
rules: {
|
||||
'react-hooks/exhaustive-deps': 'off',
|
||||
'react-hooks/rules-of-hooks': 'off',
|
||||
'jsx-a11y/click-events-have-key-events': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -28,9 +28,6 @@ function getPercentLabel(valueCount: number, totalCount: number): string {
|
|||
|
||||
export const BooleanContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { count, sampleCount, trueCount, falseCount } = stats;
|
||||
const docsPercent = roundToDecimalPlace((count / sampleCount) * 100);
|
||||
|
|
|
@ -19,9 +19,6 @@ const TIME_FORMAT = 'MMM D YYYY, HH:mm:ss.SSS';
|
|||
|
||||
export const DateContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { count, sampleCount, earliest, latest } = stats;
|
||||
const docsPercent = roundToDecimalPlace((count / sampleCount) * 100);
|
||||
|
|
|
@ -17,9 +17,6 @@ const CHART_HEIGHT = 350;
|
|||
|
||||
export const DocumentCountContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { documentCounts, timeRangeEarliest, timeRangeLatest } = stats;
|
||||
|
||||
|
|
|
@ -36,9 +36,6 @@ export const GeoPointContent: FC<FieldDataCardProps> = ({ config }) => {
|
|||
// }
|
||||
|
||||
const { stats } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { count, sampleCount, cardinality, examples } = stats;
|
||||
const docsPercent = roundToDecimalPlace((count / sampleCount) * 100);
|
||||
|
|
|
@ -18,9 +18,6 @@ import { TopValues } from '../top_values';
|
|||
|
||||
export const IpContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats, fieldFormat } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { count, sampleCount, cardinality } = stats;
|
||||
const docsPercent = roundToDecimalPlace((count / sampleCount) * 100);
|
||||
|
|
|
@ -18,9 +18,6 @@ import { TopValues } from '../top_values';
|
|||
|
||||
export const KeywordContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats, fieldFormat } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { count, sampleCount, cardinality } = stats;
|
||||
const docsPercent = roundToDecimalPlace((count / sampleCount) * 100);
|
||||
|
|
|
@ -34,9 +34,6 @@ const DEFAULT_TOP_VALUES_THRESHOLD = 100;
|
|||
|
||||
export const NumberContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats, fieldFormat } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const chartData = buildChartDataFromStats(stats, METRIC_DISTRIBUTION_CHART_WIDTH);
|
||||
|
|
|
@ -16,9 +16,6 @@ import { ExamplesList } from '../examples_list';
|
|||
|
||||
export const OtherContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats, type, aggregatable } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { count, sampleCount, cardinality, examples } = stats;
|
||||
const docsPercent = roundToDecimalPlace((count / sampleCount) * 100);
|
||||
|
|
|
@ -15,9 +15,6 @@ import { ExamplesList } from '../examples_list';
|
|||
|
||||
export const TextContent: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { stats } = config;
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { examples } = stats;
|
||||
const numExamples = examples.length;
|
||||
|
|
|
@ -30,7 +30,11 @@ export interface FieldDataCardProps {
|
|||
}
|
||||
|
||||
export const FieldDataCard: FC<FieldDataCardProps> = ({ config }) => {
|
||||
const { fieldName, loading, type, existsInDocs } = config;
|
||||
const { fieldName, loading, type, existsInDocs, stats } = config;
|
||||
|
||||
if (stats === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function getCardContent() {
|
||||
if (existsInDocs === false) {
|
||||
|
|
|
@ -198,7 +198,7 @@ function TabStack({ title, items, switchState, switchFunc }) {
|
|||
|
||||
return (
|
||||
<li key={i} className={className} >
|
||||
<a onClick={() => switchFunc(item.index)}>{item.label}</a>
|
||||
<a onClick={() => switchFunc(item.index)} onKeyUp={() => {}} >{item.label}</a>
|
||||
{(item.body !== undefined) &&
|
||||
<div className="body">
|
||||
{item.body}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue