feat: compliance triggers and customers up to spec

This commit is contained in:
Taranto 2020-08-17 17:48:52 +01:00 committed by Josh Harvey
parent b153a23f25
commit 6f5cb385b0
8 changed files with 400 additions and 104 deletions

View file

@ -93,6 +93,7 @@ const ECol = ({
}) => {
const {
name,
bypassField,
input,
editable = true,
size,
@ -122,6 +123,9 @@ const ECol = ({
innerProps.getLabel = view
}
const isEditing = editing && editable
const isField = !bypassField
return (
<Td
className={{
@ -133,11 +137,11 @@ const ECol = ({
size={size}
bold={bold}
textAlign={textAlign}>
{editing && editable ? (
{isEditing && isField && (
<Field name={name} component={input} {...innerProps} />
) : (
values && <>{view(values[name])}</>
)}
{isEditing && !isField && <config.input name={name} />}
{!isEditing && values && <>{view(values[name], values)}</>}
{suffix && (
<SuffixComponent className={classes.suffix}>{suffix}</SuffixComponent>
)}