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

isEditedPostDateFloating should be filterable to support custom statuses #26984

Open
davisshaver opened this issue Nov 15, 2020 · 1 comment
Open
Labels
[Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.

Comments

@davisshaver
Copy link
Contributor

davisshaver commented Nov 15, 2020

Is your feature request related to a problem? Please describe.
Working with the Edit Flow project, we have run into an issue where posts with custom statuses are unable to stay in "floating" date mode.

See discussion here: Automattic/Edit-Flow#623

Describe the solution you'd like
Allow the list of statuses supporting floating date mode to be filtered.

Current

const status = getEditedPostAttribute( state, 'status' );
if (
    status === 'draft' ||
    status === 'auto-draft' ||
    status === 'pending'
) {
    return date === modified || date === null;
}
return false;

Proposed

const status = getEditedPostAttribute( state, 'status' );
const floatingStatuses = applyFilters(
	'selectors.getPostDateFloatingStatuses',
	[ 'draft', 'auto-draft', 'pending', ],
);
if (floatingStatuses.includes(status)) {
	return date === modified || date === null;
}
return false;

Describe alternatives you've considered
Disabling Edit Flow or adding a notification letting users know they need to work around the Gutenberg limitation.

Related to:

@talldan talldan added [Type] Enhancement A suggestion for improvement. [Package] Editor /packages/editor labels Nov 16, 2020
@davisshaver
Copy link
Contributor Author

@talldan Thanks for the labels! Maybe [Feature] Extensibility too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants