Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jira plugin for Bugger #1

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions Bugger.Applications.Test/Services/DataServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void GeneralDataServiceTest()
dataService.UserBugs.Add(
new Bug()
{
ID = 1,
ID = "1",
Title = "Bug1",
Description = "Description for Bug1.",
Type = BugType.Red,
Expand All @@ -44,7 +44,7 @@ public void GeneralDataServiceTest()
dataService.UserBugs.Add(
new Bug()
{
ID = 6,
ID = "6",
Title = "Bug6",
Description = "Description for Bug6.",
AssignedTo = "Pupil",
Expand All @@ -63,7 +63,7 @@ public void GeneralDataServiceTest()
dataService.TeamBugs.Add(
new Bug()
{
ID = 5,
ID = "5",
Title = "Bug5",
Description = "Description for Bug5.",
Type = BugType.Red,
Expand Down
4 changes: 2 additions & 2 deletions Bugger.Applications.Test/ViewModels/FloatingViewModelTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void PropertiesWithNotification()
dataService.UserBugs.Add(
new Bug()
{
ID = 1,
ID = "1",
Title = "Bug1",
Description = "Description for Bug1.",
Type = BugType.Red,
Expand All @@ -74,7 +74,7 @@ public void PropertiesWithNotification()
dataService.UserBugs.Add(
new Bug()
{
ID = 6,
ID = "6",
Title = "Bug6",
Description = "Description for Bug6.",
AssignedTo = "Pupil",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void GenaralTeamBugsViewModelTest()
dataService.TeamBugs.Add(
new Bug()
{
ID = 5,
ID = "5",
Title = "Bug5",
Description = "Description for Bug5.",
Type = BugType.Red,
Expand Down
4 changes: 2 additions & 2 deletions Bugger.Applications.Test/ViewModels/UserBugsViewModelTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void GenaralUserBugsViewModelTest()
dataService.UserBugs.Add(
new Bug()
{
ID = 1,
ID = "1",
Title = "Bug1",
Description = "Description for Bug1.",
Type = BugType.Red,
Expand All @@ -38,7 +38,7 @@ public void GenaralUserBugsViewModelTest()
dataService.UserBugs.Add(
new Bug()
{
ID = 6,
ID = "6",
Title = "Bug6",
Description = "Description for Bug6.",
AssignedTo = "Pupil",
Expand Down
14 changes: 14 additions & 0 deletions Bugger.Applications/Controllers/DataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ public void TimerStart()
this.dataService.UserBugsProgressValue = 0;
this.dataService.TeamBugsProgressValue = 0;
this.timerStarted = true;

RefreshBugVisiblefields();
}

private void RefreshBugVisiblefields()
{
this.dataService.VisibleBugFields.Clear();
foreach (var field in this.ActiveProxy.GetVisibleBugFields())
{
dataService.VisibleBugFields.Add(field);
}
}

public void TimerStop()
Expand Down Expand Up @@ -134,6 +145,8 @@ private void RefreshBugsCommandExecute()
this.dataService.TeamBugsQueryState = QueryStatus.NotWorking;
this.dataService.RefreshTime = DateTime.Now;

RefreshBugVisiblefields();

if (!string.IsNullOrWhiteSpace(Settings.Default.UserName))
{
this.dataService.UserBugsQueryState = QueryStatus.Qureying;
Expand All @@ -147,6 +160,7 @@ private void RefreshBugsCommandExecute()
{
this.dataService.UserBugsQueryState = QueryStatus.FillingData;
this.dataService.UserBugsProgressValue = 50;

UpdateCommands();
return task.Result;
}, CancellationToken.None, TaskContinuationOptions.OnlyOnRanToCompletion, currentSynchronizationTaskScheduler)
Expand Down
5 changes: 4 additions & 1 deletion Bugger.Applications/Controllers/ProxyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Bugger.Applications.Properties;
using Bugger.Applications.Services;
using Bugger.Proxy;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
Expand Down Expand Up @@ -49,7 +50,9 @@ protected override void OnInitialize()
}
else if (this.ProxyService.Proxies.Any())
{
this.proxyService.ActiveProxy = this.proxyService.Proxies.First();

var jiraProxy = this.proxyService.Proxies.FirstOrDefault(x => x.ProxyName.IndexOf("jira", 0, StringComparison.CurrentCultureIgnoreCase) != -1);
this.proxyService.ActiveProxy = jiraProxy ?? this.proxyService.Proxies.First();
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions Bugger.Applications/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
[assembly: AssemblyVersion("0.4.0.0")]
[assembly: AssemblyFileVersion("0.4.0.0")]
[assembly: InternalsVisibleTo("Bugger.Applications.Test")]
10 changes: 10 additions & 0 deletions Bugger.Applications/Services/DataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal class DataService : DataModel, IDataService
private int userBugsProgressValue;
private int teamBugsProgressValue;
private InitializeStatus initializeStatus;
private MultiThreadingObservableCollection<string> visibleFields;
#endregion

[ImportingConstructor]
Expand All @@ -32,13 +33,22 @@ public DataService()
this.teamBugsQueryState = QueryStatus.QureyPause;
this.teamBugsProgressValue = 0;
this.initializeStatus = InitializeStatus.Initializing;
this.visibleFields = new MultiThreadingObservableCollection<string>();
}

#region Properties
public MultiThreadingObservableCollection<Bug> UserBugs { get { return this.userBugs; } }

public MultiThreadingObservableCollection<Bug> TeamBugs { get { return this.teamBugs; } }

public MultiThreadingObservableCollection<string> VisibleBugFields
{
get
{
return this.visibleFields;
}
}

public DateTime RefreshTime
{
get { return this.refreshTime; }
Expand Down
2 changes: 2 additions & 0 deletions Bugger.Applications/Services/IDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public interface IDataService : INotifyPropertyChanged

MultiThreadingObservableCollection<Bug> TeamBugs { get; }

MultiThreadingObservableCollection<string> VisibleBugFields { get; }

DateTime RefreshTime { get; set; }

QueryStatus UserBugsQueryState { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Bugger.Applications/ViewModels/FloatingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public FloatingViewModel(IFloatingView view, IDataService dataService, IPresenta
}
else
{
ViewCore.Left = presentationService.VirtualScreenWidth - 200;
ViewCore.Left = 0;
ViewCore.Top = 50;
}

Expand Down
5 changes: 5 additions & 0 deletions Bugger.Applications/ViewModels/TeamBugsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public TeamBugsViewModel(ITeamBugsView view, IDataService dataService)

#region Properties
public ObservableCollection<Bug> Bugs { get { return this.dataService.TeamBugs; } }
public ObservableCollection<string> VisibleBugFields
{
get { return this.dataService.VisibleBugFields; }
}

#endregion
}
}
20 changes: 17 additions & 3 deletions Bugger.Applications/ViewModels/UserBugsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
using BigEgg.Framework.Applications.ViewModels;
using System;
using BigEgg.Framework.Applications.ViewModels;
using Bugger.Applications.Services;
using Bugger.Applications.Views;
using Bugger.Domain.Models;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.Composition;

namespace Bugger.Applications.ViewModels
{
{
[Export]
public class UserBugsViewModel : ViewModel<IUserBugsView>
{
#region Fields

private readonly IDataService dataService;

#endregion

[ImportingConstructor]
Expand All @@ -22,7 +26,17 @@ public UserBugsViewModel(IUserBugsView view, IDataService dataService)
}

#region Properties
public ObservableCollection<Bug> Bugs { get { return this.dataService.UserBugs; } }

public ObservableCollection<Bug> Bugs
{
get { return this.dataService.UserBugs; }
}

public ObservableCollection<string> VisibleBugFields
{
get { return this.dataService.VisibleBugFields; }
}

#endregion
}
}
3 changes: 3 additions & 0 deletions Bugger.Domain.Test/Bugger.Domain.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<Name>Bugger.Domain</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
8 changes: 4 additions & 4 deletions Bugger.Domain.Test/Models/BugTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void GeneralWorkItemTest()
{
Bug item = new Bug()
{
ID = 123,
ID = "123",
Title = "Bug A",
Description = "Bug Description.",
Type = BugType.Red,
Expand Down Expand Up @@ -44,7 +44,7 @@ public void EqualsTest()
{
Bug item1 = new Bug()
{
ID = 123,
ID = "123",
Title = "Bug A",
Description = "Bug Description.",
Type = BugType.Red,
Expand All @@ -58,7 +58,7 @@ public void EqualsTest()

Bug item2 = new Bug()
{
ID = 124,
ID = "124",
Title = "Bug A",
Description = "Bug Description.",
Type = BugType.Red,
Expand All @@ -72,7 +72,7 @@ public void EqualsTest()

Bug item3 = new Bug()
{
ID = 124,
ID = "124",
Title = "Bug A",
Description = "Bug Description.",
Type = BugType.Red,
Expand Down
Loading