Skip to content

Commit 13ab2ca

Browse files
lonesomegeeklonesomegeek
and
lonesomegeek
authored
Work/duge/92 (#144)
* before merging with default vanilla project * working version bug outdated * working version with ng8, ag-grid and netcore3.1 * adding database location and themes to aggrid * tests with wsl2 * adding new docker commands for wsl * adding babel to let ng build complete, bug documented here: angular/angular-cli#17262 * working version with vscode debugger * adding objects and shares controller * adding contact controller * remove item controller, new tables * working objects FE and BE * adding generic crud historical, missing generic service layer * adding release notes and breaking changes * merge conflict * rework classes * reverting items to normal crud * put back on track shares controller * adding contributor * all working endpoints without dto for now * working version of generic components * working with sub component * historical crud component ready, missing dynamic form * dynamic listing and form * adding showHistory * little cleanup * adding the other entities * before cleanup in crud components * refactoring in components * adding blog posts * move files * adding sample database project * adding contributor about page * almost done for the v1 of the UI * change naming of services in dto lib * putting in place de dto layers * Adding dependencies * converting to json * users with dto * blog post with DTO * update to existing tables * hooks online * Change log level * adding production setup for SQL * docker build image * remove trigger Co-authored-by: lonesomegeek <[email protected]>
1 parent 32244f1 commit 13ab2ca

File tree

136 files changed

+1391
-884
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1391
-884
lines changed

LSG.GenericCrud.Dto/Helpers/ServiceHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public static class ServiceHelpers
1414
/// <param name="services">The services.</param>
1515
public static void AddCrudDto(this IServiceCollection services)
1616
{
17-
services.AddScoped(typeof(CrudService<,,>));
18-
services.AddScoped(typeof(HistoricalCrudService<,,>));
17+
services.AddScoped(typeof(CrudServiceBase<,,>));
18+
services.AddScoped(typeof(HistoricalCrudServiceBase<,,>));
1919
}
2020
}
2121
}

LSG.GenericCrud.Dto/Services/CrudService.cs renamed to LSG.GenericCrud.Dto/Services/CrudServiceBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace LSG.GenericCrud.Dto.Services
9999
/// <typeparam name="TEntity">The type of the entity.</typeparam>
100100
/// <seealso cref="LSG.GenericCrud.Services.CrudService{TEntity}" />
101101
/// <seealso cref="LSG.GenericCrud.Services.ICrudService{TDto}" />
102-
public class CrudService<TId, TDto, TEntity> :
102+
public class CrudServiceBase<TId, TDto, TEntity> :
103103
ICrudService<TId, TDto>
104104
where TDto : IEntity<TId>
105105
where TEntity : class, IEntity<TId>, new()
@@ -119,7 +119,7 @@ public class CrudService<TId, TDto, TEntity> :
119119
/// <param name="service"></param>
120120
/// <param name="repository">The repository.</param>
121121
/// <param name="mapper">The mapper.</param>
122-
public CrudService(ICrudService<TId, TEntity> service, ICrudRepository repository, IMapper mapper)
122+
public CrudServiceBase(ICrudService<TId, TEntity> service, ICrudRepository repository, IMapper mapper)
123123
{
124124
_service = service;
125125
_mapper = mapper;

LSG.GenericCrud.Dto/Services/HistoricalCrudService.cs renamed to LSG.GenericCrud.Dto/Services/HistoricalCrudServiceBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace LSG.GenericCrud.Dto.Services
142142
/// <typeparam name="TEntity">The type of the entity.</typeparam>
143143
/// <seealso cref="LSG.GenericCrud.Services.HistoricalCrudService{TEntity}" />
144144
/// <seealso cref="LSG.GenericCrud.Services.IHistoricalCrudService{TDto}" />
145-
public class HistoricalCrudService<TId, TDto, TEntity> :
145+
public class HistoricalCrudServiceBase<TId, TDto, TEntity> :
146146
ICrudService<TId, TDto>,
147147
IHistoricalCrudService<TId, TDto>
148148
where TDto : class, IEntity<TId>, new()
@@ -154,7 +154,7 @@ public class HistoricalCrudService<TId, TDto, TEntity> :
154154
private readonly IUserInfoRepository _userInfoRepository;
155155
private readonly IHistoricalCrudReadService<TId, TEntity> _historicalCrudReadService;
156156

157-
public HistoricalCrudService(
157+
public HistoricalCrudServiceBase(
158158
IHistoricalCrudService<TId, TEntity> service,
159159
ICrudRepository repository,
160160
IUserInfoRepository userInfoRepository,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Operations Version="1.0" xmlns="http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02">
3+
<Operation Name="Rename Refactor" Key="68749241-141a-422a-949b-95feee7ff2d4" ChangeDateTime="04/19/2020 19:07:25">
4+
<Property Name="ElementName" Value="[dbo].[Items].[Name]" />
5+
<Property Name="ElementType" Value="SqlSimpleColumn" />
6+
<Property Name="ParentElementName" Value="[dbo].[Items]" />
7+
<Property Name="ParentElementType" Value="SqlTable" />
8+
<Property Name="NewName" Value="JsonMetadata" />
9+
</Operation>
10+
<Operation Name="Rename Refactor" Key="b7a15cc6-2f53-48fe-a8e3-350b1040a73c" ChangeDateTime="04/20/2020 17:38:47">
11+
<Property Name="ElementName" Value="[dbo].[Hooks].[Description]" />
12+
<Property Name="ElementType" Value="SqlSimpleColumn" />
13+
<Property Name="ParentElementName" Value="[dbo].[Hooks]" />
14+
<Property Name="ParentElementType" Value="SqlTable" />
15+
<Property Name="NewName" Value="URL" />
16+
</Operation>
17+
</Operations>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<Name>LSG.GenericCrud.Samples.Database</Name>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectVersion>4.1</ProjectVersion>
9+
<ProjectGuid>{f2b52a52-8ff2-44e6-8dd8-cf256aad0bf4}</ProjectGuid>
10+
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>
11+
<OutputType>Database</OutputType>
12+
<RootPath>
13+
</RootPath>
14+
<RootNamespace>LSG.GenericCrud.Samples.Database</RootNamespace>
15+
<AssemblyName>LSG.GenericCrud.Samples.Database</AssemblyName>
16+
<ModelCollation>1033, CI</ModelCollation>
17+
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
18+
<DeployToDatabase>True</DeployToDatabase>
19+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
20+
<TargetLanguage>CS</TargetLanguage>
21+
<AppDesignerFolder>Properties</AppDesignerFolder>
22+
<SqlServerVerification>False</SqlServerVerification>
23+
<IncludeCompositeObjects>True</IncludeCompositeObjects>
24+
<TargetDatabaseSet>True</TargetDatabaseSet>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<OutputPath>bin\Release\</OutputPath>
28+
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
29+
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<DefineDebug>false</DefineDebug>
33+
<DefineTrace>true</DefineTrace>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
38+
<OutputPath>bin\Debug\</OutputPath>
39+
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
40+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
41+
<DebugSymbols>true</DebugSymbols>
42+
<DebugType>full</DebugType>
43+
<Optimize>false</Optimize>
44+
<DefineDebug>true</DefineDebug>
45+
<DefineTrace>true</DefineTrace>
46+
<ErrorReport>prompt</ErrorReport>
47+
<WarningLevel>4</WarningLevel>
48+
</PropertyGroup>
49+
<PropertyGroup>
50+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
51+
<!-- Default to the v11.0 targets path if the targets file for the current VS version is not found -->
52+
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
53+
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
54+
</PropertyGroup>
55+
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
56+
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
57+
<ItemGroup>
58+
<Folder Include="Properties" />
59+
<Folder Include="Tables" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<Build Include="Tables\Items.sql" />
63+
<Build Include="Tables\Contacts.sql" />
64+
<Build Include="Tables\HistoricalChangesets.sql" />
65+
<Build Include="Tables\HistoricalEvents.sql" />
66+
<Build Include="Tables\Hooks.sql" />
67+
<Build Include="Tables\Shares.sql" />
68+
<Build Include="Tables\Users.sql" />
69+
<Build Include="Tables\Contributors.sql" />
70+
<Build Include="Tables\BlogPost.sql" />
71+
</ItemGroup>
72+
<ItemGroup>
73+
<None Include="LSG.GenericCrud.Samples.Database.publish.xml" />
74+
</ItemGroup>
75+
<ItemGroup>
76+
<RefactorLog Include="LSG.GenericCrud.Samples.Database.refactorlog" />
77+
</ItemGroup>
78+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CREATE TABLE [dbo].[BlogPosts]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[Title] [nvarchar](50) NULL,
5+
[Text] [nvarchar](max) NULL
6+
7+
-- constraints
8+
CONSTRAINT PK_BlogPost PRIMARY KEY (Id),
9+
[Hash] NVARCHAR(MAX) NULL
10+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE TABLE [dbo].[Contacts]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[Name] [nvarchar](50) NULL,
5+
[Phone] [nvarchar](50) NULL
6+
7+
-- constraints
8+
CONSTRAINT PK_Contacts PRIMARY KEY (Id)
9+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE TABLE [dbo].[Contributors]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[Name] [nvarchar](50) NULL,
5+
[GitHubRepository] [nvarchar](50) NULL
6+
7+
-- constraints
8+
CONSTRAINT PK_Contributors PRIMARY KEY (Id)
9+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE TABLE [dbo].[HistoricalChangesets]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL DEFAULT NEWID(),
4+
[EventId] [uniqueidentifier] NOT NULL,
5+
[ObjectData] [nvarchar](max) NULL,
6+
[ObjectDelta] [nvarchar](max) NULL,
7+
[CreatedDate] [datetime] NULL,
8+
[CreatedBy] [nvarchar](255) NULL,
9+
10+
-- constraints
11+
CONSTRAINT PK_HistoricalChangesets PRIMARY KEY (Id)
12+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE TABLE [dbo].[HistoricalEvents]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL DEFAULT NEWID(),
4+
[EntityId] [nvarchar](255) NOT NULL,
5+
[EntityName] [nvarchar](255) NOT NULL,
6+
[Action] [nvarchar](50) NOT NULL,
7+
[CreatedDate] [datetime] NULL,
8+
[CreatedBy] [nvarchar](255) NULL
9+
10+
-- constraints
11+
CONSTRAINT PK_HistoricalEvents PRIMARY KEY (Id)
12+
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CREATE TABLE [dbo].[Hooks]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[Name] [nvarchar](50) NULL,
5+
[URL] [nvarchar](max) NULL
6+
7+
-- constraints
8+
CONSTRAINT PK_Hooks PRIMARY KEY (Id),
9+
[EntityId] NVARCHAR(MAX) NULL,
10+
[EntityName] NVARCHAR(MAX) NULL
11+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE [dbo].[Items]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[JsonMetadata] [nvarchar](MAX) NULL
5+
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CREATE TABLE [dbo].[Shares]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[ContactId] [uniqueidentifier] NOT NULL,
5+
[ItemId] [uniqueidentifier] NOT NULL,
6+
[Description] [nvarchar](max) NULL,
7+
[SharingReminder] datetime2 NULL
8+
9+
-- constraints
10+
CONSTRAINT PK_Shares PRIMARY KEY (Id)
11+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE TABLE [dbo].[Users]
2+
(
3+
[Id] [uniqueidentifier] NOT NULL,
4+
[Name] [nvarchar](50) NULL
5+
6+
-- constraints
7+
CONSTRAINT PK_Users PRIMARY KEY (Id),
8+
[SomeSecretValue] NVARCHAR(MAX) NULL
9+
)

LSG.GenericCrud.Samples/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Databases

LSG.GenericCrud.Samples/ClientApp/angular.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
"node_modules/bootstrap/dist/css/bootstrap.min.css",
2626
"src/styles.css"
2727
],
28-
"scripts": []
28+
"scripts": [
29+
"node_modules/jquery/dist/jquery.min.js",
30+
"node_modules/bootstrap/dist/js/bootstrap.min.js"
31+
]
2932
},
3033
"configurations": {
3134
"production": {

LSG.GenericCrud.Samples/ClientApp/src/app/@crud/crud/crud.component.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

LSG.GenericCrud.Samples/ClientApp/src/app/@crud/crud/crud.component.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

LSG.GenericCrud.Samples/ClientApp/src/app/@crud/historical-crud/historical-crud/historical-crud.component.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

LSG.GenericCrud.Samples/ClientApp/src/app/@crud/historical-crud/historical-crud/historical-crud.component.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

LSG.GenericCrud.Samples/ClientApp/src/app/@crud/historical-crud/historical-detail/historical-detail.component.html

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)