Skip to content

Commit

Permalink
Removed pinned nature of repo for now. (#92)
Browse files Browse the repository at this point in the history
* Copy/adaptation of Sunsetting controller

Being lazy. :)

* Update viewmodel, view contents, github service

* more

* Better form controls

* fix checkbox positioning

* Data annotations for subjects

* Remove some unneeded annotations

* Mark as multiline

* Increase size of body field

* Additional zones and submit button

* previews on keyup

* remove console logs

* Validation

* oops

* Attempt of mass issue creator using SemaphoreSlim

* Register IMassIssueCreator

* update language

* try/catch

* Update field names

* fix previews

* oops

* update logging

* fix

* Extract classes / interfaces

* R# cleanup

* Removed pinned item field

* unrelated R# cleanup
  • Loading branch information
SeanKilleen authored Jun 23, 2020
1 parent 4e1848c commit ef98eb3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
25 changes: 1 addition & 24 deletions src/Konmaripo.Web.Tests.Unit/Helpers/RepositoryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,7 @@ namespace Konmaripo.Web.Tests.Unit.Helpers
{
public class RepositoryBuilder
{
const string DummyString = "";
const long DummyLong = 0;
const int DummyInt = 0;
private readonly DateTimeOffset _dummyDateTimeOffset;

private string _repositoryName = "";
private int _starCount = 0;
private bool _isArchived = false;
private int _forkCount = 0;
private int _openIssueCount = 0;
private DateTimeOffset _createdDate = DateTimeOffset.Now;
private DateTimeOffset _updatedDate = DateTimeOffset.Now;
private long _repoId = 0;
private string _description = "";
private bool _isPrivate = false;
private DateTimeOffset _pushedDate = DateTimeOffset.Now;
private string _repoUrl = "";

private Faker<Repository> _faker = new Faker<Repository>();

public RepositoryBuilder()
{
_dummyDateTimeOffset = DateTimeOffset.Now;
}
private readonly Faker<Repository> _faker = new Faker<Repository>();

public RepositoryBuilder WithName(string repoName)
{
Expand Down
8 changes: 2 additions & 6 deletions src/Konmaripo.Web/Controllers/MassIssuesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ public class MassIssue
[DataType(DataType.MultilineText)]
public string IssueBody { get; set; }

[Display(Name = "Pin Issue?")]
public bool ShouldBePinned { get; set; }

// ReSharper disable once UnusedMember.Global
public MassIssue()
{
// this is here because the model binding uses it
}
public MassIssue(string issueSubject, string issueBody, bool shouldBePinned)
public MassIssue(string issueSubject, string issueBody)
{
IssueSubject = issueSubject;
IssueBody = issueBody;
ShouldBePinned = shouldBePinned;
}
}
public class MassIssueViewModel
Expand Down Expand Up @@ -73,7 +69,7 @@ public async Task<IActionResult> Index()
{
var remainingRequests = _gitHubService.RemainingAPIRequests();
var nonArchivedRepos = await NonArchivedReposCount();
var issue = new MassIssue(string.Empty, string.Empty, false);
var issue = new MassIssue(string.Empty, string.Empty);

var vm = new MassIssueViewModel(issue, nonArchivedRepos, remainingRequests);

Expand Down
7 changes: 0 additions & 7 deletions src/Konmaripo.Web/Views/MassIssues/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@
@Html.TextAreaFor(x => x.MassIssue.IssueBody, htmlAttributes: new { @class = "form-control", rows = 10 })
@Html.ValidationMessageFor(x => x.MassIssue.IssueBody, null, htmlAttributes: new { @class = "text-danger" })
</div>

<div class="form-check">
@Html.CheckBoxFor(x => x.MassIssue.ShouldBePinned, htmlAttributes: new { @class = "form-check-input" })
@Html.LabelFor(x => x.MassIssue.ShouldBePinned, htmlAttributes: new { @class = "form-check-label" })
@Html.ValidationMessageFor(x=>x.MassIssue.ShouldBePinned, null, htmlAttributes: new { @class = "text-danger" })
</div>

</div>

<div>
Expand Down

0 comments on commit ef98eb3

Please sign in to comment.