Skip to content

Commit

Permalink
Merge branch 'release/v0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyJoel committed Jan 4, 2019
2 parents f1f510b + 9c76770 commit e5d7799
Show file tree
Hide file tree
Showing 40 changed files with 373 additions and 116 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2010-2017 Uber Creative Ltd
Copyright (c) 2010-2019 Cofoundry Technologies Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Task("Build")
.Append("/p:AssemblyVersion=" + versionInfo.AssemblySemVer)
.Append("/p:FileVersion=" + versionInfo.MajorMinorPatch + ".0")
.Append("/p:InformationalVersion=" + versionInfo.InformationalVersion)
.Append("/p:Copyright=" + "\"Copyright © Cofoundry.org " + DateTime.Now.Year + "\"")
.Append("/p:Copyright=" + "\"Copyright © Cofoundry Technologies Ltd " + DateTime.Now.Year + "\"")
};
foreach (var projectToBuild in projectsToBuild)
Expand Down
2 changes: 1 addition & 1 deletion src/Cofoundry.BasicTestSite/Cofoundry.BasicTestSite.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>

Expand Down
28 changes: 14 additions & 14 deletions src/Cofoundry.Core/Cofoundry.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All" />

<PackageReference Include="AngleSharp" Version="0.9.10" />
<PackageReference Include="HtmlSanitizer" Version="4.0.187" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.1.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.2" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="AngleSharp" Version="0.9.11" />
<PackageReference Include="HtmlSanitizer" Version="4.0.199" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
</ItemGroup>

</Project>
28 changes: 14 additions & 14 deletions src/Cofoundry.Domain/Cofoundry.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All" />

<PackageReference Include="AngleSharp" Version="0.9.10" />
<PackageReference Include="HtmlSanitizer" Version="4.0.187" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.4" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.1.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.2" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="AngleSharp" Version="0.9.11" />
<PackageReference Include="HtmlSanitizer" Version="4.0.199" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public async Task<IUserContext> GetCurrentContextByUserAreaAsync(string userArea

// otherwise, try and get a specific user context:
var userId = await _userSessionService.GetUserIdByUserAreaCodeAsync(userAreaCode);
if (!userId.HasValue) return new UserContext();

userContext = await GetUserContextByIdAsync(userId);

if (!userContext.UserId.HasValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public async Task<IActionResult> Get()

#region commands

[HttpPatch]
public async Task<IActionResult> Patch([FromBody] IDelta<UpdateCurrentUserAccountCommand> delta)
{
var userContext = await _userContextService.GetCurrentContextAsync();
Expand All @@ -53,6 +54,7 @@ public async Task<IActionResult> Patch([FromBody] IDelta<UpdateCurrentUserAccoun
return await _apiResponseHelper.RunCommandAsync(this, userId, delta);
}

[HttpPut]
public async Task<IActionResult> PutPassword([FromBody] UpdateCurrentUserPasswordCommandDto dto)
{
var command = new UpdateCurrentUserPasswordCommand()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,25 @@ public async Task<IActionResult> GetById(int customEntityId)

#region commands

[HttpPost]
public async Task<IActionResult> Post([ModelBinder(BinderType = typeof(CustomEntityDataModelCommandModelBinder))] AddCustomEntityCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> PutOrdering([FromBody] ReOrderCustomEntitiesCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> PutCustomEntityUrl(int customEntityId, [FromBody] UpdateCustomEntityUrlCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> Delete(int customEntityId)
{
var command = new DeleteCustomEntityCommand();
Expand All @@ -75,6 +79,7 @@ public async Task<IActionResult> Delete(int customEntityId)
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPost]
public async Task<IActionResult> PostDuplicate([FromBody] DuplicateCustomEntityCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,28 @@ public async Task<IActionResult> Get(int customEntityVersionPageBlockId, CustomE

#region commands

[HttpPost]
public async Task<IActionResult> Post([ModelBinder(BinderType = typeof(PageVersionBlockDataModelCommandModelBinder))] AddCustomEntityVersionPageBlockCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> Put(int customEntityVersionPageBlockId, [ModelBinder(BinderType = typeof(PageVersionBlockDataModelCommandModelBinder))] UpdateCustomEntityVersionPageBlockCommand command)
{
command.CustomEntityVersionPageBlockId = customEntityVersionPageBlockId;
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> Delete(int customEntityVersionPageBlockId)
{
var command = new DeleteCustomEntityVersionPageBlockCommand() { CustomEntityVersionPageBlockId = customEntityVersionPageBlockId };

return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> MoveUp(int customEntityVersionPageBlockId)
{
var command = new MoveCustomEntityVersionPageBlockCommand();
Expand All @@ -80,6 +84,7 @@ public async Task<IActionResult> MoveUp(int customEntityVersionPageBlockId)
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> MoveDown(int customEntityVersionPageBlockId)
{
var command = new MoveCustomEntityVersionPageBlockCommand();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,34 @@ public async Task<IActionResult> Get(int customEntityId, GetCustomEntityVersionS

#region commands

[HttpPost]
public async Task<IActionResult> Post([FromBody] AddCustomEntityDraftVersionCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> PutDraft(int customEntityId, [ModelBinder(BinderType = typeof(CustomEntityDataModelCommandModelBinder))] UpdateCustomEntityDraftVersionCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> DeleteDraft(int customEntityId)
{
var command = new DeleteCustomEntityDraftVersionCommand() { CustomEntityId = customEntityId };

return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> Publish(int customEntityId)
{
var command = new PublishCustomEntityCommand() { CustomEntityId = customEntityId };
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> UnPublish(int customEntityId)
{
var command = new UnPublishCustomEntityCommand() { CustomEntityId = customEntityId };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ public async Task<IActionResult> Post(AddDocumentAssetCommand command, IFormFile
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> Put(int documentAssetId, UpdateDocumentAssetCommand command, IFormFile file)
{
command.File = _formFileUploadedFileFactory.Create(file);

return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> Delete(int documentAssetId)
{
var command = new DeleteDocumentAssetCommand();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ public async Task<IActionResult> GetById(int imageAssetId)

#region commands

[HttpPost]
public async Task<IActionResult> Post(AddImageAssetCommand command, IFormFile file)
{
command.File = _formFileUploadedFileFactory.Create(file);
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> Put(int imageAssetId, UpdateImageAssetCommand command, IFormFile file)
{
command.File = _formFileUploadedFileFactory.Create(file);
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> Delete(int imageAssetId)
{
var command = new DeleteImageAssetCommand();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ public async Task<IActionResult> GetById(int pageDirectoryId)

#region commands

[HttpPost]
public async Task<IActionResult> Post([FromBody] AddPageDirectoryCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> Patch(int pageDirectoryId, [FromBody] IDelta<UpdatePageDirectoryCommand> delta)
{
return await _apiResponseHelper.RunCommandAsync(this, pageDirectoryId, delta);
}

[HttpDelete]
public async Task<IActionResult> Delete(int pageDirectoryId)
{
var command = new DeletePageDirectoryCommand();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,27 @@ public async Task<IActionResult> Get(int pageVersionBlockId, PageVersionRegionBl

#region commands

[HttpPost]
public async Task<IActionResult> Post([ModelBinder(BinderType = typeof(PageVersionBlockDataModelCommandModelBinder))] AddPageVersionBlockCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> Put(int PageVersionBlockId, [ModelBinder(BinderType = typeof(PageVersionBlockDataModelCommandModelBinder))] UpdatePageVersionBlockCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> Delete(int pageVersionBlockId)
{
var command = new DeletePageVersionBlockCommand() { PageVersionBlockId = pageVersionBlockId };

return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> MoveUp(int pageVersionBlockId)
{
var command = new MovePageVersionBlockCommand();
Expand All @@ -79,6 +83,7 @@ public async Task<IActionResult> MoveUp(int pageVersionBlockId)
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPut]
public async Task<IActionResult> MoveDown(int pageVersionBlockId)
{
var command = new MovePageVersionBlockCommand();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ public async Task<IActionResult> Get(int pageId, GetPageVersionSummariesByPageId

#region commands

[HttpPost]
public async Task<IActionResult> Post([FromBody] AddPageDraftVersionCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> PatchDraft(int pageId, [FromBody] IDelta<UpdatePageDraftVersionCommand> delta)
{
// Custom patching because we may need to create a draft version first
Expand All @@ -65,19 +67,22 @@ public async Task<IActionResult> PatchDraft(int pageId, [FromBody] IDelta<Update
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> DeleteDraft(int pageId)
{
var command = new DeletePageDraftVersionCommand() { PageId = pageId };

return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> Publish(int pageId)
{
var command = new PublishPageCommand() { PageId = pageId };
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> UnPublish(int pageId)
{
var command = new UnPublishPageCommand() { PageId = pageId };
Expand Down
5 changes: 5 additions & 0 deletions src/Cofoundry.Web.Admin/Admin/Api/Pages/PagesApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,25 @@ public async Task<IActionResult> GetById(int pageId)

#region commands

[HttpPost]
public async Task<IActionResult> Post([FromBody] AddPageCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPatch]
public async Task<IActionResult> Patch(int pageId, [FromBody] IDelta<UpdatePageCommand> delta)
{
return await _apiResponseHelper.RunCommandAsync(this, pageId, delta);
}

[HttpPut]
public async Task<IActionResult> PutPageUrl(int pageId, [FromBody] UpdatePageUrlCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpDelete]
public async Task<IActionResult> Delete(int pageId)
{
var command = new DeletePageCommand();
Expand All @@ -79,6 +83,7 @@ public async Task<IActionResult> Delete(int pageId)
return await _apiResponseHelper.RunCommandAsync(this, command);
}

[HttpPost]
public async Task<IActionResult> PostDuplicate([FromBody] DuplicatePageCommand command)
{
return await _apiResponseHelper.RunCommandAsync(this, command);
Expand Down
Loading

0 comments on commit e5d7799

Please sign in to comment.