Skip to content

Commit

Permalink
Wiki reviews, improved node system handling, node link annotations, a…
Browse files Browse the repository at this point in the history
…utosaving and dirty state checks
  • Loading branch information
Steffen Nörtershäuser committed Jun 17, 2021
1 parent 7d8f1a3 commit f5a9522
Show file tree
Hide file tree
Showing 187 changed files with 10,436 additions and 1,473 deletions.
18 changes: 18 additions & 0 deletions Authentication/ExternalUserConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace GoNorth.Authentication
{
/// <summary>
/// Constants for external user
/// </summary>
public class ExternalUserConstants
{
/// <summary>
/// External user id
/// </summary>
public const string ExternalUserId = "00000000-0000-0000-0000-000000000001";

/// <summary>
/// Login Name for an external user
/// </summary>
public const string ExternalUserLoginName = "EXTERNAL_USER";
}
}
10 changes: 10 additions & 0 deletions Config/MiscConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,15 @@ public class MiscConfig
/// Timeout for locks
/// </summary>
public int? ResourceLockTimespan { get; set;}

/// <summary>
/// True if external wiki sharing must be disabled, else false
/// </summary>
public bool? DisableWikiExternalSharing { get; set; }

/// <summary>
/// True if auto saving must be disabled
/// </summary>
public bool? DisableAutoSaving { get; set; }
}
}
29 changes: 26 additions & 3 deletions Controllers/AikaController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using GoNorth.Config;
using GoNorth.Models.AikaViewModels;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace GoNorth.Controllers
{
Expand All @@ -10,14 +13,30 @@ namespace GoNorth.Controllers
[ApiExplorerSettings(IgnoreApi = true)]
public class AikaController : Controller
{
/// <summary>
/// Misc config
/// </summary>
private readonly MiscConfig _config;

/// <summary>
/// Constructor
/// </summary>
/// <param name="configuration">Configuration</param>
public AikaController(IOptions<ConfigurationData> configuration)
{
_config = configuration.Value.Misc;
}

/// <summary>
/// Chapter Overview view
/// </summary>
/// <returns>View</returns>
[HttpGet]
public IActionResult Index()
{
return View();
SharedAikaViewModel viewModel = new SharedAikaViewModel();
viewModel.DisableAutoSaving = _config.DisableAutoSaving.HasValue ? _config.DisableAutoSaving.Value : false;
return View(viewModel);
}

/// <summary>
Expand All @@ -27,7 +46,9 @@ public IActionResult Index()
[HttpGet]
public IActionResult Detail()
{
return View();
SharedAikaViewModel viewModel = new SharedAikaViewModel();
viewModel.DisableAutoSaving = _config.DisableAutoSaving.HasValue ? _config.DisableAutoSaving.Value : false;
return View(viewModel);
}

/// <summary>
Expand All @@ -37,7 +58,9 @@ public IActionResult Detail()
[HttpGet]
public IActionResult Quest()
{
return View();
SharedAikaViewModel viewModel = new SharedAikaViewModel();
viewModel.DisableAutoSaving = _config.DisableAutoSaving.HasValue ? _config.DisableAutoSaving.Value : false;
return View(viewModel);
}

/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion Controllers/Api/FlexFieldBaseApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ public class ImportFieldValuesLogQueryResult
/// </summary>
private const string ExcelCsvContentType = "application/vnd.ms-excel";

/// <summary>
/// Octet Stream Content Type
/// </summary>
private const string OctetStreamContentType = "application/octet-stream";

/// <summary>
/// CSV Header Id
/// </summary>
Expand Down Expand Up @@ -1670,7 +1675,7 @@ public async Task<IActionResult> ImportFieldValuesPreCheck()
}

IFormFile uploadFile = Request.Form.Files[0];
if (uploadFile.ContentType != CsvContentType && uploadFile.ContentType != ExcelCsvContentType)
if (uploadFile.ContentType != CsvContentType && uploadFile.ContentType != ExcelCsvContentType && uploadFile.ContentType != OctetStreamContentType)
{
return BadRequest();
}
Expand Down

0 comments on commit f5a9522

Please sign in to comment.