Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,27 @@ interface SimpleTableManualProps extends PConnProps {
displayMode?: string;
useSeparateViewForEdit: any;
viewForEditModal: any;
validatemessage?: string;
required?: boolean;
}

const useStyles = makeStyles((/* theme */) => ({
label: {
margin: '8px'
},
tableLabel: {
'&::after': {
display: 'inline',
content: '" *"',
verticalAlign: 'top',
color: 'var(--app-error-color)'
}
},
message: {
margin: '8px',
color: 'var(--app-error-color)',
fontSize: '14px'
},
header: {
background: '#f5f5f5'
},
Expand Down Expand Up @@ -110,7 +125,9 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
editModeConfig,
displayMode,
useSeparateViewForEdit,
viewForEditModal
viewForEditModal,
required,
validatemessage
} = props;
const pConn = getPConnect();
const [rowData, setRowData] = useState([]);
Expand Down Expand Up @@ -583,10 +600,11 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
<>
<TableContainer component={Paper} style={{ margin: '4px 0px' }} id='simple-table-manual'>
{propsToUse.label && (
<h3 className={classes.label}>
<h3 className={`${classes.label} ${required ? classes.tableLabel : ''}`}>
{propsToUse.label} {results()}
</h3>
)}
{validatemessage && <div className={classes.message}>{validatemessage}</div>}
<Table>
<TableHead className={classes.header}>
<TableRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

.file-error {
color: var(--app-error-color);
font-size: 14px;
}

.psdk-utility-card {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const updateAttachmentState = (pConn, key, attachments) => {
};

export default function Attachment(props: AttachmentProps) {
const { value, getPConnect, label, validatemessage, allowMultiple, extensions, displayMode } = props;
const { value, getPConnect, label, validatemessage, allowMultiple, extensions, displayMode, helperText } = props;
/* this is a temporary fix because required is supposed to be passed as a boolean and NOT as a string */
let { required, disabled } = props;
[required, disabled] = [required, disabled].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
Expand Down Expand Up @@ -461,7 +461,7 @@ export default function Attachment(props: AttachmentProps) {
<div className='file-upload-container'>
<span className={`label ${required ? 'file-label' : ''}`}>{label}</span>
{((files.length === 0 && allowMultiple !== 'true') || allowMultiple === 'true') && <section>{content}</section>}
{validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : ''}
{validatemessage !== '' ? <span className='file-error'>{validatemessage}</span> : <span style={{ fontSize: '14px' }}>{helperText}</span>}
{files && files.length > 0 && <section>{fileDisplay}</section>}
</div>
);
Expand Down