Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project overview
  • Repository
  • Issues 400
  • Merge Requests 52
  • 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
  • !613

Open
Opened 1 month ago by Ben Hayward@benhayward.ben
Report abuse

[Sprint/QuietQuail](fix): Blog & media edit updated to new nsfw system #1936

Closes #1936 and #2267

Depends on engine!384

Summary

This changes first part encompasses a fix to the NSFW system, wherein even though the selector shows as blue, it does not respect the values in it without clicking it, so a user may believe they are posting something as NSFW, but in actuality the post would be untagged.

The other change, moves the future blogs to the mature blog system, to the NSFW blog system. When creating a new blog, values must also be respected as in the first part of this upgrade, however, when editing, existing values must be shown.

Testing

Blog

Example testing video - https://streamable.com/ps39o

  1. Post NSFW Post, give it a few random reasons, remember them.
  2. Post a blog - do not touch the selector
  3. Edit blog, check the selector - it should be the same as your last post.
  4. Change the NSFW tags
  5. Edit again and ensure the change stuck
  6. Check the changes are respected on the channel sidebar
  1. Post a non-NSFW blog post
  2. Edit it to be NSFW, enter edit mode again to check it 3. worked
  3. Make a normal post with different tags.
  4. Edit blog and check it ignores those tags, and has the correct ones for the blog.
  1. In one of the NSFW blogs activity posts on the feed, mark it as non-nsfw
  2. Check change propegates by clicking the blog, editing, checking nothing is checked
  3. Ensure the sidebar of the blog does not have the explicit overlay now.
  1. Edit it back to be NSFW in the activity.
  2. Check the change propegated in the same fashion.
  3. Ensure blogs in sidebar are flagged appropriately
Poster

Example testing video - https://streamable.com/3r8d2

  1. Make a non-nsfw post.
  2. Edit to be nsfw.
  3. Edit again to make sure the tags stuck.
  4. Remove NSFW from the activity, check the activity is no longer nsfw.
  5. Make a new NSFW post, remember the nsfw tags you placed on it.
  6. Nav to another page like wallet and back.
  7. Post, it should be NSFW.
  8. Make another post with a different config to change the nsfw selectors defaults.
  9. On the post in step 7, edit and check the nsfw values are correct.
Media

Example testing video - https://streamable.com/qokw4

  1. Post NSFW media (remember which nsfw reasons you selected).
  2. Make another random post with another configuration of NSFW reasons.
  3. Check the activity, edit it, it should show the reasons correctly, and not show the values of your last post.
  4. Edit it to not be NSFW, this should be respected
  5. Edit it back to being NSFW.
  1. Go to the media page for the activity (if you are seeing media modals, just reload the url in the url box).
  2. NSFW values should be respected (check via edit)
  3. Edit away the changes
  4. Check changes apply to the activity on the newsfeed.
  5. Go back onto the media page.
  6. Make it NSFW again.
  7. Check changes propagate.
Admin

Example testing video - https://streamable.com/v8hye

  1. Watch XHRs
  2. Visit channel
  3. Ensure no spam calls are made to moderation endpoints
  1. Ensure an admin can set a post on another user as NSFW
  2. Ensure an NSFW post shows the correct reasons initially, regardless of what the current state of the admins NSFW post box is.

Issues I'm aware of

  • Live update of NSFW in sidebar widgets - I would prefer to leave this out of this, and add that in at a later date. With the amount of testing involved change-detection fixes are not something I want to add into the mix.

  • Image posts are not propagating to sidebar widget; handled here engine#1150 Blogs and Video should be

Edited 1 week ago by Ben Hayward
Request to merge fix/blog-media-nsfw-update-1936 into master
The source branch is 36 commits behind the target branch
Open in Web IDE
Pipeline #97599328 passed with warnings for 31888535 on fix/blog-media-nsfw-update-1936
              Merge request approved. Approved by
              Brian Hatchet
              Brian Hatchet
              Xander Miller
              Xander Miller
              Mark Harding
              Mark Harding
              Rami Albatal
              Rami Albatal
              Juan Manuel Solaro
              Juan Manuel Solaro
              Olivia Madrid
              Olivia Madrid
              Emiliano Balbuena
              Emiliano Balbuena
              Ready to be merged automatically. Ask someone with write access to this repository to merge this request

              Closes #1936 and #2267

              Mentions engine#1150

              Deletes source branch

              • Discussion 8
              • Commits 11
              • Pipelines 6
              • Changes 11
              0/7 threads resolved
              • Ben Hayward @benhayward.ben added MR::Awaiting Review Squad::Yellow scoped labels 1 month ago

                added scoped labels

              • Ben Hayward @benhayward.ben changed the description 1 month ago

                changed the description

              • Ben Hayward @benhayward.ben marked as a Work In Progress 1 month ago

                marked as a Work In Progress

              • Ben Hayward @benhayward.ben added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 1 month ago

                added scoped label and automatically removed label

              • Ben Hayward @benhayward.ben mentioned in merge request engine!384 1 month ago

                mentioned in merge request engine!384

              • Ben Hayward @benhayward.ben changed the description 1 month ago

                changed the description

              • Ben Hayward @benhayward.ben added 2 commits 1 month ago

                added 2 commits

                • b3bf6a83 - Updated test
                • be7434a2 - Updated E2E tests to use newer nsfw selector

                Compare with previous version

              • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 3 weeks ago

                added scoped label and automatically removed label

              • Ben Hayward @benhayward.ben unmarked as a Work In Progress 3 weeks ago

                unmarked as a Work In Progress

              • Ben Hayward @benhayward.ben added 90 commits 2 weeks ago

                added 90 commits

                • be7434a2...a0d1737e - 87 commits from branch master
                • 7cb030ad - Merge branch 'master' of gitlab.com:minds/front into fix/blog-media-nsfw-update-1936
                • aaf95d86 - Merge branch 'master' of gitlab.com:minds/front into fix/blog-media-nsfw-update-1936
                • 76664e6c - Merge branch 'master' of gitlab.com:minds/front into fix/blog-media-nsfw-update-1936

                Compare with previous version

                Toggle commit list
              • Ben Hayward @benhayward.ben added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 1 week ago

                added scoped label and automatically removed label

              • Ben Hayward @benhayward.ben marked as a Work In Progress 1 week ago

                marked as a Work In Progress

              • Ben Hayward @benhayward.ben changed the description 1 week ago

                changed the description

              • Ben Hayward @benhayward.ben changed the description 1 week ago

                changed the description

              • Ben Hayward @benhayward.ben added 2 commits 1 week ago

                added 2 commits

                • f91890c3 - Blogs working correctly
                • 36f95435 - spec test fix

                Compare with previous version

              • Ben Hayward @benhayward.ben changed the description 1 week ago

                changed the description

              • Ben Hayward
                Ben Hayward @benhayward.ben · 1 week ago
                Developer

                This definitely needs testing with live data, so we can see how old blogs marked as mature will react to the changes.

              • Ben Hayward @benhayward.ben added 1 commit 1 week ago

                added 1 commit

                • 31888535 - Removed console logs

                Compare with previous version

              • Ben Hayward @benhayward.ben changed the description 1 week ago

                changed the description

              • Ben Hayward @benhayward.ben added MR::Awaiting Review scoped label and automatically removed MR::Requires Changes label 1 week ago

                added scoped label and automatically removed label

              • Ben Hayward @benhayward.ben unmarked as a Work In Progress 1 week ago

                unmarked as a Work In Progress

              • Xander Miller @xander-miller approved this merge request 1 week ago

                approved this merge request

              • Brian Hatchet :speech_balloon: @brianhatchet approved this merge request 1 week ago

                approved this merge request

              • Brian Hatchet :speech_balloon: @brianhatchet added version::3.12.0 scoped label 4 hours ago

                added scoped label

              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/common/components/nsfw-selector/nsfw-selector.component.ts
                23 23 @Input('consumer') consumer: false;
                24 24 @Input('expanded') expanded: false;
                25 25 @Output('selectedChange') onSelected: EventEmitter<any> = new EventEmitter();
                26 @Output('onInit') onInit: EventEmitter<any> = new EventEmitter();
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  angulars (output) brackets assume the work on as they are events. So this is translating as onOnInit but it should just be (init). However, I am not even sure why we have this init event emitter, all the uses of it that I see do the exact same thing as selectedChange.

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/common/components/nsfw-selector/nsfw-selector.component.ts
                51 53 }
                52 54
                53 55 @Input('selected') set selected(selected: Array<number>) {
                56 if (!selected) {
                57 return;
                58 }
                59 this.service.override = true;
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  what is this overriding?

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/common/components/nsfw-selector/nsfw-selector.component.ts
                51 53 }
                52 54
                53 55 @Input('selected') set selected(selected: Array<number>) {
                56 if (!selected) {
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  Are you anticipating that null would be sent? The typings assume an array.

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/common/components/nsfw-selector/nsfw-selector.service.ts
                2 2
                3 3 export class NSFWSelectorService {
                4 4 cacheKey: string = '';
                5 override: boolean = false;
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  overriding what?

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/common/components/nsfw-selector/nsfw-selector.service.ts
                17 18 onInit() {}
                18 19
                19 20 build(): NSFWSelectorService {
                20 let reasons = this.storage.get(`nsfw:${this.cacheKey}`) || [];
                21 for (let reason of this.reasons) {
                22 reason.selected = reasons.indexOf(reason.value) > -1;
                21 if (!this.override) {
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  perhaps build should never have been called? This function doesn't do anything if override is set.

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/modules/blogs/edit/edit.html
                162 <i
                163 class="material-icons"
                164 [ngClass]="{ 'mdl-color-text--red-500': blog.mature }"
                165 title="Mature content"
                166 i18n-title="@@M__COMMON__MATURE_CONTENT"
                167 >explicit</i
                168 >
                169 <span [ngClass]="{ 'mdl-color-text--red-500': blog.mature }"
                170 >{{ blog.mature ? 'Mature content' : 'Anyone' }}</span
                171 >
                172 </a>
                173 </div>
                157
                158 <m-nsfw-selector
                159 (selectedChange)="onNSFWSelections($event)"
                160 (onInit)="onNSFWSelections($event)"
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  same function called. Why do we have two emitters?

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 2 hours ago
                src/app/modules/media/edit/edit.component.html
                86
                87 <span [ngClass]="{ 'mdl-color-text--red-500': entity.mature }">
                88 <ng-container *ngIf="entity.mature" i18n="@@M__COMMON__MATURE_CONTENT"
                89 >Mature Content</ng-container
                90 >
                91 <ng-container
                92 *ngIf="!entity.mature"
                93 i18n="@@MINDS__MEDIA__ANYONE_LABEL"
                94 >Anyone</ng-container
                95 >
                96 </span>
                97 </a>
                98 </div>
                74 <m-nsfw-selector
                75 (selectedChange)="onNSFWSelections($event)"
                76 (onInit)="onNSFWSelections($event)"
                • Mark Harding
                  Mark Harding @markeharding · 2 hours ago
                  Owner

                  calling the same function so why two?

                • Please register or sign in to reply
              • Mark Harding @markeharding added MR::Requires Changes scoped label and automatically removed MR::Awaiting Review label 2 hours ago

                added scoped label and automatically removed label

              Please register or sign in to reply
              0 Assignees
              None
              None
              Milestone
              None
              Time tracking
              No estimate or time spent
              3
              Labels
              MR::Requires Changes Squad::Yellow version::3.12.0
              Lock merge request
              Unlocked
              11
              11 participants
              user avatar
              Mark Harding
              user avatar
              Rami Albatal
              user avatar
              Juan Manuel Solaro
              user avatar
              Olivia Madrid
              user avatar
              Emiliano Balbuena
              user avatar
              Guy Thouret
              user avatar
              Marcelo Rivera
              Reference: minds/front!613