-
Notifications
You must be signed in to change notification settings - Fork 64
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
Migrate frontend to Blazor #992
Conversation
ffc11a4
to
98b766a
Compare
Modix.Web/Pages/Tags.razor
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% sure what's happening, but something seems broken with the markdown preview. When I type a codeblock into the tag content, the page seems to freeze (preview stops updating, buttons stop working), and I need to refresh the page. Not sure if this is something we're able to do anything about on our end or if it's a bug with MudMarkdown component that we just have to live with for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it was kinda wonky during development as well, it works when copy pasting something into it
There are probably better packages out there but I haven't looked into it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't spend an awful amount of time on the styling, I just remember this was the only quick way I could get it to look good on all resolutions (they buttons kinda overlap on some screensizes otherwise)
Obviously there's room for improvement but I'm honestly not sure where to begin here, CSS really isn't my forte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I have fixed this now, can you check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought I had covered all the cases where this component is used when I fixed the nullability warnings
I guess not.
prop = null!;
it is :)
Wrote a comment explaining why the workaround exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
00e2051
to
ef3f0e1
Compare
Add Authorization policies based on AuthorizationClaim enum Add crude implementation of DiscordUserService
ClaimsTransformation uses a different service scope from the blazor circuit - which leads to AuthorizationService properties not being set properly for the authenticated user Also remove redundant authorization setup in startup
…move the usage of it on the UserLookup page
… to avoid overlapping between elements
…tly in the _Host file
…f the version references in projects
Head branch was pushed to by a user without write access
* Initial blazor implementation * Remove template files * Add developmentSettings to gitignore and allow wwwroot in blazor project * Add MudBlazor to _Host.cshtml * Initial landing page implementation * Migrate Modix startup to Modix.Web Add Authorization policies based on AuthorizationClaim enum Add crude implementation of DiscordUserService * Implement navbar with separate views depending on authorization state * Initial implementation of UserLookup page * Initial implementation of Commands page * Initial implementation of Stats page * Initial implementation of Tags page * Initial implementation of Promotions page * Run AuthorizationService.OnAuthenticatedAsync in MainLayout instead ClaimsTransformation uses a different service scope from the blazor circuit - which leads to AuthorizationService properties not being set properly for the authenticated user Also remove redundant authorization setup in startup * Initial implementation of Logs/Infractions page * Use dropdown for 'Type' in infractions grid * Remove unnecessary comments * Move navbar from MainLayout to separate component * Change page titles * Get SocketGuild from SocketGuildUser instead * Use OnAfterRenderAsync instead to avoid duplicate DB calls * Implement guild selection Remove ClaimsTransformationService Overall improvements to navbar Move logic for adding claims to App.razor Read selected guild from cookie and pass it down the chain * Remove <AuthorizeView> etc in favor of Authorize attribute * Use OnAfterRenderAsync to avoid unnecessary execution of db calls etc * Use [Authorize] attribute to avoid rendering of the page whatsoever * Fix icon colors of navbar in the logged out state * Use middleware to assign claims rather than have it in App.razor The call to AuthorizationService.OnAuthenticatedAsync is still needed in App.razor to be able to set the values in the correct scope. * Move logout button to dropdown menu Small tidy up * Rename LocalStorageService -> CookieService * Show current user when first visiting UserLookup Slight improvements with nullability Remove commented code * Move models to Models folder * Propagate CurrentUserId down to components via SessionState to avoid reading from user claims constantly * Fix issue with filters not resetting properly * Initially select nothing in the dropdown for InfractionType (nothing was actually initially selected, it just appeared to be) * Force cookie to be created on root path * Continue with first found guild if no guild cookie was found * Case-insensitive filtering on Tags page * Improve feedback when Tag creation fails (or succeeds) * Allow null/empty comments for promotions Use MudSpacer instead of manual flex-grow * Disable editing comments for closed campaigns Update UI after editing comment Better feedback after editing comment * Initial implementation of Configuration (Claims) * Small touchup * Remove unnecessary stuff in MainLayout * Modify DesignatedRoleService API slightly to return the id of the created entity * Initial implementation of Configuration (Roles) * Slight improvement to styling of menu for Configuration and Logs * Modify DesignatedChannelService API slightly to return the id of the created entity * Make IndividualDesignation component generic * Initial implementation of Configuration (Channels) * Slight improvements to Channels/Roles configuration pages * Make Autocomplete component generic * Move ModixUser and RoleInformation into Common * Modify interface of PromotionsService to return the PromotionActionSummary after updating a comment Fix bug in Promotions UI where you could edit a comment and inadvertently have two active ones as a result * Implement possibility of passing query parameters to infractions page, such as ?id=<infraction_id> and ?subject=<username> Also redirect from /infractions to /logs/infractions * Add possibility of accepting/rejecting/forcing a campaign as well as link to the infractions page for the campaign subject * Simplify styling on Infractions page * Use iconbuttons instead for accept/reject * Re-use existing extension method for getting full username * Initial implementation of Logs/DeletedMessages page * Fix bug with filtering DeletedMessageEntity - When Batch is set, use that to filter on CreatedBy(Id) - Move AsExpandable() to sourceQuery * Set _currentContext before potential early bail Close dialog on error * Show role color if relevant in Tags grid * Enable query parameter for Tags page * Use generic version of DialogParameters when instantiating Dialogs * Persist infraction table settings to local storage Move cookie constants into separate class * Slight styling improvements to stats page * Fix/consolidate date string formatting * Responsive navmenu * Responsive commands page * Better styling for DeletedMessages * Better styling for Infractions page * Responsive styling for Configuration (Claims) * Responsive styling for UserLookup * Slightly improve styling for landing and promotions pages * Remove unnecessary elements from landing page * Change Primary color to match the vue website * Fix weird flickering issue when navigating via anchors * Use MudGrid instead of MudDrawer Improve styling on Commands page Fix element Ids not being navigable to because of having spaces in them * Rename DiscordUserService to DiscordHelper * Make it possible to switch between Vue and Blazor via config flag 'UseBlazor' Convert Startup based startup to minimal hosting model in Modix Make Modix.Web into a class library * Remove appsettings from Modix.Web * Add NoDefaultLaunchSettingsFile to avoid re-creating launchSettings.json * Remove LocalStorageService in favor of reading cookies upon first HTTP request to the site and propagating settings through SessionState instead * Remove unused package/project references * Add favicon * Use Roles instead of Policy authorization * Improve grid size for bigger screens * Implement comment creation box to show when the user has yet to vote on a campaign * Fit content to screen width on Tags page * Minor touchups * Remove unused css * Fix more nullability stuff Some of it might technically be impossible scenarios, but "meh" :) * Fixed AutoComplete after breaking it by not invoking the RenderFragment after fixing nullability * Disable button/comment box on promotion creation page if no "next rank" is available * Fix compilation issue * Upgrade packages to stable version to fix startup issue * Fix ItemTemplate issue causing preview to be empty * Remove TODO comments, add error message when fetching of campaign details fails * Make Title an optional parameter on the AutoComplete component and remove the usage of it on the UserLookup page * Remove background color from UserLookup * Apply small gap rule on small screen sizes (that aren't quite xs yet) to avoid overlapping between elements * Improved styling for toolbar on Infractions page * Improved styling for toolbar on Tags page * Fix css not being served from the correct folder * Improve styling for Promotions page on small resolutions * Update NuGet packages and change from deprecated APIs/properties * Remove UseStaticFiles call in favor of linking to static files correctly in the _Host file * Update Dockerfile to use .net8 instead of .net8-preview image * Update more NuGet packages to .NET pinned versions and cleanup some of the version references in projects * Use maxcpucount:1 in Dockerfile to avoid files being used by other processes error * Slight mobile styling tweaks to Infractions and Tags page * Reduce reliance on inline styling * Update default value for UseBlazor setting in deployment configuration files * Format code * Improved styling on CreatePromotion page on small resolutions * Improved styling for Configuration/Logs pages * Add margin to make it look a bit nicer when scrolling to the bottom of the page * Tweak styling for large resolutions on Stats and Logs pages
Initial implementations
If there's anything I've missed in the checklist above, please let me know
Current known issues
DiscordClient.GetUser(id)
returns nullTODO