Skip to content

Commit

Permalink
New improved Exporting, NetCore 3.1, Bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Nörtershäuser committed Apr 17, 2020
1 parent e85a521 commit 673a7dd
Show file tree
Hide file tree
Showing 1,137 changed files with 95,061 additions and 13,573 deletions.
9 changes: 8 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
dbdata/
dbdata/
**/bin
**/obj
**/out
**/.vscode
**/.vs
.dotnet
.Microsoft.DotNet.ImageBuilder
1 change: 0 additions & 1 deletion Config/ConfigurationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class ConfigurationData
/// <summary>
/// Misc Config
/// </summary>
/// <returns></returns>
public MiscConfig Misc { get; set; }

/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions Controllers/Api/AdministrationApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public AdministrationApiController(IEncryptionService encryptionService, ILogger
/// </summary>
/// <param name="value">Encryption request</param>
/// <returns>Encrypted value</returns>
[Produces(typeof(string))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[ValidateAntiForgeryToken]
[HttpPost]
public IActionResult EncryptConfigValue([FromBody]EncryptConfigValueRequest value)
Expand Down
69 changes: 26 additions & 43 deletions Controllers/Api/AikaApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using GoNorth.Data.Karta.Marker;
using GoNorth.Services.ImplementationStatusCompare;
using Microsoft.AspNetCore.Http;
using System.Globalization;

namespace GoNorth.Controllers.Api
{
Expand Down Expand Up @@ -205,8 +206,7 @@ public class ChapterDetailDeleteValidationResult
/// Returns the chapter overview
/// </summary>
/// <returns>Chapter Overview</returns>
[Produces(typeof(AikaChapterOverview))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaChapterOverview), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetChapterOverview()
{
Expand Down Expand Up @@ -250,8 +250,7 @@ private async Task<AikaChapterDetail> CreateNewChapterDetail(string projectId, s
/// </summary>
/// <param name="overview">Overview to save</param>
/// <returns>Chapter Overview</returns>
[Produces(typeof(AikaChapterOverview))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaChapterOverview), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[HttpPost]
[ValidateAntiForgeryToken]
Expand Down Expand Up @@ -406,7 +405,7 @@ public async Task<IActionResult> SaveChapterOverview([FromBody]AikaChapterOvervi
/// <param name="minChapterNumber">Min Chapter number</param>
/// <param name="maxChapterNumber">Max Chapter number</param>
/// <param name="chapters">Chapters</param>
/// <returns></returns>
/// <returns>Task</returns>
private async Task AdjustKartaMapMarkersForDeletedChapter(string projectId, int deletedChapter, int minChapterNumber, int maxChapterNumber, List<AikaChapter> chapters)
{
List<KartaMap> allMaps = await _kartaMapDbAccess.GetAllProjectMapsWithFullDetail(projectId);
Expand Down Expand Up @@ -554,8 +553,7 @@ private int GetNextChapterNumber(int curChapter, List<AikaChapter> chapters)
/// Returns available chapters
/// </summary>
/// <returns>Available chapters</returns>
[Produces(typeof(List<ChapterResponse>))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<ChapterResponse>), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetChapters()
{
Expand Down Expand Up @@ -583,8 +581,7 @@ public async Task<IActionResult> GetChapters()
/// <param name="start">Start of the page</param>
/// <param name="pageSize">Page Size</param>
/// <returns>Chapter Details</returns>
[Produces(typeof(List<ChapterDetailQueryResult>))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ChapterDetailQueryResult), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetChapterDetails(string searchPattern, int start, int pageSize)
{
Expand Down Expand Up @@ -615,8 +612,7 @@ public async Task<IActionResult> GetChapterDetails(string searchPattern, int sta
/// </summary>
/// <param name="id">Id of the Chapter Detail</param>
/// <returns>Chapter detail</returns>
[Produces(typeof(AikaChapterDetail))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaChapterDetail), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[HttpGet]
public async Task<IActionResult> GetChapterDetail(string id)
Expand All @@ -635,8 +631,7 @@ public async Task<IActionResult> GetChapterDetail(string id)
/// </summary>
/// <param name="questId">Quest Id</param>
/// <returns>Chapter Details</returns>
[Produces(typeof(List<AikaChapterDetail>))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<AikaChapterDetail>), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetChapterDetailsByQuest(string questId)
{
Expand All @@ -649,8 +644,7 @@ public async Task<IActionResult> GetChapterDetailsByQuest(string questId)
/// </summary>
/// <param name="id">Id of the Chapter Detail</param>
/// <returns>Chapter detaildelete validation result</returns>
[Produces(typeof(ChapterDetailDeleteValidationResult))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ChapterDetailDeleteValidationResult), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[HttpGet]
public async Task<IActionResult> ValidateChapterDetailDelete(string id)
Expand Down Expand Up @@ -749,8 +743,7 @@ private void CopyValidChapterDetailProperties(AikaChapterDetail targetDetail, Ai
/// </summary>
/// <param name="chapterDetail">Chapter Detail</param>
/// <returns>Created chapter detail</returns>
[Produces(typeof(AikaChapterDetail))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaChapterDetail), StatusCodes.Status200OK)]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> CreateChapterDetail([FromBody]AikaChapterDetail chapterDetail)
Expand Down Expand Up @@ -786,8 +779,7 @@ public async Task<IActionResult> CreateChapterDetail([FromBody]AikaChapterDetail
/// <param name="id">Id of the chapter detail</param>
/// <param name="chapterDetail">Chapter Detail</param>
/// <returns>Updated chapter detail</returns>
[Produces(typeof(AikaChapterDetail))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaChapterDetail), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[HttpPost]
[ValidateAntiForgeryToken]
Expand Down Expand Up @@ -915,8 +907,7 @@ private List<AikaStart> GetStartNodeList(List<AikaStart> start)
/// </summary>
/// <param name="id">Id of the Chapter Detail</param>
/// <returns>Deleted chapter detail</returns>
[Produces(typeof(string))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[HttpDelete]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteChapterDetail(string id)
Expand All @@ -938,8 +929,7 @@ public async Task<IActionResult> DeleteChapterDetail(string id)
/// <param name="start">Start of the page</param>
/// <param name="pageSize">Page Size</param>
/// <returns>Quests</returns>
[Produces(typeof(QuestQueryResult))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(QuestQueryResult), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetQuests(string searchPattern, int start, int pageSize)
{
Expand All @@ -949,13 +939,13 @@ public async Task<IActionResult> GetQuests(string searchPattern, int start, int
Task<int> countTask;
if(string.IsNullOrEmpty(searchPattern))
{
queryTask = _questDbAccess.GetQuestsByProjectId(project.Id, start, pageSize);
countTask = _questDbAccess.GetQuestsByProjectIdCount(project.Id);
queryTask = _questDbAccess.GetQuestsByProjectId(project.Id, start, pageSize, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
countTask = _questDbAccess.GetQuestsByProjectIdCount(project.Id, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
}
else
{
queryTask = _questDbAccess.SearchQuests(project.Id, searchPattern, start, pageSize);
countTask = _questDbAccess.SearchQuestsCount(project.Id, searchPattern);
queryTask = _questDbAccess.SearchQuests(project.Id, searchPattern, start, pageSize, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
countTask = _questDbAccess.SearchQuestsCount(project.Id, searchPattern, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
}
Task.WaitAll(queryTask, countTask);

Expand All @@ -971,17 +961,16 @@ public async Task<IActionResult> GetQuests(string searchPattern, int start, int
/// <param name="start">Start of the page</param>
/// <param name="pageSize">Page Size</param>
/// <returns>Quests</returns>
[Produces(typeof(QuestQueryResult))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(QuestQueryResult), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.Aika)]
[Authorize(Roles = RoleNames.ImplementationStatusTracker)]
[HttpGet]
public async Task<IActionResult> GetNotImplementedQuests(int start, int pageSize)
{
GoNorthProject project = await _projectDbAccess.GetDefaultProject();

Task<List<AikaQuest>> queryTask = _questDbAccess.GetNotImplementedQuests(project.Id, start, pageSize);
Task<int> countTask = _questDbAccess.GetNotImplementedQuestsCount(project.Id);
Task<List<AikaQuest>> queryTask = _questDbAccess.GetNotImplementedQuests(project.Id, start, pageSize, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
Task<int> countTask = _questDbAccess.GetNotImplementedQuestsCount(project.Id, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
Task.WaitAll(queryTask, countTask);

QuestQueryResult queryResult = new QuestQueryResult();
Expand All @@ -995,8 +984,7 @@ public async Task<IActionResult> GetNotImplementedQuests(int start, int pageSize
/// </summary>
/// <param name="id">Quest id</param>
/// <returns>Quest</returns>
[Produces(typeof(AikaQuest))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaQuest), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetQuest(string id)
{
Expand All @@ -1009,8 +997,7 @@ public async Task<IActionResult> GetQuest(string id)
/// </summary>
/// <param name="objectId">Object id</param>
/// <returns>Quests</returns>
[Produces(typeof(List<AikaQuest>))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<AikaQuest>), StatusCodes.Status200OK)]
[HttpGet]
public async Task<IActionResult> GetQuestsObjectIsReferenced(string objectId)
{
Expand All @@ -1023,8 +1010,7 @@ public async Task<IActionResult> GetQuestsObjectIsReferenced(string objectId)
/// </summary>
/// <param name="questIds">Quest Ids</param>
/// <returns>Resolved names</returns>
[Produces(typeof(List<AikaQuest>))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<AikaQuest>), StatusCodes.Status200OK)]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> ResolveQuestNames([FromBody]List<string> questIds)
Expand All @@ -1038,8 +1024,7 @@ public async Task<IActionResult> ResolveQuestNames([FromBody]List<string> questI
/// </summary>
/// <param name="quest">Quest</param>
/// <returns>Created quest</returns>
[Produces(typeof(AikaQuest))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaQuest), StatusCodes.Status200OK)]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> CreateQuest([FromBody]AikaQuest quest)
Expand All @@ -1066,8 +1051,7 @@ public async Task<IActionResult> CreateQuest([FromBody]AikaQuest quest)
/// <param name="id">Id of the quest</param>
/// <param name="quest">Quest</param>
/// <returns>Updated quest</returns>
[Produces(typeof(AikaQuest))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(AikaQuest), StatusCodes.Status200OK)]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> UpdateQuest(string id, [FromBody]AikaQuest quest)
Expand Down Expand Up @@ -1125,8 +1109,7 @@ private void CopyValidQuestProperties(AikaQuest targetQuest, AikaQuest sourceQue
/// </summary>
/// <param name="id">Id of the quest</param>
/// <returns>Deleted quest</returns>
[Produces(typeof(string))]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[HttpDelete]
[ValidateAntiForgeryToken]
Expand Down
18 changes: 10 additions & 8 deletions Controllers/Api/EvneApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
using GoNorth.Services.FlexFieldThumbnail;
using GoNorth.Data.Exporting;
using GoNorth.Services.Security;
using System.Globalization;
using Microsoft.AspNetCore.Http;

namespace GoNorth.Controllers.Api
{
Expand Down Expand Up @@ -177,7 +179,7 @@ public class EvneApiController : FlexFieldBaseApiController<EvneSkill>
/// </summary>
/// <param name="template">Template to create</param>
/// <returns>Result</returns>
[Produces(typeof(EvneSkill))]
[ProducesResponseType(typeof(EvneSkill), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.EvneTemplateManager)]
[HttpPost]
[ValidateAntiForgeryToken]
Expand All @@ -191,7 +193,7 @@ public async Task<IActionResult> CreateFlexFieldTemplate([FromBody]EvneSkill tem
/// </summary>
/// <param name="id">Id of the template</param>
/// <returns>Result Status Code</returns>
[Produces(typeof(string))]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.EvneTemplateManager)]
[HttpDelete]
[ValidateAntiForgeryToken]
Expand All @@ -206,7 +208,7 @@ public async Task<IActionResult> DeleteFlexFieldTemplate(string id)
/// <param name="id">Template Id</param>
/// <param name="template">Update template data</param>
/// <returns>Result Status Code</returns>
[Produces(typeof(EvneSkill))]
[ProducesResponseType(typeof(EvneSkill), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.EvneTemplateManager)]
[HttpPost]
[ValidateAntiForgeryToken]
Expand All @@ -220,7 +222,7 @@ public async Task<IActionResult> UpdateFlexFieldTemplate(string id, [FromBody]Ev
/// </summary>
/// <param name="id">Template Id</param>
/// <returns>Task</returns>
[Produces(typeof(string))]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.EvneTemplateManager)]
[HttpPost]
[ValidateAntiForgeryToken]
Expand All @@ -234,7 +236,7 @@ public async Task<IActionResult> DistributeFlexFieldTemplateFields(string id)
/// </summary>
/// <param name="id">Id of the template</param>
/// <returns>Image Name</returns>
[Produces(typeof(string))]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.EvneTemplateManager)]
[HttpPost]
[ValidateAntiForgeryToken]
Expand Down Expand Up @@ -343,7 +345,7 @@ protected override async Task<CompareResult> CompareObjectWithImplementationSnap
/// <param name="start">Start of the page</param>
/// <param name="pageSize">Page Size</param>
/// <returns>Skills</returns>
[Produces(typeof(FlexFieldObjectQueryResult))]
[ProducesResponseType(typeof(FlexFieldObjectQueryResult), StatusCodes.Status200OK)]
[Authorize(Roles = RoleNames.Evne)]
[Authorize(Roles = RoleNames.ImplementationStatusTracker)]
[HttpGet]
Expand All @@ -352,8 +354,8 @@ public async Task<IActionResult> GetNotImplementedSkills(int start, int pageSize
GoNorthProject project = await _projectDbAccess.GetDefaultProject();
Task<List<EvneSkill>> queryTask;
Task<int> countTask;
queryTask = _objectDbAccess.GetNotImplementedFlexFieldObjects(project.Id, start, pageSize);
countTask = _objectDbAccess.GetNotImplementedFlexFieldObjectsCount(project.Id);
queryTask = _objectDbAccess.GetNotImplementedFlexFieldObjects(project.Id, start, pageSize, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
countTask = _objectDbAccess.GetNotImplementedFlexFieldObjectsCount(project.Id, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
Task.WaitAll(queryTask, countTask);

FlexFieldObjectQueryResult queryResult = new FlexFieldObjectQueryResult();
Expand Down

0 comments on commit 673a7dd

Please sign in to comment.