Skip to content

Commit

Permalink
Fixes type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Feb 16, 2021
1 parent 787ea16 commit 4b299d6
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions x-pack/plugins/ml/common/constants/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type JobValidationMessage = {
};

export const getMessages = once(() => {
const docLinks: CoreStart['docLinks'];
const docsLinks = CoreStart.docLinks;
return {
categorizer_detector_missing_per_partition_field: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -53,7 +53,7 @@ export const getMessages = once(() => {
'Partition field must be set for detectors that reference "mlcategory" when per-partition categorization is enabled.',
}
),
url: `${docLinks.links.ml.anomalyDetectionCategories}`,
url: `${docsLinks.links.ml.anomalyDetectionCategories}`,
},
categorizer_varying_per_partition_fields: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -68,7 +68,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.anomalyDetectionCategories}`,
url: `${docsLinks.links.ml.anomalyDetectionCategories}`,
},
field_not_aggregatable: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -78,14 +78,14 @@ export const getMessages = once(() => {
fieldName: '"{{fieldName}}"',
},
}),
url: `${docLinks.links.ml.anomalyDetectionAggs}`,
url: `${docsLinks.links.ml.anomalyDetectionAggs}`,
},
fields_not_aggregatable: {
status: VALIDATION_STATUS.ERROR,
text: i18n.translate('xpack.ml.models.jobValidation.messages.fieldsNotAggregatableMessage', {
defaultMessage: 'One of the detector fields is not an aggregatable field.',
}),
url: `${docLinks.links.ml.anomalyDetectionAggs}`,
url: `${docsLinks.links.ml.anomalyDetectionAggs}`,
},
cardinality_no_results: {
status: VALIDATION_STATUS.WARNING,
Expand Down Expand Up @@ -116,7 +116,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.anomalyDetectionAggs}`,
url: `${docsLinks.links.ml.anomalyDetectionAggs}`,
},
cardinality_by_field: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -127,7 +127,7 @@ export const getMessages = once(() => {
fieldName: 'by_field "{{fieldName}}"',
},
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
},
cardinality_over_field_low: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -141,7 +141,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
},
cardinality_over_field_high: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -155,7 +155,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
},
cardinality_partition_field: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -169,7 +169,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
},
cardinality_model_plot_high: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -193,7 +193,7 @@ export const getMessages = once(() => {
defaultMessage: 'Categorization filters checks passed.',
}
),
url: `${docLinks.links.ml.anomalyDetectionCategories}`,
url: `${docsLinks.links.ml.anomalyDetectionCategories}`,
},
categorization_filters_invalid: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -208,14 +208,14 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
bucket_span_empty: {
status: VALIDATION_STATUS.ERROR,
text: i18n.translate('xpack.ml.models.jobValidation.messages.bucketSpanEmptyMessage', {
defaultMessage: 'The bucket span field must be specified.',
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
bucket_span_estimation_mismatch: {
status: VALIDATION_STATUS.INFO,
Expand All @@ -236,7 +236,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsBucketSpan}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsBucketSpan}`,
},
bucket_span_high: {
status: VALIDATION_STATUS.INFO,
Expand All @@ -247,7 +247,7 @@ export const getMessages = once(() => {
defaultMessage:
'Bucket span is 1 day or more. Be aware that days are considered as UTC days, not local days.',
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsBucketSpan}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsBucketSpan}`,
},
bucket_span_valid: {
status: VALIDATION_STATUS.SUCCESS,
Expand All @@ -260,7 +260,7 @@ export const getMessages = once(() => {
bucketSpan: '"{{bucketSpan}}"',
},
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
bucket_span_invalid: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -271,7 +271,7 @@ export const getMessages = once(() => {
defaultMessage:
'The specified bucket span is not a valid time interval format e.g. 10m, 1h. It also needs to be higher than zero.',
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
detectors_duplicates: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -288,21 +288,21 @@ export const getMessages = once(() => {
partitionFieldNameParam: `'partition_field_name'`,
},
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
},
detectors_empty: {
status: VALIDATION_STATUS.ERROR,
text: i18n.translate('xpack.ml.models.jobValidation.messages.detectorsEmptyMessage', {
defaultMessage: 'No detectors were found. At least one detector must be specified.',
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
},
detectors_function_empty: {
status: VALIDATION_STATUS.ERROR,
text: i18n.translate('xpack.ml.models.jobValidation.messages.detectorsFunctionEmptyMessage', {
defaultMessage: 'One of the detector functions is empty.',
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
},
detectors_function_not_empty: {
status: VALIDATION_STATUS.SUCCESS,
Expand All @@ -318,7 +318,7 @@ export const getMessages = once(() => {
defaultMessage: 'Presence of detector functions validated in all detectors.',
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsDetectors}`,
},
index_fields_invalid: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -339,15 +339,15 @@ export const getMessages = once(() => {
'The job configuration includes more than 3 influencers. ' +
'Consider using fewer influencers or creating multiple jobs.',
}),
url: `${docLinks.links.ml.influencers}`,
url: `${docsLinks.links.ml.influencers}`,
},
influencer_low: {
status: VALIDATION_STATUS.WARNING,
text: i18n.translate('xpack.ml.models.jobValidation.messages.influencerLowMessage', {
defaultMessage:
'No influencers have been configured. Picking an influencer is strongly recommended.',
}),
url: `${docLinks.links.ml.influencers}`,
url: `${docsLinks.links.ml.influencers}`,
},
influencer_low_suggestion: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -359,7 +359,7 @@ export const getMessages = once(() => {
values: { influencerSuggestion: '{{influencerSuggestion}}' },
}
),
url: `${docLinks.links.ml.influencers}`,
url: `${docsLinks.links.ml.influencers}`,
},
influencer_low_suggestions: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -371,14 +371,14 @@ export const getMessages = once(() => {
values: { influencerSuggestion: '{{influencerSuggestion}}' },
}
),
url: `${docLinks.links.ml.influencers}`,
url: `${docsLinks.links.ml.influencers}`,
},
job_id_empty: {
status: VALIDATION_STATUS.ERROR,
text: i18n.translate('xpack.ml.models.jobValidation.messages.jobIdEmptyMessage', {
defaultMessage: 'Job ID field must not be empty.',
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
},
job_id_invalid: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -387,7 +387,7 @@ export const getMessages = once(() => {
'Job ID is invalid. It can contain lowercase alphanumeric (a-z and 0-9) characters, ' +
'hyphens or underscores and must start and end with an alphanumeric character.',
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
},
job_id_invalid_max_length: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -401,7 +401,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
},
job_id_valid: {
status: VALIDATION_STATUS.SUCCESS,
Expand All @@ -417,7 +417,7 @@ export const getMessages = once(() => {
maxLength: JOB_ID_MAX_LENGTH,
},
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsPathParams}`,
},
job_group_id_invalid: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -426,7 +426,7 @@ export const getMessages = once(() => {
'One of the job group names is invalid. They can contain lowercase ' +
'alphanumeric (a-z and 0-9) characters, hyphens or underscores and must start and end with an alphanumeric character.',
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
job_group_id_invalid_max_length: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -440,7 +440,7 @@ export const getMessages = once(() => {
},
}
),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
job_group_id_valid: {
status: VALIDATION_STATUS.SUCCESS,
Expand All @@ -456,7 +456,7 @@ export const getMessages = once(() => {
maxLength: JOB_ID_MAX_LENGTH,
},
}),
url: `${docLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
url: `${docsLinks.links.ml.createAnomalyDetectionJobsRequestBody}`,
},
missing_summary_count_field_name: {
status: VALIDATION_STATUS.ERROR,
Expand All @@ -483,7 +483,7 @@ export const getMessages = once(() => {
text: i18n.translate('xpack.ml.models.jobValidation.messages.successCardinalityMessage', {
defaultMessage: 'Cardinality of detector fields is within recommended bounds.',
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsCardinality}`,
},
success_bucket_span: {
status: VALIDATION_STATUS.SUCCESS,
Expand All @@ -494,14 +494,14 @@ export const getMessages = once(() => {
defaultMessage: 'Format of {bucketSpan} is valid and passed validation checks.',
values: { bucketSpan: '"{{bucketSpan}}"' },
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsBucketSpan}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsBucketSpan}`,
},
success_influencers: {
status: VALIDATION_STATUS.SUCCESS,
text: i18n.translate('xpack.ml.models.jobValidation.messages.successInfluencersMessage', {
defaultMessage: 'Influencer configuration passed the validation checks.',
}),
url: `${docLinks.links.ml.influencers}`,
url: `${docsLinks.links.ml.influencers}`,
},
estimated_mml_greater_than_max_mml: {
status: VALIDATION_STATUS.WARNING,
Expand Down Expand Up @@ -539,7 +539,7 @@ export const getMessages = once(() => {
'1MB and should be specified in bytes e.g. 10MB.',
values: { mml: '{{mml}}' },
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
},
half_estimated_mml_greater_than_mml: {
status: VALIDATION_STATUS.WARNING,
Expand All @@ -551,7 +551,7 @@ export const getMessages = once(() => {
'memory limit and will likely hit the hard limit.',
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
},
estimated_mml_greater_than_mml: {
status: VALIDATION_STATUS.INFO,
Expand All @@ -562,7 +562,7 @@ export const getMessages = once(() => {
'The estimated model memory limit is greater than the model memory limit you have configured.',
}
),
url: `${docLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
},
success_mml: {
status: VALIDATION_STATUS.SUCCESS,
Expand All @@ -572,7 +572,7 @@ export const getMessages = once(() => {
text: i18n.translate('xpack.ml.models.jobValidation.messages.successMmlMessage', {
defaultMessage: 'Valid and within the estimated model memory limit.',
}),
url: `${docLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
url: `${docsLinks.links.ml.anomalyDetectionJobTipsModelMemory}`,
},
success_time_range: {
status: VALIDATION_STATUS.SUCCESS,
Expand Down

0 comments on commit 4b299d6

Please sign in to comment.