Conectar: Configuración and Avanzado tabs, rows instead of JSON, field titles as keys, captions that fit their nodes
This commit is contained in:
@@ -16,6 +16,12 @@ const PIPELINE = {
|
||||
when: { type: 'array', items: { $ref: '#/$defs/Condition' } },
|
||||
resource: { anyOf: [{ type: 'string' }, { type: 'null' }], title: 'Resource' },
|
||||
values: { type: 'object', additionalProperties: { type: 'string' }, title: 'Values' },
|
||||
on: {
|
||||
type: 'array',
|
||||
items: { type: 'array', prefixItems: [{ type: 'string' }, { type: 'string' }] },
|
||||
},
|
||||
extra: { type: 'object', title: 'Extra' },
|
||||
source: { type: 'string', advanced: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -25,7 +31,7 @@ describe('node forms from the pipeline schema', () => {
|
||||
const schema = nodeSchema(PIPELINE, 'route') as any;
|
||||
|
||||
it('leaves out what the canvas edits', () => {
|
||||
expect(Object.keys(schema.properties)).toEqual(['when', 'resource', 'values']);
|
||||
expect(Object.keys(schema.properties)).toEqual(['when', 'resource', 'values', 'on']);
|
||||
expect(schema.required).toEqual(['when']);
|
||||
});
|
||||
|
||||
@@ -34,7 +40,13 @@ describe('node forms from the pipeline schema', () => {
|
||||
expect(schema.properties.resource.type).toBe('string');
|
||||
});
|
||||
|
||||
it('edits maps as JSON', () => {
|
||||
expect(schema.properties.values.widget.formlyConfig.type).toBe('json');
|
||||
it('edits maps of texts and pairs as rows', () => {
|
||||
expect(schema.properties.values.widget.formlyConfig.type).toBe('map');
|
||||
expect(schema.properties.on.widget.formlyConfig.type).toBe('pairs');
|
||||
});
|
||||
|
||||
it('leaves JSON-only values and advanced fields to the "Avanzado" tab', () => {
|
||||
expect(schema.properties.extra).toBeUndefined();
|
||||
expect(schema.properties.source).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user