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

[stable14] Fix rendering of the participant list #1222

Merged
merged 6 commits into from
Sep 28, 2018

Conversation

danxuliu
Copy link
Member

Backport of #1208

Backbone requires a unique identifier for each model in a collection to
be able to properly sort the models, merge their state when updating
them... In the case of participants the id is their "userId" or their
"sessionId", depending on whether the participant is a user or a guest.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The participant list view was rendered on every collection event to
overcome the problem of participant views not being rendered, but that
caused unneeded renderings, for example when the collection was synced
but it had not changed. Now that the id of models in the participant
collection is properly set the view for each participant is rendered
again as expected when the attributes in its model change, so it is no
longer needed to render the participant list on every collection event.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Some of the attribute names, as well as the "checkSharingStatus" call,
look like leftovers from a copy-paste; now the proper names are used.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When the collection is sorted after an update (for example, if a user is
promoted to a moderator) there is no need to render again each subview
of the participant list; Marionette provides "reorderOnSort" for those
cases, which simply reorders the already existing DOM nodes instead of
rendering the whole list again.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The endpoints for moderation operations do not fit the default setup for
Backbone models, so the operations are performed directly with AJAX
requests on the view. Thus, after a successful request rendering again
the view has no visible effect, as the model it is based on has not
changed yet. Now the model is updated instead, which will trigger the
render with the new state; that state will be later refreshed with the
server state (although it should be the same) when the model is synced
again.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When a participant is offline the ".participant-offline" CSS class is
added to the element of its view. However, when the view is rendered
again the element itself is reused and only its contents are replaced by
the template. Thus, the CSS class must be explicitly removed from the
element when the view is rendered if the user is now online.

As the CSS class is expected (by the CSS rules) to be set on the
participant element instead of on the link inside it the CSS class was
removed from the template. This makes no difference, though, as
"isOffline" was always undefined and thus the class was never set on the
link.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@Ivansss Ivansss merged commit aa42c38 into stable14 Sep 28, 2018
@Ivansss Ivansss deleted the stable14-1208-fix-rendering-of-the-participant-list branch September 28, 2018 07:34
nickvergessen added a commit that referenced this pull request Nov 15, 2018
**Added**
- Add an option to test the TURN configuration in the admin settings
  [#1294](#1294)

**Changed**
- Improve the notifications when a share password is requested
  [#1296](#1296)
- Do not show an error when a file is shared a second time into a conversation
  [#1295](#1295)

**Fixed**
- Custom Signaling, STUN and TURN configurations are not loaded for the user requesting the password for a share
  [#1297](#1297)
- Fix position of the contacts menu when clicking on the avatar of a chat author
  [#1293](#1293)
- Avatars in messages/mentions by guests show the guest avatar instead of the user
  [#1292](#1292)
- Information about user state in a call is bugged
  [#1291](#1291)
- Wrong conversation name of password requests in the details sidebar
  [#1290](#1290)
- Fix rendering, reloading and interaction with the participant list
  [#1222](#1222)
  [#1289](#1289)

Signed-off-by: Joas Schilling <[email protected]>
nickvergessen added a commit that referenced this pull request Dec 6, 2018
**Added**
- Add an option to test the TURN configuration in the admin settings
  [#1294](#1294)

**Changed**
- Improve the notifications when a share password is requested
  [#1296](#1296)
- Do not show an error when a file is shared a second time into a conversation
  [#1295](#1295)

**Fixed**
- Custom Signaling, STUN and TURN configurations are not loaded for the user requesting the password for a share
  [#1297](#1297)
- Fix position of the contacts menu when clicking on the avatar of a chat author
  [#1293](#1293)
- Avatars in messages/mentions by guests show the guest avatar instead of the user
  [#1292](#1292)
- Information about user state in a call is bugged
  [#1291](#1291)
- Wrong conversation name of password requests in the details sidebar
  [#1290](#1290)
- Fix rendering, reloading and interaction with the participant list
  [#1222](#1222)
  [#1289](#1289)

Signed-off-by: Joas Schilling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants