diff --git a/demo/cms/index.jsx b/demo/cms/index.jsx index 2d93ea1bc..b9d6b1570 100644 --- a/demo/cms/index.jsx +++ b/demo/cms/index.jsx @@ -20,7 +20,7 @@ const wrapCmsHandler = handler => async (req, res) => { res.status(status).send(body); } catch (e) { - logger.err(e); + logger.error(e); res.send(500).end(); } }; diff --git a/example-schema/types/MainType.yaml b/example-schema/types/MainType.yaml index 4831b3d44..9fb2212e0 100644 --- a/example-schema/types/MainType.yaml +++ b/example-schema/types/MainType.yaml @@ -2,6 +2,10 @@ name: MainType description: Description of MainType. moreInformation: | More information for MainType +minimumViableRecord: + - code + - children + - someString properties: code: type: Code diff --git a/packages/tc-ui/src/lib/get-schema-subset.js b/packages/tc-ui/src/lib/get-schema-subset.js index 45fd8880a..f473f794e 100644 --- a/packages/tc-ui/src/lib/get-schema-subset.js +++ b/packages/tc-ui/src/lib/get-schema-subset.js @@ -1,17 +1,13 @@ const { getType } = require('@financial-times/tc-schema-sdk'); -const getTypeOptions = { - groupProperties: true, - includeMetaFields: false, -}; - const getSchemaSubset = (event, type, isCreate = false) => { const properties = event.query && event.query.properties; if (!properties) { return { schema: getType(type, { - ...getTypeOptions, + groupProperties: true, + includeMetaFields: false, useMinimumViableRecord: isCreate, }), isSubset: false, @@ -19,9 +15,11 @@ const getSchemaSubset = (event, type, isCreate = false) => { } const title = event.query && event.query.title; - const fullSchema = getType(type, getTypeOptions); + const fullSchema = getType(type, { + groupProperties: false, + includeMetaFields: false, + }); const propertyKeys = properties.split(','); - return { schema: { ...fullSchema, diff --git a/packages/tc-ui/src/pages/edit/browser.js b/packages/tc-ui/src/pages/edit/browser.js index a1761899f..08451c45c 100644 --- a/packages/tc-ui/src/pages/edit/browser.js +++ b/packages/tc-ui/src/pages/edit/browser.js @@ -56,7 +56,7 @@ const fieldValueCheckers = { !![...field.querySelectorAll('input')].some(input => input.checked), relationship: field => !![...field.querySelectorAll('input[type="hidden"]')].every( - input => !!input.value, + input => !!input.value && input.value !== '[]', ), }; diff --git a/packages/tc-ui/src/primitives/relationship/lib/relationship-picker.jsx b/packages/tc-ui/src/primitives/relationship/lib/relationship-picker.jsx index 6711acc37..191efe5a9 100644 --- a/packages/tc-ui/src/primitives/relationship/lib/relationship-picker.jsx +++ b/packages/tc-ui/src/primitives/relationship/lib/relationship-picker.jsx @@ -218,6 +218,7 @@ class RelationshipPicker extends React.Component { return (