-
Notifications
You must be signed in to change notification settings - Fork 18
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
Initial commit of admin panel #149
Conversation
caseyswilliams
commented
Jan 27, 2023
- Created admin section
- Created initial user admin page, only has ability to set flags at the moment
- Most of the changes are just changes to imports to use @ alias because I hate relative paths, I should've done this sooner
Related: #135 |
@@ -53,13 +61,12 @@ | |||
justify-content: flex-end; | |||
|
|||
.nav-link.router-link-active, | |||
.navbar-nav .show > .nav-link { | |||
.navbar-nav .show>.nav-link { |
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.
Why?
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.
Must've autoformatted 🤷
export enum AccountFlag { | ||
None = 'None', | ||
Admin = 'Admin', | ||
Moderator = 'Moderator', | ||
Developer = 'Developer', | ||
ContentCreator = 'ContentCreator', | ||
HubOwner = 'HubOwner' | ||
} |
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.
Add numbers in comments from UT4MasterServer.Models.AccountFlags
enum
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.
The enum numbers aren't relevant to the front end
const headers: HeadersInit = { 'Content-Type': form ? 'application/x-www-form-urlencoded' : 'application/json' }; | ||
|
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.
Double line
const headers: HeadersInit = { 'Content-Type': form ? 'application/x-www-form-urlencoded' : 'application/json' }; | |
const headers: HeadersInit = { 'Content-Type': form ? 'application/x-www-form-urlencoded' : 'application/json' }; |
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 just autoformat with vscode, it wraps when it deems the line too long.
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'll add prettier in a separate PR, that should alleviate all of your whitespace concerns.
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 just autoformat with vscode, it wraps when it deems the line too long.
I selected 2 lines and deleted blank one in suggestion, but GH don't get it...
You have double lines - 29 and 30
Co-authored-by: Adam Stachowicz <[email protected]>
var flags = new List<string>(); | ||
|
||
var flagNamesAll = Enum.GetNames<AccountFlags>(); | ||
var flagValuesAll = Enum.GetValues<AccountFlags>(); | ||
|
||
for (int i = 0; i < flagNamesAll.Length; i++) | ||
{ | ||
if (account.Flags.HasFlag(flagValuesAll[i])) | ||
{ | ||
flags.Add(flagNamesAll[i]); | ||
} | ||
} | ||
var flagsArray = new JArray(flags); | ||
obj.Add("flags", flagsArray); | ||
|
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.
This endpoint is used by the game and should not be changed. From the looks of it, it seems that what you added here is never even needed anywhere.
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 use it in the front end, but I can put it in another place. Persona controller?
minorStatus?: string; | ||
cabinedMode?: boolean; | ||
hasHashedEmail?: boolean | ||
flags?: AccountFlag[]; |
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.
flags
should not be returned in the standard account fetching endpoint, so i assume this shouldn't be here as well.
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 I'm gonna have to move the whole thing to a different controller action, that's fine. I'd rather avoid using any of the epic endpoints so I don't have to worry about changing them
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.
We should maybe mark the ones used by the game so we know not to change em
import { SessionStore } from '../../stores/session-store'; | ||
import { onMounted, shallowRef } from 'vue'; | ||
import CustomService from '../../services/custom.service'; | ||
import { IPlayerCard } from '../../types/player-card'; | ||
|
||
const customService = new CustomService(); | ||
|
||
const playerCard = shallowRef<IPlayerCard | undefined>(undefined); | ||
|
||
async function fetchProfile() { | ||
if (SessionStore.session) { | ||
playerCard.value = await customService.getPlayerCard(SessionStore.session.account_id); | ||
} | ||
} | ||
|
||
onMounted(fetchProfile); | ||
|
||
import { AccountStore } from '@/stores/account-store'; | ||
</script> |
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.
We will use playerCard
to also show other players cards in game.
IMO we should have deleted playerCard
constant here, to be able to modify it when we get player ID from GET (original Epic URL: https://www.epicgames.com/unrealtournament/en-US/playerCard?playerId=63e4964c6cc1441089a726c00fcb2926)
const headers: HeadersInit = { 'Content-Type': form ? 'application/x-www-form-urlencoded' : 'application/json' }; | ||
|
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 just autoformat with vscode, it wraps when it deems the line too long.
I selected 2 lines and deleted blank one in suggestion, but GH don't get it...
You have double lines - 29 and 30