mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
fix Canvas available in search in serverless (#163740)
Closes https://github.com/elastic/kibana/issues/163442 --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
bc37dc2c5a
commit
78250515ff
3 changed files with 2 additions and 67 deletions
|
@ -43,7 +43,7 @@ dev_tools.deeplinks.navLinkStatus: visible
|
||||||
management.deeplinks.navLinkStatus: visible
|
management.deeplinks.navLinkStatus: visible
|
||||||
|
|
||||||
# Other disabled plugins
|
# Other disabled plugins
|
||||||
#xpack.canvas.enabled: false #only disabable in dev-mode
|
xpack.canvas.enabled: false
|
||||||
xpack.cloud_integrations.data_migration.enabled: false
|
xpack.cloud_integrations.data_migration.enabled: false
|
||||||
data.search.sessions.enabled: false
|
data.search.sessions.enabled: false
|
||||||
advanced_settings.enabled: false
|
advanced_settings.enabled: false
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
||||||
* or more contributor license agreements. Licensed under the Elastic License
|
|
||||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
|
||||||
* 2.0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
jest.mock('crypto', () => ({
|
|
||||||
randomBytes: jest.fn(),
|
|
||||||
constants: jest.requireActual('crypto').constants,
|
|
||||||
}));
|
|
||||||
|
|
||||||
jest.mock('@kbn/utils', () => ({
|
|
||||||
getLogsPath: () => '/mock/kibana/logs/path',
|
|
||||||
}));
|
|
||||||
|
|
||||||
import { ConfigSchema } from './config';
|
|
||||||
|
|
||||||
describe('config schema', () => {
|
|
||||||
it('generates proper defaults', () => {
|
|
||||||
expect(ConfigSchema.validate({})).toMatchInlineSnapshot(`
|
|
||||||
Object {
|
|
||||||
"enabled": true,
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
expect(ConfigSchema.validate({}, { dev: false })).toMatchInlineSnapshot(`
|
|
||||||
Object {
|
|
||||||
"enabled": true,
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
expect(ConfigSchema.validate({}, { dev: true })).toMatchInlineSnapshot(`
|
|
||||||
Object {
|
|
||||||
"enabled": true,
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should throw error if spaces is disabled', () => {
|
|
||||||
expect(() => ConfigSchema.validate({ enabled: false })).toThrow(
|
|
||||||
'[enabled]: Canvas can only be disabled in development mode'
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(() => ConfigSchema.validate({ enabled: false }, { dev: false })).toThrow(
|
|
||||||
'[enabled]: Canvas can only be disabled in development mode'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not throw error if spaces is disabled in development mode', () => {
|
|
||||||
expect(() => ConfigSchema.validate({ enabled: false }, { dev: true })).not.toThrow();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -8,17 +8,5 @@
|
||||||
import { schema } from '@kbn/config-schema';
|
import { schema } from '@kbn/config-schema';
|
||||||
|
|
||||||
export const ConfigSchema = schema.object({
|
export const ConfigSchema = schema.object({
|
||||||
enabled: schema.conditional(
|
enabled: schema.boolean({ defaultValue: true }),
|
||||||
schema.contextRef('dev'),
|
|
||||||
true,
|
|
||||||
schema.boolean({ defaultValue: true }),
|
|
||||||
schema.boolean({
|
|
||||||
validate: (rawValue) => {
|
|
||||||
if (rawValue === false) {
|
|
||||||
return 'Canvas can only be disabled in development mode';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
defaultValue: true,
|
|
||||||
})
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue