ValentinnDimitroff / ra-compact-ui

Enhanced components for popular framework react-admin. Helps reducing the styling boilerplate code and eases layout customizations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom Fields using Controller Props are not working in BoxedShowLayout

yash-zorp opened this issue · comments

<ShowController {...props} component="div">
        {(controllerProps) => 
            <ShowView {...props} actions={<TaskShowActions />} {...controllerProps}>
                <BoxedShowLayout>
                  <RaBox display="flex">
                    <RaBox
                      display="flex"
                      flexWrap="wrap"
                      flexGrow={4}
                      className={classes.detailsBox}
                    >
                      <RaBox
                        flex="0 0 100%"
                        display="flex"
                        justifyContent="space-between"
                      >
                        <TextField label="Task Id" source="taskId" />
                        <TextField
                          label="Task Type"
                          source="taskTypeDisplayName"
                        />
                        {controllerProps.record &&
                          controllerProps.record.taskType ===
                            "order_management_task" && (
                            <TextField
                              label="Customer Name"
                              source="customerName"
                            />
                          )}
                        {controllerProps.record &&
                          controllerProps.record.taskType ===
                            "order_management_task" && (
                            <TextField label="Phone Number" source="phone" />
                          )}
                      </RaBox>
                    </RaBox>
                  </RaBox>
                </BoxedShowLayout>
            </ShowView>
        }
      </ShowController>

TypeError: Cannot read property 'source' of undefined