Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,7 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

**/uploaded/**/*
**/uploaded/**/*

# Idea
.idea/
3 changes: 3 additions & 0 deletions Ticky.Base/Entities/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public class Card : AbstractDbEntity, IOrderable, IDeletable, IAssignable

public DateTime? SnoozedUntil { get; set; }

public TimeSpan GetTotalTime() =>
TimeRecords.Select(x => x.GetTotalTime()).Sum();

public DateTime CalculateNextRepeat(DateTime from)
{
if (RepeatInfo is null)
Expand Down
3 changes: 3 additions & 0 deletions Ticky.Base/Entities/TimeRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ public class TimeRecord : AbstractDbEntity
public required DateTime StartedAt { get; set; }

public DateTime? EndedAt { get; set; }

public TimeSpan GetTotalTime() =>
(EndedAt ?? DateTime.Now) - StartedAt;
}
1 change: 1 addition & 0 deletions Ticky.Base/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
global using Devity.Extensions;
global using System.ComponentModel.DataAnnotations;
global using System.ComponentModel.DataAnnotations.Schema;
global using System.Drawing;
Expand Down
2 changes: 1 addition & 1 deletion Ticky.Base/Ticky.Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Devity.Extensions" Version="2025.8.13.2012" />
<PackageReference Include="Devity.Extensions" Version="2026.1.4.1450" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.9" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Ticky.Internal/Ticky.Internal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Devity.Extensions" Version="2025.8.13.2012" />
<PackageReference Include="Devity.Extensions" Version="2026.1.4.1450" />
<PackageReference Include="Devity.Mailing" Version="2025.8.13.2012" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.9" />
Expand Down
4 changes: 2 additions & 2 deletions Ticky.Web/Components/Elements/CardView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
}
@if (Card.Subtasks.Any())
{
<label class="card-data-point"><i class="fa fa-check" title="Subtasks"></i> @Card.Subtasks.Where(x => x.Completed).Count()/@Card.Subtasks.Count</label>
<label class="card-data-point"><i class="fa fa-check" title="Subtasks"></i> @Card.Subtasks.Count(x => x.Completed)/@Card.Subtasks.Count</label>
}
@{
var trackedTime = new TimeSpan(Card.TimeRecords.Select(x => ((x.EndedAt ?? DateTime.Now) - x.StartedAt).Ticks).Sum()).ToElapsedString(true);
var trackedTime = Card.GetTotalTime().ToElapsedString(true);
}
@if (!string.IsNullOrWhiteSpace(trackedTime))
{
Expand Down
60 changes: 59 additions & 1 deletion Ticky.Web/Components/Pages/BoardView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<!-- Side section -->
@if (_board is not null)
{
var completedCards = _cards.Where(x => x.Column.Finished).Count();
var completedCards = _cards.Count(x => x.Column.Finished);
var totalCards = _cards.Count();

<div class="flex flex-col gap-4">
Expand All @@ -111,6 +111,51 @@
<div class="rounded-lg bg-pink-300" style="grid-row: 1; grid-column: 1;"></div>
</div>
</div>

<!-- Column time totals -->
<div class="flex flex-col gap-2">
<h2 class="text-sm">Column time totals</h2>
@foreach(var col in _board.Columns.OrderBy(c => c.Index))
{
var colCards = _cards.Where(c => c.ColumnId == col.Id).ToList();
var colTotal = colCards.Select(x => x.GetTotalTime()).Sum();
var perUser = colCards.SelectMany(x => x.TimeRecords).GroupBy(x => x.UserId).Select(x => new KeyValuePair<int,TimeSpan>(x.Key, x.Select(y => y.GetTotalTime()).Sum())).ToDictionary(x => x.Key, x => x.Value);
var expandId = $"columnTime_{col.Id}";

<div class="rounded-lg border border-tab-outline p-2">
<div class="flex flex-row items-center justify-between">
<div class="flex items-center gap-2">
<label class="text-sm font-semibold">@col.Name</label>
<label class="text-2xs text-gray-500">@colTotal.ToElapsedString()</label>
Comment thread
dkorecko marked this conversation as resolved.
</div>
<div>
<button class="text-xs text-primary px-3 py-1 rounded" @onclick="() => ToggleExpand(expandId)">@(IsExpanded(expandId) ? "Hide" : "Show")</button>
</div>
</div>

@if (IsExpanded(expandId))
{
<div class="mt-2 ml-2 text-xs">
@if (perUser.Any())
{
@foreach(var kv in perUser.OrderByDescending(k => k.Value))
{
var user = _members.FirstOrDefault(m => m.Id == kv.Key);
<div class="flex flex-row justify-between">
<div class="text-ellipsis">@(user != null ? user.Name : "Unknown")</div>
<div class="text-gray-500">@kv.Value.ToElapsedString()</div>
</div>
}
Comment thread
dkorecko marked this conversation as resolved.
}
else
{
<div class="text-gray-500">No time tracked</div>
}
</div>
}
</div>
}
</div>
</div>
}
else
Expand Down Expand Up @@ -162,6 +207,7 @@
private int? _initialCardId;

private HubConnection? _hubConnection;
private HashSet<string> _expandedSections = new();

protected override void OnParametersSet()
{
Expand Down Expand Up @@ -531,5 +577,17 @@
{
_adding = columnId;
}

private void ToggleExpand(string id)
{
if (_expandedSections.Contains(id))
_expandedSections.Remove(id);
else
_expandedSections.Add(id);

StateHasChanged();
}

private bool IsExpanded(string id) => _expandedSections.Contains(id);
}

2 changes: 1 addition & 1 deletion Ticky.Web/Ticky.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<ItemGroup>
<PackageReference Include="Devity.Blazor" Version="2025.5.7.2024" />
<PackageReference Include="Devity.Extensions" Version="2025.8.13.2012" />
<PackageReference Include="Devity.Extensions" Version="2026.1.4.1450" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.9" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.9">
Expand Down
Loading