Skip to content

Commit 0469906

Browse files
authored
Merge pull request #2 from typinghard/feature/49
Feature/49
2 parents 830f0c2 + 3616d8b commit 0469906

14 files changed

+39
-26
lines changed

AzureDevopsTracker/Adapters/WorkItemAdapter.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using AzureDevopsTracker.DTOs;
22
using AzureDevopsTracker.Entities;
3+
using AzureDevopsTracker.Extensions;
34
using AzureDevopsTracker.Interfaces;
5+
using System;
46
using System.Collections.Generic;
57
using System.Linq;
68

@@ -86,8 +88,8 @@ public TimeByStateDTO ToTimeByStateDTO(TimeByState workItemStatusTime)
8688
{
8789
CreatedAt = workItemStatusTime.CreatedAt,
8890
State = workItemStatusTime.State,
89-
//TotalTime = workItemStatusTime.TotalTimeText,
90-
//TotalWorkedTime = workItemStatusTime.TotalWorkedTimeText
91+
TotalTime = TimeSpan.FromSeconds(workItemStatusTime.TotalTime).ToTextTime(),
92+
TotalWorkedTime = TimeSpan.FromSeconds(workItemStatusTime.TotalWorkedTime).ToTextTime()
9193
};
9294
}
9395

AzureDevopsTracker/AzureDevopsTracker.csproj

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,30 @@
88
<Company>TypingHard</Company>
99
<Product>Azure DevOps Tracker</Product>
1010
<PackageLicenseExpression></PackageLicenseExpression>
11-
<PackageProjectUrl>https://github.com/typinghard/azure-devops-state-tracker</PackageProjectUrl>
12-
<RepositoryUrl>https://github.com/typinghard/azure-devops-state-tracker</RepositoryUrl>
11+
<PackageProjectUrl>https://github.com/typinghard/azure-devops-tracker</PackageProjectUrl>
12+
<RepositoryUrl>https://github.com/typinghard/azure-devops-tracker</RepositoryUrl>
1313
<PackageIcon>adst_icon.png</PackageIcon>
1414
<PackageIconUrl />
1515
<RepositoryType>GitHub</RepositoryType>
1616
<PackageTags>Azure DevOps Tracker Columns State Tracking Track Board Scrum Kanbam Time Column Timing Workitem Worked Hours Team Performance</PackageTags>
1717
<NeutralLanguage>en</NeutralLanguage>
1818
<PackageLicenseFile>LICENSE.md.txt</PackageLicenseFile>
19+
<Description>A NuGet that allows you to use a Azure DevOps Service Hook to track workitems changes in a simply and detailed way.</Description>
20+
<AssemblyVersion>1.0.0.0</AssemblyVersion>
21+
<FileVersion>1.0.0.0</FileVersion>
22+
<Version>1.0.1</Version>
1923
</PropertyGroup>
2024

2125
<ItemGroup>
2226
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.7" />
23-
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
27+
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="1.1.2" />
2428
</ItemGroup>
2529

2630
<ItemGroup>
31+
<None Include="..\..\..\..\..\..\..\Downloads\adst_icon.png">
32+
<Pack>True</Pack>
33+
<PackagePath></PackagePath>
34+
</None>
2735
<None Include="LICENSE.md.txt">
2836
<Pack>True</Pack>
2937
<PackagePath></PackagePath>

AzureDevopsTracker/Configurations/Configuration.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ namespace AzureDevopsTracker.Configurations
1313
{
1414
public static class Configuration
1515
{
16-
public static IServiceCollection AddAzureDevopsStateTracker(this IServiceCollection services, DataBaseConfig configurations)
16+
public static IServiceCollection AddAzureDevopsTracker(this IServiceCollection services, DataBaseConfig configurations)
1717
{
18-
services.AddDbContext<AzureDevopsStateTrackerContext>(options =>
18+
services.AddDbContext<AzureDevopsTrackerContext>(options =>
1919
options.UseSqlServer(DataBaseConfig.ConnectionsString));
2020

21-
services.AddScoped<AzureDevopsStateTrackerContext>();
21+
services.AddScoped<AzureDevopsTrackerContext>();
2222
services.AddScoped<IWorkItemAdapter, WorkItemAdapter>();
2323
services.AddScoped<IWorkItemRepository, WorkItemRepository>();
24-
services.AddScoped<IAzureDevopsStateTrackerService, AzureDevopsStateTrackerService>();
24+
services.AddScoped<IAzureDevopsTrackerService, AzureDevopsTrackerService>();
2525

2626
return services;
2727
}
2828

29-
public static IApplicationBuilder UseAzureDevopsStateTracker(this IApplicationBuilder app, IServiceProvider serviceProvider)
29+
public static IApplicationBuilder UseAzureDevopsTracker(this IApplicationBuilder app, IServiceProvider serviceProvider)
3030
{
31-
var context = serviceProvider.GetService<AzureDevopsStateTrackerContext>();
31+
var context = serviceProvider.GetService<AzureDevopsTrackerContext>();
3232
context.Database.Migrate();
3333

3434
return app;

AzureDevopsTracker/Data/Context/AzureDevopsStateTrackerContext.cs renamed to AzureDevopsTracker/Data/Context/AzureDevopsTrackerContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace AzureDevopsTracker.Data.Context
77
{
8-
public class AzureDevopsStateTrackerContext : DbContext, IDisposable
8+
public class AzureDevopsTrackerContext : DbContext, IDisposable
99
{
10-
public AzureDevopsStateTrackerContext(DbContextOptions options) : base(options)
10+
public AzureDevopsTrackerContext(DbContextOptions options) : base(options)
1111
{ }
1212

1313
public DbSet<WorkItem> WorkItems { get; set; }

AzureDevopsTracker/Data/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ namespace AzureDevopsTracker.Data
1010
{
1111
internal abstract class Repository<TEntity> : IRepository<TEntity> where TEntity : Entity
1212
{
13-
protected readonly AzureDevopsStateTrackerContext Db;
13+
protected readonly AzureDevopsTrackerContext Db;
1414
protected readonly DbSet<TEntity> DbSet;
1515

16-
public Repository(AzureDevopsStateTrackerContext db)
16+
public Repository(AzureDevopsTrackerContext db)
1717
{
1818
Db = db;
1919
DbSet = db.Set<TEntity>();

AzureDevopsTracker/Data/WorkItemRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace AzureDevopsTracker.Data
1010
{
1111
internal class WorkItemRepository : Repository<WorkItem>, IWorkItemRepository
1212
{
13-
public WorkItemRepository(AzureDevopsStateTrackerContext context) : base(context) { }
13+
public WorkItemRepository(AzureDevopsTrackerContext context) : base(context) { }
1414

1515
public async Task<WorkItem> GetByWorkItemId(string workItemId)
1616
{

AzureDevopsTracker/Extensions/HelperExtenions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static string ExtractEmail(this string user)
2525
public static string ToTextTime(this TimeSpan timeSpan)
2626
{
2727
if (timeSpan.Days > 0)
28-
return $@"{timeSpan:%d} Dia(s) {timeSpan:%h} h e {timeSpan:%m} min e {timeSpan:%s} s";
28+
return $@"{timeSpan:%d} Day(s) {timeSpan:%h} h e {timeSpan:%m} min e {timeSpan:%s} s";
2929

3030
if (timeSpan.Hours > 0)
3131
return $@"{timeSpan:%h} h e {timeSpan:%m} min e {timeSpan:%s} s";

AzureDevopsTracker/Interfaces/IAzureDevopsStateTrackerService.cs renamed to AzureDevopsTracker/Interfaces/IAzureDevopsTrackerService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace AzureDevopsTracker.Interfaces
77
{
8-
public interface IAzureDevopsStateTrackerService
8+
public interface IAzureDevopsTrackerService
99
{
1010
Task Create(CreateWorkItemDTO createDto, bool addWorkItemChange = true);
1111
Task Update(UpdatedWorkItemDTO updateDto);

AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)