Skip to content

Commit 974432d

Browse files
authored
Merge pull request #472 from codeforpdx/cleanup-jsdoc
Cleaning up existing JSDoc comments; Excluding props for typedefs
2 parents ca4b149 + 34e6a82 commit 974432d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+210
-375
lines changed

src/components/Contacts/ContactListTable.jsx

+4-10
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,27 @@ import TableContainer from '@mui/material/TableContainer';
88
import TableHead from '@mui/material/TableHead';
99
import TableRow from '@mui/material/TableRow';
1010
import Paper from '@mui/material/Paper';
11-
1211
// MUI Theme
1312
import { ThemeProvider } from '@mui/material/styles';
1413
import theme from '../../theme';
15-
1614
// Component Imports
1715
import ContactListTableRow from './ContactListTableRow';
1816

1917
// ===== MAKE CHANGES HERE FOR TABLE HEADER / COLUMN TITLES =====
2018
const columnTitlesArray = ['Contact', 'Pin', 'Delete'];
2119

2220
/**
23-
* contactListTableProps is an object that stores the props for the
24-
* ContactListTable component
25-
*
26-
* @typedef {object} contactListTableProps
27-
* @property {Array} contacts - this list of contacts to display
28-
* @property {Function} deleteContact - method to delete contact
29-
* @memberof typedefs
21+
* @typedef {import("../../typedefs.js").userListObject} userListObject
3022
*/
3123

3224
/**
3325
* ContactListTable Component - Component that generates table of contacts from data within ContactList
3426
*
3527
* @memberof Contacts
3628
* @name ContactListTable
37-
* @param {contactListTableProps} Props - Props for ContactListTable
29+
* @param {object} Props - Props for ContactListTable
30+
* @param {userListObject[]} Props.contacts - this list of contacts to display
31+
* @param {Function} Props.deleteContact - method to delete contact
3832
* @returns {React.JSX.Element} The ContactListTable Component
3933
*/
4034
const ContactListTable = ({ contacts, deleteContact }) => {

src/components/Contacts/ContactListTableRow.jsx

+7-13
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,16 @@ import PushPinIcon from '@mui/icons-material/PushPin';
1111
import PushPinOutlinedIcon from '@mui/icons-material/PushPinOutlined';
1212
import TableCell from '@mui/material/TableCell';
1313
import TableRow from '@mui/material/TableRow';
14-
1514
// Context Imports
1615
import { DocumentListContext } from '@contexts';
17-
16+
// Custom Hook Imports
17+
import useNotification from '@hooks/useNotification';
1818
// MUI Theme
1919
import { ThemeProvider } from '@mui/material/styles';
2020
import theme from '../../theme';
2121

22-
// Custom Hook Imports
23-
import useNotification from '../../hooks/useNotification';
24-
2522
/**
26-
* contactListTableRowProps is an object that stores the props for the
27-
* ContactListTableRow component
28-
*
29-
* @typedef {object} contactListTableRowProps
30-
* @property {object} contact - Object containing contact information
31-
* @property {Function} deleteContact
32-
* - function to delete a chosen contact
23+
* @typedef {import("../../typedefs.js").userListObject} userListObject
3324
*/
3425

3526
/**
@@ -38,7 +29,10 @@ import useNotification from '../../hooks/useNotification';
3829
*
3930
* @memberof Contacts
4031
* @name ContactListTableRow
41-
* @param {contactListTableRowProps} Props - Props for ContactListTableRow
32+
* @param {object} Props - Props for ContactListTableRow
33+
* @param {userListObject} Props.contact - contact object that store's contact
34+
* information
35+
* @param {Function} Props.deleteContact - method to delete contact
4236
* @returns {React.JSX.Element} The ContactListTableRow Component
4337
*/
4438
const ContactListTableRow = ({ contact, deleteContact }) => {

src/components/Documents/DocumentTable.jsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@ import TableHead from '@mui/material/TableHead';
1111
import TableRow from '@mui/material/TableRow';
1212
// Context Imports
1313
import { DocumentListContext } from '@contexts';
14-
1514
// Component Imports
1615
import { ThemeProvider } from '@mui/material/styles';
1716
import theme from '../../theme';
1817
import DocumentTableRow from './DocumentTableRow';
1918
import { EmptyListNotification, LoadingAnimation } from '../Notification';
2019

21-
/**
22-
* @typedef {import("../../typedefs.js").documentTableProps} documentTableProps
23-
*/
24-
2520
/**
2621
* DocumentTable Component - The Document Table that shows the list of documents
2722
* stored on Solid
2823
*
2924
* @memberof Documents
3025
* @name DocumentTable
31-
* @param {documentTableProps} Props - Props for DocumentTable component
26+
* @param {object} Props - Props for DocumentTable component
27+
* @param {(modalType: string, docName: string, docType: string)
28+
* => void} Props.handleAclPermissionsModal - Function for setting up the
29+
* correct version of the SetAclPermissions Modal, and opening it.
30+
* @param {(document: object) => void} Props.handleSelectDeleteDoc - method
31+
* to delete document
3232
* @returns {React.JSX.Element} The DocumentTable component
3333
*/
3434
const DocumentTable = ({ handleAclPermissionsModal, handleSelectDeleteDoc }) => {

src/components/Documents/DocumentTableRow.jsx

+7-8
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,26 @@ import IconButton from '@mui/material/IconButton';
99
import ShareIcon from '@mui/icons-material/Share';
1010
import TableCell from '@mui/material/TableCell';
1111
import TableRow from '@mui/material/TableRow';
12-
1312
// Utility Imports
1413
import { getBlobFromSolid } from '@utils';
15-
1614
// MUI Theme
1715
import { ThemeProvider } from '@mui/material/styles';
1816
import theme from '../../theme';
19-
2017
// Constants Imports
2118
import DOC_TYPES from '../../constants/doc_types';
2219

23-
/**
24-
* @typedef {import("../../typedefs.js").documentTableRowProps} documentTableRowProps
25-
*/
26-
2720
/**
2821
* DocumentTableRow Component - A row in the Document Table
2922
*
3023
* @memberof Documents
3124
* @name DocumentTableRow
32-
* @param {documentTableRowProps} Props - Props for DocumentTableRow
25+
* @param {object} Props - Props for DocumentTableRow
26+
* @param {File} Props.document - File object containing the document
27+
* @param {(modalType: string, docName: string, docType: string)
28+
* => void} Props.handleAclPermissionsModal - Function for setting up the
29+
* correct version of the SetAclPermissions Modal, and opening it.
30+
* @param {(document: object) => void} Props.handleSelectDeleteDoc - method
31+
* to delete document
3332
* @returns {React.JSX.Element} The DocumentTableRow component
3433
*/
3534
const DocumentTableRow = ({ document, handleAclPermissionsModal, handleSelectDeleteDoc }) => {

src/components/Footer/RenderCallToActionSection.jsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import Button from '@mui/material/Button';
55
import Stack from '@mui/material/Stack';
66
import Typography from '@mui/material/Typography';
77

8-
/**
9-
* @typedef {import("../../typedefs.js").footerProps} footerProps
10-
*/
11-
128
/**
139
* The RenderCallToActionSection component renders information about policy,
1410
* terms and conditions, and the site to Code for PDX
1511
*
16-
* @param {footerProps} Props - The props for footer sub-component
12+
* @param {object} Props - The props for footer sub-component
13+
* @param {boolean} Props.isReallySmallScreen - Boolean for if screen is below theme
14+
* breakdown of 'sm' for MUI
1715
* @returns {React.JSX.Element} The RenderCallToActionSection component
1816
*/
1917
const RenderCallToActionSection = ({ isReallySmallScreen }) => (

src/components/Footer/RenderCompanyInfoSection.jsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Box from '@mui/material/Box';
55
import Link from '@mui/material/Link';
66
import Stack from '@mui/material/Stack';
77
import Typography from '@mui/material/Typography';
8-
98
import FacebookIcon from '@mui/icons-material/Facebook';
109
import InstagramIcon from '@mui/icons-material/Instagram';
1110
import SvgIcon from '@mui/material/SvgIcon';
@@ -49,15 +48,13 @@ const socialLinks = [
4948
}
5049
];
5150

52-
/**
53-
* @typedef {import("../../typedefs.js").footerProps} footerProps
54-
*/
55-
5651
/**
5752
* The RenderCompanyInfoSection component renders information about policy,
5853
* terms and conditions, and the site to Code for PDX
5954
*
60-
* @param {footerProps} Props - The props for footer sub-component
55+
* @param {object} Props - The props for footer sub-component
56+
* @param {boolean} Props.isReallySmallScreen - Boolean for if screen is below theme
57+
* breakdown of 'sm' for MUI
6158
* @returns {React.JSX.Element} The RenderCompanyInfoSection component
6259
*/
6360
const RenderCompanyInfoSection = ({ isReallySmallScreen }) => (

src/components/Footer/RenderCopyrightAndLinksSection.jsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ const legalLinks = [
2727
}
2828
];
2929

30-
/**
31-
* @typedef {import("../../typedefs.js").footerProps} footerProps
32-
*/
33-
3430
/**
3531
* The RenderCopyrightAndLinksSection component renders information about policy,
3632
* terms and conditions, and the site to Code for PDX
3733
*
38-
* @param {footerProps} Props - The props for footer sub-component
34+
* @param {object} Props - The props for footer sub-component
35+
* @param {boolean} Props.isReallySmallScreen - Boolean for if screen is below theme
36+
* breakdown of 'sm' for MUI
3937
* @returns {React.JSX.Element} The RenderCopyrightAndLinksSection component
4038
*/
4139
const RenderCopyrightAndLinksSection = ({ isReallySmallScreen }) => (

src/components/Form/DocumentSelection.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ import DOC_TYPES from '../../constants/doc_types';
1515
*
1616
* @memberof Forms
1717
* @name DocumentSelection
18+
* @param {object} Props - Props for DocumentSelection Component
19+
* @param {string} Props.htmlForAndIdProp - String for HTML for and id
20+
* @param {(event) => void} Props.handleDocType - Handler function for selecting
21+
* doc type
22+
* @param {string} Props.docType - The specific doc type selected
23+
* @returns {React.JSX.Element} - The Document Selection Component
1824
*/
19-
2025
const DocumentSelection = ({ htmlForAndIdProp, handleDocType, docType }) => (
2126
<Box>
2227
<FormControl required fullWidth>

src/components/Form/FormSection.jsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@ import React from 'react';
33
// Material UI Imports
44
import Box from '@mui/material/Box';
55
import Typography from '@mui/material/Typography';
6-
// Component Imports
7-
8-
/**
9-
* @typedef {import('../../typedefs').formSectionProps} formSectionProps
10-
*/
116

127
/**
138
* FormSection Component - Component that wraps section with title and MUI Box
149
* component
1510
*
1611
* @memberof Forms
1712
* @name FormSection
18-
* @param {formSectionProps} formSectionProps - A React prop that consists of
13+
* @param {object} Props - A React prop that consists of
1914
* that consist of title and children (see {@link formSectionProps})
15+
* @param {string} Props.title - Title of form section
16+
* @param {React.ReactElement} Props.children - JSX Element of the wrapped form
17+
* @returns {React.JSX.Element} - The FormSection Component
2018
*/
21-
2219
const FormSection = ({ title, children }) => (
2320
<Box
2421
sx={{

src/components/Home/HomeSection.jsx

+11-14
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,23 @@ import React from 'react';
44
import Box from '@mui/material/Box';
55
import Typography from '@mui/material/Typography';
66
import Button from '@mui/material/Button';
7-
/**
8-
* @typedef {object} HomeSectionParams
9-
* @property {string} componentImageSrc - image src
10-
* @property {string} componentImageAlt - image alt
11-
* @property {string} title - section title
12-
* @property {string} description - section description
13-
* @property {string} button - section button
14-
* @property {string} href - section button href
15-
* @property {string} label - section button aria-label
16-
* @property {boolean} isReallySmallScreen - screen size
17-
*/
7+
188
/**
199
* Represents a home section component
2010
*
21-
* @memberof Home
11+
* @memberof Home
2212
* @name HomeSecton
23-
* @param {HomeSectionParams} props - the component props
13+
* @param {object} Props - the component props
14+
* @param {string} Props.componentImageSrc - image src
15+
* @param {string} Props.componentImageAlt - image alt
16+
* @param {string} Props.title - section title
17+
* @param {string} Props.description - section description
18+
* @param {string} Props.button - section button
19+
* @param {string} Props.href - section button href
20+
* @param {string} Props.label - section button aria-label
21+
* @param {boolean} Props.isReallySmallScreen - screen size
2422
* @returns {React.JSX.Element} - the home section component
2523
*/
26-
2724
const HomeSection = ({
2825
componentImageSrc,
2926
componentImageAlt,

src/components/Home/KeyFeatures.jsx

+5-9
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@ import React from 'react';
33
// Material UI Imports
44
import Box from '@mui/material/Box';
55
import Typography from '@mui/material/Typography';
6-
/**
7-
* @typedef {object} KeyFeaturesParams
8-
* @property {string} icon - icon
9-
* @property {string} title - key feature title
10-
* @property {string} description - key feature description
11-
* @property {boolean} isReallySmallScreen - screen size
12-
*/
136

147
/**
158
* Represents key features section component
169
*
1710
* @memberof Home
1811
* @name KeyFeatures
19-
* @param {KeyFeaturesParams} props - the props
12+
* @param {object} Props - the props
13+
* @param {string} Props.icon - icon
14+
* @param {string} Props.title - key feature title
15+
* @param {string} Props.description - key feature description
16+
* @param {boolean} Props.isReallySmallScreen - screen size
2017
* @returns {React.JSX.Element} the KeyFeatures section component
2118
*/
22-
2319
const KeyFeatures = ({ icon, title, description, isReallySmallScreen }) => (
2420
<>
2521
<Box

src/components/Messages/MessageFolder.jsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ import { EmptyListNotification, LoadingAnimation } from '../Notification';
1616
* @typedef {import("../../typedefs.js").messageListObject} messageListObject
1717
*/
1818

19-
/**
20-
* @typedef {import("../../typedefs.js").messageFolderProps} messageFolderProps
21-
*/
22-
2319
/**
2420
* MessageFolder Component - The general component used for Message Folders Inbox
2521
* and Outbox
2622
*
2723
* @memberof Messages
2824
* @name MessageFolder
29-
* @param {messageFolderProps} Props - Component props for MessageFolder
25+
* @param {object} Props - Component props for MessageFolder
26+
* @param {string} Props.folderType - The name of the message box, i.e. "inbox"
27+
* or "outbox"
28+
* @param {() => Promise<void>} Props.handleRefresh - The handle function for
29+
* message folder refresh
30+
* @param {boolean} Props.loadMessages - Boolean for triggering loading message
31+
* @param {messageListObject[]} Props.messageList - A list of messages from
32+
* Solid Pod
3033
* @returns {React.JSX.Element} React component for MessageFolder
3134
*/
3235
const MessageFolder = ({ folderType, handleRefresh, loadMessages, messageList }) => {

src/components/Messages/MessagePreview.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { MessageContext, SignedInUserContext } from '@contexts';
1919
import { NewMessageModal } from '../Modals';
2020

2121
/**
22-
* @typedef {import("../../typedefs.js").messagePreviewProps} messagePreviewProps
22+
* @typedef {import("../../typedefs.js").messageListObject} messageListObject
2323
*/
2424

2525
/**
@@ -28,7 +28,9 @@ import { NewMessageModal } from '../Modals';
2828
*
2929
* @memberof Messages
3030
* @name MessagePreview
31-
* @param {messagePreviewProps} Props - Component props for MessagePreview
31+
* @param {object} Props - Component props for MessagePreview
32+
* @param {messageListObject} Props.message - The message object
33+
* @param {string} Props.folderType - Type of message box
3234
* @returns {React.JSX.Element} React component for MessagePreview
3335
*/
3436
const MessagePreview = ({ message, folderType }) => {

src/components/Modals/AddContactModal.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ import FormControl from '@mui/material/FormControl';
1111
import IconButton from '@mui/material/IconButton';
1212
import InputAdornment from '@mui/material/InputAdornment';
1313
import TextField from '@mui/material/TextField';
14+
// Custom Hook Imports
15+
import useNotification from '@hooks/useNotification';
1416
// Component Imports
1517
import { FormSection } from '../Form';
16-
import useNotification from '../../hooks/useNotification';
1718

1819
/**
1920
* @memberof Contcts

0 commit comments

Comments
 (0)