-
Notifications
You must be signed in to change notification settings - Fork 2
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 method groups sorting #41
Add method groups sorting #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
name, | ||
value, | ||
options = { | ||
domain: window.location.hostname.split('.').slice(-2).join('.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is better to specify an empty object as a default value of options
, declare somewhere earlier defaultOptions = { domain: .... }
, and then merge options from params and default options. What do you think?
With current defaults declaration we must duplicate domain
option where we call cookies.set
, otherwise it will be overwritten
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Fixed.
@@ -41,11 +45,16 @@ class MainLayout extends React.PureComponent { | |||
|
|||
this.warnings = props.topLevelMeta.warnings; | |||
|
|||
this.isGroupsSortingEnabled = cookies.get({ | |||
name: SORT_METHOD_GROUPS_COOKIE_NAME, | |||
}) === true.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't say that this is totally wrong, I see why you need this (I mean true.toString()
). But I have strange feeling that it looks a bit awkward.
If you later choose another value for cookie (so it's not 'true' or 'false'), you need to change it here too or it will break down. I would prefer something like cookie is set / cookie is undefined
to use good old double negation !!
.
But as I said, this is just my feeling, you are free to stay with this implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I have fixed it
2d27069
to
667f345
Compare
667f345
to
03be83d
Compare
Updated sorting for organizing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great! @NetDead, сould you merge this pull request?
This PR adds method groups sorting option.
sort.mp4