Skip to content

Commit

Permalink
added i18n and titles to config deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Sep 29, 2021
1 parent c63f4be commit aaf1a45
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions x-pack/plugins/reporting/server/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 2.0.
*/

import { i18n } from '@kbn/i18n';
import { PluginConfigDescriptor } from 'kibana/server';
import { get } from 'lodash';
import { ConfigSchema, ReportingConfigType } from './schema';
Expand All @@ -27,27 +28,48 @@ export const config: PluginConfigDescriptor<ReportingConfigType> = {
const reporting = get(settings, fromPath);
if (reporting?.index) {
addDeprecation({
message: `"${fromPath}.index" is deprecated. Multitenancy by changing "kibana.index" will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy for more details`,
title: i18n.translate('xpack.reporting.deprecations.reportingIndex.title', {
defaultMessage: 'Setting "{fromPath}.index" is deprecated',
values: { fromPath },
}),
message: i18n.translate('xpack.reporting.deprecations.reportingIndex.description', {
defaultMessage: `Multitenancy by changing "kibana.index" will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy for more details`,
}),
correctiveActions: {
manualSteps: [
`If you rely on this setting to achieve multitenancy you should use Spaces, cross-cluster replication, or cross-cluster search instead.`,
`To migrate to Spaces, we encourage using saved object management to export your saved objects from a tenant into the default tenant in a space.`,
i18n.translate('xpack.reporting.deprecations.reportingIndex.manualStepOne', {
defaultMessage: `If you rely on this setting to achieve multitenancy you should use Spaces, cross-cluster replication, or cross-cluster search instead.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingIndex.manualStepTwo', {
defaultMessage: `To migrate to Spaces, we encourage using saved object management to export your saved objects from a tenant into the default tenant in a space.`,
}),
],
},
});
}

if (reporting?.roles?.enabled !== false) {
addDeprecation({
message:
`"${fromPath}.roles" is deprecated. Granting reporting privilege through a "reporting_user" role will not be supported ` +
`starting in 8.0. Please set "xpack.reporting.roles.enabled" to "false" and grant reporting privileges to users ` +
`using Kibana application privileges **Management > Security > Roles**.`,
title: i18n.translate('xpack.reporting.deprecations.reportingRoles.title', {
defaultMessage: 'Setting "{fromPath}.roles" is deprecated',
values: { fromPath },
}),
message: i18n.translate('xpack.reporting.deprecations.reportingRoles.description', {
defaultMessage:
`Granting reporting privilege through a "reporting_user" role will not be supported ` +
` starting in 8.0. Please set "xpack.reporting.roles.enabled" to "false" and grant reporting privileges to users` +
` using Kibana application privileges **Management > Security > Roles**.`,
}),
correctiveActions: {
manualSteps: [
`Set 'xpack.reporting.roles.enabled' to 'false' in your kibana configs.`,
`Grant reporting privileges to users using Kibana application privileges` +
`under **Management > Security > Roles**.`,
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepOne', {
defaultMessage: `Set 'xpack.reporting.roles.enabled' to 'false' in your kibana configs.`,
}),
i18n.translate('xpack.reporting.deprecations.reportingRoles.manualStepTwo', {
defaultMessage:
`Grant reporting privileges to users using Kibana application privileges` +
` under **Management > Security > Roles**.`,
}),
],
},
});
Expand Down

0 comments on commit aaf1a45

Please sign in to comment.