merged LiebUserId with DiscordId

This commit is contained in:
t.ruspekhofer 2022-05-17 23:14:58 +02:00
parent 49374412b3
commit d54ce50336
19 changed files with 109 additions and 142 deletions

View file

@ -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);
}

View file

@ -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>());

View file

@ -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)

View file

@ -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>
}

View file

@ -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>());

View file

@ -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; }