Skip to content

Commit

Permalink
[Reporting] Add deprecation titles (#113387)
Browse files Browse the repository at this point in the history
* added i18n and titles to config deprecations

* Updated jest test

* Add newline at end of file

* remove unneeded space
  • Loading branch information
jloleysens authored Sep 30, 2021
1 parent a33ae63 commit 9a530b2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/reporting/server/config/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('deprecations', () => {
const { messages } = applyReportingDeprecations({ index, roles: { enabled: false } });
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"xpack.reporting.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",
"Multitenancy by changing \\"kibana.index\\" will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy for more details",
]
`);
});
Expand All @@ -47,7 +47,7 @@ describe('deprecations', () => {
const { messages } = applyReportingDeprecations({ roles: { enabled: true } });
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"xpack.reporting.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**.",
"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**.",
]
`);
});
Expand Down
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 9a530b2

Please sign in to comment.