Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project overview
  • Repository
  • Issues 351
  • Merge Requests 58
  • CI / CD
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds FrontendMinds Frontend
  • Merge Requests
  • !710

Open
Opened 3 days ago by Ben Hayward@benhayward.ben
Report abuse

Group membership change propegation

  • Overview 7
  • Commits 3
  • Pipelines 3
  • Changes 6
1/4 threads resolved

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
  1. Log in.
  2. Create a new group.
  3. Check the sidebar has the new group without you having to reload.
  4. Delete the group, it should now be gone.
Leave and Join
  1. Join a group that you are not an admin of.
  2. Leave the group - it should now be gone from the sidebar.
  3. 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.

Request to merge fix/group-membership-propegation-2228 into master
Open in Web IDE
Pipeline #107384196 passed with warnings for ee302228 on fix/group-membership-propegation-2228
              Requires 3 more approvals from Devs, Deployers, and QA.
              Martin Santangelo
              Martin Santangelo
              Olivia Madrid
              Olivia Madrid
              Mark Harding
              Mark Harding
              Brian Hatchet
              Brian Hatchet
              Xander Miller
              Xander Miller
              Ready to be merged automatically. Ask someone with write access to this repository to merge this request

              Closes #2228

              Deletes source branch

              • Ben Hayward @benhayward.ben added Squad::Yellow Status::Requires Changes scoped labels 3 days ago

                added scoped labels

              • Ben Hayward
                Ben Hayward @benhayward.ben started a thread on the diff 3 days ago
                src/app/modules/videochat/videochat.component.ts
                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();
                • Ben Hayward
                  Ben Hayward @benhayward.ben · 3 days ago
                  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.

                • Please register or sign in to reply
              • Ben Hayward
                Ben Hayward @benhayward.ben started a thread on the diff 3 days ago
                Resolved by Brian Hatchet 14 hours ago
              • Ben Hayward @benhayward.ben added 7 commits 15 hours ago

                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

                Compare with previous version

              • Brian Hatchet
                Brian Hatchet :speech_balloon: @brianhatchet started a thread on the diff 14 hours ago
                Last updated by Ben Hayward 10 hours ago
                cypress/integration/groups/groups.spec.js
                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();
                • Brian Hatchet
                  Brian Hatchet :speech_balloon: @brianhatchet · 14 hours ago
                  Developer

                  Why did we change that to a more brittle nth-child selector?

                • Ben Hayward
                  Ben Hayward @benhayward.ben · 10 hours ago
                  Developer

                  I don't see it as more brittle, as the element I was to get is always going to be at that index, clicking the last group in the list (array length - 1) which is the group that the e2e test creates every time.

                  Doing the following:

                  cy.get("m-group--sidebar-markers li:contains('test group')")
                        .first()
                        .click();

                  Grabs the first group in the list named test group. If the test is interrupted you'll find yourself with more than one test group, so actually be deleting the first one every time. That said this solution also is not perfect as if the test is interrupted more than 12 times, the groups bar will be full so you'll only ever get the 12th group in (as we aren't going searching through the "see more".

                  Multiple things we could do to switch this up if you'd like adding randomized group names in so we can identify which one it is. I liked this approach though because then I verify that the bar is one item shorter after the deletion.

                • Ben Hayward
                  Ben Hayward @benhayward.ben · 10 hours ago
                  Developer

                  Actually, I've made a change to unshift to the start of the array, rather than push to the end. I think that makes the most sense to handle the 12 group issue, and it makes more sense for the end-user to see their newly joined group top of the list.

                • Please register or sign in to reply
              • Brian Hatchet
                Brian Hatchet :speech_balloon: @brianhatchet started a thread on the diff 14 hours ago
                cypress/integration/groups/groups.spec.js
                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();
                • Brian Hatchet
                  Brian Hatchet :speech_balloon: @brianhatchet · 14 hours ago
                  Developer

                  Same here, nth-child

                • Please register or sign in to reply
              • Ben Hayward @benhayward.ben added 1 commit 10 hours ago

                added 1 commit

                • ee302228 - Update sidebar-markers.component.ts

                Compare with previous version

              Please register or sign in to reply
              0 Assignees
              None
              None
              Milestone
              None
              Time tracking
              No estimate or time spent
              2
              Labels
              Squad::Yellow Status::Requires Changes
              Lock merge request
              Unlocked
              11
              11 participants
              user avatar
              Martin Santangelo
              user avatar
              Olivia Madrid
              user avatar
              Mark Harding
              user avatar
              Brian Hatchet
              user avatar
              Xander Miller
              user avatar
              Guy Thouret
              user avatar
              Juan Manuel Solaro
              Reference: minds/front!710

              Now you can access the merge request navigation tabs at the top, where they’re easier to find.

              More information and share feedback