Skip to content

Commit 90d90d0

Browse files
committed
change to camel case, linting, and remove console logs
1 parent 60dee93 commit 90d90d0

File tree

5 files changed

+18
-31
lines changed

5 files changed

+18
-31
lines changed

src/components/FilesTable/FilesTable.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
// add back handleDeleteFile to props once posting attachments/messages is working/during the work for this ticket:
1010
// https://github.com/scientist-softserv/webstore-component-library/issues/152*/
1111
const FilesTable = ({ addClass, files }) => {
12-
console.log('files from filestable', files)
1312
if (files.length === 0) {
1413
return (
1514
<h6 className='mt-3'>You do not have this type of document yet.</h6>
@@ -30,10 +29,10 @@ const FilesTable = ({ addClass, files }) => {
3029
</thead>
3130
<tbody>
3231
{files.map((file) => {
33-
const { uuid, filename, uploadedBy, contentLength, createdAt } = file
32+
const { uuid, fileName, uploadedBy, contentLength, createdAt } = file
3433
return (
3534
<tr key={uuid} className='small'>
36-
<td>{filename}</td>
35+
<td>{fileName}</td>
3736
<td>{uploadedBy}</td>
3837
<td>{contentLength}</td>
3938
<td>{createdAt}</td>
@@ -60,12 +59,10 @@ FilesTable.propTypes = {
6059
files: PropTypes.arrayOf(
6160
PropTypes.shape({
6261
contentLength: PropTypes.string.isRequired,
63-
content_length: PropTypes.number.isRequired,
64-
content_type: PropTypes.string.isRequired,
62+
contentType: PropTypes.string.isRequired,
6563
createdAt: PropTypes.string.isRequired,
66-
created_at: PropTypes.string.isRequired,
6764
download: PropTypes.string.isRequired,
68-
filename: PropTypes.string.isRequired,
65+
fileName: PropTypes.string.isRequired,
6966
href: PropTypes.string.isRequired,
7067
status: PropTypes.string.isRequired,
7168
uploadedBy: PropTypes.string.isRequired,

src/components/FilesTable/FilesTable.stories.jsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ const Template = (args) => <FilesTable {...args} />
1111
export const Default = Template.bind({})
1212
Default.args = {
1313
files: [{
14-
contentLength: "938.57 KB",
15-
content_length: 961096,
16-
content_type: "image/png",
17-
createdAt: " Dec 22 2022 at 12:56:48 PM",
18-
created_at: "2022-12-22T10:56:48.405-08:00",
19-
download: "/quote_groups/10bd825f-c7e0-4c07-bd9e-f7982b21f435/attachments/nepal5.png",
20-
filename: "nepal5.png",
21-
href: "https://acme.scientist.com/secure_attachments/4611434c-ba99-481e-84ee-37e1fdbd203e",
14+
contentLength: '938.57 KB',
15+
contentType: 'image/png',
16+
createdAt: ' Dec 22 2022 at 12:56:48 PM',
17+
download: '/quote_groups/10bd825f-c7e0-4c07-bd9e-f7982b21f435/attachments/nepal5.png',
18+
fileName: 'nepal5.png',
19+
href: 'https://acme.scientist.com/secure_attachments/4611434c-ba99-481e-84ee-37e1fdbd203e',
2220
status: null,
23-
uploadedBy: "Summer Cook",
24-
uuid: "4611434c-ba99-481e-84ee-37e1fdbd203e",
21+
uploadedBy: 'Summer Cook',
22+
uuid: '4611434c-ba99-481e-84ee-37e1fdbd203e',
2523
}],
2624
}

src/compounds/ActionsGroup/ActionsGroup.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import './actions-group.scss'
88

99
// TODO: add back handleSendingMessagesOrFiles into the props. see below TODO.
1010
const ActionsGroup = ({ initialFiles }) => {
11-
console.log('initialfiles', initialFiles)
1211
const [show, setShow] = useState(false)
1312
const [action, setAction] = useState(null)
1413

@@ -65,12 +64,10 @@ ActionsGroup.propTypes = {
6564
initialFiles: PropTypes.arrayOf(
6665
PropTypes.shape({
6766
contentLength: PropTypes.string.isRequired,
68-
content_length: PropTypes.number.isRequired,
69-
content_type: PropTypes.string.isRequired,
67+
contentType: PropTypes.string.isRequired,
7068
createdAt: PropTypes.string.isRequired,
71-
created_at: PropTypes.string.isRequired,
7269
download: PropTypes.string.isRequired,
73-
filename: PropTypes.string.isRequired,
70+
fileName: PropTypes.string.isRequired,
7471
href: PropTypes.string.isRequired,
7572
status: PropTypes.string.isRequired,
7673
uploadedBy: PropTypes.string.isRequired,

src/compounds/ActionsGroup/ActionsGroup.stories.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ Default.args = {
1717
},
1818
initialFiles: [{
1919
contentLength: '938.57 KB',
20-
content_length: 961096,
21-
content_type: 'image/png',
20+
contentType: 'image/png',
2221
createdAt: ' Dec 22 2022 at 12:56:48 PM',
23-
created_at: '2022-12-22T10:56:48.405-08:00',
2422
download: '/quote_groups/10bd825f-c7e0-4c07-bd9e-f7982b21f435/attachments/nepal5.png',
25-
filename: 'nepal5.png',
23+
fileName: 'nepal5.png',
2624
href: 'https://acme.scientist.com/secure_attachments/4611434c-ba99-481e-84ee-37e1fdbd203e',
2725
status: null,
2826
uploadedBy: 'Summer Cook',

src/compounds/ActionsGroup/actions/ViewFiles.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import FilesTable from '../../../components/FilesTable/FilesTable'
1717
// import { apiV2CompatibleStrings, convertToBase64 } from '../../../resources/utilityFunctions'
1818

1919
const ViewFiles = ({ initialFiles, handleClose, show }) => {
20-
console.log('initialfiles form viewfiles', initialFiles)
2120
// TODO(summercook):
2221
// - comment back in the following 2 lines & above imports once posting messages/attachments is working
2322
// const fileRef = useRef(null)
@@ -136,12 +135,10 @@ ViewFiles.propTypes = {
136135
initialFiles: PropTypes.arrayOf(
137136
PropTypes.shape({
138137
contentLength: PropTypes.string.isRequired,
139-
content_length: PropTypes.number.isRequired,
140-
content_type: PropTypes.string.isRequired,
138+
contentType: PropTypes.string.isRequired,
141139
createdAt: PropTypes.string.isRequired,
142-
created_at: PropTypes.string.isRequired,
143140
download: PropTypes.string.isRequired,
144-
filename: PropTypes.string.isRequired,
141+
fileName: PropTypes.string.isRequired,
145142
href: PropTypes.string.isRequired,
146143
status: PropTypes.string.isRequired,
147144
uploadedBy: PropTypes.string.isRequired,

0 commit comments

Comments
 (0)