Updates swim lane UI text (#69454)

This commit is contained in:
Lisa Cawley 2020-06-23 08:59:32 -07:00 committed by GitHub
parent 8956a33e4c
commit 0e2f9fc365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 26 deletions

View file

@ -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,
@ -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>
@ -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:"
/>
}
>

View file

@ -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',
@ -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',

View file

@ -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;
@ -81,7 +81,7 @@ export class ExplorerService {
}
/**
* Loads overall swimlane data
* Loads overall swim lane data
* @param selectedJobs
* @param chartWidth
*/
@ -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.
@ -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;
}
@ -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`;
@ -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;
}
@ -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({
@ -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.
@ -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,
};
@ -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) => {

View file

@ -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(', ') },
});

View file

@ -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',
});
}

View file

@ -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>
@ -121,7 +121,7 @@ export const AnomalySwimlaneInitializer: FC<AnomalySwimlaneInitializerProps> = (
label={
<FormattedMessage
id="xpack.ml.swimlaneEmbeddable.setupModal.swimlaneTypeLabel"
defaultMessage="Swimlane type"
defaultMessage="Swim lane type"
/>
}
>
@ -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}

View file

@ -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"

View file

@ -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) {