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

Load all available tenant options #1

Closed
CGuether opened this issue Dec 15, 2023 · 2 comments
Closed

Load all available tenant options #1

CGuether opened this issue Dec 15, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@CGuether
Copy link
Collaborator

Right now the plugin only loads the first page with a page size of 2000 for the tenant options.

tenant-option-management\tenant-option-management.service.ts

  getAllOptions() {
    return this.tenantOption
      .list({
        pageSize: 2000,
      })
      .then((res) => res.data.map((o) => ({ id: `${o.category}-${o.key}`, value: o.value })));
  }

It's unusual, but there could be use cases, which have more than 2000 tenant options. In this case, it might happen that not all options are displayed correctly, because they can't be found on the page loaded.

Proposed Solution

Update the query to include query parameter withTotalPages and load all available pages for tenant options.

@CGuether CGuether added the bug Something isn't working label Dec 15, 2023
@CGuether
Copy link
Collaborator Author

I will create a PR for this issue

CGuether added a commit that referenced this issue Dec 18, 2023
* #1 Refactor getAllOptions method to handle pagination

* #1 display alert and return empty if tentant options couldn't be loaded
@hnaether-c8y
Copy link
Collaborator

Added as part of v1.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants