Commit graph

16 commits

Author SHA1 Message Date
sudokoko
30133f592c
Hotfix notification recipient IDs and fix errant photo removal notifications (#942) 2023-10-30 16:16:00 -04:00
sudokoko
aa3caea363
Add missing moderation notification calls (#937)
* Add missing moderation notifications

* Shorten temporary variable "commentEntity" to "c" for consistency

Didn't catch this when rider inserted these include statements

* Fix incorrect access of TargetUser

* Remove excess indent and random semicolon
2023-10-29 19:49:48 -04:00
sudokoko
aea66b4a74
Implement in-game and website notifications (#932)
* Implement notifications logic, basic calls, and admin command

* Remove unnecessary code

* Add ability to stack notifications and return manually created XML

* Remove test that is no longer needed and is causing failures

* Apply suggestions from code review

* Merge notifications with existing announcements page

* Order notifications by descending ID instead of ascending ID

* Move notification send task to moderation options under user

Also restyles the buttons to line up next to each other like in the slot pages.

* Style/position fixes with granted slots/notification partials

* Fix incorrect form POST route

* Prevent notification text area from breaking out of container

* Actually use builder result for notification text

* Minor restructuring of the notifications page

* Add notifications for team picks, publish issues, and moderation

* Mark notifications as dismissed instead of deleting them

* Add XMLdoc to SendNotification method

* Fix incorrect URL in announcements webhook

* Remove unnecessary inline style from granted slots partial

* Apply suggestions from code review

* Apply first batch of suggestions from code review

* Apply second batch of suggestions from code review

* Change notification icon depending on if user has unread notifications

* Show unread notification icon if there is an announcement posted

* Remove "potential" wording from definitive fixes in error docs

* Remove "Error code:" from publish notifications

* Send notification if user tries to unlock a mod-locked level

* Change notification timestamp format to include date

* Add clarification to level mod-lock notification message

* Change team pick notifications to moderation notifications

Apparently the MMPick type doesn't show a visual notification.

* Apply suggestions from code review

* Add obsolete to notification types that display nothing in-game

* Remove unused imports and remove icon switch case in favor of bell icon

* Last minute fixes

* Send notification upon earth wipe and clarify moderation case notifications

* Add check for empty/too long notification text
2023-10-29 20:27:41 +00:00
koko
3a2cdc9afe
Improve moderation case page and case partial (#900)
* Add pagination to moderation cases list and tweak case dismissal task

* Clean up case partial and add extended case status indicators

* Redirect back to cases list after dismissing a case

* Fix typo on cases list queue counter

* Fix dismissal queue counter

* Convert dismiss button check into pattern

* Turn down case dismissal task repeat interval to every 1 hour

* Use page 0 for case searching

* Implement pagination on the admin users list <3

* Fix pagination button padding and update colors to match existing role colors

* Fix typo in admin search placeholder

* Make cases searchable by user/slot ID instead of reason

Due to the current state of the moderation case entity, I can't directly query against the affected user name, so I've added the ability to search for the affected user/slot ID instead of reason.

* Actually apply the desired changes instead of just fixing the counts

* Grammatical nitpick in the search box placeholder
2023-09-22 18:53:53 +00:00
Josh
a316c866c5
Add proper relationships to Comments (#838)
* Add specific foreign keys for comment targets

* Remove inheritdoc tags from migration

* Fix punctuation of deleted comment message and add mod deletion message

* Fix broken merge

* Cleanup comment queries
2023-08-24 18:58:03 +00:00
Slendy
5c66b0f713
Improve input validation for story level moderation 2023-06-26 23:41:30 -05:00
Josh
14ebad07f3
Allow moderators to moderate story levels (#809)
* Allow moderators to view story levels on website
Show comments to moderators on in-game story levels that show the levels id

* Only show LH ID comment on the first page
2023-06-26 23:52:15 +00:00
koko
6f55ce3226
Add basic ability to flag duplicate levels (#753)
* Add the basics for duplicate level flagging

* Use this.BadRequest instead of StatusCode(500)

* Remove redundant slot creator check

* Include creator entity

* Redirect back to slot page for unauthenticated reqs

* Check if reporter = level creator on server side

* A few formatting nitpicks with the webhook

* Move external url config to a shorter var

* Change duplicate flag button icon to a flag

* Remove accidental dollar sign

Co-authored-by: Josh <josh@slendy.pw>

* Remove another accidental dollar sign

Co-authored-by: Josh <josh@slendy.pw>

* Three dollar signs... I'm blind

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse.Servers.Website/Controllers/Moderator/ModerationSlotController.cs

Co-authored-by: Josh <josh@slendy.pw>

---------

Co-authored-by: Josh <josh@slendy.pw>
2023-04-27 02:48:19 +00:00
Slendy
c34b7f3e79
Revert website Forbid and Unauthorized method usage to StatusCode
This is because by default ASP.NET expects an authentication scheme to be registered when using these methods.
2023-03-30 19:23:11 -05:00
Slendy
a603cdb002
Use Unauthorized instead of Forbid on Website & Api 2023-03-29 21:44:16 -05:00
Josh
329ab66043
Refactor serialization system (#702)
* Initial work for serialization refactor

* Experiment with new naming conventions

* Mostly implement user and slot serialization.
Still needs to be fine tuned to match original implementation
Many things are left in a broken state like website features/api endpoints/lbp3 categories

* Fix release building

* Migrate scores, reviews, and more to new serialization system.
Many things are still broken but progress is steadily being made

* Fix Api responses and migrate serialization for most types

* Make serialization better and fix bugs
Fix recursive PrepareSerialization when recursive item is set during root item's PrepareSerialization, items, should be properly indexed in order but it's only tested to 1 level of recursion

* Fix review serialization

* Fix user serialization producing malformed SQL query

* Remove DefaultIfEmpty query

* MariaDB doesn't like double nested queries

* Fix LBP1 tag counter

* Implement lbp3 categories and add better deserialization handling

* Implement expression tree caching to speed up reflection and write new serializer tests

* Remove Game column from UserEntity and rename DatabaseContextModelSnapshot.cs back to DatabaseModelSnapshot.cs

* Make UserEntity username not required

* Fix recursive serialization of lists and add relevant unit tests

* Actually commit the migration

* Fix LocationTests to use new deserialization class

* Fix comments not serializing the right author username

* Replace all occurrences of StatusCode with their respective ASP.NET named result
instead of StatusCode(403) everything is now in the form of Forbid()

* Fix SlotBase.ConvertToEntity and LocationTests

* Fix compilation error

* Give Location a default value in GameUserSlot and GameUser

* Reimplement stubbed website functions

* Convert grief reports to new serialization system

* Update DatabaseModelSnapshot and bump dotnet tool version

* Remove unused directives

* Fix broken type reference

* Fix rated comments on website

* Don't include banned users in website comments

* Optimize score submission

* Fix slot id calculating in in-game comment posting

* Move serialization interfaces to types folder and add more documentation

* Allow uploading of versus scores
2023-03-28 00:39:54 +00:00
Josh
64b95e807d
Refactor Database class (#616)
Refactor Database into DatabaseContext
Moved into separate folder so it actually has a namespace instead sitting in the root
2023-02-15 23:54:30 -06:00
Josh
f1c5ad4002
Major refactor and reorganization of types (#652)
* Start of reorganization and cleanup

* Remove duplicate title id

* Refactor types

* Fix Release building

* Move classes in /Types to a Types namespace

* Fix compilation error (RoomVisualizerPage strikes again)

* Fix bugs created from auto merge

* Fix auto-merge compilation error

* Changes from review/fix failed merge
2023-02-13 22:02:58 -06:00
Josh
4559d26a54
Fix bug where users can't be deleted (#648)
* Add username to mod cases if user is deleted

* Add timezone package to docker container

* Remove extra space in migration sql statement

* Changes from self-review
2023-01-29 22:10:36 -06:00
Slendy
1b69f6a0e0
Fixup website content deletion permissions 2022-12-19 17:32:37 -06:00
Josh
f4cad21061
Website UI redesign and QOL changes (#601)
* Initial support for leaderboards and some refactoring

* Start of UI redesign

* Finish slot and user redesign, added deletion of comments, reviews, scores, and photos

* Remove leftover debug print

* Fix bug in permission check

* Simplify sidebar code and add hearted and queued levels

* Fix navbar scrolling on mobile and refactor SlotCardPartial
2022-12-19 15:20:49 -08:00