Skip to content

Commit

Permalink
Merge pull request #8 from janvanhelvoort/develop
Browse files Browse the repository at this point in the history
Clean-up for final release
  • Loading branch information
janvanhelvoort authored Oct 25, 2018
2 parents c3b533d + c8b3548 commit de28690
Show file tree
Hide file tree
Showing 23 changed files with 38 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class CamelCaseAttribute : Attribute, IControllerConfiguration
public void Initialize(HttpControllerSettings currentConfiguration, HttpControllerDescriptor currentDescriptor)
{
var currentFormatter = currentConfiguration.Formatters.OfType<JsonMediaTypeFormatter>().Single();

// remove the current formatter
currentConfiguration.Formatters.Remove(currentFormatter);

var camelFormatter = new JsonMediaTypeFormatter
{
SerializerSettings = { ContractResolver = new CamelCasePropertyNamesContractResolver() }
};

// add the camel case formatter
currentConfiguration.Formatters.Add(camelFormatter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ul class="thumbnails">
<li class="span4" ng-repeat="question in content.questions">
<div style="margin-right: 20px; padding: 20px;">
<a href ng-click="navigate(question.id)" title="{{question.name}}">
<a href="javascript:;" ng-click="navigate(question.id)" title="{{question.name}}">
<span style="font-weight: bold;">{{question.name}}</span>
<div class="umb-listview" ng-if="question.answers.length > 0">
<table class="table table-striped">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div ng-controller="PollIt.PickerOverlayController">

<umb-load-indicator ng-if="isLoading"/>
<umb-load-indicator ng-if="isLoading" />

<!-- FILTER -->
<div class="umb-control-group -no-border" ng-if="!isLoading && content.questions.length !== 0">
Expand All @@ -9,7 +9,6 @@
<input type="text"
class="-full-width-input"
ng-model="content.filterTerm"
class="umb-search-field search-query search-input input-block-level"
localize="placeholder"
placeholder="@placeholders_filter"
umb-auto-focus>
Expand All @@ -21,7 +20,7 @@
<a href="" title="{{ question.name }}">
<i class="icon-poll"></i>
<span class="menu-label">
{{question.name}}
{{question.name}}
</span>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
for (var i = 0; i < err.data.notifications.length; i++) {
notificationsService.showNotification(err.data.notifications[i]);
}
};
}
});

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<localize key="defaultdialogs_confirmdelete">Are you sure you want to delete</localize> <strong>{{currentNode.name}}</strong>?
</p>

<umb-confirm on-confirm="performDelete" on-cancel="cancel"/>
<umb-confirm on-confirm="performDelete" on-cancel="cancel" />
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}, function (result) {
notificationsService.error(result.data.message);
$scope.page.saveButtonState = "error";
});;
});
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<div ng-controller="PollIt.EditController">
<form name="contentForm" novalidate val-form-manager>

<umb-load-indicator ng-if="page.isLoading"></umb-load-indicator>

<umb-editor-view ng-if="!page.isLoading">

<umb-editor-header name="model.question.name" navigation="page.navigation" hide-icon="true" hide-description="true" hide-alias="true"></umb-editor-header>

<umb-editor-container class="form-horizontal">
Expand All @@ -14,7 +12,7 @@
<umb-editor-footer>
<umb-editor-footer-content-right>
<umb-button action="save()" type="button" button-style="success" state="page.saveButtonState" shortcut="ctrl+s" label="Save"
label-key="buttons_save" disabled="page.saveButtonState === 'busy'" />
label-key="buttons_save" disabled="page.saveButtonState === 'busy'" />
</umb-editor-footer-content-right>
</umb-editor-footer>
</umb-editor-view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
today: "icon-locate"
}
}
}
};

$scope.startDatePicker = { view: 'datepicker', value: $scope.model.question.startDate, config: $.extend({}, $scope.config.datePicker) };
$scope.endDatePicker = { view: 'datepicker', value: $scope.model.question.endDate, config: $.extend({}, $scope.config.datePicker) };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function PickerController($scope, localizationService, pollItResource) {
$scope.content = { selection: null, error: null }
$scope.content = { selection: null, error: null };

if ($scope.model.value) {
pollItResource.getQuestionById($scope.model.value).then(function(result) {
Expand Down Expand Up @@ -32,14 +32,14 @@
$scope.content.pollPickerOverlay = null;
$scope.content.error = null;
}
}
};
}
}
};

$scope.remove = function () {
$scope.content.selection = null;
$scope.model.value = null;
}
};
}

angular.module("umbraco").controller("PollIt.PickerController", PickerController);
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<umb-load-indicator ng-if="isLoading" />

<umb-node-preview ng-if="content.selection.name" name="content.selection.name" icon="icon-poll" allow-remove="true" on-remove="remove()"/>
<a href="" ng-if="!content.selection.name" class="umb-node-preview-add" ng-click="openPollPicker()" prevent-default>
<umb-node-preview ng-if="content.selection.name" name="content.selection.name" icon="icon-poll" allow-remove="true" on-remove="remove()" />

<a href="javascript:;" ng-if="!content.selection.name" class="umb-node-preview-add" ng-click="openPollPicker()" prevent-default>
<localize key="general_add">Add</localize>
</a>

<div ng-if="content.error" class="alert alert-warning">
{{ content.error }}
</div>

<umb-overlay ng-if="content.pollPickerOverlay.show" model="content.pollPickerOverlay" view="content.pollPickerOverlay.view" position="right"/>
<umb-overlay ng-if="content.pollPickerOverlay.show" model="content.pollPickerOverlay" view="content.pollPickerOverlay.view" position="right" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PollTreeController : TreeController

protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
TreeNodeCollection nodes = new TreeNodeCollection();
var nodes = new TreeNodeCollection();

if (id.Equals(this.rootId))
{
Expand All @@ -39,7 +39,7 @@ protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection

protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
MenuItemCollection collection = new MenuItemCollection();
var collection = new MenuItemCollection();

if (id.Equals(this.rootId))
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Qvision.Umbraco.PollIt/Migrations/InitialMigration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public InitialMigration(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sql
public override void Up()
{
if (!this.databaseSchema.TableExist(TableConstants.Questions.TableName))
{
{
this.Create.Table(TableConstants.Questions.TableName)
.WithColumn("Id").AsInt32().NotNullable()
.PrimaryKey("PK_poll_questions").Identity()
Expand Down Expand Up @@ -58,7 +58,7 @@ public override void Up()
.PrimaryKey("PK_poll_responses").Identity()
.WithColumn("ResponseDate").AsDateTime().NotNullable()
.WithColumn("QuestionId").AsInt32().NotNullable()
.WithColumn("AnswerId").AsInt32().NotNullable();
.WithColumn("AnswerId").AsInt32().NotNullable();

this.Create.ForeignKey("QuestionId_Response")
.FromTable(TableConstants.Responses.TableName).ForeignColumn("QuestionId")
Expand Down
2 changes: 1 addition & 1 deletion Source/Qvision.Umbraco.PollIt/Models/Answer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Qvision.PollIt.Models
{
using System.Collections.Generic;
using System.Collections.Generic;

public class Answer
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Qvision.Umbraco.PollIt/Models/Pocos/Answer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// <summary>
/// The answer.
/// </summary>
[TableName(TableConstants.Answers.TableName)]
[TableName(TableConstants.Answers.TableName)]
public class Answer
{
/// <summary>
Expand All @@ -22,7 +22,7 @@ public class Answer

/// <summary>
/// Gets or sets the answer.
/// </summary>
/// </summary>
public string Value { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/Qvision.Umbraco.PollIt/Models/Pocos/Question.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// <summary>
/// The poll question.
/// </summary>
[TableName(TableConstants.Questions.TableName)]
[TableName(TableConstants.Questions.TableName)]
public class Question
{
/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions Source/Qvision.Umbraco.PollIt/Models/Question.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class Question

public DateTime? EndDate { get; set; }

public DateTime CreatedDate { get; set; }
public DateTime CreatedDate { get; set; }

public IEnumerable<Answer> Answers { get; set; }
public IEnumerable<Answer> Answers { get; set; }
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Answer Save(Answer answer)
{
if (answer != null && answer.Id > 0)
{
this.Database.Update(answer);
this.Database.Update(answer);
}

return answer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public bool Delete(int id)

public bool DeleteByAnswerId(int id)
{
var query = new Sql().Where<Response>(response => response.AnswerId.Equals(id), this.SqlSyntax);
var query = new Sql().Where<Response>(response => response.AnswerId.Equals(id), this.SqlSyntax);

return this.Database.Delete<Response>(query) > -1;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Qvision.Umbraco.PollIt/PollItContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class PollItContext
/// </summary>
private PollItContext()
{
this.AmountOfAnswers = this.GetAppSetting<int>(Constants.AppSettings.AmountOfAnswers, 6);
this.AmountOfAnswers = this.GetAppSetting(Constants.AppSettings.AmountOfAnswers, 6);
instance = this;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Qvision.Umbraco.PollIt/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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.9.1.*")]
[assembly: AssemblyFileVersion("0.9.1.*")]
[assembly: AssemblyVersion("0.9.2.*")]
[assembly: AssemblyFileVersion("0.9.2s.*")]
2 changes: 1 addition & 1 deletion Source/Qvision.Umbraco.PollIt/Services/PollItService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Question Vote(int questionId, int answerId)

if (result != null)
{
PollItCacheRefresher.ClearCache(questionId);
PollItCacheRefresher.ClearCache(questionId);
}

return this.GetQuestion(questionId);
Expand Down
6 changes: 3 additions & 3 deletions Source/Qvision.Umbraco.PollIt/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ private void SetupSections(ApplicationContext applicationContext)
/// Setup database.
/// </summary>
private void SetupMigration()
{
var migrations = ApplicationContext.Current.Services.MigrationEntryService.GetAll(ApplicationConstants.ProductName);
{
var migrations = ApplicationContext.Current.Services.MigrationEntryService.GetAll(ApplicationConstants.ProductName);
var latestMigration = migrations.OrderByDescending(x => x.Version).FirstOrDefault();

var currentVersion = latestMigration != null ? latestMigration.Version : new SemVersion(0, 0, 0);
Expand Down Expand Up @@ -135,7 +135,7 @@ private void ServerVariablesParserParsing(object sender, Dictionary<string, obje
{ "postQuestionAnswer", urlHelper.GetUmbracoApiService<QuestionApiController>("PostAnswer") },
{ "getQuestionResponsesById", urlHelper.GetUmbracoApiService<QuestionApiController>("GetResponses") },

{ "saveAnswer", urlHelper.GetUmbracoApiService<AnswerApiController>("Post") },
{ "saveAnswer", urlHelper.GetUmbracoApiService<AnswerApiController>("Post") },
{ "deleteAnswer", urlHelper.GetUmbracoApiService<AnswerApiController>("Delete") },

{ "AmountOfAnswers", PollItContext.Current.AmountOfAnswers }
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os: Visual Studio 2015

# Version format
version: 0.9.1.{build}
version: 0.9.2.{build}

cache:
- Source\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
Expand Down

0 comments on commit de28690

Please sign in to comment.