[CANVAS] Relax workpad schema to allow existing templates to work (#54019)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
f3cdbf20ce
commit
3ce2025c75
|
@ -42,7 +42,7 @@ export const getTemplateStrings = (): TemplateStringDict => ({
|
|||
defaultMessage: 'Pitch',
|
||||
}),
|
||||
help: i18n.translate('xpack.canvas.templates.pitchHelp', {
|
||||
defaultMessage: 'Branded presentation with large photos"',
|
||||
defaultMessage: 'Branded presentation with large photos',
|
||||
}),
|
||||
},
|
||||
Status: {
|
||||
|
|
|
@ -24,7 +24,10 @@ export const WorkpadTemplates = compose(
|
|||
cloneWorkpad: props => workpad => {
|
||||
workpad.id = getId('workpad');
|
||||
workpad.name = `My Canvas Workpad - ${workpad.name}`;
|
||||
// Remove unneeded fields
|
||||
workpad.tags = undefined;
|
||||
workpad.displayName = undefined;
|
||||
workpad.help = undefined;
|
||||
return workpadService
|
||||
.create(workpad)
|
||||
.then(() => props.router.navigateTo('loadWorkpad', { id: workpad.id, page: 1 }))
|
||||
|
|
|
@ -24,11 +24,13 @@ export const WorkpadElementSchema = schema.object({
|
|||
|
||||
export const WorkpadPageSchema = schema.object({
|
||||
elements: schema.arrayOf(WorkpadElementSchema),
|
||||
groups: schema.arrayOf(
|
||||
schema.object({
|
||||
id: schema.string(),
|
||||
position: PositionSchema,
|
||||
})
|
||||
groups: schema.maybe(
|
||||
schema.arrayOf(
|
||||
schema.object({
|
||||
id: schema.string(),
|
||||
position: PositionSchema,
|
||||
})
|
||||
)
|
||||
),
|
||||
id: schema.string(),
|
||||
style: schema.recordOf(schema.string(), schema.string()),
|
||||
|
|
Loading…
Reference in a new issue