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

EPMRPP-96415 || Default number of items per page is displayed when us… #4065

Closed
wants to merge 2 commits into from

Conversation

BlazarQSO
Copy link
Contributor

@BlazarQSO BlazarQSO commented Oct 24, 2024

…er returns to the page

PR Checklist

  • Have you verified that the PR is pointing to the correct target branch? (develop for features/bugfixes, other if mentioned in the task)
  • Have you verified that your branch is consistent with the target branch and has no conflicts? (if not, make a rebase under the target branch)
  • Have you checked that everything works within the branch according to the task description and tested it locally?
  • Have you run the linter (npm run lint) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.
  • Have you run the tests locally and added/updated them if needed?
  • Have you checked that app can be built (npm run build)?
  • Have you made sure that all the necessary pipelines has been successfully completed?
  • If the task requires translations to be updated, have you done this by running the manage:translations script?

Visuals

@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.05%. Comparing base (d14991a) to head (6c75f01).

Additional details and impacted files
@@              Coverage Diff              @@
##           feature/orgs    #4065   +/-   ##
=============================================
  Coverage         61.05%   61.05%           
=============================================
  Files                82       82           
  Lines               914      914           
  Branches            131      130    -1     
=============================================
  Hits                558      558           
  Misses              326      326           
  Partials             30       30           

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

@@ -105,6 +105,7 @@ export const prevPagePropertiesSelector = (

export const createQueryParametersSelector = ({
namespace: staticNamespace,
alternativeNamespace,
Copy link
Member

Choose a reason for hiding this comment

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

Why the existing staticNamespace cannot be used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When everyone switches to the same pagination format, then you can leave one option.

@@ -29,6 +29,7 @@ export const withPagination = ({
paginationSelector = defaultPaginationSelector,
namespace,
namespaceSelector,
alternativeNamespace,
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When everyone switches to the same pagination format, then you can leave one option.


export const totalElementsSelector = (paginationSelector) => (state) =>
paginationSelector(state).totalElements;
export const totalPagesSelector = (paginationSelector) => (state) =>
paginationSelector(state).totalPages;

export const defaultPaginationSelector = () => DEFAULT_PAGINATION;

export const createParametersSelector = ({
Copy link
Member

Choose a reason for hiding this comment

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

As this not related just to pagination, I suggest to move this selector to the pages/selectors and name it as createAlternativeQueryParametersSelector to be consistent in naming.
In this case this alternative common query selector will be responsible for collecting and processing all types of query parameters (pagination, sorting, etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -25,4 +25,5 @@ export const loadingSelector = (state) => domainSelector(state).loading || false

export const querySelector = createQueryParametersSelector({
Copy link
Member

Choose a reason for hiding this comment

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

Should it be replaced by createAlternativeQueryParametersSelector?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an old pagination and can work via namespace:
image

But then there will be such parameters:
image

with an alternative namespace:
image

Copy link

sonarcloud bot commented Oct 24, 2024

@BlazarQSO BlazarQSO closed this Oct 25, 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.

3 participants