Commit graph

33 commits

Author SHA1 Message Date
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
Josh
58664a2c7e
Add checks for resource strings (#930)
* Add checks for resource strings

* Don't use resource regex against png files
2023-10-24 22:14:52 +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
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
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
ace3678da7
Add some resource tests and other small changes (#638)
* Cleanup custom icon resources and add resource tests

* Don't delete old custom icons
2023-01-20 00:18:57 -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
Slendy
c6ddeaf154
Allow moderators to dismiss reports 2022-11-17 16:14:03 -06:00
Josh
b3a00da554
Refactor deserialization and authentication (#550)
* Refactor deserialization and more

* Refactor authentication flow

* Fix unit tests

* Make deserialization better
2022-11-10 21:14:16 -06:00
A My Sour
84e2914e40
Add webhook message when a new Team Pick is added (#528)
* Add webhook message when a new Team Pick is added

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

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

* Update ModerationSlotController.cs

* Include ServerConfiguration class

Co-authored-by: Alex_Sour <52638772+Alex-Sour@users.noreply.github.com>
Co-authored-by: Josh <josh@slendy.pw>
2022-11-05 15:35:10 -05:00
Josh
f6a7fe6283
User settings, level settings, language and timezone selection and more. (#471)
* Initial work for user settings page

* Finish user setting and slot setting pages

* Don't show slot upload date on home page and fix team pick redirection

* Fix upload image button alignment on mobile

* Fix image upload on iPhone

* Remove unused css and add selected button color

* Fix login email check and bump ChromeDriver to 105

* Remove duplicated code and allow users to leave fields empty

* Add unpublish button on level settings and move settings button position

* Don't show edit button on mini card

* Self review bug fixes and users can no longer use an in-use email
2022-09-17 14:02:46 -05:00
jvyden
ef6acbb210
Add ability to hide levels 2022-08-05 21:44:17 -04:00
jvyden
842e161d7e
Add ability to ban users with a case 2022-08-05 21:12:10 -04:00
jvyden
4718970f6b
Add ability for cases to perform actions 2022-08-05 20:32:35 -04:00
jvyden
96e8c7f71e
Add support for dismissing cases 2022-08-05 19:07:43 -04:00
jvyden
b3d91fd470
Reduce CaseTypes to those that can be temporary 2022-08-05 17:18:43 -04:00
jvyden
b6da930e20
Merge main into mod-panel 2022-08-05 17:02:19 -04:00
Josh
add83a32a8
Prevent grief report deletion from removing slot rootLevel (#395) 2022-08-02 09:10:53 -04:00
jvyden
523c86f98f
Fix SetUserPermissionLevel route 2022-07-27 18:56:48 -04:00
jvyden
8ecca5d358
Add case for planet deletion 2022-07-27 18:52:47 -04:00
jvyden
7ba50e26f5
Add mod notes to ban cases, improve case display 2022-07-27 17:54:32 -04:00
jvyden
cdcc03fdc1
Add case generator for bans, allow mods to ban 2022-07-27 17:34:59 -04:00
jvyden
1eede416d4
Add case generation 2022-07-27 17:19:49 -04:00
jvyden
a6f077725a
Rename /modPanel to /moderation 2022-06-17 19:50:32 -04:00
jvyden
6c6a7f01f9
Add moderation cases log page 2022-06-10 21:21:27 -04:00
jvyden
693f0a3855
Add basic mod panel 2022-06-10 18:38:11 -04:00
jvyden
1037a6eddb
Add ability to change user's permissions from admin panel user list 2022-06-10 17:02:02 -04:00
jvyden
8301418085
Use permission level model for permissions
This is better. Because having 20 fucking columns for permissions is STUPID.
2022-05-22 15:51:02 -04:00
jvyden
33f344f200
Add admin button to wipe a user's earth decorations 2022-05-20 22:01:54 -04:00
jvyden
c345eeebb9
Massive organization of classes and namespaces 2022-05-15 16:45:00 -04:00
jvyden
b2ec7eae57
Move servers to LBPU.PL.Servers 2022-05-14 23:37:55 -04:00