Skip to content

Commit ff16e12

Browse files
committed
fix(job-file-inputs): display required indicator on inputs
1 parent db1f1fa commit ff16e12

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

components/executionsCards/JobCard/JobInputFields.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const JobInputFields = ({
6161
([key, { title, type, multiple, "mime-types": mimeTypes }]) => {
6262
if (type === "file" || type === "directory") {
6363
return (
64-
<InputSection key={key} title={title}>
64+
<InputSection key={key} required={inputs.required?.includes(key)} title={title}>
6565
<FileSelector
6666
mimeTypes={mimeTypes}
6767
multiple={!!multiple}
@@ -79,7 +79,7 @@ export const JobInputFields = ({
7979
multiple = true;
8080

8181
return (
82-
<InputSection key={key} title={title}>
82+
<InputSection key={key} required={inputs.required?.includes(key)} title={title}>
8383
<MultipleMoleculeInput
8484
mimeTypes={mimeTypes}
8585
projectId={projectId}
@@ -108,14 +108,18 @@ export const JobInputFields = ({
108108
interface InputSectionProps {
109109
children: ReactNode;
110110
title: string;
111+
required?: boolean;
111112
}
112113

113-
export const InputSection = ({ children, title }: InputSectionProps) => {
114+
export const InputSection = ({ children, title, required }: InputSectionProps) => {
114115
return (
115116
// Expect a grid container in the parent component
116117
<Grid item xs={12}>
117118
<Typography component="h4" variant="subtitle1">
118-
<em>{title}</em>
119+
<em>
120+
{title}
121+
{!!required && " *"}
122+
</em>
119123
</Typography>
120124
{children}
121125
</Grid>

0 commit comments

Comments
 (0)