Skip to content

Commit e353d40

Browse files
committed
linting
1 parent edfddd5 commit e353d40

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

src/components/FilesTable/FilesTable.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ const FilesTable = ({ addClass, files }) => {
1919
<th>Uploaded By</th>
2020
<th>Size</th>
2121
<th>Created At</th>
22-
<th></th>
22+
<th aria-label='actions' />
2323
</tr>
2424
</thead>
2525
<tbody>
2626
{files.map((file) => {
27-
const { contentLength, createdAt, fileName, href, uploadedBy, uuid } = file
27+
const { contentLength, createdAt, fileName, href, uploadedBy, uuid } = file
2828
return (
2929
<tr key={uuid} className='small'>
3030
<td>{fileName}</td>
@@ -35,6 +35,7 @@ const FilesTable = ({ addClass, files }) => {
3535
<Link
3636
icon='fa-download'
3737
href={href}
38+
aria-label='download'
3839
/>
3940
</td>
4041
</tr>

src/compounds/ActionsGroup/actions/ViewFiles.jsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ const ViewFiles = ({ backgroundColor, files, handleClose, onSubmit }) => {
4949
throw new Error(error)
5050
}
5151
}
52-
52+
5353
const handleSubmit = async (event) => {
5454
event.preventDefault()
5555
await onSubmit({ files: apiV2CompatibleStrings([...tempFiles]) })
56-
if (tempFiles.length > 0) {
56+
if (tempFiles.length > 0) {
5757
setShowSuccessAlert(true)
5858
setTempFiles([])
5959
}
@@ -74,15 +74,15 @@ const ViewFiles = ({ backgroundColor, files, handleClose, onSubmit }) => {
7474
<h6 className='mt-3'>Upload Additional Documents</h6>
7575
<InputGroup controlId='attachments' className='mb-3'>
7676
<Form.Control
77-
multiple
78-
type='file'
79-
onChange={handleAddFile}
80-
ref={fileRef}
77+
multiple
78+
type='file'
79+
onChange={handleAddFile}
80+
ref={fileRef}
8181
/>
8282
<Button
83-
variant='outline-primary'
84-
onClick={handleSubmit}
85-
type='submit'
83+
variant='outline-primary'
84+
onClick={handleSubmit}
85+
type='submit'
8686
>
8787
<FontAwesomeIcon icon='fa-upload' />
8888
</Button>
@@ -93,16 +93,17 @@ const ViewFiles = ({ backgroundColor, files, handleClose, onSubmit }) => {
9393
const fileName = Object.keys(file)[0]
9494
return (
9595
<ListGroup.Item key={fileName} className='d-flex align-items-center'>
96-
<span>{fileName}</span>
97-
<CloseButton onClick={() => handleDeleteTempFile(file)} className='ms-auto' />
96+
<span>{fileName}</span>
97+
<CloseButton onClick={() => handleDeleteTempFile(file)} className='ms-auto' />
9898
</ListGroup.Item>
9999
)
100100
})}
101-
{showSuccessAlert &&
102-
<Alert variant='success' onClose={() => setShowSuccessAlert(false)} dismissible >
103-
Your files have been uploaded successfully. It may take some time for them to appear below.
104-
</Alert>
105-
}
101+
{showSuccessAlert
102+
&& (
103+
<Alert variant='success' onClose={() => setShowSuccessAlert(false)} dismissible>
104+
Your files have been uploaded successfully. It may take some time for them to appear below.
105+
</Alert>
106+
)}
106107
</ListGroup>
107108
<Tabs defaultActiveKey='files' id='document-tabs' justify fill>
108109
{documentTabs && documentTabs.map((tab) => {
@@ -145,10 +146,11 @@ ViewFiles.propTypes = {
145146
}),
146147
).isRequired,
147148
handleClose: PropTypes.func.isRequired,
149+
onSubmit: PropTypes.func.isRequired,
148150
}
149151

150152
ViewFiles.defaultProps = {
151-
backgroundColor: 'secondary'
153+
backgroundColor: 'secondary',
152154
}
153155

154156
export default ViewFiles

0 commit comments

Comments
 (0)