Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed May 25, 2021
1 parent 3c82724 commit 42991e8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
BROWSER_FAMILY_LABEL,
BROWSER_VERSION_LABEL,
CLS_LABEL,
CORE_WEB_VITALS_LABEL,
CPU_USAGE_LABEL,
DEVICE_LABEL,
ENVIRONMENT_LABEL,
Expand Down Expand Up @@ -92,6 +93,7 @@ export const DataViewLabels: Record<ReportViewTypeId, string> = {
logs: LOGS_FREQUENCY_LABEL,
mem: MEMORY_USAGE_LABEL,
nwk: NETWORK_ACTIVITY_LABEL,
cwv: CORE_WEB_VITALS_LABEL,
};

export const ReportToDataTypeMap: Record<ReportViewTypeId, AppDataType> = {
Expand All @@ -105,6 +107,7 @@ export const ReportToDataTypeMap: Record<ReportViewTypeId, AppDataType> = {
mem: 'infra_metrics',
logs: 'infra_logs',
cpu: 'infra_metrics',
cwv: 'ux',
};

export const USE_BREAK_DOWN_COLUMN = 'USE_BREAK_DOWN_COLUMN';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ export const NETWORK_ACTIVITY_LABEL = i18n.translate(
defaultMessage: 'Network activity',
}
);

export const CORE_WEB_VITALS_LABEL = i18n.translate(
'xpack.observability.expView.fieldLabels.coreWebVitals',
{
defaultMessage: 'Core web vitals',
}
);

export const MEMORY_USAGE_LABEL = i18n.translate(
'xpack.observability.expView.fieldLabels.memoryUsage',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function ReportDefinitionCol({
</EuiFlexItem>
<EuiHorizontalRule margin="xs" />
{indexPattern &&
reportDefinitions.map(({ field, custom, options, defaultValue }) => (
reportDefinitions.map(({ field, custom, options }) => (
<EuiFlexItem key={field}>
{!custom ? (
<ReportDefinitionField
Expand All @@ -78,12 +78,7 @@ export function ReportDefinitionCol({
onChange={onChange}
/>
) : (
<CustomReportField
field={field}
options={options}
defaultValue={defaultValue}
seriesId={seriesId}
/>
<CustomReportField field={field} options={options} seriesId={seriesId} />
)}
</EuiFlexItem>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Props {
options: ReportDefinition['options'];
}

export function CustomReportField({ field, seriesId, options: opts, defaultValue }: Props) {
export function CustomReportField({ field, seriesId, options: opts }: Props) {
const { series, setSeries } = useUrlStorage(seriesId);

const { reportDefinitions: rtd = {} } = series;
Expand All @@ -39,7 +39,7 @@ export function CustomReportField({ field, seriesId, options: opts, defaultValue
value: fd || id,
inputDisplay: label,
}))}
valueOfSelected={reportDefinitions?.[field]?.[0] || defaultValue || options?.[0].field}
valueOfSelected={reportDefinitions?.[field]?.[0] || options?.[0].field}
onChange={(value) => onChange(value)}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function ChartEditOptions({ series, seriesId, breakdowns }: Props) {
return (
<EuiFlexGroup wrap>
<EuiFlexItem>
<Breakdowns seriesId={seriesId} breakdowns={breakdowns} />
<Breakdowns seriesId={seriesId} breakdowns={breakdowns} reportViewConfig={series} />
</EuiFlexItem>
<EuiFlexItem>
<ChartOptions series={series} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { EuiSuperSelect } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FieldLabels, USE_BREAK_DOWN_COLUMN } from '../../configurations/constants';
import { USE_BREAK_DOWN_COLUMN } from '../../configurations/constants';
import { useUrlStorage } from '../../hooks/use_url_storage';
import { DataSeries } from '../../types';

Expand Down

0 comments on commit 42991e8

Please sign in to comment.