Closed kachnitel closed 4 years ago
RidersList.js
: (is the original user list and...) nearly a duplicate of FriendList.js
.FriendList.js
: the horizontal one w/ only pic & name used in Profile
UsersList.js
: vertical list used in FriendListScreen
, AddFriend
etc, alternating clr)getThumbnail()
at API, use Store.populate()
on list of IDs{ id, name, picture }
with minimal parameters necessarystore._collection
with a "thumbnail=true" flagstore.getPreview
(sync, only local lookup) while the List is loading details in bg, making transition to list instantstore.getSync
would throw an error if existing entity is a thumbnail. store.get
/store.getEntity
must treat thumbnail as non-existing itemUser
?1) updateFriends
/addFriend
creates the entity with info from thumbnail
2) ID of created entity is added to friends
list (or whichever entity)
3) List component then uses [ids]
and each list item uses user.getThumbnail()
(as getSync
would fail, get
would be inefficient and all details would instead load in background)
User
& Event
for membership), UserStore has no access to EventStore to populate thumbnail detailsfriends
is a list of User
objects, then each has its own friends
GET entities (list)
may return a list of objects with IDs for relationship (current implementation as of API 0.2.1GET entities/{id} (detail)
may then include related entities{
"result": { ... },
"relatedEntities": {
"users": [],
"events": []
}
}
WIP on receiving related entities (JSON:API inspired style) in stores in 4eabecbc972a558a0046da952ed0f932162c3edc
The next dilemma will be:
Should "primary" stores reference each other to be able to populate other type entities?
Should there be a store "Above" primary stores (not ApplicationStore) that would spread the goods, allowing for separation of stores
EntityManager - Sort of between both worlds
EventStore
is currently receiving userStore
(from singleton) prop in constructorEntityManager
along with other 2 collection store singletons and an EntityManager instance would be created, passed into each store's constructor?EntityManager
prop with all 3 primary stores, which would then be used to handle data with matching name (event
=> EventStore
etc..)populateRelated
could simply be moved into the mgr and stay clear of the BaseCollectionStore
or individual stores, use the "key" to distinguish destinationEventStore
would of course switch to EntityManager
from using UserStore
directlyAPI 0.3.0 now sends relatedEntities
to populate the store, list renders correctly.
Also de-duped identical list components (FriendsList and RidersList)
Only an empty circle without a name is shown in the Friends list of an user's public profile
see ridetime-server#22
Update lists to return thumbnails for friends. Show list items using thumbnails, and when the list is displayed, run a 'populate' on background for IDs shown