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

Allow "false" prop for SimpleList toolbar, removing element #6969

Merged
merged 3 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
7 changes: 5 additions & 2 deletions packages/ra-ui-materialui/src/form/SimpleForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ SimpleForm.propTypes = {
save: PropTypes.func,
saving: PropTypes.bool,
submitOnEnter: PropTypes.bool,
toolbar: PropTypes.element,
toolbar: PropTypes.oneOfType([
PropTypes.element,
PropTypes.oneOf([false]),
]),
undoable: PropTypes.bool,
validate: PropTypes.func,
version: PropTypes.number,
Expand All @@ -82,7 +85,7 @@ export interface SimpleFormProps
mutationMode?: MutationMode;
resource?: string;
submitOnEnter?: boolean;
toolbar?: ReactElement;
toolbar?: ReactElement | false;
/** @deprecated use mutationMode: undoable instead */
undoable?: boolean;
variant?: 'standard' | 'outlined' | 'filled';
Expand Down
7 changes: 5 additions & 2 deletions packages/ra-ui-materialui/src/form/SimpleFormView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ SimpleFormView.propTypes = {
save: PropTypes.func, // the handler defined in the parent, which triggers the REST submission
saving: PropTypes.bool,
submitOnEnter: PropTypes.bool,
toolbar: PropTypes.element,
toolbar: PropTypes.oneOfType([
PropTypes.element,
PropTypes.oneOf([false]),
]),
undoable: PropTypes.bool,
validate: PropTypes.func,
};
Expand All @@ -107,7 +110,7 @@ export interface SimpleFormViewProps extends FormWithRedirectRenderProps {
mutationMode?: MutationMode;
record?: Partial<Record>;
resource?: string;
toolbar?: ReactElement;
toolbar?: ReactElement | false;
/** @deprecated use mutationMode: undoable instead */
undoable?: boolean;
variant?: 'standard' | 'outlined' | 'filled';
Expand Down