mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
## Summary Passing default solution from cloud onboarding process. 1. Renaming. Solution changes are not released yet, would be shipped with `8.15`, so it's fine to do it. - `search` -> `es` - `observability` -> `oblt` - Adjusted telemetry accordingly 2. Added `cloud` as optional dependency to `spaces` plugin to use `onboarding.defaultSolution` passed through setup contract. ### How to test 1. Set `xpack.cloud.onboarding.default_solution` to `es | oblt | security` 2. Check that default space was created with provided solution `GET kbn:/api/spaces/space/default` ### Checklist - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) __Fixes: https://github.com/elastic/kibana/issues/184999__ --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
/*
|
|
* 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.
|
|
*/
|
|
|
|
import { schema } from '@kbn/config-schema';
|
|
|
|
import { MAX_SPACE_INITIALS } from '../../common';
|
|
|
|
export const SPACE_ID_REGEX = /^[a-z0-9_\-]+$/;
|
|
|
|
const spaceSchema = schema.object({
|
|
id: schema.string({
|
|
validate: (value) => {
|
|
if (!SPACE_ID_REGEX.test(value)) {
|
|
return `must be lower case, a-z, 0-9, '_', and '-' are allowed`;
|
|
}
|
|
},
|
|
}),
|
|
name: schema.string({ minLength: 1 }),
|
|
description: schema.maybe(schema.string()),
|
|
initials: schema.maybe(schema.string({ maxLength: MAX_SPACE_INITIALS })),
|
|
color: schema.maybe(
|
|
schema.string({
|
|
validate: (value) => {
|
|
if (!/^#[a-zA-Z0-9]{6}$/.test(value)) {
|
|
return `must be a 6 digit hex color, starting with a #`;
|
|
}
|
|
},
|
|
})
|
|
),
|
|
disabledFeatures: schema.arrayOf(schema.string(), { defaultValue: [] }),
|
|
_reserved: schema.maybe(schema.boolean()),
|
|
imageUrl: schema.maybe(
|
|
schema.string({
|
|
validate: (value) => {
|
|
if (value !== '' && !/^data:image.*$/.test(value)) {
|
|
return `must start with 'data:image'`;
|
|
}
|
|
},
|
|
})
|
|
),
|
|
});
|
|
|
|
const solutionSchema = schema.oneOf([
|
|
schema.literal('security'),
|
|
schema.literal('oblt'),
|
|
schema.literal('es'),
|
|
schema.literal('classic'),
|
|
]);
|
|
|
|
export const getSpaceSchema = (isServerless: boolean) => {
|
|
if (isServerless) {
|
|
return spaceSchema;
|
|
}
|
|
|
|
return spaceSchema.extends({ solution: schema.maybe(solutionSchema) });
|
|
};
|