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

Refactor publication types to simplify the code and integrate publication pagination settings #816

Conversation

caendesilva
Copy link
Member

@caendesilva caendesilva commented Jan 8, 2023

  • Improves the publication type create command to better integrate pagination settings
  • Removes the prevNextLinks setting as it's unlikely one would enable page size limits without a way to traverse them
  • Makes the pagination settings property of publication types nullable, whilst also making pagination not be the default
  • The publication type constructor now only accepts arrays for the publication setting (to keeps things simple, and since all other arguments are primitive PHP types)
  • Change default publication type canonicalField value from identifier to __createdAt as this is what is being null coalesced to in the creator action, plus it matches the pagination defaults
  • Refactor internal field data state to be parsed as this makes it impossible to create an invalid schema only to not realize it until later. Also removes the duplicate getters which is just confusing.

@caendesilva caendesilva force-pushed the improve-make-publication-type-command-to-better-integrate-pagination-settings branch from a7ad2f7 to 3617619 Compare January 8, 2023 14:40
@codecov
Copy link

codecov bot commented Jan 8, 2023

Codecov Report

Merging #816 (1281054) into publications-feature (5a61b0a) will not change coverage.
The diff coverage is n/a.

@@                    Coverage Diff                     @@
##             publications-feature      #816     +/-   ##
==========================================================
  Coverage                  100.00%   100.00%             
+ Complexity                   3020      1511   -1509     
==========================================================
  Files                         338       169    -169     
  Lines                        7548      3779   -3769     
==========================================================
- Hits                         7548      3779   -3769     
Impacted Files Coverage Δ
...rc/Console/Commands/MakePublicationTypeCommand.php 100.00% <0.00%> (ø)
...rc/Framework/Actions/CreatesNewPublicationType.php 100.00% <0.00%> (ø)
...k/Features/Publications/Models/PublicationType.php 100.00% <0.00%> (ø)
...eatures/Publications/Models/PaginationSettings.php 100.00% <0.00%> (ø)
...rc/Console/Commands/MakePublicationTypeCommand.php
...c/Console/Commands/ValidatePublicationsCommand.php
...rc/Framework/Actions/CreatesNewPublicationType.php
...eatures/Publications/Models/PaginationSettings.php
...k/Features/Publications/Models/PublicationType.php
...mework/src/Console/Commands/BuildSearchCommand.php
... and 163 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@caendesilva caendesilva changed the title Improve the publication type create command to better integrate pagination settings Simplify and integrate publication pagination settings Jan 8, 2023
@caendesilva caendesilva force-pushed the improve-make-publication-type-command-to-better-integrate-pagination-settings branch from b23fb3e to 08737e7 Compare January 8, 2023 15:43
@caendesilva caendesilva force-pushed the improve-make-publication-type-command-to-better-integrate-pagination-settings branch from 0197efb to b11d39a Compare January 8, 2023 16:53
caendesilva and others added 26 commits January 8, 2023 17:55
Makes it impossible to create an invalid schema only to not realize it until later. Also removes the duplicate getters which is just confusing.
Since the parsed value is sorted by object
…e-command-to-better-integrate-pagination-settings
…ere and add complexity without value

They are only expected in a single test file and never actually used. They also don't offer any new information since the name is present within the value.
@caendesilva caendesilva marked this pull request as ready for review January 8, 2023 19:28
@caendesilva caendesilva merged commit 26ac554 into publications-feature Jan 8, 2023
@caendesilva caendesilva deleted the improve-make-publication-type-command-to-better-integrate-pagination-settings branch January 8, 2023 19:28
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