Browse Source

Cleanup #2

pull/1/head
Sebastian 9 years ago
parent
commit
4dd7db120b
  1. 1
      src/Squidex.Read/Apps/Services/Implementations/CachingAppProvider.cs
  2. 2
      src/Squidex.Read/Schemas/Repositories/ISchemaEntityWithSchema.cs
  3. 2
      src/Squidex.Store.MongoDb/Infrastructure/MongoStreamPositionStorage.cs
  4. 1
      src/Squidex/Configurations/Constants.cs
  5. 2
      src/Squidex/Configurations/Identity/IdentityServices.cs
  6. 1
      src/Squidex/Configurations/Identity/MyIdentityOptions.cs
  7. 1
      src/Squidex/Modules/Api/Apps/Models/CreateAppDto.cs
  8. 1
      src/Squidex/Modules/Api/EntityCreatedDto.cs
  9. 2
      src/Squidex/Modules/Api/Schemas/SchemaFieldsController.cs
  10. 13
      src/Squidex/Modules/Api/Schemas/SchemasController.cs
  11. 1
      src/Squidex/Modules/UI/Account/AccountController.cs
  12. 2
      src/Squidex/Pipeline/ApiExceptionFilterAttribute.cs
  13. 2
      src/Squidex/Pipeline/AppFilterAttribute.cs
  14. 26
      src/Squidex/Pipeline/DeactivateForAppDomainAttribute.cs
  15. 3
      src/Squidex/Startup.cs
  16. 2
      tests/Squidex.Infrastructure.Tests/Reflection/PropertiesTypeAccessorTest.cs
  17. 8
      tests/Squidex.Write.Tests/Apps/AppDomainObjectTests.cs
  18. 2
      tests/Squidex.Write.Tests/Schemas/SchemaDomainObjectTests.cs
  19. 2
      tests/Squidex.Write.Tests/Utils/SchemaFixture.cs

1
src/Squidex.Read/Apps/Services/Implementations/CachingAppProvider.cs

@ -12,6 +12,7 @@ using Microsoft.Extensions.Caching.Memory;
using Squidex.Infrastructure;
using Squidex.Read.Apps.Repositories;
using Squidex.Read.Utils;
// ReSharper disable InvertIf
namespace Squidex.Read.Apps.Services.Implementations

2
src/Squidex.Read/Schemas/Repositories/ISchemaEntityWithSchema.cs

@ -1,5 +1,5 @@
// ==========================================================================
// EntityWithSchema.cs
// ISchemaEntityWithSchema.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group

2
src/Squidex.Store.MongoDb/Infrastructure/MongoStreamPositionStorage.cs

@ -1,5 +1,5 @@
// ==========================================================================
// MongoPositionStorage.cs
// MongoStreamPositionStorage.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group

1
src/Squidex/Configurations/Constants.cs

@ -5,7 +5,6 @@
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
namespace Squidex.Configurations
{
public class Constants

2
src/Squidex/Configurations/Identity/IdentityServices.cs

@ -1,5 +1,5 @@
// ==========================================================================
// IdentityDependencies.cs
// IdentityServices.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group

1
src/Squidex/Configurations/Identity/MyIdentityOptions.cs

@ -5,7 +5,6 @@
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
namespace Squidex.Configurations.Identity
{
public sealed class MyIdentityOptions

1
src/Squidex/Modules/Api/Apps/Models/CreateAppDto.cs

@ -5,7 +5,6 @@
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
namespace Squidex.Modules.Api.Apps.Models
{
public sealed class CreateAppDto

1
src/Squidex/Modules/Api/EntityCreatedDto.cs

@ -5,7 +5,6 @@
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
namespace Squidex.Modules.Api
{
public class EntityCreatedDto

2
src/Squidex/Modules/Api/Schemas/SchemaFieldsController.cs

@ -20,7 +20,7 @@ namespace Squidex.Modules.Api.Schemas
[Authorize]
[ApiExceptionFilter]
[ServiceFilter(typeof(AppFilterAttribute))]
[Route("api/apps/{app}")]
[Route("apps/{app}")]
public class SchemasFieldsController : ControllerBase
{
public SchemasFieldsController(ICommandBus commandBus)

13
src/Squidex/Modules/Api/Schemas/SchemasController.cs

@ -24,7 +24,8 @@ namespace Squidex.Modules.Api.Schemas
{
[Authorize]
[ApiExceptionFilter]
[DeactivateForAppDomain]
[ServiceFilter(typeof(AppFilterAttribute))]
[Route("apps/{app}")]
public class SchemasController : ControllerBase
{
private readonly ISchemaRepository schemaRepository;
@ -36,7 +37,7 @@ namespace Squidex.Modules.Api.Schemas
}
[HttpGet]
[Route("api/schemas/")]
[Route("schemas/")]
public async Task<List<ListSchemaDto>> Query()
{
var schemas = await schemaRepository.QueryAllAsync(AppId);
@ -45,7 +46,7 @@ namespace Squidex.Modules.Api.Schemas
}
[HttpGet]
[Route("api/schemas/{name}/")]
[Route("schemas/{name}/")]
public async Task<ActionResult> Get(string name)
{
var entity = await schemaRepository.FindSchemaAsync(AppId, name);
@ -59,7 +60,7 @@ namespace Squidex.Modules.Api.Schemas
}
[HttpPost]
[Route("api/schemas/")]
[Route("schemas/")]
public async Task<ActionResult> Create([FromBody] CreateSchemaDto model)
{
var command = SimpleMapper.Map(model, new CreateSchema { AggregateId = Guid.NewGuid() });
@ -70,7 +71,7 @@ namespace Squidex.Modules.Api.Schemas
}
[HttpPut]
[Route("api/schemas/{name}/")]
[Route("schemas/{name}/")]
public async Task<ActionResult> Update(string name, [FromBody] UpdateSchemaDto model)
{
var command = SimpleMapper.Map(model, new UpdateSchema());
@ -81,7 +82,7 @@ namespace Squidex.Modules.Api.Schemas
}
[HttpDelete]
[Route("api/schemas/{name}/")]
[Route("schemas/{name}/")]
public async Task<ActionResult> Delete(string name)
{
await CommandBus.PublishAsync(new DeleteSchema());

1
src/Squidex/Modules/UI/Account/AccountController.cs

@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.MongoDB;
using Microsoft.AspNetCore.Mvc;
// ReSharper disable RedundantIfElseBlock
// ReSharper disable ConvertIfStatementToReturnStatement

2
src/Squidex/Pipeline/ApiExceptionFilterAttribute.cs

@ -1,5 +1,5 @@
// ==========================================================================
// ExceptionFilter.cs
// ApiExceptionFilterAttribute.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group

2
src/Squidex/Pipeline/AppFilterAttribute.cs

@ -1,5 +1,5 @@
// ==========================================================================
// AppMiddleware.cs
// AppFilterAttribute.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group

26
src/Squidex/Pipeline/DeactivateForAppDomainAttribute.cs

@ -1,26 +0,0 @@
// ==========================================================================
// DeactivateForAppDomainAttribute.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
// All rights reserved.
// ==========================================================================
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Squidex.Pipeline
{
public sealed class DeactivateForAppDomainAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext context)
{
var app = context.HttpContext.Features.Get<IAppFeature>();
if (app != null)
{
context.Result = new NotFoundResult();
}
}
}
}

3
src/Squidex/Startup.cs

@ -12,6 +12,7 @@ using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@ -22,7 +23,7 @@ using Squidex.Configurations.Identity;
using Squidex.Configurations.Web;
using Squidex.Store.MongoDb;
using System.Linq;
using Microsoft.AspNetCore.Http;
// ReSharper disable ConvertClosureToMethodGroup
// ReSharper disable AccessToModifiedClosure

2
tests/Squidex.Infrastructure.Tests/Reflection/PropertiesTypeAccessorTest.cs

@ -6,8 +6,6 @@
// All rights reserved.
// ==========================================================================
// ReSharper disable ValueParameterNotUsed
using System;
using System.Linq;
using Xunit;

8
tests/Squidex.Write.Tests/Apps/AppDomainObjectTests.cs

@ -1,5 +1,5 @@
// ==========================================================================
// AppDomainObjectTest.cs
// AppDomainObjectTests.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group
@ -7,13 +7,13 @@
// ==========================================================================
using System;
using System.Linq;
using FluentAssertions;
using Squidex.Events.Apps;
using Squidex.Infrastructure;
using Squidex.Write.Apps;
using Squidex.Write.Apps.Commands;
using Xunit;
using System.Linq;
using FluentAssertions;
using Squidex.Events.Apps;
namespace Squidex.Write.Tests.Apps
{

2
tests/Squidex.Write.Tests/Schemas/SchemaDomainObjectTests.cs

@ -1,5 +1,5 @@
// ==========================================================================
// SchemaDomainObjectTest.cs
// SchemaDomainObjectTests.cs
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex Group

2
tests/Squidex.Write.Tests/Utils/SchemaFixture.cs

@ -6,9 +6,9 @@
// All rights reserved.
// ==========================================================================
using System.Reflection;
using Squidex.Core.Schemas;
using Squidex.Infrastructure;
using System.Reflection;
using Xunit;
namespace Squidex.Write.Tests.Utils

Loading…
Cancel
Save