Skip to content

Commit

Permalink
fix: fix prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Jan 13, 2021
1 parent d168e66 commit 99e6a16
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 13 additions & 2 deletions src/pages/JobList/JobList.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react'
import { object, arrayOf, string } from 'prop-types'
import { Card } from '@dhis2/ui-core'
import { Link } from 'react-router-dom'
import { Title } from '../../components/Title'
import { Info } from '../../components/Icons'
import JobListItem from './JobListItem'

const JobList = () => (
const JobList = ({ jobIds, jobEntities }) => (
<React.Fragment>
<Title priority={2}>Scheduled Jobs</Title>
<Info />
Expand All @@ -21,10 +23,19 @@ const JobList = () => (
<th>On/off</th>
</tr>
</thead>
<tbody></tbody>
<tbody>
{jobIds.map(id => (
<JobListItem key={id} job={jobEntities[id]} />
))}
</tbody>
</table>
</Card>
</React.Fragment>
)

JobList.propTypes = {
jobIds: arrayOf(string).isRequired,
jobEntities: object.isRequired,
}

export default JobList
5 changes: 2 additions & 3 deletions src/pages/JobList/JobListContainer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect } from 'react'
import { object, arrayOf, number, node, func, string, bool } from 'prop-types'
import { object, arrayOf, func, string, bool } from 'prop-types'
import { connect } from 'react-redux'
import { CircularLoader } from '@dhis2/ui-core'
import { actions, selectors } from '../../data/jobs'
Expand Down Expand Up @@ -29,10 +29,9 @@ export const UnconnectedJobListContainer = ({
}

UnconnectedJobListContainer.propTypes = {
children: node.isRequired,
isFetching: bool.isRequired,
errorMessage: string.isRequired,
jobIds: arrayOf(number).isRequired,
jobIds: arrayOf(string).isRequired,
jobEntities: object.isRequired,
fetchJobsIfNeeded: func.isRequired,
}
Expand Down

0 comments on commit 99e6a16

Please sign in to comment.