From 21e70ac4e4e3747a7ecf8362ad0b05fd596cf13c Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 1 Feb 2021 13:11:00 -0600 Subject: [PATCH] refactor: context description --- packages/entity/src/behavior-components/expression.jsx | 4 ++-- .../entity/src/behavior-components/expression/invocation.jsx | 4 ++-- packages/entity/src/behavior-components/literal.jsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/entity/src/behavior-components/expression.jsx b/packages/entity/src/behavior-components/expression.jsx index 9e532b2..98be973 100644 --- a/packages/entity/src/behavior-components/expression.jsx +++ b/packages/entity/src/behavior-components/expression.jsx @@ -27,7 +27,7 @@ const Expression = ({ const Renderables = []; let opsCount = 0; // eslint-disable-next-line react/destructuring-assignment - let description = context.constructor.descriptionFor(context); + let description = context.describeChildren(); const onChange = (event, value, localPath) => { const patches = []; const j = parseInt(relative(path, localPath).split('/')[1], 10); @@ -339,7 +339,7 @@ Expression.propTypes = { constructor: PropTypes.shape({ descriptionFor: PropTypes.func, }), - describe: PropTypes.func, + describeChildren: PropTypes.func, get: PropTypes.func, }).isRequired, value: PropTypes.shape({ diff --git a/packages/entity/src/behavior-components/expression/invocation.jsx b/packages/entity/src/behavior-components/expression/invocation.jsx index b11a9ae..2fafbe1 100644 --- a/packages/entity/src/behavior-components/expression/invocation.jsx +++ b/packages/entity/src/behavior-components/expression/invocation.jsx @@ -25,7 +25,7 @@ const Invocation = ({ childrenDescription={{ '...': {label: '', type: 'undefined'}, '[literal]': {label: '', type: 'undefined'}, - ...context.describe().children, + ...context.describeChildren().children, '[key]': {label: '', type: 'undefined'}, }} key={path} @@ -104,7 +104,7 @@ Invocation.displayName = 'Invocation'; Invocation.propTypes = { context: PropTypes.shape({ - describe: PropTypes.func, + describeChildren: PropTypes.func, }).isRequired, description: PropTypes.shape({ args: PropTypes.arrayOf( diff --git a/packages/entity/src/behavior-components/literal.jsx b/packages/entity/src/behavior-components/literal.jsx index 6a6888d..e02f8ed 100644 --- a/packages/entity/src/behavior-components/literal.jsx +++ b/packages/entity/src/behavior-components/literal.jsx @@ -64,7 +64,7 @@ const Literal = ({ setLiteralType(false); }; // eslint-disable-next-line react/destructuring-assignment - const contextDescription = context.describe(); + const contextDescription = context.describeChildren(); const valueComponent = (path, type, {value}) => { switch (type) { case 'bool': { @@ -266,7 +266,7 @@ Literal.displayName = 'Literal'; Literal.propTypes = { context: PropTypes.shape({ - describe: PropTypes.func, + describeChildren: PropTypes.func, }).isRequired, type: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired,