Group membership change propegation
Summary
Closes #2228
This MR makes it so that when joining, leaving, creating and destroying a group, the sidebar updates without the user having to refresh.
Steps to test
Create and Delete
- Log in.
- Create a new group.
- Check the sidebar has the new group without you having to reload.
- Delete the group, it should now be gone.
Leave and Join
- Join a group that you are not an admin of.
- Leave the group - it should now be gone from the sidebar.
- Rejoin, it should be back.
Estimated Regression Scope
GroupsService, The group sidebar have been the main focus of this change, most of the logical changes are in there.
I've also touched two other areas due to errors flooding my console when testing:
Avatar component, the only change is an extra condition in an if statement, so I don't see much of an issue with that but note it has been touched.
Other than that some changeDetection was added to the videochat component.
added scoped labels
39 39 this.isActive = false; 40 40 } 41 41 this.cd.markForCheck(); 42 this.cd.detectChanges(); 42 if (!this.cd['destroyed']) { 43 this.cd.detectChanges(); 44 } 43 45 } 44 46 ); 45 47 } 46 48 47 49 ngOnDestroy() { 50 this.cd.detach(); 48 51 this.service.deactivate(); - Developer
Not related to this change per se, but trying to use a destroyed change detector was flooding the console; this is likely somewhere in sentry but I could not find the issue.
- Resolved by Brian Hatchet
added 7 commits
-
f0812700...52608901 - 6 commits from branch
master
- 20ca45a7 - Merge branch 'master' of gitlab.com:minds/front into fix/group-membership-propegation-2228
-
f0812700...52608901 - 6 commits from branch
73 78 }) 74 79 75 80 it('should be able to toggle conversation and comment on it', () => { 76 77 cy.get("m-group--sidebar-markers li:contains('test group')") 78 .first() 79 .click(); 80 81 cy.get('.m-groupSidebarMarkers__list').children().its('length').then((size) => { 82 cy.get(`m-group--sidebar-markers li:nth-child(${size - 1})`).click(); - Developer
Why did we change that to a more brittle nth-child selector?
98 101 }) 99 102 100 103 it('should post an activity inside the group and record the view when scrolling', () => { 101 cy.get("m-group--sidebar-markers li:contains('test group')") 102 .first() 103 .click(); 104 cy.get('.m-groupSidebarMarkers__list').children().its('length').then((size) => { 105 cy.get(`m-group--sidebar-markers li:nth-child(${size - 1})`).click(); - Developer
Same here, nth-child