Skip to content

Commit

Permalink
Fix component arguments and proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jan 23, 2025
1 parent 907d243 commit 427aeb1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rdmo/core/assets/js/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Modal.propTypes = {
submitProps: PropTypes.object,
onClose: PropTypes.func.isRequired,
onSubmit: PropTypes.func,
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
buttons: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
buttons: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
}

export default Modal
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const Search = ({ page, attribute, values, setValues, collection = false }) => {
}

Search.propTypes = {
page: PropTypes.number.isRequired,
page: PropTypes.object,
attribute: PropTypes.number.isRequired,
setAttribute: PropTypes.number,
values: PropTypes.object.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'

import Modal from 'rdmo/core/assets/js/components/Modal'

const PageHeadDeleteModal = ({ title, name, show, onClose, onSubmit }) => {
const PageHeadDeleteModal = ({ name, show, onClose, onSubmit }) => {
return (
<Modal title={gettext('Delete tab')} show={show} submitLabel={gettext('Delete')}
submitProps={{className: 'btn btn-danger'}}
Expand All @@ -24,7 +24,6 @@ const PageHeadDeleteModal = ({ title, name, show, onClose, onSubmit }) => {
}

PageHeadDeleteModal.propTypes = {
title: PropTypes.string.isRequired,
name: PropTypes.string,
show: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ PageHeadFormModal.propTypes = {
show: PropTypes.bool.isRequired,
attribute: PropTypes.number,
reuse: PropTypes.bool,
initial: PropTypes.object,
initial: PropTypes.string,
onClose: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PageHeadReuseModal = ({ show, attribute, onClose, onSubmit }) => {
}, [values, values.value])

return (
<Modal title={gettext('Reuse answers')} show={show} submitLabel={gettext('Reuse')}
<Modal title={gettext('Reuse tab')} show={show} submitLabel={gettext('Reuse')}
submitProps={{className: 'btn btn-primary'}}
onClose={onClose} onSubmit={handleSubmit}>
<div className={classNames({'form-group': true, 'has-error': errors.value })}>
Expand All @@ -61,7 +61,6 @@ const PageHeadReuseModal = ({ show, attribute, onClose, onSubmit }) => {
}

PageHeadReuseModal.propTypes = {
title: PropTypes.string.isRequired,
show: PropTypes.bool.isRequired,
attribute: PropTypes.number,
onClose: PropTypes.func.isRequired,
Expand Down

0 comments on commit 427aeb1

Please sign in to comment.