Skip to content

Refactoring of Not-Associated-Items List #63

@framirez07

Description

@framirez07

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions