merged LiebUserId with DiscordId
This commit is contained in:
parent
49374412b3
commit
d54ce50336
19 changed files with 109 additions and 142 deletions
|
@ -17,7 +17,7 @@
|
|||
@if (_user != null && _isRaidSignUpAllowed)
|
||||
{
|
||||
<div class="signUpStatusTooltip">
|
||||
@if(_raid.SignUps.Where(s => s.LiebUserId == _user.LiebUserId && s.SignUpType != SignUpType.SignedOff).Any())
|
||||
@if(_raid.SignUps.Where(s => s.LiebUserId == _user.Id && s.SignUpType != SignUpType.SignedOff).Any())
|
||||
{
|
||||
<span class="oi oi-badge" style="color:green"></span>
|
||||
<span class="tooltiptext">You are signed up</span>
|
||||
|
@ -76,7 +76,7 @@
|
|||
<AuthorizeView>
|
||||
<button class="controlButton raidButton" @onclick="() => SignOffClicked()">Sign Off</button>
|
||||
|
||||
@if (_raid.RaidOwnerId == _user.LiebUserId || _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
|
||||
@if (_raid.RaidOwnerId == _user.Id || _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
|
||||
{
|
||||
<button class="controlButton raidButton" @onclick="() => EditClicked()">Edit</button>
|
||||
@if (_raid.RaidType != RaidType.Planned)
|
||||
|
@ -108,7 +108,7 @@
|
|||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
_isRaidSignUpAllowed = _user != null && RaidService.IsRaidSignUpAllowed(_user.LiebUserId, _raid.RaidId, out _errorMessage);
|
||||
_isRaidSignUpAllowed = _user != null && RaidService.IsRaidSignUpAllowed(_user.Id, _raid.RaidId, out _errorMessage);
|
||||
|
||||
_startTime = await TimeZoneService.GetLocalDateTime(_raid.StartTimeUTC);
|
||||
_endTime = await TimeZoneService.GetLocalDateTime(_raid.EndTimeUTC);
|
||||
|
@ -117,7 +117,7 @@
|
|||
|
||||
async Task SignOffClicked()
|
||||
{
|
||||
await RaidService.SignOff(_raid.RaidId, _user.LiebUserId);
|
||||
await RaidService.SignOff(_raid.RaidId, _user.Id);
|
||||
_raid = RaidService.GetRaid(_raid.RaidId);
|
||||
}
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@
|
|||
{
|
||||
_raid = RaidService.GetRaid(parsedId);
|
||||
|
||||
if (_raid != null && (_raid.RaidOwnerId == _user.LiebUserId
|
||||
if (_raid != null && (_raid.RaidOwnerId == _user.Id
|
||||
|| _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel))
|
||||
{
|
||||
_startTime = await TimeZoneService.GetLocalDateTime(_raid.StartTimeUTC);
|
||||
|
@ -273,7 +273,7 @@
|
|||
|
||||
if (_raid.RaidOwnerId == 0)
|
||||
{
|
||||
_raid.RaidOwnerId = _user.LiebUserId;
|
||||
_raid.RaidOwnerId = _user.Id;
|
||||
}
|
||||
|
||||
await RaidService.AddOrEditRaid(_raid, _rolesToDelete, new List<RaidReminder>());
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
[Parameter]
|
||||
public bool _isRaidSignUpAllowed { get; set; }
|
||||
|
||||
private int _liebUserId { get; set; } = -1;
|
||||
private ulong _liebUserId { get; set; } = 0;
|
||||
|
||||
private List<GuildWars2Account> _usableAccounts;
|
||||
|
||||
|
@ -125,7 +125,7 @@
|
|||
{
|
||||
_usableAccounts = _user.GuildWars2Accounts.Where(a => a.EquippedBuilds.Count > 0).ToList();
|
||||
}
|
||||
_liebUserId = _user.LiebUserId;
|
||||
_liebUserId = _user.Id;
|
||||
}
|
||||
_expandableRoles = new List<ExpandableRole>();
|
||||
foreach(RaidRole role in _raid.Roles)
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
|
||||
<AuthorizeView>
|
||||
@if (_template.RaidOwnerId == _user.LiebUserId || _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
|
||||
@if (_template.RaidOwnerId == _user.Id || _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
|
||||
{
|
||||
<button class="controlButton raidButton" @onclick="() => EditClicked()">Edit</button>
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
{
|
||||
_template = RaidTemplateService.GetTemplate(parsedId);
|
||||
|
||||
if (_template != null && (_template.RaidOwnerId == _user.LiebUserId
|
||||
if (_template != null && (_template.RaidOwnerId == _user.Id
|
||||
|| _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel))
|
||||
{
|
||||
_startTime = _template.StartTime;
|
||||
|
@ -290,7 +290,7 @@
|
|||
|
||||
if (_template.RaidOwnerId == 0)
|
||||
{
|
||||
_template.RaidOwnerId = _user.LiebUserId;
|
||||
_template.RaidOwnerId = _user.Id;
|
||||
}
|
||||
|
||||
await RaidTemplateService.AddOrEditTemplate(_template, _rolesToDelete, new List<RaidReminder>());
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
public Raid _raid { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public int _liebUserId { get; set; } = -1;
|
||||
public ulong _liebUserId { get; set; } = 0;
|
||||
|
||||
[Parameter]
|
||||
public List<GuildWars2Account> _usableAccounts { get; set; }
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
|
||||
private async Task HandleValidSubmit()
|
||||
{
|
||||
await GuildWars2AccountService.AddOrEditAccount(_account, _user.LiebUserId);
|
||||
await GuildWars2AccountService.AddOrEditAccount(_account, _user.Id);
|
||||
_account = GuildWars2AccountService.GetAccount(_account.GuildWars2AccountId);
|
||||
_saveMessage = "changes saved successfully";
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
@code {
|
||||
|
||||
[Parameter]
|
||||
public string userId { get; set; }
|
||||
public string _userId { get; set; }
|
||||
|
||||
private LiebUser _user;
|
||||
private int _editingUserRights = 0;
|
||||
|
@ -85,7 +85,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(userId) && int.TryParse(userId, out int parsedId))
|
||||
if(!string.IsNullOrEmpty(_userId) && ulong.TryParse(_userId, out ulong parsedId))
|
||||
{
|
||||
_user = UserService.GetLiebUser(parsedId);
|
||||
_roles = UserService.GetLiebRoles();
|
||||
|
@ -105,21 +105,21 @@
|
|||
RoleAssignment roleAssignment = new RoleAssignment()
|
||||
{
|
||||
LiebRoleId = role.LiebRoleId,
|
||||
LiebUserId = _user.LiebUserId
|
||||
LiebUserId = _user.Id
|
||||
};
|
||||
await UserService.AddRoleToUser(_user.LiebUserId, role.LiebRoleId);
|
||||
await UserService.AddRoleToUser(_user.Id, role.LiebRoleId);
|
||||
_user.RoleAssignments.Add(roleAssignment);
|
||||
}
|
||||
else if(!isChecked && assignment != null)
|
||||
{
|
||||
await UserService.RemoveRoleFromUser(_user.LiebUserId, role.LiebRoleId);
|
||||
await UserService.RemoveRoleFromUser(_user.Id, role.LiebRoleId);
|
||||
_user.RoleAssignments.Remove(assignment);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HandleValidSubmit()
|
||||
{
|
||||
await UserService.UpdateBannedUntil(_user.LiebUserId, _user.BannedUntil);
|
||||
await UserService.UpdateBannedUntil(_user.Id, _user.BannedUntil);
|
||||
if(_user.BannedUntil >= DateTime.Now.Date)
|
||||
{
|
||||
_submitMessage = "user banned successfully";
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
{
|
||||
<tr>
|
||||
<td class="nav-item px-3">
|
||||
@{string navLink = $"useredit/{@user.LiebUserId}";}
|
||||
@{string navLink = $"useredit/{@user.Id}";}
|
||||
<NavLink class="nav-link" href="@navLink">@user.Name</NavLink>
|
||||
</td>
|
||||
<td>@foreach(var account in user.GuildWars2Accounts){<div>@account.AccountName </div> }</td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue