Skip to content

Commit

Permalink
Merge pull request #3128 from glific/assitants/warning-mesage
Browse files Browse the repository at this point in the history
Filesearch: Added warning message for unsupported files
  • Loading branch information
kurund authored Nov 11, 2024
2 parents 89943b2 + 368aca1 commit f2e2f62
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/containers/Assistants/AssistantOptions/AssistantOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOp
};
setFiles([...files, uploadFilesearchFile]);
},
onError: (errors) => setErrorMessage(errors),
});
};

Expand Down Expand Up @@ -123,13 +124,7 @@ export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOp
buttonOkLoading={addingFiles}
>
<div className={styles.DialogContent}>
<Button
className="Container"
fullWidth={true}
component="label"
variant="text"
tabIndex={-1}
>
<Button className="Container" fullWidth={true} component="label" variant="text" tabIndex={-1}>
<div className={styles.UploadContainer}>
{uploadingFile ? (
<CircularProgress size={20} />
Expand All @@ -138,12 +133,7 @@ export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOp
<UploadIcon /> {t('Upload File')}
</>
)}
<input
data-testid="uploadFile"
type="file"
onChange={handleFileChange}
style={{ display: 'none' }}
/>
<input data-testid="uploadFile" type="file" onChange={handleFileChange} style={{ display: 'none' }} />
</div>
</Button>
{files.length > 0 && (
Expand Down Expand Up @@ -181,11 +171,7 @@ export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOp
<Typography variant="subtitle2" className={styles.Label} data-testid="inputLabel">
Files
</Typography>
<Button
data-testid="addFiles"
onClick={() => setShowUploadDialog(true)}
variant="outlined"
>
<Button data-testid="addFiles" onClick={() => setShowUploadDialog(true)} variant="outlined">
<AddIcon />
{t('Add Files')}
</Button>
Expand Down

0 comments on commit f2e2f62

Please sign in to comment.