Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit 9ebd4b2

Browse files
committed
Added back filters
1 parent 8160302 commit 9ebd4b2

26 files changed

Lines changed: 417 additions & 44 deletions

CodeHub.Core/ViewModels/Repositories/RepositoriesViewModel.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4-
using System.Threading.Tasks;
54
using System.Windows.Input;
65
using Cirrious.MvvmCross.ViewModels;
76
using CodeFramework.Core.Utils;
@@ -35,9 +34,9 @@ public ICommand GoToRepositoryCommand
3534
protected RepositoriesViewModel(string filterKey = "RepositoryController")
3635
{
3736
_repositories = new FilterableCollectionViewModel<RepositoryModel, RepositoriesFilterModel>(filterKey);
38-
//_repositories.FilteringFunction = x => _repositories.Filter.Ascending ? x.OrderBy(y => y.Name) : x.OrderByDescending(y => y.Name);
39-
//_repositories.GroupingFunction = CreateGroupedItems;
40-
_repositories.Bind(x => x.Filter, () => Repositories.Refresh());
37+
_repositories.FilteringFunction = x => Repositories.Filter.Ascending ? x.OrderBy(y => y.Name) : x.OrderByDescending(y => y.Name);
38+
_repositories.GroupingFunction = CreateGroupedItems;
39+
_repositories.Bind(x => x.Filter, Repositories.Refresh);
4140
}
4241

4342
private IEnumerable<IGrouping<string, RepositoryModel>> CreateGroupedItems(IEnumerable<RepositoryModel> model)

CodeHub.Core/ViewModels/Source/SourceTreeViewModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private void GoToSubmodule(ContentModel x)
6565
public SourceTreeViewModel()
6666
{
6767
_content = new FilterableCollectionViewModel<ContentModel, SourceFilterModel>("SourceViewModel");
68-
_content.FilteringFunction = FilterModel;
68+
_content.FilteringFunction = FilterModel;
69+
_content.Bind(x => x.Filter, _content.Refresh);
6970
}
7071

7172
public void Init(NavObject navObject)
@@ -87,9 +88,9 @@ private IEnumerable<ContentModel> FilterModel(IEnumerable<ContentModel> model)
8788
return _content.Filter.Ascending ? ret : ret.Reverse();
8889
}
8990

90-
protected override Task Load(bool forceDataRefresh)
91+
protected override Task Load(bool forceCacheInvalidation)
9192
{
92-
return Content.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].GetContent(Path, Branch), forceDataRefresh);
93+
return Content.SimpleCollectionLoad(this.GetApplication().Client.Users[Username].Repositories[Repository].GetContent(Path, Branch), forceCacheInvalidation);
9394
}
9495

9596
public class NavObject

CodeHub.iOS/CodeHub.iOS.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@
157157
<Compile Include="Views\Accounts\LoginView.cs" />
158158
<Compile Include="Views\Source\CommitsView.cs" />
159159
<Compile Include="Views\PullRequests\PullRequestCommitsView.cs" />
160+
<Compile Include="Views\Filters\IssueMilestonesFilterViewController.cs" />
161+
<Compile Include="Views\Filters\IssuesFilterViewController.cs" />
162+
<Compile Include="Views\Filters\MyIssuesFilterViewController.cs" />
163+
<Compile Include="Views\Filters\RepositoriesFilterViewController.cs" />
164+
<Compile Include="Views\Filters\SourceFilterViewController.cs" />
160165
</ItemGroup>
161166
<ItemGroup>
162167
<ProjectReference Include="..\CodeHub.Core\CodeHub.Core.iOS.csproj">
@@ -222,8 +227,6 @@
222227
<Content Include="Images\branch.png" />
223228
<Content Include="Images\Buttons\black_button%402x.png" />
224229
<Content Include="Images\Buttons\black_button.png" />
225-
<Content Include="Images\Buttons\filter%402x.png" />
226-
<Content Include="Images\Buttons\filter.png" />
227230
<Content Include="Images\Buttons\fork%402x.png" />
228231
<Content Include="Images\Buttons\fork.png" />
229232
<Content Include="Images\Buttons\grey_button%402x.png" />
@@ -238,7 +241,6 @@
238241
<Content Include="Images\comments.png" />
239242
<Content Include="Images\commit%402x.png" />
240243
<Content Include="Images\commit.png" />
241-
<Content Include="Images\Controls\warning.png" />
242244
<Content Include="Images\create%402x.png" />
243245
<Content Include="Images\create.png" />
244246
<Content Include="Images\events%402x.png" />
@@ -343,14 +345,14 @@
343345
<Content Include="WebCell\comments.html" />
344346
<BundleResource Include="Images\Buttons\back%402x.png" />
345347
<BundleResource Include="Images\Buttons\back.png" />
346-
<BundleResource Include="Images\Buttons\edit.png" />
347-
<BundleResource Include="Images\Buttons\edit%402x.png" />
348348
<BundleResource Include="Images\Buttons\cancel.png" />
349349
<BundleResource Include="Images\Buttons\cancel%402x.png" />
350350
<BundleResource Include="Images\Buttons\three_lines.png" />
351351
<BundleResource Include="Images\Buttons\three_lines%402x.png" />
352352
<BundleResource Include="Images\Buttons\check.png" />
353353
<BundleResource Include="Images\Buttons\check%402x.png" />
354+
<BundleResource Include="Images\Buttons\sort.png" />
355+
<BundleResource Include="Images\Buttons\sort%402x.png" />
354356
</ItemGroup>
355357
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
356358
<ItemGroup>
@@ -359,5 +361,6 @@
359361
</ItemGroup>
360362
<ItemGroup>
361363
<Folder Include="WebCell\" />
364+
<Folder Include="Views\Filters\" />
362365
</ItemGroup>
363366
</Project>
-1.52 KB
Binary file not shown.
-1.96 KB
Binary file not shown.
-3.45 KB
Binary file not shown.
-4.42 KB
Binary file not shown.
294 Bytes
Loading
2.28 KB
Loading
-141 Bytes
Loading

0 commit comments

Comments
 (0)