[Reporting] Allow reporting capabilities on gold with the new reporting roles (#129374)

* set min license level to gold

* remove use of standard license

* update tests to check for gold level license

* accept gold license in feature registration

* Revert "remove use of standard license"

This reverts commit 684f8f500c.

* refactor LICENSE_TYPE_STANDARD to LICENSE_TYPE_CLOUD_STANDARD

* also update canvas to use gold min

* updated canvas features snapshot

* remember to save files!

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jean-Louis Leysens 2022-04-07 10:33:10 +02:00 committed by GitHub
parent 0790fd01d9
commit edf6e21941
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 23 additions and 22 deletions

View file

@ -173,7 +173,7 @@ it(`Calls on Reporting whether to include Generate PDF as a sub-feature`, () =>
"reporting",
],
},
"minimumLicense": "platinum",
"minimumLicense": "gold",
"name": "Generate PDF reports",
"savedObject": Object {
"all": Array [],

View file

@ -65,7 +65,7 @@ export function getCanvasFeature(plugins: { reporting?: ReportingSetup }): Kiban
}),
includeIn: 'all',
management: { insightsAndAlerting: ['reporting'] },
minimumLicense: 'platinum',
minimumLicense: 'gold',
savedObject: { all: [], read: [] },
api: ['generateReport'],
ui: ['generatePdf'],

View file

@ -309,7 +309,7 @@ Array [
"reporting",
],
},
"minimumLicense": "platinum",
"minimumLicense": "gold",
"name": "Generate PDF or PNG reports",
"savedObject": Object {
"all": Array [],
@ -401,7 +401,7 @@ Array [
"reporting",
],
},
"minimumLicense": "platinum",
"minimumLicense": "gold",
"name": "Generate PDF or PNG reports",
"savedObject": Object {
"all": Array [],

View file

@ -39,6 +39,7 @@ const validLicenseSchema = schema.oneOf([
const validSubFeaturePrivilegeLicensesSchema = schema.oneOf([
schema.literal('platinum'),
schema.literal('enterprise'),
schema.literal('gold'),
schema.literal('trial'),
]);

View file

@ -514,7 +514,7 @@ const reportingFeatures: {
}
),
includeIn: 'all',
minimumLicense: 'platinum',
minimumLicense: 'gold',
savedObject: { all: [], read: [] },
management: { insightsAndAlerting: ['reporting'] },
api: ['generateReport'],
@ -550,7 +550,7 @@ const reportingFeatures: {
}
),
includeIn: 'all',
minimumLicense: 'platinum',
minimumLicense: 'gold',
savedObject: { all: [], read: [] },
management: { insightsAndAlerting: ['reporting'] },
api: ['generateReport'],

View file

@ -67,7 +67,7 @@ export const DEPRECATED_JOB_TYPES = [CSV_JOB_TYPE_DEPRECATED];
// Licenses
export const LICENSE_TYPE_TRIAL = 'trial';
export const LICENSE_TYPE_BASIC = 'basic';
export const LICENSE_TYPE_STANDARD = 'standard';
export const LICENSE_TYPE_CLOUD_STANDARD = 'standard';
export const LICENSE_TYPE_GOLD = 'gold';
export const LICENSE_TYPE_PLATINUM = 'platinum';
export const LICENSE_TYPE_ENTERPRISE = 'enterprise';

View file

@ -11,7 +11,7 @@ import {
LICENSE_TYPE_ENTERPRISE,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_TRIAL,
} from '../../../common/constants';
import { CreateJobFn, ExportTypeDefinition, RunTaskFn } from '../../types';
@ -32,7 +32,7 @@ export const getExportType = (): ExportTypeDefinition<
validLicenses: [
LICENSE_TYPE_TRIAL,
LICENSE_TYPE_BASIC,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_ENTERPRISE,

View file

@ -11,7 +11,7 @@ import {
LICENSE_TYPE_ENTERPRISE,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_TRIAL,
} from '../../../common/constants';
import { ExportTypeDefinition } from '../../types';
@ -33,7 +33,7 @@ export const getExportType = (): ExportTypeDefinition<null, ImmediateExecuteFn>
validLicenses: [
LICENSE_TYPE_TRIAL,
LICENSE_TYPE_BASIC,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_ENTERPRISE,

View file

@ -9,7 +9,7 @@ import {
LICENSE_TYPE_ENTERPRISE,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_TRIAL,
PNG_JOB_TYPE as jobType,
} from '../../../common/constants';
@ -31,7 +31,7 @@ export const getExportType = (): ExportTypeDefinition<
runTaskFnFactory,
validLicenses: [
LICENSE_TYPE_TRIAL,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_ENTERPRISE,

View file

@ -9,7 +9,7 @@ import {
LICENSE_TYPE_ENTERPRISE,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_TRIAL,
PNG_JOB_TYPE_V2 as jobType,
} from '../../../common/constants';
@ -31,7 +31,7 @@ export const getExportType = (): ExportTypeDefinition<
runTaskFnFactory,
validLicenses: [
LICENSE_TYPE_TRIAL,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_ENTERPRISE,

View file

@ -9,7 +9,7 @@ import {
LICENSE_TYPE_ENTERPRISE,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_TRIAL,
PDF_JOB_TYPE as jobType,
} from '../../../common/constants';
@ -31,7 +31,7 @@ export const getExportType = (): ExportTypeDefinition<
runTaskFnFactory,
validLicenses: [
LICENSE_TYPE_TRIAL,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_ENTERPRISE,

View file

@ -9,7 +9,7 @@ import {
LICENSE_TYPE_ENTERPRISE,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_TRIAL,
PDF_JOB_TYPE_V2 as jobType,
} from '../../../common/constants';
@ -31,7 +31,7 @@ export const getExportType = (): ExportTypeDefinition<
runTaskFnFactory,
validLicenses: [
LICENSE_TYPE_TRIAL,
LICENSE_TYPE_STANDARD,
LICENSE_TYPE_CLOUD_STANDARD,
LICENSE_TYPE_GOLD,
LICENSE_TYPE_PLATINUM,
LICENSE_TYPE_ENTERPRISE,

View file

@ -23,7 +23,7 @@ import {
const exportTypesRegistry = getExportTypesRegistry();
const getLicenseMock =
(licenseType = 'platinum') =>
(licenseType = 'gold') =>
() => {
return Promise.resolve({
isAvailable: () => true,
@ -96,12 +96,12 @@ describe('license checks', () => {
});
});
describe('with platinum license', () => {
describe('with gold license', () => {
let usageStats: any;
beforeAll(async () => {
const collector = getReportingUsageCollector(
usageCollectionSetup,
getLicenseMock('platinum'),
getLicenseMock('gold'),
exportTypesRegistry,
function isReady() {
return Promise.resolve(true);