Skip to content

Commit

Permalink
Merge branch 'main' into 155110-inventory-views-client
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyghiani authored Apr 26, 2023
2 parents 122e63a + c7c5717 commit ea223de
Show file tree
Hide file tree
Showing 183 changed files with 831 additions and 18,928 deletions.
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pageLoadAssetSize:
newsfeed: 42228
observability: 95000
observabilityOnboarding: 19573
observabilityShared: 21266
observabilityShared: 36643
osquery: 107090
painlessLab: 179748
presentationUtil: 58834
Expand Down
2 changes: 1 addition & 1 deletion x-pack/examples/exploratory_view_example/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
} from '@elastic/eui';
import type { DataView } from '@kbn/data-views-plugin/public';
import { CoreStart } from '@kbn/core/public';
import { AllSeries } from '@kbn/observability-plugin/public';
import { AllSeries } from '@kbn/exploratory-view-plugin/public';
import { StartDependencies } from './plugin';

export const App = (props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,10 @@ export function SeriesColorPicker({ seriesId, series }: { seriesId: number; seri
);
}

const PICK_A_COLOR_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.pickColor',
{
defaultMessage: 'Pick a color',
}
);
const PICK_A_COLOR_LABEL = i18n.translate('xpack.exploratoryView.pickColor', {
defaultMessage: 'Pick a color',
});

const EDIT_SERIES_COLOR_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.editSeriesColor',
{
defaultMessage: 'Edit color for series',
}
);
const EDIT_SERIES_COLOR_LABEL = i18n.translate('xpack.exploratoryView.editSeriesColor', {
defaultMessage: 'Edit color for series',
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function getAlertsKPIConfig({ spaceId }: ConfigProps): SeriesConfig {
defaultSeriesType: 'line',
seriesTypes: [],
xAxisColumn: {
label: i18n.translate('xpack.exploratoryView.exploratoryView.alerts.alertStarted', {
label: i18n.translate('xpack.exploratoryView.alerts.alertStarted', {
defaultMessage: 'Timestamp',
}),
dataType: 'date',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function getLogsKPIConfig(configProps: ConfigProps): SeriesConfig {
defaultSeriesType: 'bar',
seriesTypes: [],
xAxisColumn: {
label: i18n.translate('xpack.exploratoryView.exploratoryView.logs.logRateXAxisLabel', {
label: i18n.translate('xpack.exploratoryView.logs.logRateXAxisLabel', {
defaultMessage: 'Timestamp',
}),
dataType: 'date',
Expand All @@ -28,7 +28,7 @@ export function getLogsKPIConfig(configProps: ConfigProps): SeriesConfig {
},
yAxisColumns: [
{
label: i18n.translate('xpack.exploratoryView.exploratoryView.logs.logRateYAxisLabel', {
label: i18n.translate('xpack.exploratoryView.logs.logRateYAxisLabel', {
defaultMessage: 'Log rate per minute',
}),
dataType: 'number',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ function EmptyState({ height }: { height?: string }) {
);
}

const NO_DATA_LABEL = i18n.translate('xpack.exploratoryView.overview.exploratoryView.noData', {
const NO_DATA_LABEL = i18n.translate('xpack.exploratoryView.noData', {
defaultMessage: 'No data',
});
Original file line number Diff line number Diff line change
Expand Up @@ -204,27 +204,18 @@ const ShowPreview = styled(EuiButtonEmpty)`
bottom: 34px;
`;

const PREVIEW_LABEL = i18n.translate('xpack.exploratoryView.overview.exploratoryView.preview', {
const PREVIEW_LABEL = i18n.translate('xpack.exploratoryView.preview', {
defaultMessage: 'Preview',
});

const HIDE_CHART_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.hideChart',
{
defaultMessage: 'Hide chart',
}
);
const HIDE_CHART_LABEL = i18n.translate('xpack.exploratoryView.hideChart', {
defaultMessage: 'Hide chart',
});

const SHOW_CHART_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.showChart',
{
defaultMessage: 'Show chart',
}
);
const SHOW_CHART_LABEL = i18n.translate('xpack.exploratoryView.showChart', {
defaultMessage: 'Show chart',
});

const LENS_NOT_AVAILABLE = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.lensDisabled',
{
defaultMessage: 'Lens app is not available, please enable Lens to use exploratory view.',
}
);
const LENS_NOT_AVAILABLE = i18n.translate('xpack.exploratoryView.lensDisabled', {
defaultMessage: 'Lens app is not available, please enable Lens to use exploratory view.',
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export function RefreshButton() {
);
}

export const REFRESH_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.refresh',
{
defaultMessage: 'Refresh',
}
);
export const REFRESH_LABEL = i18n.translate('xpack.exploratoryView.refresh', {
defaultMessage: 'Refresh',
});
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function ExploratoryViewPage({
useBreadcrumbs(
[
{
text: i18n.translate('xpack.exploratoryView.overview.exploratoryView', {
text: i18n.translate('xpack.exploratoryView.overview', {
defaultMessage: 'Explore data',
}),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,30 @@ export enum DataTypes {
}

export const DataTypesLabels: Record<string, string> = {
[DataTypes.UX]: i18n.translate('xpack.exploratoryView.overview.exploratoryView.uxLabel', {
[DataTypes.UX]: i18n.translate('xpack.exploratoryView.uxLabel', {
defaultMessage: 'User experience (RUM)',
}),

[DataTypes.SYNTHETICS]: i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.syntheticsLabel',
{
defaultMessage: 'Synthetics monitoring',
}
),
[DataTypes.SYNTHETICS]: i18n.translate('xpack.exploratoryView.syntheticsLabel', {
defaultMessage: 'Synthetics monitoring',
}),

[DataTypes.UPTIME]: i18n.translate('xpack.exploratoryView.overview.exploratoryView.uptimeLabel', {
[DataTypes.UPTIME]: i18n.translate('xpack.exploratoryView.uptimeLabel', {
defaultMessage: 'Uptime',
}),

[DataTypes.METRICS]: i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.metricsLabel',
{
defaultMessage: 'Metrics',
}
),
[DataTypes.METRICS]: i18n.translate('xpack.exploratoryView.metricsLabel', {
defaultMessage: 'Metrics',
}),

[DataTypes.LOGS]: i18n.translate('xpack.exploratoryView.overview.exploratoryView.logsLabel', {
[DataTypes.LOGS]: i18n.translate('xpack.exploratoryView.logsLabel', {
defaultMessage: 'Logs',
}),

[DataTypes.MOBILE]: i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.mobileExperienceLabel',
{
defaultMessage: 'Mobile experience',
}
),
[DataTypes.ALERTS]: i18n.translate('xpack.exploratoryView.overview.exploratoryView.alertsLabel', {
[DataTypes.MOBILE]: i18n.translate('xpack.exploratoryView.mobileExperienceLabel', {
defaultMessage: 'Mobile experience',
}),
[DataTypes.ALERTS]: i18n.translate('xpack.exploratoryView.alertsLabel', {
defaultMessage: 'Alerts',
}),
};
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function LensEmbeddable(props: Props) {
});
} else {
notifications?.toasts.add(
i18n.translate('xpack.exploratoryView.exploratoryView.noBrusing', {
i18n.translate('xpack.exploratoryView.noBrushing', {
defaultMessage: 'Zoom by brush selection is only available on time series charts.',
})
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,18 @@ export function Breakdowns({ seriesConfig, seriesId, series }: Props) {
}

export const NO_BREAK_DOWN_LABEL = i18n.translate(
'xpack.exploratoryView.exp.breakDownFilter.noBreakdown',
'xpack.exploratoryView.breakDownFilter.noBreakdown',
{
defaultMessage: 'No breakdown',
}
);

export const BREAKDOWN_WARNING = i18n.translate(
'xpack.exploratoryView.exp.breakDownFilter.warning',
{
defaultMessage: 'Breakdowns can be applied to only one series at a time.',
}
);
export const BREAKDOWN_WARNING = i18n.translate('xpack.exploratoryView.breakDownFilter.warning', {
defaultMessage: 'Breakdowns can be applied to only one series at a time.',
});

export const BREAKDOWN_UNAVAILABLE = i18n.translate(
'xpack.exploratoryView.exp.breakDownFilter.unavailable',
'xpack.exploratoryView.breakDownFilter.unavailable',
{
defaultMessage:
'Step name breakdown is not available for monitor duration metric. Use step duration metric to breakdown by step name.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,10 @@ export function DataTypesSelect({ seriesId, series }: Props) {
);
}

const SELECT_DATA_TYPE_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.selectDataType',
{
defaultMessage: 'Select data type',
}
);
const SELECT_DATA_TYPE_LABEL = i18n.translate('xpack.exploratoryView.selectDataType', {
defaultMessage: 'Select data type',
});

const SELECT_DATA_TYPE_TOOLTIP = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.selectDataTypeTooltip',
{
defaultMessage: 'Data type cannot be edited.',
}
);
const SELECT_DATA_TYPE_TOOLTIP = i18n.translate('xpack.exploratoryView.selectDataTypeTooltip', {
defaultMessage: 'Data type cannot be edited.',
});
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function DatePickerCol({ seriesId, series }: Props) {
<EuiFlexGroup alignItems="center">
<EuiFlexItem grow={false}>
<strong>
{i18n.translate('xpack.exploratoryView.overview.exploratoryView.noDataAvailable', {
{i18n.translate('xpack.exploratoryView.noDataAvailable', {
defaultMessage: 'No {dataType} data available.',
values: {
dataType: series.dataType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function IncompleteBadge({ seriesConfig, series }: Props) {
(!dataType || isEmpty(reportDefinitions) || !selectedMetricField) && !loading;

const incompleteDefinition = isEmpty(reportDefinitions)
? i18n.translate('xpack.exploratoryView.overview.exploratoryView.missingReportDefinition', {
? i18n.translate('xpack.exploratoryView.missingReportDefinition', {
defaultMessage: 'Missing {reportDefinition}',
values: {
reportDefinition:
Expand All @@ -55,16 +55,10 @@ export function IncompleteBadge({ seriesConfig, series }: Props) {
return <EuiBadge color="warning">{incompleteMessage}</EuiBadge>;
}

const MISSING_REPORT_METRIC_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.missingReportMetric',
{
defaultMessage: 'Missing report metric',
}
);
const MISSING_REPORT_METRIC_LABEL = i18n.translate('xpack.exploratoryView.missingReportMetric', {
defaultMessage: 'Missing report metric',
});

const MISSING_DATA_TYPE_LABEL = i18n.translate(
'xpack.exploratoryView.overview.exploratoryView.missingDataType',
{
defaultMessage: 'Missing data type',
}
);
const MISSING_DATA_TYPE_LABEL = i18n.translate('xpack.exploratoryView.missingDataType', {
defaultMessage: 'Missing data type',
});
1 change: 1 addition & 0 deletions x-pack/plugins/observability/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"data",
"dataViews",
"embeddable",
"exploratoryView",
"features",
"files",
"guidedOnboarding",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import { i18n } from '@kbn/i18n';
import React from 'react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { CoreStart } from '@kbn/core/public';
import { AllSeries } from '@kbn/exploratory-view-plugin/public';
import { SERVICE_NAME, TRANSACTION_DURATION } from '@kbn/observability-shared-plugin/common';
import { UX_APP } from '../../../../context/constants';
import { ObservabilityPublicPluginsStart } from '../../../..';
import { SectionContainer } from '..';
Expand All @@ -17,12 +18,7 @@ import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher';
import { useHasData } from '../../../../hooks/use_has_data';
import { useDatePickerContext } from '../../../../hooks/use_date_picker_context';
import CoreVitals from '../../../shared/core_web_vitals';
import { getExploratoryViewEmbeddable } from '../../../shared/exploratory_view/embeddable';
import { AllSeries } from '../../../shared/exploratory_view/hooks/use_series_storage';
import {
SERVICE_NAME,
TRANSACTION_DURATION,
} from '../../../shared/exploratory_view/configurations/constants/elasticsearch_fieldnames';

import type { BucketSize } from '../../../../pages/overview/helpers/calculate_bucket_size';
interface Props {
bucketSize: BucketSize;
Expand All @@ -31,15 +27,14 @@ interface Props {
export function UXSection({ bucketSize }: Props) {
const { forceUpdate, hasDataMap } = useHasData();
const { services } = useKibana<ObservabilityPublicPluginsStart>();

const { ExploratoryViewEmbeddable } = services.exploratoryView;

const { relativeStart, relativeEnd, absoluteStart, absoluteEnd, lastUpdated } =
useDatePickerContext();
const uxHasDataResponse = hasDataMap.ux;
const serviceName = uxHasDataResponse?.serviceName as string;

const ExploratoryViewEmbeddable = getExploratoryViewEmbeddable(
services as ObservabilityPublicPluginsStart & CoreStart
);

const seriesList: AllSeries = [
{
name: PAGE_LOAD_DISTRIBUTION_TITLE,
Expand Down
Loading

0 comments on commit ea223de

Please sign in to comment.