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

restore deprecated undoable prop original behavior #6153

Merged
merged 2 commits into from
May 1, 2021

Conversation

ThieryMichel
Copy link
Contributor

For retrocompatibility undoable=false should be on pessimistic mode, currently it is on undoable mode.

import PropTypes from 'prop-types';
import { Record, RedirectionSideEffect, MutationMode } from 'ra-core';

import { ButtonProps } from './Button';
import DeleteWithUndoButton from './DeleteWithUndoButton';
import DeleteWithConfirmButton from './DeleteWithConfirmButton';

const useMutationMode = (mutationMode, undoable) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you extract this in a dedicated file ?

import PropTypes from 'prop-types';
import { Record, RedirectionSideEffect, MutationMode } from 'ra-core';

import { ButtonProps } from './Button';
import DeleteWithUndoButton from './DeleteWithUndoButton';
import DeleteWithConfirmButton from './DeleteWithConfirmButton';

const useMutationMode = (mutationMode, undoable) => {
useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm -1 with this useEffect and the related warnings. A simple function, rather than a hook, will be enough.

@fzaninotto
Copy link
Member

bump, could you please apply the review?

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a linter warning about performances

@ThieryMichel ThieryMichel force-pushed the delete_undoable_retrocompatibility branch from 1a589bf to 9028481 Compare April 30, 2021 10:09
@fzaninotto fzaninotto merged commit 70516ac into master May 1, 2021
@fzaninotto fzaninotto deleted the delete_undoable_retrocompatibility branch May 1, 2021 20:32
@fzaninotto fzaninotto added this to the 3.15 milestone May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants