Skip to content

Commit

Permalink
Fix: customized uiSchema can't show properly (#854)
Browse files Browse the repository at this point in the history
Co-authored-by: liyanfang <liyanfang@cmss.chinamobile.com>
  • Loading branch information
mujinhuakai and liyanfang authored Jul 14, 2023
1 parent 28dea8a commit 8a81aa1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions packages/velaux-ui/src/components/UISchema/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ class UISchema extends Component<Props, State> {
if (condition.action == 'enable' || !condition.action) {
enableConditionCount += 1;
}
if (value == undefined) {
return;
}
switch (condition.op) {
case 'in':
if (Array.isArray(condition.value) && condition.value.includes(value)) {
Expand Down Expand Up @@ -976,7 +973,7 @@ class UISchema extends Component<Props, State> {
};

const showAdvancedButton = couldBeDisabledParamCount != couldShowParamCount || requiredParamCount === 0;
return (
return (
<Form field={this.form} className="ui-schema-container">
<If condition={disableRenderRow}>{items}</If>
<If condition={!disableRenderRow}>
Expand Down
2 changes: 1 addition & 1 deletion packages/velaux-ui/src/extends/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Group extends React.Component<Props, State> {

initSwitchState = () => {
const { jsonKey = '', propertyValue = {}, alwaysShow = false, required, closed, initClose } = this.props;
const findKey = Object.keys(propertyValue).find((item) => item === jsonKey);
const findKey = propertyValue && Object.keys(propertyValue).find((item) => item === jsonKey);
if (findKey || alwaysShow) {
this.setState({ enable: true, closed: false || initClose, checked: true });
} else if (required) {
Expand Down

0 comments on commit 8a81aa1

Please sign in to comment.