Skip to content

Commit

Permalink
add multiSection subsection remoteSection
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Gonzalez committed Jul 7, 2022
1 parent b1f8188 commit ece22a9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/schemas/common-sections/sections/multiSection.js
@@ -1,11 +1,12 @@
'use strict';

const { multiSection, browseSection } = require('../sectionsNames');
const { multiSection, browseSection, remoteSection } = require('../sectionsNames');
const BrowseSection = require('./browseSection');
const RemoteSection = require('./remoteSection');
const commonSectionProperties = require('./commonProperties');
const { modifySchemaThenProperties } = require('../../utils');

const sectionsModified = [BrowseSection].map(section => (
const sectionsModified = [BrowseSection, RemoteSection].map(section => (
modifySchemaThenProperties(section, {
properties: commonSectionProperties
})
Expand All @@ -26,7 +27,7 @@ module.exports = {
type: 'array',
items: {
properties: {
rootComponent: { enum: [browseSection] }
rootComponent: { enum: [browseSection, remoteSection] }
},
allOf: sectionsModified
},
Expand Down
15 changes: 15 additions & 0 deletions tests/mocks/schemas/edit.yml
Expand Up @@ -1594,6 +1594,21 @@ sections:
- name: user
component: UserChip

- name: someRemoteSection
rootComponent: RemoteSection
source:
service: service
namespace: namespace
method: method
resolve: false
schemaSource:
type: static
endpoint:
service: service
namespace: namespace
method: method
resolve: false

- name: commentsSection
rootComponent: Comments

Expand Down
19 changes: 19 additions & 0 deletions tests/mocks/schemas/expected/edit.json
Expand Up @@ -2596,6 +2596,25 @@
"canCreate": true,
"canView": false,
"pageSize": 60
},
{
"name": "someRemoteSection",
"rootComponent": "RemoteSection",
"source": {
"service": "service",
"namespace": "namespace",
"method": "method",
"resolve": false
},
"schemaSource": {
"type": "static",
"endpoint": {
"service": "service",
"namespace": "namespace",
"method": "method",
"resolve": false
}
}
}
]
},
Expand Down

0 comments on commit ece22a9

Please sign in to comment.