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

Chrome: Adding the post category selector #1159

Merged
merged 3 commits into from
Jun 14, 2017

Conversation

youknowriad
Copy link
Contributor

Closes #854

This PR adds the category selector to the post settings panel

screen shot 2017-06-13 at 14 43 05

@youknowriad youknowriad added the General Interface Parts of the UI which don't fall neatly under other labels. label Jun 13, 2017
@youknowriad youknowriad self-assigned this Jun 13, 2017
@paulwilde
Copy link
Contributor

paulwilde commented Jun 13, 2017

Just a slight observation and not exactly relevant to this pull request, but it would make sense to have the title as "Tags & Categories" seeing as the Categories are below the Tags.

I feel Categories are used more than Tags these days, so I would just move the Categories above the Tags, personally.

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Nice one. This works quite well for me in my testing.

* External dependencies
*/
import { connect } from 'react-redux';
import { unescape, without, groupBy } from 'lodash';
Copy link
Member

Choose a reason for hiding this comment

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

I always worry about unescape since it's available as a function the global scope (shadowing):

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape

Also unique syntax highlighting in my editor.

unescape as unescapeString (or alternative) is an option, though admittedly ugly.

Maybe fine to accept the shadowing, especially since #1008 will flag if usage doesn't align with an import.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I don't care that much about the name. I'm using unescapeString

*/
import { __ } from 'i18n';
import { Component } from 'element';
import { getEditedPostAttribute } from '../../selectors';
Copy link
Member

Choose a reason for hiding this comment

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

These are "Internal" dependencies.

import { editPost } from '../../actions';

const DEFAULT_CATEGORIES_QUERY = {
number: -1,
Copy link
Member

Choose a reason for hiding this comment

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


return (
<div className="editor-post-taxonomies__categories-selector">
<strong className="editor-post-taxonomies__categories-selector-title">{ __( 'Categories' ) }</strong>
Copy link
Member

Choose a reason for hiding this comment

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

Should we use a proper heading element here instead of strong? Similarly I might have expected the panel toggle headings to be heading elements.

@youknowriad
Copy link
Contributor Author

Thanks for the reviews @aduth @paulwilde Feedback addressed

@youknowriad youknowriad merged commit 9ad8716 into master Jun 14, 2017
@youknowriad youknowriad deleted the update/categories-selector branch June 14, 2017 12:36
@afercia
Copy link
Contributor

afercia commented Jun 14, 2017

Really appreciate the introduction of headings, thanks ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants