import { i18n } from '@kbn/i18n' ; import { SavedObject , SavedObjectsImportWarning } from 'kibana/server' ; export function getImportWarnings ( rulesSavedObjects ) { if ( rulesSavedObjects . length === 0 ) { return [ ] ; } const message = i18n . translate ( 'xpack.alerting.savedObjects.onImportText' , { defaultMessage : '{rulesSavedObjectsLength} {rulesSavedObjectsLength, plural, one {rule} other {rules}} must be enabled after the import.' , values : { rulesSavedObjectsLength : rulesSavedObjects . length , } , } ) ; return [ { type : 'action_required' , message , actionPath : '/app/management/insightsAndAlerting/triggersActions/rules' , buttonLabel : GO_TO_RULES_BUTTON_LABLE , } as SavedObjectsImportWarning , ] ; } export const GO_TO_RULES_BUTTON_LABLE = i18n . translate ( 'xpack.alerting.savedObjects.goToRulesButtonText' , { defaultMessage : 'Go to rules' } ) ;