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

Refactoring of Not-Associated-Items List #63

Open
framirez07 opened this issue Sep 8, 2020 · 0 comments
Open

Refactoring of Not-Associated-Items List #63

framirez07 opened this issue Sep 8, 2020 · 0 comments
Assignees

Comments

@framirez07
Copy link
Contributor

The not-associated-items list component in the SPA and the requests it sends needs to be refactoring in order to support current functionality.
A new way of getting or display the not associated items on this component should be found.

Currently, the algorithm to get and display the not associated items when associations are being editing, is the following, and an illustrated explanation can be consulted in this document. Also, in this document a posible option is described.

Current implementation behavior:

Input:
id of the item being editing (example: userId = 4).
associated model (example: roles)

Algorithm:

  • First, an array of associated roles ids of userId=4 is fetched.
    Example: [1, 2, 3]; <--- roles ids that are associated with userID = 4.

  • Then, the roleFiltersConnection of userId=3 is fetched, filtered with a search object that excludes all current associated roles (those that were fetched in point 1).

Considerations:

  • This algorithm works fine if we can get at once all the associated ids of a given record. It was thinking when no limits & pagination restriction were in place.

  • Currently, this algorithm will not work as expected in the case when there are more associated items thant the MAX_LIMIT_RECORDS value: in this case, we will receive an error indicating that records limit was exceeded.

  • Also, the first query has no pagination argument, because it expects to receive all the ids in the filter.

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

6 participants