Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PropTypes to SimpleForm and TabbedForm #3996

Merged
merged 4 commits into from
Nov 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/ra-ui-materialui/src/form/SimpleForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,27 @@ const SimpleForm = ({ initialValues, defaultValue, saving, ...props }) => {
);
};

SimpleForm.propTypes = {
basePath: PropTypes.string,
children: PropTypes.node,
className: PropTypes.string,
defaultValue: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), // @deprecated
initialValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
handleSubmit: PropTypes.func, // passed by react-final-form
WiXSL marked this conversation as resolved.
Show resolved Hide resolved
invalid: PropTypes.bool,
WiXSL marked this conversation as resolved.
Show resolved Hide resolved
pristine: PropTypes.bool,
resource: PropTypes.string,
redirect: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.func,
]),
submitOnEnter: PropTypes.bool,
toolbar: PropTypes.element,
undoable: PropTypes.bool,
validate: PropTypes.func,
WiXSL marked this conversation as resolved.
Show resolved Hide resolved
};

const defaultSubscription = {
submitting: true,
pristine: true,
Expand Down
28 changes: 28 additions & 0 deletions packages/ra-ui-materialui/src/form/TabbedForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,34 @@ const TabbedForm = ({ initialValues, defaultValue, saving, ...props }) => {
);
};

TabbedForm.propTypes = {
basePath: PropTypes.string,
WiXSL marked this conversation as resolved.
Show resolved Hide resolved
children: PropTypes.node,
className: PropTypes.string,
classes: PropTypes.object,
defaultValue: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), // @deprecated
initialValues: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
handleSubmit: PropTypes.func, // passed by react-final-form
invalid: PropTypes.bool,
location: PropTypes.object,
match: PropTypes.object,
pristine: PropTypes.bool,
redirect: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.func,
]),
resource: PropTypes.string,
submitOnEnter: PropTypes.bool,
tabs: PropTypes.element.isRequired,
tabsWithErrors: PropTypes.arrayOf(PropTypes.string),
toolbar: PropTypes.element,
translate: PropTypes.func,
undoable: PropTypes.bool,
validate: PropTypes.func,
value: PropTypes.number,
};

const defaultSubscription = {
submitting: true,
pristine: true,
Expand Down
11 changes: 11 additions & 0 deletions packages/ra-ui-materialui/src/list/DatagridLoading.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { memo } from 'react';
import PropTypes from 'prop-types';
import Table from '@material-ui/core/Table';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
Expand Down Expand Up @@ -106,4 +107,14 @@ const DatagridLoading = ({
</Table>
);

DatagridLoading.propTypes = {
classes: PropTypes.object,
className: PropTypes.string,
expand: PropTypes.oneOfType([PropTypes.element, PropTypes.elementType]),
hasBulkActions: PropTypes.bool,
nbChildren: PropTypes.number,
nbFakeLines: PropTypes.number,
size: PropTypes.string,
WiXSL marked this conversation as resolved.
Show resolved Hide resolved
};

export default memo(DatagridLoading);