Skip to content

Conversation

@emmadesilva
Copy link
Member

Abstract

This changes the configuration option docs.sidebar_order to docs.sidebar.order in order to normalize the configuration API. It targets HydePHP v2.x via #1568.

Upgrade guide

Move the sidebar_order option's array in the config/docs.php file into the sidebar array in the same file.

Before

return [
  'sidebar' => [
      // ...
  ],

  'sidebar_order' => [
      'readme',
      'installation',
      'getting-started',
  ],
];

After

return [
  'sidebar' => [
      // ...
  
    'order' => [
        'readme',
        'installation',
        'getting-started',
    ],
  ],
];

Breaking: This changes the configuration option `docs.sidebar_order` to `docs.sidebar.order` in order to normalize the configuration API.
@codecov
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0490bf6) 99.91% compared to head (7b8e90b) 99.91%.

Additional details and impacted files
@@                       Coverage Diff                        @@
##             improved-navigation-internals    #1583   +/-   ##
================================================================
  Coverage                            99.91%   99.91%           
  Complexity                            1757     1757           
================================================================
  Files                                  183      183           
  Lines                                 4754     4754           
================================================================
  Hits                                  4750     4750           
  Misses                                   4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emmadesilva emmadesilva marked this pull request as ready for review February 22, 2024 18:46
@emmadesilva emmadesilva added the WTD Calls What The Diff label Feb 22, 2024
@what-the-diff
Copy link

what-the-diff bot commented Feb 22, 2024

PR Summary

  • Renamed Config Parameter
    The configuration parameter 'sidebar_order' has been renamed to 'order' under the 'sidebar' key. This change is consistent across several files. Specifically, the affected files are config/docs.php, docs/creating-content/documentation-pages.md, docs/digging-deeper/customization.md, docs/digging-deeper/navigation.md, and packages/framework/config/docs.php.

  • Updated Config Usage in Factory
    In files packages/framework/src/Framework/Factories/NavigationDataFactory.php and packages/framework/src/Framework/Features/Navigation/NavigationMenuGenerator.php, the updated configuration docs.sidebar.order was used in the Config::getArray method instead of the previous one (docs.sidebar_order).

  • Updated Tests
    The configuration update has been reflected in various test files - packages/framework/tests/Feature/AutomaticNavigationConfigurationsTest.php, packages/framework/tests/Feature/Services/DocumentationSidebarTest.php, and packages/framework/tests/Unit/NavigationDataFactoryUnitTest.php. The methods in these tests were updated to use the new 'sidebar.order' naming convention instead of the previous 'sidebar_order' version.

@emmadesilva emmadesilva merged commit 4fc7b9e into improved-navigation-internals Feb 22, 2024
@emmadesilva emmadesilva deleted the normalize-navigation-configuration-api branch February 22, 2024 18:48
@emmadesilva
Copy link
Member Author

Just for everyone reading this, just know that this one hurt. I don't like making breaking changes, especially ones with as high impact as this one. I am really sorry, but I do think it's necessary to improve the codebase.

@emmadesilva emmadesilva removed the WTD Calls What The Diff label Jun 30, 2024
@emmadesilva emmadesilva added this to the v2 milestone Jul 9, 2024
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.

2 participants