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

sap-commerce-cloud #5599

Closed
FilipeAPV opened this issue Nov 30, 2023 · 2 comments
Closed

sap-commerce-cloud #5599

FilipeAPV opened this issue Nov 30, 2023 · 2 comments

Comments

@FilipeAPV
Copy link

Describe the bug

  1. The total number of pages is not being updated in Dialog.tsx state.
    The problem seems to come from the method updateTotalPages that is not using the function parameter "totalPages":
updateTotalPages = (totalPages: number) => {
    // this.setState({ totalPages: this.state.totalPages }); -> bug
    this.setState({ totalPages: totalPages }); 
  };
  1. Two bugs in the following code also from Dialog.tsx:
  nextPageButtonEvent = () => {
    this.setState({ page: this.state.page - 1 });
    this.load();
  };

  prevPageButtonEvent = () => {
    this.setState({ page: this.state.page - 1 });
    this.load();
  };
  • nextPageButtonEvent should be + 1, to retrieve the next page
  • setState is async, so this.load() is going to be called with the non-updated value.

Maybe something like this would be the solution:

nextPageButtonEvent = () => {
  this.setState({ page: this.state.page + 1 }, () => {
    this.load();
  });
};

To Reproduce
Steps to reproduce the behavior:

  1. Install and configure connector
  2. Open connector dialog
  3. In the first bug, the pagination btn's will not be shown. In the second one, you'll be working with the previous value of "page".
@rusticpenguin
Copy link
Contributor

Thank you so much for triaging this Filipe! I'll be working to get these fixes in tomorrow!

@lilbitner
Copy link
Contributor

Hi @FilipeAPV, thank you for raising this bug! We have pushed a fix and it should be resolved now. Please feel free to open another Github issue if you find issues on your end with the resolution.

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

No branches or pull requests

3 participants