Skip to content

Commit

Permalink
Merge pull request #735 from valadas/release/1.6.0
Browse files Browse the repository at this point in the history
Released v1.6.0
  • Loading branch information
valadas committed Aug 23, 2024
2 parents 9f3d412 + 5763550 commit eba4be5
Show file tree
Hide file tree
Showing 75 changed files with 1,528 additions and 1,114 deletions.
33 changes: 18 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/Eraware_Dnn_Spa_Ef_Di_Stencil/module.web" # Location of package manifests
- package-ecosystem: "npm"
directory: "/Eraware_Dnn_Spa_Ef_Di_Stencil/module.web"
schedule:
interval: "monthly"
- package-ecosystem: "nuget"
directory: "/Eraware_Dnn_Spa_Ef_Di_Stencil/build"
schedule:
interval: "monthly"
- package-ecosystem: "nuget"
directory: "/Eraware_Dnn_Spa_Ef_Di_Stencil/module"
directories:
- "/Eraware_Dnn_Templates"
- "/Eraware_Dnn_Spa_Ef_Di_Stencil"
schedule:
interval: "monthly"
ignore:
Expand All @@ -23,15 +25,16 @@ updates:
- dependency-name: "Microsoft.Extensions.DependencyInjection"
- dependency-name: "Microsoft.Extensions.DependencyInjection.Abstractions"
- dependency-name: "Newtonsoft.Json"
- package-ecosystem: "nuget"
directory: "/Eraware_Dnn_Spa_Ef_Di_Stencil/UnitTests"
schedule:
interval: "monthly"
ignore:
- dependency-name: "Newtonsoft.Json"
- package-ecosystem: "nuget"
directory: "/Eraware_Dnn_Spa_Ef_Di_Stencil/IntegrationTests"
schedule:
interval: "monthly"
ignore:
- dependency-name: "Newtonsoft.Json"
groups:
xunit:
patterns:
- "xunit*"
dnn:
patterns:
- "DotNetNuke*"
nswag:
patterns:
- "NSwag*"
coverlet:
patterns:
- "coverlet*"
49 changes: 49 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ------------------------------------------------------------------------------
# <auto-generated>
#
# This code was generated.
#
# - To turn off auto-generation set:
#
# [GitHubActions (AutoGenerate = false)]
#
# - To trigger manual generation invoke:
#
# nuke --generate-configuration GitHubActions_Build --host GitHubActions
#
# </auto-generated>
# ------------------------------------------------------------------------------

name: Build

on:
push:
branches:
- master
- develop
- 'release/*'
pull_request:
branches:
- master
- main
- develop
- development
- 'release/*'

jobs:
windows-latest:
name: windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Run: CI'
run: ./build.cmd CI
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish: artifacts'
uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts
116 changes: 116 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
"properties": {
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"enum": [
"Debug",
"Release"
]
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
},
"Plan": {
"type": "boolean",
"description": "Shows the execution plan (HTML)"
},
"Profile": {
"type": "array",
"description": "Defines the profiles to load",
"items": {
"type": "string"
}
},
"Root": {
"type": "string",
"description": "Root directory during build execution"
},
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"CI",
"Clean",
"Compile",
"Release",
"Restore",
"SetVsixVersion"
]
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"CI",
"Clean",
"Compile",
"Release",
"Restore",
"SetVsixVersion"
]
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
}
}
}
}
}
4 changes: 4 additions & 0 deletions .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "Eraware_Dnn_Templates.sln"
}
36 changes: 17 additions & 19 deletions Eraware_Dnn_Spa_Ef_Di_Stencil/Eraware_Dnn_Spa_Ef_Di_Stencil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<RuntimeIdentifier>win</RuntimeIdentifier>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
Expand Down Expand Up @@ -190,30 +191,29 @@
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="UnitTests\Services\Items\UpdateItemDtoValidatorTests.cs" />
<None Include="UnitTests\Services\Items\CreateItemDtoValidatorTests.cs" />
<None Include="module\Services\Items\UpdateItemDtoValidator.cs" />
<None Include="module\Services\Items\CreateItemDtoValidator.cs" />
<None Include="UnitTests\StartupTests.cs" />
<None Include="UnitTests\Providers\DateTimeProviderTests.cs" />
<None Include="module\Providers\IDateTimeProvider.cs" />
<None Include="module\Providers\DateTimeProvider.cs" />
<None Include="IntegrationTests\Startup.cs" />
<None Include="UnitTests\Startup.cs" />
<None Include="UnitTests\Common\Extensions\IQueryableExtensionsTests.cs" />
<None Include="module\ViewModels\LocalizationViewModel.cs" />
<None Include="module\Services\Localization\LocalizationViewModel.cs" />
<None Include="UnitTests\Controllers\LocalizationControllerTests.cs" />
<None Include="module\Services\LocalizationService.cs" />
<None Include="module\Services\ILocalizationService.cs" />
<None Include="module\Services\ILoggingService.cs" />
<None Include="module\Services\LoggingService.cs" />
<None Include="UnitTests\Controllers\ModuleExceptionFilterAttributeTests.cs" />
<None Include="UnitTests\Services\LoggingServiceTests.cs" />
<None Include="UnitTests\Controllers\ValidateModelAttributeTests.cs" />
<None Include="module\Services\Localization\LocalizationService.cs" />
<None Include="module\Services\Localization\ILocalizationService.cs" />
<None Include="UnitTests\Controllers\ServiceRouteMapperTests.cs" />
<None Include="UnitTests\Controllers\ModuleApiControllerTests.cs" />
<None Include="UnitTests\Controllers\ItemControllerTests.cs" />
<None Include="module\ViewModels\ItemsPageViewModel.cs" />
<None Include="module\ViewModels\ItemViewModel.cs" />
<None Include="UnitTests\Services\ItemServiceTests.cs" />
<None Include="module\Services\ItemService.cs" />
<None Include="module\Services\IItemService.cs" />
<None Include="module\Services\Items\ItemsPageViewModel.cs" />
<None Include="module\Services\Items\ItemViewModel.cs" />
<None Include="UnitTests\Services\Items\ItemServiceTests.cs" />
<None Include="module\Services\Items\ItemService.cs" />
<None Include="module\Services\Items\IItemService.cs" />
<None Include="UnitTests\Common\GlobalsTests.cs" />
<None Include="UnitTests\Data\Entities\ItemTests.cs" />
<None Include="UnitTests\Data\ModuleDbContextTests.cs" />
Expand All @@ -234,14 +234,12 @@
</Content>
<None Include="module\Data\Entities\BaseEntity.cs" />
<None Include="module\Data\Repositories\Repository.cs" />
<None Include="module\DTO\CreateItemDTO.cs" />
<None Include="module\Services\Items\CreateItemDTO.cs" />
<None Include="IntegrationTests\Controllers\ItemControllerTests.cs" />
<None Include="IntegrationTests\Controllers\ServiceRouteMapperTests.cs" />
<None Include="IntegrationTests\FakeDataContext.cs" />
<None Include="module\DTO\UpdateItemDTO.cs" />
<None Include="module\Controllers\ModuleExceptionFilterAttribute.cs" />
<None Include="module\Controllers\ValidateModelAttribute.cs" />
<None Include="module\DTO\GetItemsPageDTO.cs" />
<None Include="module\Services\Items\UpdateItemDTO.cs" />
<None Include="module\Services\Items\GetItemsPageDTO.cs" />
<None Include="module\Controllers\LocalizationController.cs" />
<None Include="module\Common\Extensions\IQueryableExtensions.cs" />
<None Include="module\Data\Repositories\PagedList{T}.cs" />
Expand All @@ -266,7 +264,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EntityFramework">
<Version>6.4.0</Version>
<Version>6.5.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion Eraware_Dnn_Spa_Ef_Di_Stencil/IntegrationTests/App.Config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</system.data>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="Effort.Provider"
type="Effort.Provider.EffortProviderServices, Effort" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using $ext_rootnamespace$.Controllers;
using $ext_rootnamespace$.Data.Entities;
using $ext_rootnamespace$.Data.Repositories;
using $ext_rootnamespace$.DTO;
using $ext_rootnamespace$.Providers;
using $ext_rootnamespace$.Services;
using $ext_rootnamespace$.ViewModels;
using $ext_rootnamespace$.Services.Items;
using $ext_rootnamespace$.Services.Localization;
using DotNetNuke.Entities.Users;
using Moq;
using FluentValidation;
using NSubstitute;
using System;
using System.Linq;
using System.Threading.Tasks;
Expand All @@ -17,18 +17,50 @@ namespace IntegrationTests.Controllers
{
public class ItemControllerTests : FakeDataContext
{
private readonly Mock<IDateTimeProvider> dateTimeProvider;
private readonly IDateTimeProvider dateTimeProvider;
private readonly IRepository<Item> itemRepository;
private readonly IItemService itemService;
private readonly IValidator<CreateItemDTO> createItemDtoValidator;
private readonly IValidator<UpdateItemDTO> updateItemDtoValidator;
private readonly ILocalizationService localizationService;
private readonly ItemController itemController;


public ItemControllerTests()
{
this.dateTimeProvider = new Mock<IDateTimeProvider>();
this.dateTimeProvider.Setup(p => p.GetUtcNow()).Returns(new DateTime(2022, 1, 1));
this.itemRepository = new Repository<Item>(this.dataContext, this.dateTimeProvider.Object);
this.itemService = new ItemService(this.itemRepository);
this.dateTimeProvider = Substitute.For<IDateTimeProvider>();
this.dateTimeProvider.GetUtcNow().Returns(new DateTime(2022, 1, 1));
this.itemRepository = new Repository<Item>(this.dataContext, this.dateTimeProvider);
this.localizationService = Substitute.For<ILocalizationService>();
var resx = new LocalizationViewModel
{
ModelValidation = new LocalizationViewModel.ModelValidationInfo
{
NameRequired = "Name is required.",
IdGreaterThanZero = "Id must be greater than zero.",
},
UI = new LocalizationViewModel.UIInfo
{
AddItem = "Add Item",
Cancel = "Cancel",
Create = "Create",
Delete = "Delete",
DeleteItemConfirm = "Are you sure you want to delete this item?",
Description = "Description",
Edit = "Edit",
LoadMore = "Load more",
Name = "Name",
No = "No",
Save = "Save",
Yes = "Yes",
SearchPlaceholder = "Search...",
ShownItems = "Shown items",
},
};
this.localizationService.ViewModel.Returns(resx);
this.createItemDtoValidator = new CreateItemDtoValidator(localizationService);
this.updateItemDtoValidator = new UpdateItemDtoValidator(localizationService);
this.itemService = new ItemService(this.itemRepository, this.createItemDtoValidator, this.updateItemDtoValidator);
this.itemController = new FakeItemController(this.itemService);
}

Expand Down
Loading

0 comments on commit eba4be5

Please sign in to comment.