Skip to content

Commit 8192f73

Browse files
committed
fix stories
1 parent 5b7ef55 commit 8192f73

File tree

5 files changed

+55
-4
lines changed

5 files changed

+55
-4
lines changed

src/components/FilesTable/FilesTable.jsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ 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)
1213
if (files.length === 0) {
1314
return (
1415
<h6 className='mt-3'>You do not have this type of document yet.</h6>
@@ -56,7 +57,19 @@ const FilesTable = ({ addClass, files }) => {
5657

5758
FilesTable.propTypes = {
5859
addClass: PropTypes.string,
59-
files: PropTypes.shapeOf(['']).isRequired,
60+
files: PropTypes.shape([{
61+
contentLength: PropTypes.string.isRequired,
62+
content_length: PropTypes.number.isRequired,
63+
content_type: PropTypes.string.isRequired,
64+
createdAt: PropTypes.string.isRequired,
65+
created_at: PropTypes.string.isRequired,
66+
download: PropTypes.string.isRequired,
67+
filename: PropTypes.string.isRequired,
68+
href: PropTypes.string.isRequired,
69+
status: PropTypes.string.isRequired,
70+
uploadedBy: PropTypes.string.isRequired,
71+
uuid: PropTypes.string.isRequired,
72+
}]).isRequired,
6073
// TODO(summer-cook): add this back in. see comment above.
6174
// handleDeleteFile: PropTypes.func.isRequired,
6275
}

src/components/FilesTable/FilesTable.stories.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,17 @@ const Template = (args) => <FilesTable {...args} />
1010

1111
export const Default = Template.bind({})
1212
Default.args = {
13-
headers: [''],
13+
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",
22+
status: null,
23+
uploadedBy: "Summer Cook",
24+
uuid: "4611434c-ba99-481e-84ee-37e1fdbd203e",
25+
}],
1426
}

src/compounds/ActionsGroup/ActionsGroup.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,19 @@ const ActionsGroup = ({ initialFiles }) => {
6262

6363
ActionsGroup.propTypes = {
6464
// handleSendingMessagesOrFiles: PropTypes.func.isRequired,
65-
initialFiles: PropTypes.shapeOf(['']).isRequired,
65+
initialFiles: PropTypes.shape([{
66+
contentLength: PropTypes.string.isRequired,
67+
content_length: PropTypes.number.isRequired,
68+
content_type: PropTypes.string.isRequired,
69+
createdAt: PropTypes.string.isRequired,
70+
created_at: PropTypes.string.isRequired,
71+
download: PropTypes.string.isRequired,
72+
filename: PropTypes.string.isRequired,
73+
href: PropTypes.string.isRequired,
74+
status: PropTypes.string.isRequired,
75+
uploadedBy: PropTypes.string.isRequired,
76+
uuid: PropTypes.string.isRequired,
77+
}]).isRequired,
6678
}
6779

6880
export default ActionsGroup

src/compounds/ActionsGroup/ActionsGroup.stories.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,17 @@ Default.args = {
1515
console.log('the message is:', message)
1616
console.log(`attached file(s): ${files.map((file) => file.split('name=')[1])}`)
1717
},
18+
initialFiles: [{
19+
contentLength: "938.57 KB",
20+
content_length: 961096,
21+
content_type: "image/png",
22+
createdAt: " Dec 22 2022 at 12:56:48 PM",
23+
created_at: "2022-12-22T10:56:48.405-08:00",
24+
download: "/quote_groups/10bd825f-c7e0-4c07-bd9e-f7982b21f435/attachments/nepal5.png",
25+
filename: "nepal5.png",
26+
href: "https://acme.scientist.com/secure_attachments/4611434c-ba99-481e-84ee-37e1fdbd203e",
27+
status: null,
28+
uploadedBy: "Summer Cook",
29+
uuid: "4611434c-ba99-481e-84ee-37e1fdbd203e",
30+
}],
1831
}

src/compounds/ActionsGroup/actions/ViewFiles.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ 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)
2021
// TODO(summercook):
2122
// - comment back in the following 2 lines & above imports once posting messages/attachments is working
2223
// const fileRef = useRef(null)
@@ -132,7 +133,7 @@ const ViewFiles = ({ initialFiles, handleClose, show }) => {
132133
}
133134

134135
ViewFiles.propTypes = {
135-
initialFiles: PropTypes.shapeOf(['']).isRequired,
136+
initialFiles: PropTypes.shape([{}]).isRequired,
136137
handleClose: PropTypes.func.isRequired,
137138
show: PropTypes.bool.isRequired,
138139
}

0 commit comments

Comments
 (0)