feat(build): Add loading and skeleton to blocks schema.

This commit is contained in:
Gervwyk 2022-03-03 13:59:16 +02:00
parent b9e6f1ce19
commit 1398ca3506
2 changed files with 25 additions and 16 deletions

View File

@ -791,23 +791,27 @@ describe('block areas', () => {
});
});
test('user defined loading', async () => {
test('user defined skeleton', async () => {
const components = {
pages: [
{
id: 'page_1',
type: 'Container',
auth,
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
blocks: [
{
id: 'block_1',
type: 'Input',
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
},
],
},
@ -823,9 +827,11 @@ test('user defined loading', async () => {
pageId: 'page_1',
blockId: 'page_1',
type: 'Container',
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
requests: [],
areas: {
content: {
@ -834,9 +840,11 @@ test('user defined loading', async () => {
id: 'block:page_1:block_1:0',
blockId: 'block_1',
type: 'Input',
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
},
],
},

View File

@ -219,10 +219,10 @@ export default {
type: 'Block "layout" should be an object.',
},
},
loading: {
type: 'object',
skeleton: {
type: 'array',
errorMessage: {
type: 'Block "loading" should be an object.',
type: 'Block "skeleton" should be an array.',
},
},
style: {
@ -232,6 +232,7 @@ export default {
},
},
visible: {},
loading: {},
blocks: {
type: 'array',
items: {