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

Initial commit of admin panel #149

Merged
merged 4 commits into from
Jan 28, 2023
Merged

Initial commit of admin panel #149

merged 4 commits into from
Jan 28, 2023

Conversation

caseyswilliams
Copy link
Collaborator

  • 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

@Saibamen
Copy link
Collaborator

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must've autoformatted 🤷

Comment on lines +1 to +8
export enum AccountFlag {
None = 'None',
Admin = 'Admin',
Moderator = 'Moderator',
Developer = 'Developer',
ContentCreator = 'ContentCreator',
HubOwner = 'HubOwner'
}
Copy link
Collaborator

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

Copy link
Collaborator Author

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

UT4MasterServer.Web/src/route-guards.ts Outdated Show resolved Hide resolved
Comment on lines +28 to +29
const headers: HeadersInit = { 'Content-Type': form ? 'application/x-www-form-urlencoded' : 'application/json' };

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double line

Suggested change
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' };

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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

Comment on lines 100 to 114
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);

Copy link
Owner

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.

Copy link
Collaborator Author

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[];
Copy link
Owner

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.

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

@timiimit timiimit merged commit d55a027 into timiimit:master Jan 28, 2023
Comment on lines -69 to 70
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>
Copy link
Collaborator

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)

Comment on lines +28 to +29
const headers: HeadersInit = { 'Content-Type': form ? 'application/x-www-form-urlencoded' : 'application/json' };

Copy link
Collaborator

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

@caseyswilliams caseyswilliams deleted the AdminFeatures branch February 21, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants