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

<po-table>: PoTable Service singleton #2031

Open
2 of 10 tasks
joaomauriciotecadi opened this issue Apr 13, 2024 · 2 comments
Open
2 of 10 tasks

<po-table>: PoTable Service singleton #2031

joaomauriciotecadi opened this issue Apr 13, 2024 · 2 comments
Labels
status: triage Issue or pull request that need to be triaged and assigned to a reviewer

Comments

@joaomauriciotecadi
Copy link

joaomauriciotecadi commented Apr 13, 2024

Erro fetch component

O componente realiza o fetch para a URL da propriedade do p-service-api do ultimo <po-table> renderizado na tela.

Projeto com exemplo do erro

Fetch Po-table

Reprodução do erro

  1. Necessário um endpoint de consultar com paginação para habilita ro Carregar mais no primeiro componente.
  2. Criar o componente <po-table> utilizando a propriedade p-service-api para a URL "http:localhost:3000/X".
  3. Criar um outro componente <po-table> utilizando a propriedade p-service-api para a URL "http:localhost:3000/Y"
  4. Ao ser renderizado o primeiro componente, será instanciado o table service com a URL informada.
  5. O fetch ocorre normalmente para o endpoint "http:localhost:3000/X".
  6. Ao ser renderizado o segundo componente, será substituido a URL dentro do table service com a URL informada.
  7. O fetch ocorre normalmente para o endpoint "http:localhost:3000/Y"
  8. Clicar em Carregar mais do primeiro componente.
  9. O erro ocorre aqui, pois como não há uma re-reenderização a URL para fetch no table service não é atribuida novamente.
  10. O fetch ocorre de forma ERRADA para o endpoint "http:localhost:3000/Y" ao invés do endpoint "http:localhost:3000/X" informado no p-service-api do primeiro componente.

image

Que comportamento você esperava ver?

Espero que a URL do p-service-api não seja reatribuida ao criar um novo componente <po-table>

Ambiente

  • PO UI: 17.2.3
  • Angular CLI: 17.2.3
  • Node: 20.11.1
  • Browser(s):
    • Chrome
    • Firefox
    • Edge
    • Safari
    • IE 11
    • Outros
  • Operating System:
    • Windows
    • macOS
    • Ubuntu
    • Outros
@joaomauriciotecadi joaomauriciotecadi added the bug Something isn't working label Apr 13, 2024
@anliben
Copy link
Contributor

anliben commented Apr 24, 2024

Bom Dia @joaomauriciotecadi, tudo bem?

Analisarei e retorno com uma resposta em breve.

Attr.

@anliben anliben added status: triage Issue or pull request that need to be triaged and assigned to a reviewer and removed bug Something isn't working labels Apr 24, 2024
@joaomauriciotecadi
Copy link
Author

Bom dia @anliben

Coloquei uma possivel correção no pr https://github.com/po-ui/po-angular/pull/2032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage Issue or pull request that need to be triaged and assigned to a reviewer
Projects
None yet
Development

No branches or pull requests

2 participants