Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into add-endpoint-…
Browse files Browse the repository at this point in the history
…alerts-url
  • Loading branch information
XavierM committed Jun 23, 2020
2 parents a914816 + 0e2f9fc commit 09c729e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ interface AddToDashboardControlProps {
}

/**
* Component for attaching anomaly swimlane embeddable to dashboards.
* Component for attaching anomaly swim lane embeddable to dashboards.
*/
export const AddToDashboardControl: FC<AddToDashboardControlProps> = ({
onClose,
Expand Down Expand Up @@ -225,7 +225,7 @@ export const AddToDashboardControl: FC<AddToDashboardControlProps> = ({
<EuiModalHeaderTitle>
<FormattedMessage
id="xpack.ml.explorer.dashboardsTitle"
defaultMessage="Add swimlanes to dashboards"
defaultMessage="Add swim lanes to dashboards"
/>
</EuiModalHeaderTitle>
</EuiModalHeader>
Expand All @@ -234,7 +234,7 @@ export const AddToDashboardControl: FC<AddToDashboardControlProps> = ({
label={
<FormattedMessage
id="xpack.ml.explorer.addToDashboard.selectSwimlanesLabel"
defaultMessage="Select swimlane view:"
defaultMessage="Select swim lane view:"
/>
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ describe('DashboardService', () => {
gridData: { x: 24, y: 0, w: 24, h: 15, i: '0aa334bd-8308-4ded-9462-80dbd37680ee' },
panelIndex: '0aa334bd-8308-4ded-9462-80dbd37680ee',
embeddableConfig: {
title: 'ML anomaly swimlane for fb_population_1',
title: 'ML anomaly swim lane for fb_population_1',
jobIds: ['fb_population_1'],
limit: 5,
swimlaneType: 'overall',
},
title: 'ML anomaly swimlane for fb_population_1',
title: 'ML anomaly swim lane for fb_population_1',
},
{
version: '8.0.0',
Expand Down Expand Up @@ -118,12 +118,12 @@ describe('DashboardService', () => {
gridData: { x: 24, y: 0, w: 24, h: 15, i: '0aa334bd-8308-4ded-9462-80dbd37680ee' },
panelIndex: '0aa334bd-8308-4ded-9462-80dbd37680ee',
embeddableConfig: {
title: 'ML anomaly swimlane for fb_population_1',
title: 'ML anomaly swim lane for fb_population_1',
jobIds: ['fb_population_1'],
limit: 5,
swimlaneType: 'overall',
},
title: 'ML anomaly swimlane for fb_population_1',
title: 'ML anomaly swim lane for fb_population_1',
},
{
version: '8.0.0',
Expand Down
24 changes: 12 additions & 12 deletions x-pack/plugins/ml/public/application/services/explorer_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class ExplorerService {

const intervalSeconds = this.timeBuckets.getInterval().asSeconds();

// if the swimlane cell widths are too small they will not be visible
// calculate how many buckets will be drawn before the swimlanes are actually rendered
// if the swim lane cell widths are too small they will not be visible
// calculate how many buckets will be drawn before the swim lanes are actually rendered
// and increase the interval to widen the cells if they're going to be smaller than 8px
// this has to be done at this stage so all searches use the same interval
const timerangeSeconds = (bounds.max!.valueOf() - bounds.min!.valueOf()) / 1000;
Expand All @@ -81,7 +81,7 @@ export class ExplorerService {
}

/**
* Loads overall swimlane data
* Loads overall swim lane data
* @param selectedJobs
* @param chartWidth
*/
Expand All @@ -97,13 +97,13 @@ export class ExplorerService {

const bounds = this.getTimeBounds();

// Ensure the search bounds align to the bucketing interval used in the swimlane so
// Ensure the search bounds align to the bucketing interval used in the swim lane so
// that the first and last buckets are complete.
const searchBounds = getBoundsRoundedToInterval(bounds, interval, false);
const selectedJobIds = selectedJobs.map((d) => d.id);

// Load the overall bucket scores by time.
// Pass the interval in seconds as the swimlane relies on a fixed number of seconds between buckets
// Pass the interval in seconds as the swim lane relies on a fixed number of seconds between buckets
// which wouldn't be the case if e.g. '1M' was used.
// Pass 'true' when obtaining bucket bounds due to the way the overall_buckets endpoint works
// to ensure the search is inclusive of end time.
Expand All @@ -125,7 +125,7 @@ export class ExplorerService {
);

// eslint-disable-next-line no-console
console.log('Explorer overall swimlane data set:', overallSwimlaneData);
console.log('Explorer overall swim lane data set:', overallSwimlaneData);

return overallSwimlaneData;
}
Expand Down Expand Up @@ -158,7 +158,7 @@ export class ExplorerService {

const selectedJobIds = selectedJobs.map((d) => d.id);
// load scores by influencer/jobId value and time.
// Pass the interval in seconds as the swimlane relies on a fixed number of seconds between buckets
// Pass the interval in seconds as the swim lane relies on a fixed number of seconds between buckets
// which wouldn't be the case if e.g. '1M' was used.

const interval = `${swimlaneBucketInterval.asSeconds()}s`;
Expand Down Expand Up @@ -199,7 +199,7 @@ export class ExplorerService {
swimlaneBucketInterval.asSeconds()
);
// eslint-disable-next-line no-console
console.log('Explorer view by swimlane data set:', viewBySwimlaneData);
console.log('Explorer view by swim lane data set:', viewBySwimlaneData);

return viewBySwimlaneData;
}
Expand Down Expand Up @@ -227,7 +227,7 @@ export class ExplorerService {
};

// Store the earliest and latest times of the data returned by the ES aggregations,
// These will be used for calculating the earliest and latest times for the swimlane charts.
// These will be used for calculating the earliest and latest times for the swim lane charts.
Object.entries(scoresByTime).forEach(([timeMs, score]) => {
const time = Number(timeMs) / 1000;
dataset.points.push({
Expand All @@ -250,7 +250,7 @@ export class ExplorerService {
viewBySwimlaneFieldName: string,
interval: number
): OverallSwimlaneData {
// Processes the scores for the 'view by' swimlane.
// Processes the scores for the 'view by' swim lane.
// Sorts the lanes according to the supplied array of lane
// values in the order in which they should be displayed,
// or pass an empty array to sort lanes according to max score over all time.
Expand All @@ -259,7 +259,7 @@ export class ExplorerService {
points: [],
laneLabels: [],
interval,
// Set the earliest and latest to be the same as the overall swimlane.
// Set the earliest and latest to be the same as the overall swim lane.
earliest: bounds.earliest,
latest: bounds.latest,
};
Expand Down Expand Up @@ -295,7 +295,7 @@ export class ExplorerService {
});
} else {
// Sort lanes according to supplied order
// e.g. when a cell in the overall swimlane has been selected.
// e.g. when a cell in the overall swim lane has been selected.
// Find the index of each lane label from the actual data set,
// rather than using sortedLaneValues as-is, just in case they differ.
dataset.laneLabels = dataset.laneLabels.sort((a, b) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ANOMALY_SWIMLANE_EMBEDDABLE_TYPE = 'ml_anomaly_swimlane';

export const getDefaultPanelTitle = (jobIds: JobId[]) =>
i18n.translate('xpack.ml.swimlaneEmbeddable.title', {
defaultMessage: 'ML anomaly swimlane for {jobIds}',
defaultMessage: 'ML anomaly swim lane for {jobIds}',
values: { jobIds: jobIds.join(', ') },
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class AnomalySwimlaneEmbeddableFactory

public getDisplayName() {
return i18n.translate('xpack.ml.components.jobAnomalyScoreEmbeddable.displayName', {
defaultMessage: 'ML Anomaly Swimlane',
defaultMessage: 'ML Anomaly Swim Lane',
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const AnomalySwimlaneInitializer: FC<AnomalySwimlaneInitializerProps> = (
<EuiModalHeaderTitle>
<FormattedMessage
id="xpack.ml.swimlaneEmbeddable.setupModal.title"
defaultMessage="Anomaly swimlane configuration"
defaultMessage="Anomaly swim lane configuration"
/>
</EuiModalHeaderTitle>
</EuiModalHeader>
Expand Down Expand Up @@ -121,7 +121,7 @@ export const AnomalySwimlaneInitializer: FC<AnomalySwimlaneInitializerProps> = (
label={
<FormattedMessage
id="xpack.ml.swimlaneEmbeddable.setupModal.swimlaneTypeLabel"
defaultMessage="Swimlane type"
defaultMessage="Swim lane type"
/>
}
>
Expand All @@ -131,7 +131,7 @@ export const AnomalySwimlaneInitializer: FC<AnomalySwimlaneInitializerProps> = (
color="primary"
isFullWidth
legend={i18n.translate('xpack.ml.swimlaneEmbeddable.setupModal.swimlaneTypeLabel', {
defaultMessage: 'Swimlane type',
defaultMessage: 'Swim lane type',
})}
options={swimlaneTypeOptions}
idSelected={swimlaneType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const ExplorerSwimlaneContainer: FC<ExplorerSwimlaneContainerProps> = ({
title={
<FormattedMessage
id="xpack.ml.swimlaneEmbeddable.errorMessage"
defaultMessage="Unable to load the ML swimlane data"
defaultMessage="Unable to load the ML swim lane data"
/>
}
color="danger"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createEditSwimlanePanelAction(getStartServices: CoreSetup['getSt
},
getDisplayName: () =>
i18n.translate('xpack.ml.actions.editSwimlaneTitle', {
defaultMessage: 'Edit swimlane',
defaultMessage: 'Edit swim lane',
}),
execute: async ({ embeddable }: EditSwimlanePanelContext) => {
if (!embeddable) {
Expand Down

0 comments on commit 09c729e

Please sign in to comment.