-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from SSchulze1989/feature/color-coding-reviews
Feature/color coding reviews
- Loading branch information
Showing
4 changed files
with
106 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,8 @@ | |
@inject NavigationManager NavigationManager | ||
|
||
<CascadingValue Value=Review.InvolvedMembers> | ||
<div @attributes=AdditionalAttributes class="card @AddCssClass @(Selected ? "border-info" : "")" id="[email protected]" @ref=Card> | ||
<div class="card-header accordion-header review-header"> | ||
<div @attributes=AdditionalAttributes class="card @AddCssClass @GetBorderClass(Selected, Bind(Review, x => x.Status))" id="[email protected]" @ref=Card> | ||
<div class="card-header accordion-header review-header @GetBorderClass(Selected, Bind(Review, x => x.Status))"> | ||
<div class="row"> | ||
<div class="col d-md-flex justify-content-start"> | ||
<span>@Review.SessionName:</span> | ||
|
@@ -143,7 +143,7 @@ | |
{ | ||
<li class="list-group-item"> | ||
<ReviewComment Comment=comment | ||
OnStateHasChanged=@(() => InvokeAsync(StateHasChanged)) | ||
OnStateHasChanged=@(() => CommentStateChanged(comment)) | ||
OnDeleteClick=@(() => DeleteCommentClick(comment))/> | ||
</li> | ||
} | ||
|
@@ -276,6 +276,32 @@ | |
} | ||
} | ||
|
||
private async Task CommentStateChanged(ReviewCommentViewModel comment) | ||
{ | ||
Review.UpdateReviewStatus(); | ||
await InvokeAsync(StateHasChanged); | ||
} | ||
|
||
private string GetBorderClass(bool selected, ReviewStatus status) | ||
{ | ||
if (selected) | ||
{ | ||
return "border-info"; | ||
} | ||
switch(status) | ||
{ | ||
case ReviewStatus.Open: | ||
return "border-warning"; | ||
case ReviewStatus.Closed: | ||
return "border-success"; | ||
case ReviewStatus.OpenConflicted: | ||
return "border-warning"; | ||
case ReviewStatus.OpenEnoughVotes: | ||
return "border-primary"; | ||
} | ||
return ""; | ||
} | ||
|
||
private async Task CopyDirectLink() | ||
{ | ||
var url = NavigationManager.GetUriWithQueryParameter("reviewId", Review.ReviewId); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace iRLeagueManager.Web.Shared; | ||
|
||
public enum ReviewStatus | ||
{ | ||
Open = 0, | ||
OpenConflicted = 1, | ||
OpenEnoughVotes = 2, | ||
Closed = 3, | ||
Overdue = 4, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters