Skip to content

Fix path uuid lookup bug #411

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

Merged
merged 2 commits into from
Nov 22, 2021
Merged

Fix path uuid lookup bug #411

merged 2 commits into from
Nov 22, 2021

Conversation

davidanastasov
Copy link
Contributor

Related Issue

#402

Description

This fixes a bug in the detail panel uuid lookup when the rows are grouped

Impacted Areas in Application

The change affects these methods from data-manager.js which are used inside material-table.js

  • changeRowSelected
  • changeDetailPanelVisibility
  • changeGroupExpand
  • changeTreeExpand

@davidanastasov davidanastasov changed the title Fix detail panel uuid bug when the rows are grouped Fix path uuid lookup bug Nov 21, 2021
@Domino987
Copy link
Contributor

Can wee verify that if the 0 is within the oath array, this works as well? I think this change is correct bit not extensive enough, because I think there is still a case where the index is used. And this would break this. I think w would also rwmove all index path elements.

@davidanastasov
Copy link
Contributor Author

@Domino987 I thought about that case, but I couldn't recreate it with any of the demos, and that's why I thought this would be enough. To be extra safe we could either:

  1. Check if the current element from the path array is a number or a string (uuid):
    image

  2. Try to first get the element based on the index, if that's undefined, try to find it by matching the uuid
    image

I personally prefer the second option, do you think it's enough to cover this case?
As for removing the indexes from the path array everywhere, I haven't explored the filtering and grouping logic enough to be able to take on that task at this moment. Is there a benefit to doing that? I also saw in the contributor guidelines that you're planning on rewriting the data-manager global state to use context, is that still the plan?

@Domino987
Copy link
Contributor

Domino987 commented Nov 21, 2021

Yes the second option is better I think.

It might be caused by tree dat aa well.

But this should work for both sencarios.

Regarding the data-manager, one idea would be to port it to context or recoil but this would be a work of a month at least so I had no time to do that yet.

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