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

Add method groups sorting #41

Merged
merged 4 commits into from
Feb 1, 2024

Conversation

Solovev-A
Copy link
Contributor

@Solovev-A Solovev-A commented Jan 25, 2024

This PR adds method groups sorting option.

sort.mp4

@gruzzilkin
Copy link

@Ge11ert, @NetDead, hello! Could you please review the PR? 🙏

Copy link
Contributor

@Ge11ert Ge11ert left a 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('.'),
Copy link
Contributor

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

Copy link
Contributor Author

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();
Copy link
Contributor

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

Copy link
Contributor Author

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

@Solovev-A Solovev-A force-pushed the improvement-method-groups-order branch from 2d27069 to 667f345 Compare January 30, 2024 07:21
@Solovev-A Solovev-A marked this pull request as draft January 30, 2024 08:43
@Solovev-A Solovev-A force-pushed the improvement-method-groups-order branch from 667f345 to 03be83d Compare January 31, 2024 11:48
@Solovev-A Solovev-A marked this pull request as ready for review January 31, 2024 11:49
@Solovev-A
Copy link
Contributor Author

Updated sorting for organizing /#/manual-search-page content method groups.

@Solovev-A Solovev-A changed the title Add sidebar method groups sorting Add method groups sorting Jan 31, 2024
Copy link

@gruzzilkin gruzzilkin left a 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?

@NetDead NetDead merged commit f86728a into funbox:master Feb 1, 2024
4 checks passed
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.

None yet

4 participants