Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guild configuration to web dashboard #35

Merged
merged 19 commits into from
Apr 20, 2024
Merged

Commits on Apr 16, 2024

  1. Refactor caching and Discord OAuth setup

    Removed Discord startup service and added caching directly to actions that require it. Reworked OAuth setup to handle creating claims and made several changes to move responsibility away from DiscordRestClient startup service. This includes adding token saving directly to the OAuth creating ticket event, removing old OAuth event for fetching user info and creating claims, and updating controller bases to initialize DiscordRestClient using the token from the cache. Also, 'RedisCachingService' is now renamed to 'DistributedCachingService', and created 'GuildsController' to handle guild related operations.
    EpicOfficer committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    8fd73e3 View commit details
    Browse the repository at this point in the history
  2. Add caching for user guilds and update JSON serialization

    Implemented caching for Discord user guilds in both GuildsController and ApiControllerBase. This will improve performance. Also, switched the JSON serializer from System.Text.Json to Newtonsoft.Json to handle nullable values more appropriately and ensure compatibility. Additionally, a new model "DiscordPartialGuild" was created to simplify guild information.
    EpicOfficer committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    a133c67 View commit details
    Browse the repository at this point in the history
  3. Refactor caching mechanism in GenericRepository

    Simplified the caching mechanism in the GenericRepositoryWithCaching class. Converted multiple lines of code into a single, concise line using the GetOrAddAsync method. This change reduces redundancy and improves code readability.
    EpicOfficer committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    88de899 View commit details
    Browse the repository at this point in the history
  4. Update DiscordPartialGuild model and controllers

    Made `IconUrl` nullable in `DiscordPartialGuild` model. Removed the unnecessary `Discord.Rest` namespace usage in `GuildsController`. Additionally, implemented a new method in `ApiControllerBase` named `CheckGuildAccessAsync` to verify user's access to a specified guild.
    EpicOfficer committed Apr 16, 2024
    Configuration menu
    Copy the full SHA
    ebe79be View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. Integrate DiscordSocketClient into controllers

    The controllers TodoController, GuildsController, and ApiControllerBase have been adjusted to include DiscordSocketClient as part of their constructor parameters. The Blink3 project file has also been updated to include additional package references for the integration of Discord functionality. More specifically, new logic was added in the 'InitDiscordClientAsync' method of the ApiControllerBase to wait for the DiscordBotClient to be ready before proceeding.
    EpicOfficer committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    5cb27e5 View commit details
    Browse the repository at this point in the history
  2. Add BlinkGuildsController and update BlinkGuildRepository

    This update introduces the new BlinkGuildsController for handling CRUD operations on BlinkGuild items. A FindByIdsAsync method has also been added to BlinkGuildRepository to allow retrieval of a collection of BlinkGuild entities based on specified IDs. The CheckGuildAccessAsync function has been corrected in ApiControllerBase to return a ProblemForUnauthorizedAccess if any guild Ids match, rather than all. Additionally, a ULongToStringConverter has been introduced to handle ulong to string conversion for JSON serialization.
    EpicOfficer committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    86fb971 View commit details
    Browse the repository at this point in the history
  3. Implement BlinkGuild repository and update layout

    Added new HTTP repository, BlinkGuildHttpRepository, for accessing BlinkGuild entities and registered it in the application's services. Also, introduced changes in MainLayout including retrieval of DiscordPartialGuild and other guild related features. Some visual components were also modified, such as changing the theme to dark mode. Furthermore, redundant or unnecessary CSS and mock data were removed to improve the codebase.
    EpicOfficer committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    478deb9 View commit details
    Browse the repository at this point in the history
  4. Add new settings pages and update layout design

    Three new pages for 'Temporary VC', 'Wordle', and 'Staff' settings have been added. Each page accepts a 'GuildId' parameter and displays it in the view. The design for the main layout has also been updated, with a border added to the bottom of the top row.
    EpicOfficer committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    a6b1ae6 View commit details
    Browse the repository at this point in the history
  5. Update CSS properties and remove border from headings

    The CSS property for sidebar2 content border color is now linked to the Bootstrap border color variable. In the TempVC, Wordle, and Staff Razor pages, the border-bottom class has been removed from the h1 elements, hence these headings will no longer display a bottom border.
    EpicOfficer committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    c99d82b View commit details
    Browse the repository at this point in the history
  6. Add new guild-related endpoints in GuildsController

    This update adds multiple endpoints to GuildsController, including functionality to return all guilds, all categories for a guild, and all channels for a guild. To support this, a new DiscordPartialChannel model is also added to represent Discord channels in a simplified form.
    EpicOfficer committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    4ba0ba9 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2024

  1. Add Wordle settings page with color customization options

    This commit implements a Wordle settings page in the application that allows users to customize color attributes for different parts. A form has been added that lets the users specify their preferred background, text, correct, misplaced, or incorrect colors. These user preferences are now fetched from the API and saved upon submission. This required updates to the BlinkGuild entity and corresponding conversions, adjustments to NewtonsoftJson usage, and the addition of JsonPatch functionality.
    EpicOfficer committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    cef3bd4 View commit details
    Browse the repository at this point in the history
  2. Update Wordle and TempVC pages

    Refactored Wordle.razor and TempVC.razor pages in the Blink3.Web project. Changes include using Blink3.Core.Helpers, updating references to _notificationMessage, and employing ULongToStringConverter for proper JSON serialization. TempVC.razor is significantly expanded to handle guild settings.
    EpicOfficer committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    ca2bf6d View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Refactor TempVC and Wordle pages with service interfaces

    Introduced service interfaces for BlinkGuild configuration and Discord guild interaction. Existing usage of HttpClient in TempVC.razor and Wordle.razor pages have been migrated to these new service interfaces. This leads to cleaner, more maintainable code that adheres more closely to the Dependency Inversion Principle.
    EpicOfficer committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    604e1fa View commit details
    Browse the repository at this point in the history
  2. Update Staff.razor and fix method names in DiscordGuildService

    The Staff.razor page now supports viewing, selecting, and editing of staff settings. This includes loading channel options, displaying an informative message, and saving changes made to the settings. Meanwhile, corrected method names in the DiscordGuildService, making them appropriately relay their function.
    EpicOfficer committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    d0b98ac View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2024

  1. Add reset functionality and brand image CSS rules

    The commit introduces a reset functionality to the 'Wordle' page in the Blink3 Web application. The reset button allows users to return settings to their default state. Additionally, CSS rules for the brand image's height and width in the application's sidebar have been added.
    EpicOfficer committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    bde5713 View commit details
    Browse the repository at this point in the history
  2. Update favicon and add web app manifest

    The favicon link was replaced and additional web app icons were added to the root index.html file. A new web app manifest and browser config files were also added, which provide more meta information and icon options for different devices and OS scenarios. The theme color was also specified.
    EpicOfficer committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    882c37a View commit details
    Browse the repository at this point in the history
  3. Improve user feedback and add preload service in pages

    The commit includes a series of enhancements across multiple web pages. Changes include replacing text-based notification messages with ToastService notifications to provide better visibility of system responses. Additionally, PreloadService has been integrated into the data-fetching processes of all referred pages, enhancing the UX with loading indicators.
    EpicOfficer committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    62cbeca View commit details
    Browse the repository at this point in the history
  4. Update confirmation dialog messages in TodoList and Wordle

    Updated the confirmation dialog messages in TodoList.razor and Wordle.razor to make them more explicit about the permanence of the action. Additionally, added a new confirmation dialog for the reset action in Wordle.razor to warn the user about the irreversible effects of their actions.
    EpicOfficer committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    73c8431 View commit details
    Browse the repository at this point in the history
  5. Add NullableULongToStringConverter and adjust event handlers

    A new JsonConverter, NullableULongToStringConverter, has been added to handle nullable ulong values. This converter is appended to serializers' settings in Program.cs and BlinkGuildConfigService.cs where required. Additionally, certain event handlers within various .razor pages have been altered or removed for better logic flow, notably in Staff.razor, Wordle.razor, and TempVC.razor, and the listener for AuthenticationStateChanged has been added to MainLayout.razor.
    EpicOfficer committed Apr 20, 2024
    Configuration menu
    Copy the full SHA
    51f704c View commit details
    Browse the repository at this point in the history