From bf2491eaf7973d67b6f2510dbd5e96332cf74aab Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Wed, 15 Sep 2021 08:56:02 -0400 Subject: [PATCH 001/198] feat: add starting module --- StatCan.OrchardCore.sln | 47 ++++++++++++- .../StatCan.OrchardCore.Radar/Constants.cs | 10 +++ .../Controllers/HomeController.cs | 17 +++++ .../StatCan.OrchardCore.Radar/Manifest.cs | 66 +++++++++++++++++++ src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 26 ++++++++ .../StatCan.OrchardCore.Radar.csproj | 20 ++++++ .../Views/Home/Index.cshtml | 1 + ...Can.OrchardCore.Application.Targets.csproj | 1 + 8 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Constants.cs create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Controllers/HomeController.cs create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Manifest.cs create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Startup.cs create mode 100644 src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml diff --git a/StatCan.OrchardCore.sln b/StatCan.OrchardCore.sln index 4081461c1..20deb1875 100644 --- a/StatCan.OrchardCore.sln +++ b/StatCan.OrchardCore.sln @@ -94,7 +94,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Apps", "Apps", "{E8DD6EC8-A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatCan.OrchardCore.Scheduling", "src\Apps\StatCan.OrchardCore.Scheduling\StatCan.OrchardCore.Scheduling.csproj", "{56F32388-650F-433C-919F-8C265F99411D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatCan.OrchardCore.Configuration", "src\Modules\StatCan.OrchardCore.Configuration\StatCan.OrchardCore.Configuration.csproj", "{DEA6A849-3230-43DE-A9A0-3C22DA8E316E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatCan.OrchardCore.Configuration", "src\Modules\StatCan.OrchardCore.Configuration\StatCan.OrchardCore.Configuration.csproj", "{DEA6A849-3230-43DE-A9A0-3C22DA8E316E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatCan.OrchardCore.Vuetify", "src\Modules\StatCan.OrchardCore.Vuetify\StatCan.OrchardCore.Vuetify.csproj", "{2383A37A-3D99-4060-B147-F4EB81FA826D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatCan.OrchardCore.Menu", "src\Modules\StatCan.OrchardCore.Menu\StatCan.OrchardCore.Menu.csproj", "{DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatCan.OrchardCore.Radar", "src\Apps\StatCan.OrchardCore.Radar\StatCan.OrchardCore.Radar.csproj", "{B94484A0-D043-4D37-AE5C-82B729D56CA3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -466,6 +472,42 @@ Global {DEA6A849-3230-43DE-A9A0-3C22DA8E316E}.Release|x64.Build.0 = Release|Any CPU {DEA6A849-3230-43DE-A9A0-3C22DA8E316E}.Release|x86.ActiveCfg = Release|Any CPU {DEA6A849-3230-43DE-A9A0-3C22DA8E316E}.Release|x86.Build.0 = Release|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Debug|x64.ActiveCfg = Debug|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Debug|x64.Build.0 = Debug|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Debug|x86.ActiveCfg = Debug|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Debug|x86.Build.0 = Debug|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Release|Any CPU.Build.0 = Release|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Release|x64.ActiveCfg = Release|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Release|x64.Build.0 = Release|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Release|x86.ActiveCfg = Release|Any CPU + {2383A37A-3D99-4060-B147-F4EB81FA826D}.Release|x86.Build.0 = Release|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Debug|x64.ActiveCfg = Debug|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Debug|x64.Build.0 = Debug|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Debug|x86.ActiveCfg = Debug|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Debug|x86.Build.0 = Debug|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Release|Any CPU.Build.0 = Release|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Release|x64.ActiveCfg = Release|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Release|x64.Build.0 = Release|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Release|x86.ActiveCfg = Release|Any CPU + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB}.Release|x86.Build.0 = Release|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Debug|x64.ActiveCfg = Debug|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Debug|x64.Build.0 = Debug|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Debug|x86.ActiveCfg = Debug|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Debug|x86.Build.0 = Debug|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Release|Any CPU.Build.0 = Release|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Release|x64.ActiveCfg = Release|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Release|x64.Build.0 = Release|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Release|x86.ActiveCfg = Release|Any CPU + {B94484A0-D043-4D37-AE5C-82B729D56CA3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -506,6 +548,9 @@ Global {E8DD6EC8-AA09-440F-937A-1901293389E1} = {8EA5EBF0-41C6-11EA-890A-ED68CBADDC1F} {56F32388-650F-433C-919F-8C265F99411D} = {E8DD6EC8-AA09-440F-937A-1901293389E1} {DEA6A849-3230-43DE-A9A0-3C22DA8E316E} = {5E638520-41E8-11EA-885A-BDD3BB7B4F92} + {2383A37A-3D99-4060-B147-F4EB81FA826D} = {8BEC45F6-4F23-4994-9959-50C1DB93ABC3} + {DDD0D2BF-B04E-42F1-ABCC-A5D3290692FB} = {8BEC45F6-4F23-4994-9959-50C1DB93ABC3} + {B94484A0-D043-4D37-AE5C-82B729D56CA3} = {E8DD6EC8-AA09-440F-937A-1901293389E1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {8FF197F3-C3E2-4D83-80AC-D59BE36DD4AF} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs new file mode 100644 index 000000000..b49e38bb2 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs @@ -0,0 +1,10 @@ +namespace StatCan.OrchardCore.Radar +{ + public static class Constants + { + public static class Features + { + public const string Radar = "StatCan.OrchardCore.Radar"; + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Controllers/HomeController.cs b/src/Apps/StatCan.OrchardCore.Radar/Controllers/HomeController.cs new file mode 100644 index 000000000..a5ba67aec --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Controllers/HomeController.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace StatCan.OrchardCore.Radar.Controllers +{ + public class HomeController : Controller + { + public ActionResult Index() + { + return View(); + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs b/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs new file mode 100644 index 000000000..ff5da6ae9 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs @@ -0,0 +1,66 @@ +using OrchardCore.Modules.Manifest; +using StatCan.OrchardCore.Radar; +using static StatCan.OrchardCore.Manifest.StatCanManifestConstants; + +[assembly: Module( + Name = "Digital Radar", + Author = DigitalInnovationTeam, + Website = DigitalInnovationWebsite, + Version = Version, + Description = "The Digital Radar platform", + Category = "Applications" +)] + +[assembly: Feature( + Id = Constants.Features.Radar, + Name = "Radar", + Description = "The Digital Radar Application", + Category = "Applications", + Dependencies = new [] + { + // SaaS + "OrchardCore.HomeRoute", + "OrchardCore.Admin", + "OrchardCore.Diagnostics", + "OrchardCore.DynamicCache", + "OrchardCore.Features", + "OrchardCore.Navigation", + "OrchardCore.Recipes", + "OrchardCore.Resources", + "OrchardCore.Roles", + "OrchardCore.Settings", + "OrchardCore.Themes", + "OrchardCore.Users", + + // CMS + "OrchardCore.Alias", + "OrchardCore.AdminMenu", + "OrchardCore.Autoroute", + "OrchardCore.Html", + "OrchardCore.ContentFields", + "OrchardCore.ContentPreview", + "OrchardCore.Contents", + "OrchardCore.Contents.FileContentDefinition", + "OrchardCore.ContentTypes", + "OrchardCore.CustomSettings", + "OrchardCore.Deployment", + "OrchardCore.Deployment.Remote", + "OrchardCore.Feeds", + "OrchardCore.Flows", + "OrchardCore.Indexing", + "OrchardCore.Layers", + "OrchardCore.Lucene", + "OrchardCore.Lists", + "OrchardCore.Markdown", + "OrchardCore.Media", + "OrchardCore.Menu", + "OrchardCore.Placements", + "OrchardCore.Queries", + "OrchardCore.Shortcodes.Templates", + "OrchardCore.Rules", + "OrchardCore.Taxonomies", + "OrchardCore.Title", + "OrchardCore.Templates", + "OrchardCore.Widgets", + } +)] diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs new file mode 100644 index 000000000..b9e621d66 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -0,0 +1,26 @@ +using System; +using Fluid; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; +using OrchardCore.Modules; + +namespace StatCan.OrchardCore.Radar +{ + public class Startup : StartupBase + { + public override void ConfigureServices(IServiceCollection services) + { + } + + public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) + { + routes.MapAreaControllerRoute( + name: "Home", + areaName: "StatCan.OrchardCore.Radar", + pattern: "Home/Index", + defaults: new { controller = "Home", action = "Index" } + ); + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj new file mode 100644 index 000000000..4eb94323f --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj @@ -0,0 +1,20 @@ + + + + $(AspNetCoreTargetFramework) + true + ..\..\..\roslynator.ruleset + + + + + + + + + + + + + + diff --git a/src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml b/src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml new file mode 100644 index 000000000..a1ab916e5 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml @@ -0,0 +1 @@ +Template \ No newline at end of file diff --git a/src/Lib/StatCan.OrchardCore.Application.Targets/StatCan.OrchardCore.Application.Targets.csproj b/src/Lib/StatCan.OrchardCore.Application.Targets/StatCan.OrchardCore.Application.Targets.csproj index d054430f8..6584eca49 100644 --- a/src/Lib/StatCan.OrchardCore.Application.Targets/StatCan.OrchardCore.Application.Targets.csproj +++ b/src/Lib/StatCan.OrchardCore.Application.Targets/StatCan.OrchardCore.Application.Targets.csproj @@ -31,6 +31,7 @@ + From d7d836d8a4664b96a80225caa9766b45f3b49062 Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Wed, 15 Sep 2021 12:44:43 -0400 Subject: [PATCH 002/198] feat: add radar entity migration --- .../StatCan.OrchardCore.Radar/Manifest.cs | 43 +- .../StatCan.OrchardCore.Radar/Migrations.cs | 23 + .../Migrations/radar.recipe.json | 1138 +++++++++++++++++ src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 3 +- 4 files changed, 1166 insertions(+), 41 deletions(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations.cs create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json diff --git a/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs b/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs index ff5da6ae9..e5db7f50e 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs @@ -16,51 +16,14 @@ Name = "Radar", Description = "The Digital Radar Application", Category = "Applications", - Dependencies = new [] + Dependencies = new[] { - // SaaS - "OrchardCore.HomeRoute", - "OrchardCore.Admin", - "OrchardCore.Diagnostics", - "OrchardCore.DynamicCache", - "OrchardCore.Features", - "OrchardCore.Navigation", - "OrchardCore.Recipes", - "OrchardCore.Resources", - "OrchardCore.Roles", - "OrchardCore.Settings", - "OrchardCore.Themes", - "OrchardCore.Users", - - // CMS - "OrchardCore.Alias", - "OrchardCore.AdminMenu", "OrchardCore.Autoroute", - "OrchardCore.Html", - "OrchardCore.ContentFields", - "OrchardCore.ContentPreview", "OrchardCore.Contents", - "OrchardCore.Contents.FileContentDefinition", - "OrchardCore.ContentTypes", - "OrchardCore.CustomSettings", - "OrchardCore.Deployment", - "OrchardCore.Deployment.Remote", - "OrchardCore.Feeds", + "OrchardCore.ContentFields", "OrchardCore.Flows", - "OrchardCore.Indexing", - "OrchardCore.Layers", - "OrchardCore.Lucene", - "OrchardCore.Lists", - "OrchardCore.Markdown", - "OrchardCore.Media", - "OrchardCore.Menu", - "OrchardCore.Placements", - "OrchardCore.Queries", - "OrchardCore.Shortcodes.Templates", - "OrchardCore.Rules", "OrchardCore.Taxonomies", "OrchardCore.Title", - "OrchardCore.Templates", - "OrchardCore.Widgets", + "StatCan.OrchardCore.ContentPermissions", } )] diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs new file mode 100644 index 000000000..79970c485 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using OrchardCore.Data.Migration; +using OrchardCore.Recipes.Services; + +namespace StatCan.OrchardCore.Radar +{ + public class Migrations: DataMigration + { + private readonly IRecipeMigrator _recipeMigrator; + + public Migrations(IRecipeMigrator recipeMigrator) + { + _recipeMigrator = recipeMigrator; + } + + public async Task CreateAsync() + { + await _recipeMigrator.ExecuteAsync("radar.recipe.json", this); + + return 1; + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json new file mode 100644 index 000000000..427a0c62a --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json @@ -0,0 +1,1138 @@ +{ + "steps": [ + { + "name": "ContentDefinition", + "ContentTypes": [ + { + "Name": "Topic", + "DisplayName": "Topic", + "Settings": { + "ContentTypeSettings": { + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "Topic", + "Name": "Topic", + "Settings": { + "ContentTypePartSettings": { + "Position": "2" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 1, + "Pattern": "{{ ContentItem.Content.Topic.Name.Text }}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "Proposal", + "DisplayName": "Proposal", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "Proposal", + "Name": "Proposal", + "Settings": { + "ContentTypePartSettings": { + "Position": "2" + } + } + }, + { + "PartName": "RadarEntity", + "Name": "RadarEntity", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.RadarEntityPart.Name.Text }}" + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "ContentPermissionsPart", + "Name": "ContentPermissionsPart", + "Settings": { + "ContentTypePartSettings": { + "Position": "3" + } + } + }, + { + "PartName": "BagPart", + "Name": "Workspace", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "Workspace", + "Description": "Add an Artifact to your workspace of this proposal", + "Position": "4" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "Artifact" + ] + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "ProjectType", + "DisplayName": "ProjectType", + "Settings": { + "ContentTypeSettings": { + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "ProjectType", + "Name": "ProjectType", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.ProjectType.Name.Text }}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "ProposalType", + "DisplayName": "ProposalType", + "Settings": { + "ContentTypeSettings": { + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "ProposalType", + "Name": "ProposalType", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.ProposalType.Name.Text }}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "CommunityType", + "DisplayName": "CommunityType", + "Settings": { + "ContentTypeSettings": { + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "CommunityType", + "Name": "CommunityType", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.CommunityType.Name.Text }}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "Artifact", + "DisplayName": "Artifact", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "Artifact", + "Name": "Artifact", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + } + } + } + ] + }, + { + "Name": "Event", + "DisplayName": "Event", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "Event", + "Name": "Event", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "ContentPermissionsPart", + "Name": "ContentPermissionsPart", + "Settings": { + "ContentTypePartSettings": { + "Position": "5" + } + } + }, + { + "PartName": "RadarEntity", + "Name": "RadarEntity", + "Settings": { + "ContentTypePartSettings": { + "Position": "2" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.RadarEntityPart.Name.Text }}" + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "BagPart", + "Name": "EventOrganizer", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "EventOrganizer", + "Description": "Event Organizer", + "Position": "3" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "EventOrganizer" + ] + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "BagPart", + "Name": "Workspace", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "Workspace", + "Description": "Add an Artifact to your workspace of this event", + "Position": "4" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "Artifact" + ] + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "EventOrganizer", + "DisplayName": "EventOrganizer", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "EventOrganizer", + "Name": "EventOrganizer", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 1, + "Pattern": "{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %}\r\n{% for user in users %}\r\n {{ user.UserName }} - {{ user.Email }}\r\n{% endfor %}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "CommunityMember", + "DisplayName": "CommunityMember", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "CommunityMember", + "Name": "CommunityMember", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 1, + "Pattern": "{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %}\r\n{% for user in users %}\r\n {{ user.UserName }} - {{ user.Email }}\r\n{% endfor %}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "Community", + "DisplayName": "Community", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "Community", + "Name": "Community", + "Settings": { + "ContentTypePartSettings": { + "Position": "4" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "RadarEntity", + "Name": "RadarEntity", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "ContentPermissionsPart", + "Name": "ContentPermissionsPart", + "Settings": { + "ContentTypePartSettings": { + "Position": "5" + } + } + }, + { + "PartName": "BagPart", + "Name": "Workspace", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "Workspace", + "Description": "Add an Artifact to your workspace of this community", + "Position": "2" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "Artifact" + ] + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "BagPart", + "Name": "CommunityMember", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "Community Member", + "Description": "Add a member to this community", + "Position": "3" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "CommunityMember" + ] + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "ProjectMember", + "DisplayName": "ProjectMember", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "ProjectMember", + "Name": "ProjectMember", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 1, + "Pattern": "{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %}\r\n{% for user in users %}\r\n {{ user.UserName }} - {{ user.Email }}\r\n{% endfor %}" + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "Project", + "DisplayName": "Project", + "Settings": { + "ContentTypeSettings": { + "Creatable": true, + "Listable": true, + "Draftable": true, + "Versionable": true, + "Securable": true + }, + "FullTextAspectSettings": {} + }, + "ContentTypePartDefinitionRecords": [ + { + "PartName": "Project", + "Name": "Project", + "Settings": { + "ContentTypePartSettings": { + "Position": "4" + } + } + }, + { + "PartName": "RadarEntity", + "Name": "RadarEntity", + "Settings": { + "ContentTypePartSettings": { + "Position": "1" + } + } + }, + { + "PartName": "TitlePart", + "Name": "TitlePart", + "Settings": { + "ContentTypePartSettings": { + "Position": "0" + }, + "TitlePartSettings": { + "Options": 2, + "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "ContentPermissionsPart", + "Name": "ContentPermissionsPart", + "Settings": { + "ContentTypePartSettings": { + "Position": "5" + } + } + }, + { + "PartName": "BagPart", + "Name": "Workspace", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "Workspace", + "Description": "Add an Artifact to your workspace of this project", + "Position": "2" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "Artifact" + ] + }, + "ContentIndexSettings": {} + } + }, + { + "PartName": "BagPart", + "Name": "ProjectMember", + "Settings": { + "ContentTypePartSettings": { + "DisplayName": "Project Member", + "Description": "Add a member to this project", + "Position": "3" + }, + "BagPartSettings": { + "ContainedContentTypes": [ + "ProjectMember" + ] + }, + "ContentIndexSettings": {} + } + } + ] + } + ], + "ContentParts": [ + { + "Name": "RadarEntity", + "Settings": { + "ContentPartSettings": { + "Attachable": true + } + }, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TextField", + "Name": "Name", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Name", + "Position": "0" + } + } + }, + { + "FieldName": "TextField", + "Name": "Description", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Description", + "Position": "1" + } + } + }, + { + "FieldName": "ContentPickerField", + "Name": "RelatedEntity", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Related Entity", + "Position": "3" + }, + "ContentPickerFieldSettings": { + "Multiple": true, + "DisplayedContentTypes": [ + "Proposal" + ] + }, + "ContentIndexSettings": {} + } + }, + { + "FieldName": "TaxonomyField", + "Name": "Topics", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Topics", + "Editor": "Tags", + "DisplayMode": "Tags", + "Position": "2" + }, + "ContentIndexSettings": {}, + "TaxonomyFieldSettings": { + "TaxonomyContentItemId": "43p29bmfpe85a319g7t98waa40", + "Unique": true + }, + "TaxonomyFieldTagsEditorSettings": { + "Open": false + } + } + } + ] + }, + { + "Name": "Topic", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TextField", + "Name": "Name", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Name" + } + } + }, + { + "FieldName": "TextField", + "Name": "Description", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Description" + } + } + } + ] + }, + { + "Name": "Proposal", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TaxonomyField", + "Name": "Type", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Type", + "Editor": "Tags", + "DisplayMode": "Tags", + "Position": "0" + }, + "ContentIndexSettings": {}, + "TaxonomyFieldSettings": { + "Required": true, + "TaxonomyContentItemId": "4fn9mss5kdqfmy0b7qwbnneb5s", + "Unique": true + }, + "TaxonomyFieldTagsEditorSettings": { + "Open": false + } + } + } + ] + }, + { + "Name": "ProjectType", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TextField", + "Name": "Name", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Name", + "Position": "0" + } + } + }, + { + "FieldName": "TextField", + "Name": "Description", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Description", + "Position": "1" + } + } + } + ] + }, + { + "Name": "ProposalType", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TextField", + "Name": "Name", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Name", + "Position": "0" + } + } + }, + { + "FieldName": "TextField", + "Name": "Description", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Description", + "Position": "1" + } + } + } + ] + }, + { + "Name": "CommunityType", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TextField", + "Name": "Name", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Name", + "Position": "0" + } + } + }, + { + "FieldName": "TextField", + "Name": "Description", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Description", + "Position": "1" + } + } + } + ] + }, + { + "Name": "Event", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "UserPickerField", + "Name": "Attendees", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Attendees", + "Position": "0" + } + } + }, + { + "FieldName": "DateTimeField", + "Name": "StartDate", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Start Date", + "Position": "1" + } + } + }, + { + "FieldName": "DateTimeField", + "Name": "EndDate", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "End Date", + "Position": "2" + } + } + } + ] + }, + { + "Name": "EventOrganizer", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "UserPickerField", + "Name": "Organizer", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Organizer", + "Position": "0" + }, + "UserPickerFieldSettings": { + "Required": true, + "DisplayAllUsers": true, + "DisplayedRoles": [] + }, + "ContentIndexSettings": {} + } + }, + { + "FieldName": "TextField", + "Name": "Role", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Role", + "Position": "1" + } + } + } + ] + }, + { + "Name": "CommunityMember", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "UserPickerField", + "Name": "Member", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Member", + "Position": "0" + }, + "UserPickerFieldSettings": { + "Required": true, + "DisplayAllUsers": true, + "DisplayedRoles": [] + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "Community", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TaxonomyField", + "Name": "Type", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Type", + "Position": "0" + }, + "ContentIndexSettings": {}, + "TaxonomyFieldSettings": { + "Required": true, + "TaxonomyContentItemId": "4be7bdq6y7k9f1wpf1q6h8kwd9", + "Unique": true + } + } + } + ] + }, + { + "Name": "ProjectMember", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "UserPickerField", + "Name": "Member", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Member", + "Position": "0" + }, + "UserPickerFieldSettings": { + "Required": true, + "DisplayAllUsers": true, + "DisplayedRoles": [] + }, + "ContentIndexSettings": {} + } + } + ] + }, + { + "Name": "Project", + "Settings": {}, + "ContentPartFieldDefinitionRecords": [ + { + "FieldName": "TaxonomyField", + "Name": "Type", + "Settings": { + "ContentPartFieldSettings": { + "DisplayName": "Type", + "Position": "0" + }, + "ContentIndexSettings": {}, + "TaxonomyFieldSettings": { + "Required": true, + "TaxonomyContentItemId": "4fg74m81qafx3zp342n8csj2wm", + "Unique": true + } + } + } + ] + } + ] + }, + { + "name": "content", + "data": [ + { + "ContentItemId": "43p29bmfpe85a319g7t98waa40", + "ContentItemVersionId": "496gng475pa3r2s6w4v724zjxz", + "ContentType": "Taxonomy", + "DisplayText": "Topics", + "Latest": true, + "Published": true, + "ModifiedUtc": "2021-09-15T13:22:03.8522685Z", + "PublishedUtc": "2021-09-15T13:22:03.8580812Z", + "CreatedUtc": "2021-09-15T13:22:03.8522685Z", + "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", + "Author": "admin", + "TitlePart": { + "Title": "Topics" + }, + "AliasPart": { + "Alias": "topics" + }, + "AutoroutePart": { + "Path": "topics", + "SetHomepage": false, + "Disabled": false, + "RouteContainedItems": false, + "Absolute": false + }, + "TaxonomyPart": { + "TermContentType": "Topic", + "Terms": [] + } + }, + { + "ContentItemId": "4fg74m81qafx3zp342n8csj2wm", + "ContentItemVersionId": "47q1vnrggydfj7ah65mqahj5cn", + "ContentType": "Taxonomy", + "DisplayText": "ProjectType", + "Latest": true, + "Published": true, + "ModifiedUtc": "2021-09-15T13:42:45.0701723Z", + "PublishedUtc": "2021-09-15T13:42:45.0777122Z", + "CreatedUtc": "2021-09-15T13:42:45.0701723Z", + "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", + "Author": "admin", + "TitlePart": { + "Title": "ProjectType" + }, + "AliasPart": { + "Alias": "projecttype" + }, + "AutoroutePart": { + "Path": "projecttype", + "SetHomepage": false, + "Disabled": false, + "RouteContainedItems": false, + "Absolute": false + }, + "TaxonomyPart": { + "TermContentType": "ProjectType", + "Terms": [] + } + }, + { + "ContentItemId": "4fn9mss5kdqfmy0b7qwbnneb5s", + "ContentItemVersionId": "4k50x7trga6cn4rpsmwsc92qmx", + "ContentType": "Taxonomy", + "DisplayText": "ProposalType", + "Latest": true, + "Published": true, + "ModifiedUtc": "2021-09-15T13:46:00.5646917Z", + "PublishedUtc": "2021-09-15T13:46:00.5693251Z", + "CreatedUtc": "2021-09-15T13:46:00.5646917Z", + "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", + "Author": "admin", + "TitlePart": { + "Title": "ProposalType" + }, + "AliasPart": { + "Alias": "proposaltype" + }, + "AutoroutePart": { + "Path": "proposaltype", + "SetHomepage": false, + "Disabled": false, + "RouteContainedItems": false, + "Absolute": false + }, + "TaxonomyPart": { + "TermContentType": "ProposalType", + "Terms": [] + } + }, + { + "ContentItemId": "4be7bdq6y7k9f1wpf1q6h8kwd9", + "ContentItemVersionId": "44gxhx8fymzh54vvf64nnwma4a", + "ContentType": "Taxonomy", + "DisplayText": "CommunityType", + "Latest": true, + "Published": true, + "ModifiedUtc": "2021-09-15T14:45:27.1221385Z", + "PublishedUtc": "2021-09-15T14:45:27.1263705Z", + "CreatedUtc": "2021-09-15T14:45:27.1221385Z", + "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", + "Author": "admin", + "TitlePart": { + "Title": "CommunityType" + }, + "AliasPart": { + "Alias": "communitytype" + }, + "AutoroutePart": { + "Path": "communitytype", + "SetHomepage": false, + "Disabled": false, + "RouteContainedItems": false, + "Absolute": false + }, + "TaxonomyPart": { + "TermContentType": "CommunityType", + "Terms": [] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index b9e621d66..5a0dfdc22 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -1,9 +1,9 @@ using System; -using Fluid; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using OrchardCore.Modules; +using OrchardCore.Data.Migration; namespace StatCan.OrchardCore.Radar { @@ -11,6 +11,7 @@ public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { + services.AddScoped(); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) From 211276a649201372addf1e01d80ad2a5bfdad863 Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Wed, 15 Sep 2021 13:09:19 -0400 Subject: [PATCH 003/198] fix: title part --- .../Migrations/radar.recipe.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json index 427a0c62a..301eb6b82 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json @@ -82,7 +82,7 @@ }, "TitlePartSettings": { "Options": 2, - "Pattern": "{{ ContentItem.Content.RadarEntityPart.Name.Text }}" + "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" }, "ContentIndexSettings": {} } @@ -313,7 +313,7 @@ }, "TitlePartSettings": { "Options": 2, - "Pattern": "{{ ContentItem.Content.RadarEntityPart.Name.Text }}" + "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" }, "ContentIndexSettings": {} } @@ -1046,7 +1046,7 @@ "ContentItemId": "4fg74m81qafx3zp342n8csj2wm", "ContentItemVersionId": "47q1vnrggydfj7ah65mqahj5cn", "ContentType": "Taxonomy", - "DisplayText": "ProjectType", + "DisplayText": "Project Type", "Latest": true, "Published": true, "ModifiedUtc": "2021-09-15T13:42:45.0701723Z", @@ -1055,7 +1055,7 @@ "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", "Author": "admin", "TitlePart": { - "Title": "ProjectType" + "Title": "Project Type" }, "AliasPart": { "Alias": "projecttype" @@ -1076,7 +1076,7 @@ "ContentItemId": "4fn9mss5kdqfmy0b7qwbnneb5s", "ContentItemVersionId": "4k50x7trga6cn4rpsmwsc92qmx", "ContentType": "Taxonomy", - "DisplayText": "ProposalType", + "DisplayText": "Proposal Type", "Latest": true, "Published": true, "ModifiedUtc": "2021-09-15T13:46:00.5646917Z", @@ -1085,7 +1085,7 @@ "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", "Author": "admin", "TitlePart": { - "Title": "ProposalType" + "Title": "Proposal Type" }, "AliasPart": { "Alias": "proposaltype" @@ -1106,7 +1106,7 @@ "ContentItemId": "4be7bdq6y7k9f1wpf1q6h8kwd9", "ContentItemVersionId": "44gxhx8fymzh54vvf64nnwma4a", "ContentType": "Taxonomy", - "DisplayText": "CommunityType", + "DisplayText": "Community Type", "Latest": true, "Published": true, "ModifiedUtc": "2021-09-15T14:45:27.1221385Z", @@ -1115,7 +1115,7 @@ "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", "Author": "admin", "TitlePart": { - "Title": "CommunityType" + "Title": "Community Type" }, "AliasPart": { "Alias": "communitytype" From 5a19dc1116ec21e43a0a770f7fab925123d2200d Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Wed, 15 Sep 2021 15:32:40 -0400 Subject: [PATCH 004/198] feat: add taxonomy code migration --- .../StatCan.OrchardCore.Radar/Constants.cs | 9 + .../StatCan.OrchardCore.Radar/Migrations.cs | 23 -- .../Migrations/TaxonomyMigrations.cs | 233 ++++++++++++++++++ src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 3 +- .../StatCan.OrchardCore.Radar.csproj | 6 + 5 files changed, 250 insertions(+), 24 deletions(-) delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations.cs create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs diff --git a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs index b49e38bb2..301266827 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs @@ -6,5 +6,14 @@ public static class Features { public const string Radar = "StatCan.OrchardCore.Radar"; } + + public static class ContentTypes + { + // Taxonomies + public const string Topic = "Topic"; + public const string ProposalType = "ProposalType"; + public const string ProjectType = "ProjectType"; + public const string CommunityType = "CommunityType"; + } } } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs deleted file mode 100644 index 79970c485..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Threading.Tasks; -using OrchardCore.Data.Migration; -using OrchardCore.Recipes.Services; - -namespace StatCan.OrchardCore.Radar -{ - public class Migrations: DataMigration - { - private readonly IRecipeMigrator _recipeMigrator; - - public Migrations(IRecipeMigrator recipeMigrator) - { - _recipeMigrator = recipeMigrator; - } - - public async Task CreateAsync() - { - await _recipeMigrator.ExecuteAsync("radar.recipe.json", this); - - return 1; - } - } -} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs new file mode 100644 index 000000000..b723f9b62 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs @@ -0,0 +1,233 @@ +using System.Threading.Tasks; + +using OrchardCore.ContentManagement; +using OrchardCore.ContentManagement.Metadata; +using OrchardCore.ContentManagement.Metadata.Settings; +using OrchardCore.Data.Migration; +using OrchardCore.Title.Models; +using OrchardCore.Taxonomies.Models; + +namespace StatCan.OrchardCore.Radar.Migrations +{ + public class TaxonomyMigrations : DataMigration + { + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IContentManager _contentManager; + + public TaxonomyMigrations(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) + { + _contentDefinitionManager = contentDefinitionManager; + _contentManager = contentManager; + } + + public async Task CreateAsync() + { + Topic(); + ProposalType(); + ProjectType(); + CommunityType(); + + await CreateTopicsTaxonomy(); + await CreateProposalTypesTaxonomy(); + await CreateProjectTypesTaxonomy(); + await CreateCommunityTypesTaxonoy(); + + return 1; + } + + private void Topic() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Topic, type => type + .DisplayedAs("Topic") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("Topic", part => part + .WithPosition("2") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.Topic.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Topic, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + ) + ); + } + + private void ProposalType() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.ProposalType, type => type + .DisplayedAs("Proposal Type") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("ProposalType", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.ProposalType.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.ProposalType, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + } + + private void ProjectType() + { + _contentDefinitionManager.AlterTypeDefinition("ProjectType", type => type + .DisplayedAs("Project Type") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("ProjectType", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.ProjectType.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition("ProjectType", part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + } + + private void CommunityType() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.CommunityType, type => type + .DisplayedAs("Community Type") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("CommunityType", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.CommunityType.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.CommunityType, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + + } + + private async Task CreateTopicsTaxonomy() + { + var topics = await _contentManager.NewAsync("Taxonomy"); + + topics.DisplayText = "Topics"; // Instead of TitlePart.Title + topics.Alter(part => + { + part.TermContentType = Constants.ContentTypes.Topic; + }); + + await _contentManager.CreateAsync(topics, VersionOptions.Published); + await _contentManager.PublishAsync(topics); + } + + private async Task CreateProposalTypesTaxonomy() + { + var proposalTypes = await _contentManager.NewAsync("Taxonomy"); + + proposalTypes.DisplayText = "Proposal Types"; // Instead of TitlePart.Title + proposalTypes.Alter(part => + { + part.TermContentType = Constants.ContentTypes.ProposalType; + }); + + await _contentManager.CreateAsync(proposalTypes, VersionOptions.Published); + await _contentManager.PublishAsync(proposalTypes); + } + + private async Task CreateProjectTypesTaxonomy() + { + var projectTypes = await _contentManager.NewAsync("Taxonomy"); + + projectTypes.DisplayText = "Project Types"; // Instead of TitlePart.Title + projectTypes.Alter(part => + { + part.TermContentType = Constants.ContentTypes.ProjectType; + }); + + await _contentManager.CreateAsync(projectTypes, VersionOptions.Published); + await _contentManager.PublishAsync(projectTypes); + } + + private async Task CreateCommunityTypesTaxonoy() + { + var communityTypes = await _contentManager.NewAsync("Taxonomy"); + + communityTypes.DisplayText = "Communities Types"; // Instead of TitlePart.Title + communityTypes.Alter(part => + { + part.TermContentType = Constants.ContentTypes.CommunityType; + }); + + await _contentManager.CreateAsync(communityTypes, VersionOptions.Published); + await _contentManager.PublishAsync(communityTypes); + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index 5a0dfdc22..9ceff0c9b 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using OrchardCore.Modules; using OrchardCore.Data.Migration; +using StatCan.OrchardCore.Radar.Migrations; namespace StatCan.OrchardCore.Radar { @@ -11,7 +12,7 @@ public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddScoped(); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) diff --git a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj index 4eb94323f..2a5dc4ae5 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj +++ b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj @@ -13,6 +13,12 @@ + + + + + + From db1f570b22e70837d9266311ecd51d541bf284cc Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:02:25 -0400 Subject: [PATCH 005/198] feat: add artifact code migration --- .../StatCan.OrchardCore.Radar/Constants.cs | 3 ++ .../Migrations/ArtifactMigration.cs | 41 +++++++++++++++++++ src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 1 + 3 files changed, 45 insertions(+) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs diff --git a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs index 301266827..4fb440e17 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs @@ -14,6 +14,9 @@ public static class ContentTypes public const string ProposalType = "ProposalType"; public const string ProjectType = "ProjectType"; public const string CommunityType = "CommunityType"; + + // Entities + public const string Aritifact = "Aritifact"; } } } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs new file mode 100644 index 000000000..75e297658 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs @@ -0,0 +1,41 @@ +using OrchardCore.ContentManagement.Metadata; +using OrchardCore.ContentManagement.Metadata.Settings; +using OrchardCore.Data.Migration; + +namespace StatCan.OrchardCore.Radar.Migrations +{ + public class ArtifactMigration: DataMigration + { + private readonly IContentDefinitionManager _contentDefinitionManager; + + public ArtifactMigration(IContentDefinitionManager contentDefinitionManager) + { + _contentDefinitionManager = contentDefinitionManager; + } + + public int Create() + { + CreateArtifact(); + + return 1; + } + + private void CreateArtifact() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Aritifact, type => type + .DisplayedAs("Artifact") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("Artifact", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + ) +); + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index 9ceff0c9b..31a26b258 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -13,6 +13,7 @@ public class Startup : StartupBase public override void ConfigureServices(IServiceCollection services) { services.AddScoped(); + services.AddScoped(); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) From f96cfabdda86548d58c03c2635da7782e70f4b9d Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Thu, 16 Sep 2021 12:16:43 -0400 Subject: [PATCH 006/198] feat: use code migration --- .../StatCan.OrchardCore.Radar/Constants.cs | 11 + .../StatCan.OrchardCore.Radar/Manifest.cs | 1 + .../StatCan.OrchardCore.Radar/Migrations.cs | 673 ++++++++++ .../Migrations/ArtifactMigration.cs | 41 - .../Migrations/TaxonomyMigrations.cs | 233 ---- .../Migrations/radar.recipe.json | 1138 ----------------- src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 4 +- .../StatCan.OrchardCore.Radar.csproj | 5 +- 8 files changed, 690 insertions(+), 1416 deletions(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations.cs delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json diff --git a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs index 4fb440e17..1d40749e1 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs @@ -17,6 +17,17 @@ public static class ContentTypes // Entities public const string Aritifact = "Aritifact"; + public const string Proposal = "Proposal"; + public const string Project = "Project"; + public const string Event = "Event"; + public const string Community = "Community"; + + public const string ProjectMember = "ProjectMember"; + public const string EventOrganizer = "EventOrganizer"; + public const string CommunityMember = "CommunityMember"; + + // Parts + public const string RadarEntity = "RadarEntity"; } } } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs b/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs index e5db7f50e..5b6564abd 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Manifest.cs @@ -20,6 +20,7 @@ { "OrchardCore.Autoroute", "OrchardCore.Contents", + "OrhcardCore.ContentManagement", "OrchardCore.ContentFields", "OrchardCore.Flows", "OrchardCore.Taxonomies", diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs new file mode 100644 index 000000000..11f163190 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs @@ -0,0 +1,673 @@ +using System; +using System.Threading.Tasks; +using System.Collections.Generic; +using OrchardCore.ContentManagement; +using OrchardCore.ContentManagement.Metadata; +using OrchardCore.ContentManagement.Metadata.Settings; +using OrchardCore.Data.Migration; +using OrchardCore.Taxonomies.Models; +using OrchardCore.Title.Models; +using OrchardCore.ContentFields.Fields; +using OrchardCore.ContentFields.Settings; +using OrchardCore.Taxonomies.Fields; +using OrchardCore.Taxonomies.Settings; +using OrchardCore.Flows.Models; + +namespace StatCan.OrchardCore.Radar +{ + public class Migrations : DataMigration + { + private readonly IContentDefinitionManager _contentDefinitionManager; + private readonly IContentManager _contentManager; + + private readonly Dictionary _taxonomyIds; + + public Migrations(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) + { + _contentDefinitionManager = contentDefinitionManager; + _contentManager = contentManager; + + _taxonomyIds = new Dictionary(); + } + + public async Task CreateAsync() + { + CreateTaxonomies(); + await CreateTaxonomyItems(); + CreateArtifact(); + CreateRadarEntityPart(); + CreateProposal(); + CreateProject(); + CreateEvent(); + CreateCommunity(); + + return 1; + } + + private void CreateTaxonomies() + { + // Topic + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Topic, type => type + .DisplayedAs("Topic") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("Topic", part => part + .WithPosition("2") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.Topic.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Topic, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + ) + ); + + // Proposal Type + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.ProposalType, type => type + .DisplayedAs("Proposal Type") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("ProposalType", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.ProposalType.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.ProposalType, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + + // Project Type + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.ProjectType, type => type + .DisplayedAs("Project Type") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("ProjectType", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.ProjectType.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.ProjectType, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + + // Community Type + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.CommunityType, type => type + .DisplayedAs("Community Type") + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("CommunityType", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.CommunityType.Name.Text }}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.CommunityType, part => part + .WithField("Name", field => field + .OfType("TextField") + .WithDisplayName("Name") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + } + + private async Task CreateTaxonomyItems() + { + // Topics + var topics = await _contentManager.NewAsync("Taxonomy"); + _taxonomyIds.Add("Topics", topics.ContentItemId); + + topics.DisplayText = "Topics"; // Instead of TitlePart.Title + topics.Alter(part => + { + part.TermContentType = Constants.ContentTypes.Topic; + }); + + await _contentManager.CreateAsync(topics, VersionOptions.Published); + await _contentManager.PublishAsync(topics); + + // Proposal Type + var proposalTypes = await _contentManager.NewAsync("Taxonomy"); + _taxonomyIds.Add("Proposal Types", proposalTypes.ContentItemId); + + proposalTypes.DisplayText = "Proposal Types"; // Instead of TitlePart.Title + proposalTypes.Alter(part => + { + part.TermContentType = Constants.ContentTypes.ProposalType; + }); + + await _contentManager.CreateAsync(proposalTypes, VersionOptions.Published); + await _contentManager.PublishAsync(proposalTypes); + + // Project Type + var projectTypes = await _contentManager.NewAsync("Taxonomy"); + _taxonomyIds.Add("Project Types", proposalTypes.ContentItemId); + + projectTypes.DisplayText = "Project Types"; // Instead of TitlePart.Title + projectTypes.Alter(part => + { + part.TermContentType = Constants.ContentTypes.ProjectType; + }); + + await _contentManager.CreateAsync(projectTypes, VersionOptions.Published); + await _contentManager.PublishAsync(projectTypes); + + // Community Type + var communityTypes = await _contentManager.NewAsync("Taxonomy"); + _taxonomyIds.Add("Community Types", communityTypes.ContentItemId); + + communityTypes.DisplayText = "Community Types"; // Instead of TitlePart.Title + communityTypes.Alter(part => + { + part.TermContentType = Constants.ContentTypes.CommunityType; + }); + + await _contentManager.CreateAsync(communityTypes, VersionOptions.Published); + await _contentManager.PublishAsync(communityTypes); + } + + private void CreateArtifact() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Aritifact, type => type + .DisplayedAs("Artifact") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart("Artifact", part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + ) + ); + } + + private void CreateRadarEntityPart() + { + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.RadarEntity, part => part + .Attachable() + .WithDescription("Provides fields for an entity in Radar") + .WithField("Name", field => field + .OfType(nameof(TextField)) + .WithDisplayName("Name") + ) + .WithField("Description", field => field + .OfType(nameof(TextField)) + .WithDisplayName("Description") + ) + .WithField("Topics", field => field + .OfType(nameof(TaxonomyField)) + .WithDisplayName("Topics") + .WithEditor("Tags") + .WithDisplayMode("Tags") + .WithSettings(new TaxonomyFieldSettings + { + Unique = false, + TaxonomyContentItemId = _taxonomyIds.GetValueOrDefault("Topics") + }) + .WithSettings(new TaxonomyFieldTagsEditorSettings + { + Open = false, + }) + + ) + .WithField("RelatedEntity", field => field + .OfType(nameof(ContentPickerField)) + .WithDisplayName("Related Entity") + .WithSettings(new ContentPickerFieldSettings + { + Multiple = true, + Required = false + }) + ) + ); + } + + private void CreateProposal() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Proposal, type => type + .DisplayedAs("Proposal") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.Proposal, part => part + .WithPosition("2") + ) + .WithPart(Constants.ContentTypes.RadarEntity, part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.RadarEntity.Name.Text }}", + }) + ) + .WithPart("ContentPermissionsPart", part => part + .WithPosition("3") + ) + .WithPart("Workspace", part => part + .WithDisplayName("Workspace") + .WithDescription("Add an Artifact to your workspace of this proposal") + .WithPosition("4") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.Aritifact }, + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Proposal, part => part + .WithField("Type", field => field + .OfType("TaxonomyField") + .WithDisplayName("Type") + .WithEditor("Tags") + .WithDisplayMode("Tags") + .WithPosition("0") + .WithSettings(new TaxonomyFieldSettings + { + Required = true, + TaxonomyContentItemId = _taxonomyIds.GetValueOrDefault("Proposal Types"), + Unique = true, + }) + .WithSettings(new TaxonomyFieldTagsEditorSettings + { + Open = false, + }) + ) + ); + } + + private void CreateProject() + { + // Project Member + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.ProjectMember, type => type + .DisplayedAs("ProjectMember") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.ProjectMember, part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = @"{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %} + {% for user in users %} + {{ user.UserName }} - {{ user.Email }} + {% endfor %}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.ProjectMember, part => part + .WithField("Member", field => field + .OfType("UserPickerField") + .WithDisplayName("Member") + .WithPosition("0") + .WithSettings(new UserPickerFieldSettings + { + Required = true, + DisplayAllUsers = true, + DisplayedRoles = Array.Empty(), + }) + ) + ); + + // Project + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Project, type => type + .DisplayedAs("Project") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.Project, part => part + .WithPosition("4") + ) + .WithPart(Constants.ContentTypes.RadarEntity, part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.RadarEntity.Name.Text }}", + }) + ) + .WithPart("ContentPermissionsPart", part => part + .WithPosition("5") + ) + .WithPart("Workspace", part => part + .WithDisplayName("Workspace") + .WithDescription("Add an Artifact to your workspace of this project") + .WithPosition("2") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.Aritifact }, + }) + ) + .WithPart(Constants.ContentTypes.ProjectMember, part => part + .WithDisplayName("Project Member") + .WithDescription("Add a member to this project") + .WithPosition("3") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.ProjectMember }, + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Project, part => part + .WithField("Type", field => field + .OfType("TaxonomyField") + .WithEditor("Tags") + .WithDisplayMode("Tags") + .WithDisplayName("Type") + .WithPosition("0") + .WithSettings(new TaxonomyFieldSettings + { + Required = true, + TaxonomyContentItemId = _taxonomyIds.GetValueOrDefault("Project Types"), + Unique = true, + }) + .WithSettings(new TaxonomyFieldTagsEditorSettings + { + Open = false, + }) + ) + ); + } + + private void CreateEvent() + { + // Event Organizer + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.EventOrganizer, type => type + .DisplayedAs("Event Organizer") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.EventOrganizer, part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = @"{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %} + {% for user in users %} + {{ user.UserName }} - {{ user.Email }} + {% endfor %}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.EventOrganizer, part => part + .WithField("Organizer", field => field + .OfType("UserPickerField") + .WithDisplayName("Organizer") + .WithPosition("0") + .WithSettings(new UserPickerFieldSettings + { + Required = true, + DisplayAllUsers = true, + DisplayedRoles = Array.Empty(), + }) + ) + .WithField("Role", field => field + .OfType("TextField") + .WithDisplayName("Role") + .WithPosition("1") + ) + ); + + // Event + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Event, type => type + .DisplayedAs("Event") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.Event, part => part + .WithPosition("1") + ) + .WithPart("ContentPermissionsPart", part => part + .WithPosition("5") + ) + .WithPart(Constants.ContentTypes.RadarEntity, part => part + .WithPosition("2") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedDisabled, + Pattern = "{{ ContentItem.Content.RadarEntity.Name.Text }}", + }) + ) + .WithPart(Constants.ContentTypes.EventOrganizer, part => part + .WithDisplayName("Event Organizer") + .WithDescription("Event Organizer") + .WithPosition("3") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.EventOrganizer }, + }) + ) + .WithPart("Workspace", part => part + .WithDisplayName("Workspace") + .WithDescription("Add an Artifact to your workspace of this event") + .WithPosition("4") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.Aritifact }, + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Event, part => part + .WithField("Attendees", field => field + .OfType("UserPickerField") + .WithDisplayName("Attendees") + .WithPosition("0") + ) + .WithField("StartDate", field => field + .OfType("DateTimeField") + .WithDisplayName("Start Date") + .WithPosition("1") + ) + .WithField("EndDate", field => field + .OfType("DateTimeField") + .WithDisplayName("End Date") + .WithPosition("2") + ) + ); + } + + private void CreateCommunity() + { + // Community Member + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.CommunityMember, type => type + .DisplayedAs("Community Member") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.CommunityMember, part => part + .WithPosition("1") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = @"{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %} + {% for user in users %} + {{ user.UserName }} - {{ user.Email }} + {% endfor %}", + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.CommunityMember, part => part + .WithField("Member", field => field + .OfType("UserPickerField") + .WithDisplayName("Member") + .WithPosition("0") + .WithSettings(new UserPickerFieldSettings + { + Required = true, + DisplayAllUsers = true, + DisplayedRoles = Array.Empty(), + }) + ) + ); + + // Community + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Community, type => type + .DisplayedAs("Community") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.Community, part => part + .WithPosition("4") + ) + .WithPart("TitlePart", part => part + .WithPosition("0") + .WithSettings(new TitlePartSettings + { + Options = TitlePartOptions.GeneratedHidden, + Pattern = "{{ ContentItem.Content.RadarEntity.Name.Text }}", + }) + ) + .WithPart(Constants.ContentTypes.RadarEntity, part => part + .WithPosition("1") + ) + .WithPart("ContentPermissionsPart", part => part + .WithPosition("5") + ) + .WithPart("Workspace", part => part + .WithDisplayName("Workspace") + .WithDescription("Add an Artifact to your workspace of this community") + .WithPosition("2") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.Aritifact }, + }) + ) + .WithPart(Constants.ContentTypes.CommunityMember, part => part + .WithDisplayName("Community Member") + .WithDescription("Add a member to this community") + .WithPosition("3") + .WithSettings(new BagPartSettings + { + ContainedContentTypes = new[] { Constants.ContentTypes.CommunityMember }, + }) + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Community, part => part + .WithField("Type", field => field + .OfType("TaxonomyField") + .WithDisplayName("Type") + .WithEditor("Tags") + .WithDisplayMode("Tags") + .WithPosition("0") + .WithSettings(new TaxonomyFieldSettings + { + Required = true, + TaxonomyContentItemId = _taxonomyIds.GetValueOrDefault("Community Types"), + Unique = true, + }) + .WithSettings(new TaxonomyFieldTagsEditorSettings + { + Open = false, + }) + ) + ); + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs deleted file mode 100644 index 75e297658..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/ArtifactMigration.cs +++ /dev/null @@ -1,41 +0,0 @@ -using OrchardCore.ContentManagement.Metadata; -using OrchardCore.ContentManagement.Metadata.Settings; -using OrchardCore.Data.Migration; - -namespace StatCan.OrchardCore.Radar.Migrations -{ - public class ArtifactMigration: DataMigration - { - private readonly IContentDefinitionManager _contentDefinitionManager; - - public ArtifactMigration(IContentDefinitionManager contentDefinitionManager) - { - _contentDefinitionManager = contentDefinitionManager; - } - - public int Create() - { - CreateArtifact(); - - return 1; - } - - private void CreateArtifact() - { - _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Aritifact, type => type - .DisplayedAs("Artifact") - .Creatable() - .Listable() - .Draftable() - .Versionable() - .Securable() - .WithPart("Artifact", part => part - .WithPosition("1") - ) - .WithPart("TitlePart", part => part - .WithPosition("0") - ) -); - } - } -} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs deleted file mode 100644 index b723f9b62..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/TaxonomyMigrations.cs +++ /dev/null @@ -1,233 +0,0 @@ -using System.Threading.Tasks; - -using OrchardCore.ContentManagement; -using OrchardCore.ContentManagement.Metadata; -using OrchardCore.ContentManagement.Metadata.Settings; -using OrchardCore.Data.Migration; -using OrchardCore.Title.Models; -using OrchardCore.Taxonomies.Models; - -namespace StatCan.OrchardCore.Radar.Migrations -{ - public class TaxonomyMigrations : DataMigration - { - private readonly IContentDefinitionManager _contentDefinitionManager; - private readonly IContentManager _contentManager; - - public TaxonomyMigrations(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) - { - _contentDefinitionManager = contentDefinitionManager; - _contentManager = contentManager; - } - - public async Task CreateAsync() - { - Topic(); - ProposalType(); - ProjectType(); - CommunityType(); - - await CreateTopicsTaxonomy(); - await CreateProposalTypesTaxonomy(); - await CreateProjectTypesTaxonomy(); - await CreateCommunityTypesTaxonoy(); - - return 1; - } - - private void Topic() - { - _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.Topic, type => type - .DisplayedAs("Topic") - .Listable() - .Draftable() - .Versionable() - .Securable() - .WithPart("Topic", part => part - .WithPosition("2") - ) - .WithPart("TitlePart", part => part - .WithPosition("0") - .WithSettings(new TitlePartSettings - { - Options = TitlePartOptions.GeneratedHidden, - Pattern = "{{ ContentItem.Content.Topic.Name.Text }}", - }) - ) - ); - - _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.Topic, part => part - .WithField("Name", field => field - .OfType("TextField") - .WithDisplayName("Name") - ) - .WithField("Description", field => field - .OfType("TextField") - .WithDisplayName("Description") - ) - ); - } - - private void ProposalType() - { - _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.ProposalType, type => type - .DisplayedAs("Proposal Type") - .Listable() - .Draftable() - .Versionable() - .Securable() - .WithPart("ProposalType", part => part - .WithPosition("1") - ) - .WithPart("TitlePart", part => part - .WithPosition("0") - .WithSettings(new TitlePartSettings - { - Options = TitlePartOptions.GeneratedHidden, - Pattern = "{{ ContentItem.Content.ProposalType.Name.Text }}", - }) - ) - ); - - _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.ProposalType, part => part - .WithField("Name", field => field - .OfType("TextField") - .WithDisplayName("Name") - .WithPosition("0") - ) - .WithField("Description", field => field - .OfType("TextField") - .WithDisplayName("Description") - .WithPosition("1") - ) - ); - } - - private void ProjectType() - { - _contentDefinitionManager.AlterTypeDefinition("ProjectType", type => type - .DisplayedAs("Project Type") - .Listable() - .Draftable() - .Versionable() - .Securable() - .WithPart("ProjectType", part => part - .WithPosition("1") - ) - .WithPart("TitlePart", part => part - .WithPosition("0") - .WithSettings(new TitlePartSettings - { - Options = TitlePartOptions.GeneratedHidden, - Pattern = "{{ ContentItem.Content.ProjectType.Name.Text }}", - }) - ) - ); - - _contentDefinitionManager.AlterPartDefinition("ProjectType", part => part - .WithField("Name", field => field - .OfType("TextField") - .WithDisplayName("Name") - .WithPosition("0") - ) - .WithField("Description", field => field - .OfType("TextField") - .WithDisplayName("Description") - .WithPosition("1") - ) - ); - } - - private void CommunityType() - { - _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.CommunityType, type => type - .DisplayedAs("Community Type") - .Listable() - .Draftable() - .Versionable() - .Securable() - .WithPart("CommunityType", part => part - .WithPosition("1") - ) - .WithPart("TitlePart", part => part - .WithPosition("0") - .WithSettings(new TitlePartSettings - { - Options = TitlePartOptions.GeneratedHidden, - Pattern = "{{ ContentItem.Content.CommunityType.Name.Text }}", - }) - ) - ); - - _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.CommunityType, part => part - .WithField("Name", field => field - .OfType("TextField") - .WithDisplayName("Name") - .WithPosition("0") - ) - .WithField("Description", field => field - .OfType("TextField") - .WithDisplayName("Description") - .WithPosition("1") - ) - ); - - } - - private async Task CreateTopicsTaxonomy() - { - var topics = await _contentManager.NewAsync("Taxonomy"); - - topics.DisplayText = "Topics"; // Instead of TitlePart.Title - topics.Alter(part => - { - part.TermContentType = Constants.ContentTypes.Topic; - }); - - await _contentManager.CreateAsync(topics, VersionOptions.Published); - await _contentManager.PublishAsync(topics); - } - - private async Task CreateProposalTypesTaxonomy() - { - var proposalTypes = await _contentManager.NewAsync("Taxonomy"); - - proposalTypes.DisplayText = "Proposal Types"; // Instead of TitlePart.Title - proposalTypes.Alter(part => - { - part.TermContentType = Constants.ContentTypes.ProposalType; - }); - - await _contentManager.CreateAsync(proposalTypes, VersionOptions.Published); - await _contentManager.PublishAsync(proposalTypes); - } - - private async Task CreateProjectTypesTaxonomy() - { - var projectTypes = await _contentManager.NewAsync("Taxonomy"); - - projectTypes.DisplayText = "Project Types"; // Instead of TitlePart.Title - projectTypes.Alter(part => - { - part.TermContentType = Constants.ContentTypes.ProjectType; - }); - - await _contentManager.CreateAsync(projectTypes, VersionOptions.Published); - await _contentManager.PublishAsync(projectTypes); - } - - private async Task CreateCommunityTypesTaxonoy() - { - var communityTypes = await _contentManager.NewAsync("Taxonomy"); - - communityTypes.DisplayText = "Communities Types"; // Instead of TitlePart.Title - communityTypes.Alter(part => - { - part.TermContentType = Constants.ContentTypes.CommunityType; - }); - - await _contentManager.CreateAsync(communityTypes, VersionOptions.Published); - await _contentManager.PublishAsync(communityTypes); - } - } -} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json deleted file mode 100644 index 301eb6b82..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/radar.recipe.json +++ /dev/null @@ -1,1138 +0,0 @@ -{ - "steps": [ - { - "name": "ContentDefinition", - "ContentTypes": [ - { - "Name": "Topic", - "DisplayName": "Topic", - "Settings": { - "ContentTypeSettings": { - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "Topic", - "Name": "Topic", - "Settings": { - "ContentTypePartSettings": { - "Position": "2" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 1, - "Pattern": "{{ ContentItem.Content.Topic.Name.Text }}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "Proposal", - "DisplayName": "Proposal", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "Proposal", - "Name": "Proposal", - "Settings": { - "ContentTypePartSettings": { - "Position": "2" - } - } - }, - { - "PartName": "RadarEntity", - "Name": "RadarEntity", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "ContentPermissionsPart", - "Name": "ContentPermissionsPart", - "Settings": { - "ContentTypePartSettings": { - "Position": "3" - } - } - }, - { - "PartName": "BagPart", - "Name": "Workspace", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "Workspace", - "Description": "Add an Artifact to your workspace of this proposal", - "Position": "4" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "Artifact" - ] - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "ProjectType", - "DisplayName": "ProjectType", - "Settings": { - "ContentTypeSettings": { - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "ProjectType", - "Name": "ProjectType", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.ProjectType.Name.Text }}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "ProposalType", - "DisplayName": "ProposalType", - "Settings": { - "ContentTypeSettings": { - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "ProposalType", - "Name": "ProposalType", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.ProposalType.Name.Text }}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "CommunityType", - "DisplayName": "CommunityType", - "Settings": { - "ContentTypeSettings": { - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "CommunityType", - "Name": "CommunityType", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.CommunityType.Name.Text }}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "Artifact", - "DisplayName": "Artifact", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "Artifact", - "Name": "Artifact", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - } - } - } - ] - }, - { - "Name": "Event", - "DisplayName": "Event", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "Event", - "Name": "Event", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "ContentPermissionsPart", - "Name": "ContentPermissionsPart", - "Settings": { - "ContentTypePartSettings": { - "Position": "5" - } - } - }, - { - "PartName": "RadarEntity", - "Name": "RadarEntity", - "Settings": { - "ContentTypePartSettings": { - "Position": "2" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "BagPart", - "Name": "EventOrganizer", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "EventOrganizer", - "Description": "Event Organizer", - "Position": "3" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "EventOrganizer" - ] - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "BagPart", - "Name": "Workspace", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "Workspace", - "Description": "Add an Artifact to your workspace of this event", - "Position": "4" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "Artifact" - ] - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "EventOrganizer", - "DisplayName": "EventOrganizer", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "EventOrganizer", - "Name": "EventOrganizer", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 1, - "Pattern": "{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %}\r\n{% for user in users %}\r\n {{ user.UserName }} - {{ user.Email }}\r\n{% endfor %}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "CommunityMember", - "DisplayName": "CommunityMember", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "CommunityMember", - "Name": "CommunityMember", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 1, - "Pattern": "{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %}\r\n{% for user in users %}\r\n {{ user.UserName }} - {{ user.Email }}\r\n{% endfor %}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "Community", - "DisplayName": "Community", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "Community", - "Name": "Community", - "Settings": { - "ContentTypePartSettings": { - "Position": "4" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "RadarEntity", - "Name": "RadarEntity", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "ContentPermissionsPart", - "Name": "ContentPermissionsPart", - "Settings": { - "ContentTypePartSettings": { - "Position": "5" - } - } - }, - { - "PartName": "BagPart", - "Name": "Workspace", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "Workspace", - "Description": "Add an Artifact to your workspace of this community", - "Position": "2" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "Artifact" - ] - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "BagPart", - "Name": "CommunityMember", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "Community Member", - "Description": "Add a member to this community", - "Position": "3" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "CommunityMember" - ] - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "ProjectMember", - "DisplayName": "ProjectMember", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "ProjectMember", - "Name": "ProjectMember", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 1, - "Pattern": "{% assign users = ContentItem.Content.EventOrganier.UserPicker.UserIds | users_by_id %}\r\n{% for user in users %}\r\n {{ user.UserName }} - {{ user.Email }}\r\n{% endfor %}" - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "Project", - "DisplayName": "Project", - "Settings": { - "ContentTypeSettings": { - "Creatable": true, - "Listable": true, - "Draftable": true, - "Versionable": true, - "Securable": true - }, - "FullTextAspectSettings": {} - }, - "ContentTypePartDefinitionRecords": [ - { - "PartName": "Project", - "Name": "Project", - "Settings": { - "ContentTypePartSettings": { - "Position": "4" - } - } - }, - { - "PartName": "RadarEntity", - "Name": "RadarEntity", - "Settings": { - "ContentTypePartSettings": { - "Position": "1" - } - } - }, - { - "PartName": "TitlePart", - "Name": "TitlePart", - "Settings": { - "ContentTypePartSettings": { - "Position": "0" - }, - "TitlePartSettings": { - "Options": 2, - "Pattern": "{{ ContentItem.Content.RadarEntity.Name.Text }}" - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "ContentPermissionsPart", - "Name": "ContentPermissionsPart", - "Settings": { - "ContentTypePartSettings": { - "Position": "5" - } - } - }, - { - "PartName": "BagPart", - "Name": "Workspace", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "Workspace", - "Description": "Add an Artifact to your workspace of this project", - "Position": "2" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "Artifact" - ] - }, - "ContentIndexSettings": {} - } - }, - { - "PartName": "BagPart", - "Name": "ProjectMember", - "Settings": { - "ContentTypePartSettings": { - "DisplayName": "Project Member", - "Description": "Add a member to this project", - "Position": "3" - }, - "BagPartSettings": { - "ContainedContentTypes": [ - "ProjectMember" - ] - }, - "ContentIndexSettings": {} - } - } - ] - } - ], - "ContentParts": [ - { - "Name": "RadarEntity", - "Settings": { - "ContentPartSettings": { - "Attachable": true - } - }, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TextField", - "Name": "Name", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Name", - "Position": "0" - } - } - }, - { - "FieldName": "TextField", - "Name": "Description", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Description", - "Position": "1" - } - } - }, - { - "FieldName": "ContentPickerField", - "Name": "RelatedEntity", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Related Entity", - "Position": "3" - }, - "ContentPickerFieldSettings": { - "Multiple": true, - "DisplayedContentTypes": [ - "Proposal" - ] - }, - "ContentIndexSettings": {} - } - }, - { - "FieldName": "TaxonomyField", - "Name": "Topics", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Topics", - "Editor": "Tags", - "DisplayMode": "Tags", - "Position": "2" - }, - "ContentIndexSettings": {}, - "TaxonomyFieldSettings": { - "TaxonomyContentItemId": "43p29bmfpe85a319g7t98waa40", - "Unique": true - }, - "TaxonomyFieldTagsEditorSettings": { - "Open": false - } - } - } - ] - }, - { - "Name": "Topic", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TextField", - "Name": "Name", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Name" - } - } - }, - { - "FieldName": "TextField", - "Name": "Description", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Description" - } - } - } - ] - }, - { - "Name": "Proposal", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TaxonomyField", - "Name": "Type", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Type", - "Editor": "Tags", - "DisplayMode": "Tags", - "Position": "0" - }, - "ContentIndexSettings": {}, - "TaxonomyFieldSettings": { - "Required": true, - "TaxonomyContentItemId": "4fn9mss5kdqfmy0b7qwbnneb5s", - "Unique": true - }, - "TaxonomyFieldTagsEditorSettings": { - "Open": false - } - } - } - ] - }, - { - "Name": "ProjectType", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TextField", - "Name": "Name", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Name", - "Position": "0" - } - } - }, - { - "FieldName": "TextField", - "Name": "Description", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Description", - "Position": "1" - } - } - } - ] - }, - { - "Name": "ProposalType", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TextField", - "Name": "Name", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Name", - "Position": "0" - } - } - }, - { - "FieldName": "TextField", - "Name": "Description", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Description", - "Position": "1" - } - } - } - ] - }, - { - "Name": "CommunityType", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TextField", - "Name": "Name", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Name", - "Position": "0" - } - } - }, - { - "FieldName": "TextField", - "Name": "Description", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Description", - "Position": "1" - } - } - } - ] - }, - { - "Name": "Event", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "UserPickerField", - "Name": "Attendees", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Attendees", - "Position": "0" - } - } - }, - { - "FieldName": "DateTimeField", - "Name": "StartDate", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Start Date", - "Position": "1" - } - } - }, - { - "FieldName": "DateTimeField", - "Name": "EndDate", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "End Date", - "Position": "2" - } - } - } - ] - }, - { - "Name": "EventOrganizer", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "UserPickerField", - "Name": "Organizer", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Organizer", - "Position": "0" - }, - "UserPickerFieldSettings": { - "Required": true, - "DisplayAllUsers": true, - "DisplayedRoles": [] - }, - "ContentIndexSettings": {} - } - }, - { - "FieldName": "TextField", - "Name": "Role", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Role", - "Position": "1" - } - } - } - ] - }, - { - "Name": "CommunityMember", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "UserPickerField", - "Name": "Member", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Member", - "Position": "0" - }, - "UserPickerFieldSettings": { - "Required": true, - "DisplayAllUsers": true, - "DisplayedRoles": [] - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "Community", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TaxonomyField", - "Name": "Type", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Type", - "Position": "0" - }, - "ContentIndexSettings": {}, - "TaxonomyFieldSettings": { - "Required": true, - "TaxonomyContentItemId": "4be7bdq6y7k9f1wpf1q6h8kwd9", - "Unique": true - } - } - } - ] - }, - { - "Name": "ProjectMember", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "UserPickerField", - "Name": "Member", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Member", - "Position": "0" - }, - "UserPickerFieldSettings": { - "Required": true, - "DisplayAllUsers": true, - "DisplayedRoles": [] - }, - "ContentIndexSettings": {} - } - } - ] - }, - { - "Name": "Project", - "Settings": {}, - "ContentPartFieldDefinitionRecords": [ - { - "FieldName": "TaxonomyField", - "Name": "Type", - "Settings": { - "ContentPartFieldSettings": { - "DisplayName": "Type", - "Position": "0" - }, - "ContentIndexSettings": {}, - "TaxonomyFieldSettings": { - "Required": true, - "TaxonomyContentItemId": "4fg74m81qafx3zp342n8csj2wm", - "Unique": true - } - } - } - ] - } - ] - }, - { - "name": "content", - "data": [ - { - "ContentItemId": "43p29bmfpe85a319g7t98waa40", - "ContentItemVersionId": "496gng475pa3r2s6w4v724zjxz", - "ContentType": "Taxonomy", - "DisplayText": "Topics", - "Latest": true, - "Published": true, - "ModifiedUtc": "2021-09-15T13:22:03.8522685Z", - "PublishedUtc": "2021-09-15T13:22:03.8580812Z", - "CreatedUtc": "2021-09-15T13:22:03.8522685Z", - "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", - "Author": "admin", - "TitlePart": { - "Title": "Topics" - }, - "AliasPart": { - "Alias": "topics" - }, - "AutoroutePart": { - "Path": "topics", - "SetHomepage": false, - "Disabled": false, - "RouteContainedItems": false, - "Absolute": false - }, - "TaxonomyPart": { - "TermContentType": "Topic", - "Terms": [] - } - }, - { - "ContentItemId": "4fg74m81qafx3zp342n8csj2wm", - "ContentItemVersionId": "47q1vnrggydfj7ah65mqahj5cn", - "ContentType": "Taxonomy", - "DisplayText": "Project Type", - "Latest": true, - "Published": true, - "ModifiedUtc": "2021-09-15T13:42:45.0701723Z", - "PublishedUtc": "2021-09-15T13:42:45.0777122Z", - "CreatedUtc": "2021-09-15T13:42:45.0701723Z", - "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", - "Author": "admin", - "TitlePart": { - "Title": "Project Type" - }, - "AliasPart": { - "Alias": "projecttype" - }, - "AutoroutePart": { - "Path": "projecttype", - "SetHomepage": false, - "Disabled": false, - "RouteContainedItems": false, - "Absolute": false - }, - "TaxonomyPart": { - "TermContentType": "ProjectType", - "Terms": [] - } - }, - { - "ContentItemId": "4fn9mss5kdqfmy0b7qwbnneb5s", - "ContentItemVersionId": "4k50x7trga6cn4rpsmwsc92qmx", - "ContentType": "Taxonomy", - "DisplayText": "Proposal Type", - "Latest": true, - "Published": true, - "ModifiedUtc": "2021-09-15T13:46:00.5646917Z", - "PublishedUtc": "2021-09-15T13:46:00.5693251Z", - "CreatedUtc": "2021-09-15T13:46:00.5646917Z", - "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", - "Author": "admin", - "TitlePart": { - "Title": "Proposal Type" - }, - "AliasPart": { - "Alias": "proposaltype" - }, - "AutoroutePart": { - "Path": "proposaltype", - "SetHomepage": false, - "Disabled": false, - "RouteContainedItems": false, - "Absolute": false - }, - "TaxonomyPart": { - "TermContentType": "ProposalType", - "Terms": [] - } - }, - { - "ContentItemId": "4be7bdq6y7k9f1wpf1q6h8kwd9", - "ContentItemVersionId": "44gxhx8fymzh54vvf64nnwma4a", - "ContentType": "Taxonomy", - "DisplayText": "Community Type", - "Latest": true, - "Published": true, - "ModifiedUtc": "2021-09-15T14:45:27.1221385Z", - "PublishedUtc": "2021-09-15T14:45:27.1263705Z", - "CreatedUtc": "2021-09-15T14:45:27.1221385Z", - "Owner": "4rbm0rzcxcvx7xndye0hp63nw3", - "Author": "admin", - "TitlePart": { - "Title": "Community Type" - }, - "AliasPart": { - "Alias": "communitytype" - }, - "AutoroutePart": { - "Path": "communitytype", - "SetHomepage": false, - "Disabled": false, - "RouteContainedItems": false, - "Absolute": false - }, - "TaxonomyPart": { - "TermContentType": "CommunityType", - "Terms": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index 31a26b258..5a0dfdc22 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.DependencyInjection; using OrchardCore.Modules; using OrchardCore.Data.Migration; -using StatCan.OrchardCore.Radar.Migrations; namespace StatCan.OrchardCore.Radar { @@ -12,8 +11,7 @@ public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); + services.AddScoped(); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) diff --git a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj index 2a5dc4ae5..a75b9040c 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj +++ b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj @@ -12,9 +12,12 @@ - + + + + From de4f2cc1d96cb29d75bed7412afa535d541b9cbc Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Thu, 16 Sep 2021 16:01:28 -0400 Subject: [PATCH 007/198] wip: add setup recipe --- .../Migrations/AppMigration.cs | 24 ++++ .../EntityMigration.cs} | 6 +- .../Migrations/app.recipe.json | 104 ++++++++++++++++++ .../Migrations/init.recipe.json | 86 +++++++++++++++ .../Recipes/radar.setup.recipe.json | 57 ++++++++++ src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 4 +- .../StatCan.OrchardCore.Radar.csproj | 3 +- .../assets/images/radar-icon-white.svg | 18 +++ 8 files changed, 297 insertions(+), 5 deletions(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs rename src/Apps/StatCan.OrchardCore.Radar/{Migrations.cs => Migrations/EntityMigration.cs} (99%) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json create mode 100644 src/Apps/StatCan.OrchardCore.Radar/wwwroot/assets/images/radar-icon-white.svg diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs new file mode 100644 index 000000000..1576f6769 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using OrchardCore.Recipes.Services; +using OrchardCore.Data.Migration; + +namespace StatCan.OrchardCore.Radar.Migrations +{ + public class AppMigration : DataMigration + { + private readonly IRecipeMigrator _recipeMigrator; + + public AppMigration(IRecipeMigrator recipeMigrator) + { + _recipeMigrator = recipeMigrator; + } + + public async Task CreateAsync() + { + await _recipeMigrator.ExecuteAsync("init.recipe.json", this); + await _recipeMigrator.ExecuteAsync("app.recipe.json", this); + + return 1; + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/EntityMigration.cs similarity index 99% rename from src/Apps/StatCan.OrchardCore.Radar/Migrations.cs rename to src/Apps/StatCan.OrchardCore.Radar/Migrations/EntityMigration.cs index 11f163190..62c34a49b 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/EntityMigration.cs @@ -13,16 +13,16 @@ using OrchardCore.Taxonomies.Settings; using OrchardCore.Flows.Models; -namespace StatCan.OrchardCore.Radar +namespace StatCan.OrchardCore.Radar.Migrations { - public class Migrations : DataMigration + public class EntityMigration : DataMigration { private readonly IContentDefinitionManager _contentDefinitionManager; private readonly IContentManager _contentManager; private readonly Dictionary _taxonomyIds; - public Migrations(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) + public EntityMigration(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) { _contentDefinitionManager = contentDefinitionManager; _contentManager = contentManager; diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json new file mode 100644 index 000000000..d2e2e63c1 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json @@ -0,0 +1,104 @@ +{ + "name": "", + "displayName": "", + "description": "", + "author": "", + "website": "", + "version": "", + "issetuprecipe": false, + "categories": [], + "tags": [], + "steps": [ + { + "name": "themes", + "admin": "DigitalAdmin", + "site": "VuetifyTheme" + }, + { + "name": "Settings", + "Calendar": null, + "UseCdn": false, + "TimeZoneId": "America/Toronto", + "AppendVersion": true, + "LocalizationSettings": { + "DefaultCulture": "en", + "SupportedCultures": [ "fr", "en" ] + }, + "AdminSettings": { + "DisplayMenuFilter": true + }, + "LoginSettings": { + "UseSiteTheme": true + }, + "ResetPasswordSettings": { + "UseSiteTheme": true + }, + "RegistrationSettings": { + "UseSiteTheme": true + }, + "LayerSettings": { + "Zones": [ + "Header", + "Breadcrumb", + "NavigationDrawer", + "Footer", + "IEBanner" + ] + } + }, + { + "name": "Layers", + "Layers": [ + { + "Name": "All", + "Rule": "true", + "Description": null + } + ] + }, + { + "name": "media", + "Files": [ + { + "SourcePath": "../wwwroot/assets/images/radar-icon-white.svg", + "TargetPath": "radar-icon-white.svg" + } + ] + }, + { + "name": "custom-settings", + "VuetifyThemeSettings": { + "ContentItemId": "[js: uuid()]", + "ContentItemVersionId": null, + "ContentType": "VuetifyThemeSettings", + "DisplayText": "", + "Latest": false, + "Published": false, + "ModifiedUtc": null, + "PublishedUtc": null, + "CreatedUtc": null, + "Owner": "[js: parameters('AdminUserId')]", + "Author": "[js: parameters('AdminUsername')]", + "VuetifyThemeSettings": { + "DisplayName": { + "Text": "Radar" + }, + "Logo": { + "Paths": [ + "radar-icon-white.svg" + ], + "MediaTexts": [ + "" + ] + }, + "DisplayMode": { + "Text": "light" + }, + "ThemeOptions": { + "Text": null + } + } + } + } + ] +} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json new file mode 100644 index 000000000..73272c4ec --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json @@ -0,0 +1,86 @@ +{ + "name": "", + "displayName": "", + "description": "", + "author": "", + "website": "", + "version": "", + "issetuprecipe": false, + "categories": [], + "tags": [], + "steps": [ + { + "name": "Feature", + "enable": [ + "Application.Default", + "StatCan.OrchardCore.Cms.Web", + "OrchardCore.Liquid", + "OrchardCore.Resources", + "OrchardCore.Settings", + "OrchardCore.Contents", + "OrchardCore.ContentTypes", + "OrchardCore.Autoroute", + "OrchardCore.Widgets", + "OrchardCore.Flows", + "OrchardCore.Title", + "OrchardCore.Shortcodes", + "OrchardCore.Html", + "OrchardCore.Admin", + "OrchardCore.Templates", + "OrchardCore.Alias", + "OrchardCore.Features", + "OrchardCore.Scripting", + "OrchardCore.Recipes", + "OrchardCore.ContentFields", + "OrchardCore.Users", + "OrchardCore.Localization", + "OrchardCore.ContentLocalization", + "OrchardCore.ContentLocalization.ContentCulturePicker", + "OrchardCore.ContentPreview", + "OrchardCore.Deployment", + "OrchardCore.Contents.Deployment.Download", + "OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget", + "OrchardCore.CustomSettings", + "OrchardCore.Diagnostics", + "OrchardCore.DynamicCache", + "OrchardCore.Email", + "OrchardCore.Feeds", + "OrchardCore.HomeRoute", + "OrchardCore.Https", + "OrchardCore.Indexing", + "OrchardCore.Rules", + "OrchardCore.Layers", + "OrchardCore.Lists", + "OrchardCore.Markdown", + "OrchardCore.Media", + "OrchardCore.Menu", + "OrchardCore.Microsoft.Authentication.AzureAD", + "OrchardCore.Navigation", + "OrchardCore.Placements", + "OrchardCore.Queries", + "OrchardCore.ReverseProxy", + "OrchardCore.Roles", + "OrchardCore.Shortcodes.Templates", + "OrchardCore.Themes", + "OrchardCore.Users.Registration", + "OrchardCore.Workflows", + "OrchardCore.Workflows.Http", + "OrchardCore.Workflows.Timers", + "StatCan.OrchardCore.ContentPermissions", + "StatCan.OrchardCore.Configuration", + "StatCan.OrchardCore.ContentFields", + "StatCan.OrchardCore.ContentFields.PredefinedGroup", + "StatCan.OrchardCore.DisplayHelpers", + "StatCan.OrchardCore.EmailTemplates", + "StatCan.OrchardCore.GitHub", + "StatCan.OrchardCore.LocalizedText", + "StatCan.OrchardCore.Scripting", + "StatCan.OrchardCore.VueForms", + "StatCan.OrchardCore.VueForms.Localized", + "StatCan.OrchardCore.Vuetify", + "DigitalAdmin", + "VuetifyTheme" + ] + } + ] +} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json new file mode 100644 index 000000000..8fb359156 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -0,0 +1,57 @@ +{ + "name": "radar-setup", + "displayName": "Radar Setup", + "description": "Recipe used to set the Radar application.", + "author": "Digital Innovation Team", + "website": "https://digital.statcan.gc.ca", + "version": "1.0", + "issetuprecipe": false, + "categories": [ "radar" ], + "tags": [ "innovation", "inno" ], + "steps": [ + { + "name": "media", + "Files": [ + { + "SourcePath": "../wwwroot/assets/images/radar-icon-white.svg", + "TargetPath": "radar-icon-white.svg" + } + ] + }, + { + "name": "custom-settings", + "VuetifyThemeSettings": { + "ContentItemId": "[js: uuid()]", + "ContentItemVersionId": null, + "ContentType": "VuetifyThemeSettings", + "DisplayText": "", + "Latest": false, + "Published": false, + "ModifiedUtc": null, + "PublishedUtc": null, + "CreatedUtc": null, + "Owner": "[js: parameters('AdminUserId')]", + "Author": "[js: parameters('AdminUsername')]", + "VuetifyThemeSettings": { + "DisplayName": { + "Text": "Radar" + }, + "Logo": { + "Paths": [ + "radar-icon-white.svg" + ], + "MediaTexts": [ + "" + ] + }, + "DisplayMode": { + "Text": "light" + }, + "ThemeOptions": { + "Text": null + } + } + } + } + ] +} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index 5a0dfdc22..631a22cc1 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection; using OrchardCore.Modules; using OrchardCore.Data.Migration; +using StatCan.OrchardCore.Radar.Migrations; namespace StatCan.OrchardCore.Radar { @@ -11,7 +12,8 @@ public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); + services.AddScoped(); + services.AddScoped(); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) diff --git a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj index a75b9040c..634b73c1d 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj +++ b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj @@ -1,4 +1,4 @@ - + $(AspNetCoreTargetFramework) @@ -18,6 +18,7 @@ + diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/assets/images/radar-icon-white.svg b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/assets/images/radar-icon-white.svg new file mode 100644 index 000000000..168b10556 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/assets/images/radar-icon-white.svg @@ -0,0 +1,18 @@ + + + + + + + + + + From 2800e9f24c9ac7b6c0caf41f48822b7558af896a Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Fri, 17 Sep 2021 07:25:13 -0400 Subject: [PATCH 008/198] wip: recipe to initialize radar --- .../EntityMigration.cs => Migrations.cs} | 8 +- .../Migrations/AppMigration.cs | 24 ---- .../Migrations/app.recipe.json | 104 ------------------ .../Migrations/init.recipe.json | 86 --------------- .../Recipes/radar.setup.recipe.json | 51 ++++++++- src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 4 +- 6 files changed, 55 insertions(+), 222 deletions(-) rename src/Apps/StatCan.OrchardCore.Radar/{Migrations/EntityMigration.cs => Migrations.cs} (99%) delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/EntityMigration.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs similarity index 99% rename from src/Apps/StatCan.OrchardCore.Radar/Migrations/EntityMigration.cs rename to src/Apps/StatCan.OrchardCore.Radar/Migrations.cs index 62c34a49b..3e29f85ec 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/EntityMigration.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs @@ -13,16 +13,16 @@ using OrchardCore.Taxonomies.Settings; using OrchardCore.Flows.Models; -namespace StatCan.OrchardCore.Radar.Migrations +namespace StatCan.OrchardCore.Radar { - public class EntityMigration : DataMigration + public class Migrations : DataMigration { private readonly IContentDefinitionManager _contentDefinitionManager; private readonly IContentManager _contentManager; private readonly Dictionary _taxonomyIds; - public EntityMigration(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) + public Migrations(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) { _contentDefinitionManager = contentDefinitionManager; _contentManager = contentManager; @@ -33,7 +33,7 @@ public EntityMigration(IContentDefinitionManager contentDefinitionManager, ICont public async Task CreateAsync() { CreateTaxonomies(); - await CreateTaxonomyItems(); + await CreateTaxonomyItems(); CreateArtifact(); CreateRadarEntityPart(); CreateProposal(); diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs deleted file mode 100644 index 1576f6769..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/AppMigration.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using OrchardCore.Recipes.Services; -using OrchardCore.Data.Migration; - -namespace StatCan.OrchardCore.Radar.Migrations -{ - public class AppMigration : DataMigration - { - private readonly IRecipeMigrator _recipeMigrator; - - public AppMigration(IRecipeMigrator recipeMigrator) - { - _recipeMigrator = recipeMigrator; - } - - public async Task CreateAsync() - { - await _recipeMigrator.ExecuteAsync("init.recipe.json", this); - await _recipeMigrator.ExecuteAsync("app.recipe.json", this); - - return 1; - } - } -} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json deleted file mode 100644 index d2e2e63c1..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/app.recipe.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "name": "", - "displayName": "", - "description": "", - "author": "", - "website": "", - "version": "", - "issetuprecipe": false, - "categories": [], - "tags": [], - "steps": [ - { - "name": "themes", - "admin": "DigitalAdmin", - "site": "VuetifyTheme" - }, - { - "name": "Settings", - "Calendar": null, - "UseCdn": false, - "TimeZoneId": "America/Toronto", - "AppendVersion": true, - "LocalizationSettings": { - "DefaultCulture": "en", - "SupportedCultures": [ "fr", "en" ] - }, - "AdminSettings": { - "DisplayMenuFilter": true - }, - "LoginSettings": { - "UseSiteTheme": true - }, - "ResetPasswordSettings": { - "UseSiteTheme": true - }, - "RegistrationSettings": { - "UseSiteTheme": true - }, - "LayerSettings": { - "Zones": [ - "Header", - "Breadcrumb", - "NavigationDrawer", - "Footer", - "IEBanner" - ] - } - }, - { - "name": "Layers", - "Layers": [ - { - "Name": "All", - "Rule": "true", - "Description": null - } - ] - }, - { - "name": "media", - "Files": [ - { - "SourcePath": "../wwwroot/assets/images/radar-icon-white.svg", - "TargetPath": "radar-icon-white.svg" - } - ] - }, - { - "name": "custom-settings", - "VuetifyThemeSettings": { - "ContentItemId": "[js: uuid()]", - "ContentItemVersionId": null, - "ContentType": "VuetifyThemeSettings", - "DisplayText": "", - "Latest": false, - "Published": false, - "ModifiedUtc": null, - "PublishedUtc": null, - "CreatedUtc": null, - "Owner": "[js: parameters('AdminUserId')]", - "Author": "[js: parameters('AdminUsername')]", - "VuetifyThemeSettings": { - "DisplayName": { - "Text": "Radar" - }, - "Logo": { - "Paths": [ - "radar-icon-white.svg" - ], - "MediaTexts": [ - "" - ] - }, - "DisplayMode": { - "Text": "light" - }, - "ThemeOptions": { - "Text": null - } - } - } - } - ] -} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json deleted file mode 100644 index 73272c4ec..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations/init.recipe.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "", - "displayName": "", - "description": "", - "author": "", - "website": "", - "version": "", - "issetuprecipe": false, - "categories": [], - "tags": [], - "steps": [ - { - "name": "Feature", - "enable": [ - "Application.Default", - "StatCan.OrchardCore.Cms.Web", - "OrchardCore.Liquid", - "OrchardCore.Resources", - "OrchardCore.Settings", - "OrchardCore.Contents", - "OrchardCore.ContentTypes", - "OrchardCore.Autoroute", - "OrchardCore.Widgets", - "OrchardCore.Flows", - "OrchardCore.Title", - "OrchardCore.Shortcodes", - "OrchardCore.Html", - "OrchardCore.Admin", - "OrchardCore.Templates", - "OrchardCore.Alias", - "OrchardCore.Features", - "OrchardCore.Scripting", - "OrchardCore.Recipes", - "OrchardCore.ContentFields", - "OrchardCore.Users", - "OrchardCore.Localization", - "OrchardCore.ContentLocalization", - "OrchardCore.ContentLocalization.ContentCulturePicker", - "OrchardCore.ContentPreview", - "OrchardCore.Deployment", - "OrchardCore.Contents.Deployment.Download", - "OrchardCore.Contents.Deployment.ExportContentToDeploymentTarget", - "OrchardCore.CustomSettings", - "OrchardCore.Diagnostics", - "OrchardCore.DynamicCache", - "OrchardCore.Email", - "OrchardCore.Feeds", - "OrchardCore.HomeRoute", - "OrchardCore.Https", - "OrchardCore.Indexing", - "OrchardCore.Rules", - "OrchardCore.Layers", - "OrchardCore.Lists", - "OrchardCore.Markdown", - "OrchardCore.Media", - "OrchardCore.Menu", - "OrchardCore.Microsoft.Authentication.AzureAD", - "OrchardCore.Navigation", - "OrchardCore.Placements", - "OrchardCore.Queries", - "OrchardCore.ReverseProxy", - "OrchardCore.Roles", - "OrchardCore.Shortcodes.Templates", - "OrchardCore.Themes", - "OrchardCore.Users.Registration", - "OrchardCore.Workflows", - "OrchardCore.Workflows.Http", - "OrchardCore.Workflows.Timers", - "StatCan.OrchardCore.ContentPermissions", - "StatCan.OrchardCore.Configuration", - "StatCan.OrchardCore.ContentFields", - "StatCan.OrchardCore.ContentFields.PredefinedGroup", - "StatCan.OrchardCore.DisplayHelpers", - "StatCan.OrchardCore.EmailTemplates", - "StatCan.OrchardCore.GitHub", - "StatCan.OrchardCore.LocalizedText", - "StatCan.OrchardCore.Scripting", - "StatCan.OrchardCore.VueForms", - "StatCan.OrchardCore.VueForms.Localized", - "StatCan.OrchardCore.Vuetify", - "DigitalAdmin", - "VuetifyTheme" - ] - } - ] -} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json index 8fb359156..284a0335a 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -1,7 +1,7 @@ { "name": "radar-setup", "displayName": "Radar Setup", - "description": "Recipe used to set the Radar application.", + "description": "Recipe used to setup the Radar application.", "author": "Digital Innovation Team", "website": "https://digital.statcan.gc.ca", "version": "1.0", @@ -9,6 +9,55 @@ "categories": [ "radar" ], "tags": [ "innovation", "inno" ], "steps": [ + { + "name": "feature", + "enable": [ + "Application.Default", + "StatCan.OrchardCore.Cms.Web", + "OrchardCore.Resources", + "OrchardCore.Liquid", + "OrchardCore.Settings", + "OrchardCore.Contents", + "OrchardCore.ContentTypes", + "OrchardCore.Autoroute", + "OrchardCore.Widgets", + "OrchardCore.Flows", + "OrchardCore.Title", + "OrchardCore.Shortcodes", + "OrchardCore.Admin", + "OrchardCore.Alias", + "OrchardCore.Features", + "OrchardCore.Scripting", + "OrchardCore.Recipes", + "OrchardCore.ContentFields", + "OrchardCore.Users", + "OrchardCore.Localization", + "OrchardCore.Deployment", + "OrchardCore.CustomSettings", + "OrchardCore.Diagnostics", + "OrchardCore.DynamicCache", + "OrchardCore.HomeRoute", + "OrchardCore.Rules", + "OrchardCore.Layers", + "OrchardCore.Media", + "OrchardCore.Menu", + "OrchardCore.Navigation", + "OrchardCore.Roles", + "OrchardCore.Tenants", + "OrchardCore.Themes", + "StatCan.OrchardCore.ContentFields", + "StatCan.OrchardCore.DisplayHelpers", + "StatCan.OrchardCore.Menu", + "StatCan.OrchardCore.Vuetify", + "TheAdmin", + "VuetifyTheme" + ] + }, + { + "name": "themes", + "admin": "TheAdmin", + "site": "VuetifyTheme" + }, { "name": "media", "Files": [ diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index 631a22cc1..5a0dfdc22 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.DependencyInjection; using OrchardCore.Modules; using OrchardCore.Data.Migration; -using StatCan.OrchardCore.Radar.Migrations; namespace StatCan.OrchardCore.Radar { @@ -12,8 +11,7 @@ public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { - services.AddScoped(); - services.AddScoped(); + services.AddScoped(); } public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilder routes, IServiceProvider serviceProvider) From 2ecdcec67384007f26adbe025fa6bd4f85c98e7b Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Fri, 17 Sep 2021 08:48:38 -0400 Subject: [PATCH 009/198] feat: add app var --- .../Recipes/radar.setup.recipe.json | 105 ++++++++++-------- 1 file changed, 59 insertions(+), 46 deletions(-) diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json index 284a0335a..482f8d719 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -10,54 +10,14 @@ "tags": [ "innovation", "inno" ], "steps": [ { - "name": "feature", - "enable": [ - "Application.Default", - "StatCan.OrchardCore.Cms.Web", - "OrchardCore.Resources", - "OrchardCore.Liquid", - "OrchardCore.Settings", - "OrchardCore.Contents", - "OrchardCore.ContentTypes", - "OrchardCore.Autoroute", - "OrchardCore.Widgets", - "OrchardCore.Flows", - "OrchardCore.Title", - "OrchardCore.Shortcodes", - "OrchardCore.Admin", - "OrchardCore.Alias", - "OrchardCore.Features", - "OrchardCore.Scripting", - "OrchardCore.Recipes", - "OrchardCore.ContentFields", - "OrchardCore.Users", - "OrchardCore.Localization", - "OrchardCore.Deployment", - "OrchardCore.CustomSettings", - "OrchardCore.Diagnostics", - "OrchardCore.DynamicCache", - "OrchardCore.HomeRoute", - "OrchardCore.Rules", - "OrchardCore.Layers", - "OrchardCore.Media", - "OrchardCore.Menu", - "OrchardCore.Navigation", - "OrchardCore.Roles", - "OrchardCore.Tenants", - "OrchardCore.Themes", - "StatCan.OrchardCore.ContentFields", - "StatCan.OrchardCore.DisplayHelpers", - "StatCan.OrchardCore.Menu", - "StatCan.OrchardCore.Vuetify", - "TheAdmin", - "VuetifyTheme" + "name": "recipes", + "Values": [ + { + "executionid": "ThemeSetup", + "name": "vuetify-theme-setup" + } ] }, - { - "name": "themes", - "admin": "TheAdmin", - "site": "VuetifyTheme" - }, { "name": "media", "Files": [ @@ -101,6 +61,59 @@ } } } + }, + { + "name": "content", + "data": [ + { + "ContentItemId": "[js: uuid()]", + "ContentItemVersionId": null, + "ContentType": "VAppBar", + "DisplayText": null, + "Latest": true, + "Published": true, + "ModifiedUtc": null, + "PublishedUtc": null, + "CreatedUtc": null, + "Owner": "[js: parameters('AdminUserId')]", + "Author": "[js: parameters('AdminUsername')]", + "VAppBar": { + "Props": { + "Values": [ + "dark" + ] + }, + "Color": { + "Text": "#009688" + }, + "Elevation": { + "Value": 10.0 + }, + "ExtensionHeight": { + "Value": 48.0 + }, + "ScrollThreshold": { + "Value": null + }, + "BackgroundImage": { + "Paths": [], + "MediaTexts": [] + }, + "Height": { + "Value": null + }, + "Width": { + "Value": null + } + }, + "LayerMetadata": { + "RenderTitle": false, + "Position": 1.0, + "Zone": "Header", + "Layer": "All" + } + } + ] } ] } \ No newline at end of file From 90aa2fd5a5a06a3dd0313c8eff10e9f9f4b3a833 Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Fri, 17 Sep 2021 11:45:13 -0400 Subject: [PATCH 010/198] wip: add landing page --- .../StatCan.OrchardCore.Radar/Assets.json | 9 +++++ .../Assets/css/page.css | 35 +++++++++++++++++++ .../Recipes/radar.setup.recipe.json | 10 +++++- .../ResourceManagementOptionsConfiguration.cs | 25 +++++++++++++ .../StatCan.OrchardCore.Radar.csproj | 3 +- .../Views/Home/Index.cshtml | 1 - .../wwwroot/css/index.css | 35 +++++++++++++++++++ .../{assets => }/images/radar-icon-white.svg | 0 8 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Assets.json create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Assets/css/page.css create mode 100644 src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs delete mode 100644 src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml create mode 100644 src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css rename src/Apps/StatCan.OrchardCore.Radar/wwwroot/{assets => }/images/radar-icon-white.svg (100%) diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets.json b/src/Apps/StatCan.OrchardCore.Radar/Assets.json new file mode 100644 index 000000000..21964b0b2 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets.json @@ -0,0 +1,9 @@ +[ + { + "copy": true, + "inputs": [ + "Assets/css/*.css" + ], + "output": "wwwroot/css/index.css" + } +] \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets/css/page.css b/src/Apps/StatCan.OrchardCore.Radar/Assets/css/page.css new file mode 100644 index 000000000..7047edabc --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets/css/page.css @@ -0,0 +1,35 @@ +.zigzag { + position: relative; + padding: 8px 8px 32px 8px; + background: #cfece9; +} + + .zigzag:after { + background: linear-gradient(-40deg, hsl(0, 0%, 100%) 16px, transparent 0), linear-gradient(40deg, #ffffff 16px, transparent 0); + background-position: left bottom; + background-repeat: repeat-x; + background-size: 32px 32px; + content: ' '; + display: block; + position: absolute; + bottom: 0px; + left: 0px; + width: 100%; + height: 32px; + } + +.ripple { + background-color: #227069; + background-image: url(../Icons/ripples.svg); + background-size: cover; + background-repeat: no-repeat; + background-position: center bottom -623px; +} + +.rippleFront { + background-color: #cfece9; + background-image: url(../Icons/ripples-white.svg); + background-size: cover; + background-repeat: no-repeat; + background-position: center bottom -590px; +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json index 482f8d719..9c01281f6 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -9,6 +9,14 @@ "categories": [ "radar" ], "tags": [ "innovation", "inno" ], "steps": [ + { + "name": "feature", + "disable": [], + "enable": [ + "StatCan.OrchardCore.Vuetify.Grid", + "StatCan.OrchardCore.Vuetify.Image" + ] + }, { "name": "recipes", "Values": [ @@ -22,7 +30,7 @@ "name": "media", "Files": [ { - "SourcePath": "../wwwroot/assets/images/radar-icon-white.svg", + "SourcePath": "../wwwroot/images/radar-icon-white.svg", "TargetPath": "radar-icon-white.svg" } ] diff --git a/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs b/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs new file mode 100644 index 000000000..b58f6e1f9 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.Options; +using OrchardCore.ResourceManagement; + +namespace StatCan.OrchardCore.Radar +{ + public class ResourceManagementOptionsConfiguration : IConfigureOptions + { + private static ResourceManifest _manifest; + + static ResourceManagementOptionsConfiguration() + { + _manifest = new ResourceManifest(); + + _manifest + .DefineStyle("Radar Stylesheet") + .SetUrl("~/StatCan.OrchardCore.Radar/css/index.css", "~/StatCan.OrchardCore.Radar/css/index.css") + .SetVersion("1.0.0"); + } + + public void Configure(ResourceManagementOptions options) + { + options.ResourceManifests.Add(_manifest); + } + } +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj index 634b73c1d..31fd92785 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj +++ b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj @@ -1,4 +1,4 @@ - + $(AspNetCoreTargetFramework) @@ -19,6 +19,7 @@ + diff --git a/src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml b/src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml deleted file mode 100644 index a1ab916e5..000000000 --- a/src/Apps/StatCan.OrchardCore.Radar/Views/Home/Index.cshtml +++ /dev/null @@ -1 +0,0 @@ -Template \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css new file mode 100644 index 000000000..7047edabc --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css @@ -0,0 +1,35 @@ +.zigzag { + position: relative; + padding: 8px 8px 32px 8px; + background: #cfece9; +} + + .zigzag:after { + background: linear-gradient(-40deg, hsl(0, 0%, 100%) 16px, transparent 0), linear-gradient(40deg, #ffffff 16px, transparent 0); + background-position: left bottom; + background-repeat: repeat-x; + background-size: 32px 32px; + content: ' '; + display: block; + position: absolute; + bottom: 0px; + left: 0px; + width: 100%; + height: 32px; + } + +.ripple { + background-color: #227069; + background-image: url(../Icons/ripples.svg); + background-size: cover; + background-repeat: no-repeat; + background-position: center bottom -623px; +} + +.rippleFront { + background-color: #cfece9; + background-image: url(../Icons/ripples-white.svg); + background-size: cover; + background-repeat: no-repeat; + background-position: center bottom -590px; +} diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/assets/images/radar-icon-white.svg b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/radar-icon-white.svg similarity index 100% rename from src/Apps/StatCan.OrchardCore.Radar/wwwroot/assets/images/radar-icon-white.svg rename to src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/radar-icon-white.svg From 59fa12fe6d899b5d0b924593d0c47eb6aa988128 Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Fri, 17 Sep 2021 15:05:32 -0400 Subject: [PATCH 011/198] wip: add landing page header --- .../StatCan.OrchardCore.Radar/Constants.cs | 2 + .../StatCan.OrchardCore.Radar/Migrations.cs | 45 +++++++++++++++++ .../Recipes/radar.setup.recipe.json | 50 +++++++++++++++++++ .../ResourceManagementOptionsConfiguration.cs | 4 +- src/Apps/StatCan.OrchardCore.Radar/Startup.cs | 3 ++ .../Views/Content-LandingPage.liquid | 26 ++++++++++ .../css/{index.css => landing-page.css} | 50 +++++++++++++++---- .../wwwroot/images/ripples-white.svg | 1 + 8 files changed, 170 insertions(+), 11 deletions(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid rename src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/{index.css => landing-page.css} (54%) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/ripples-white.svg diff --git a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs index 1d40749e1..b0a3e5f60 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Constants.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Constants.cs @@ -28,6 +28,8 @@ public static class ContentTypes // Parts public const string RadarEntity = "RadarEntity"; + + public const string LandingPage = "LandingPage"; } } } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs index 3e29f85ec..23f279c73 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs @@ -41,6 +41,8 @@ public async Task CreateAsync() CreateEvent(); CreateCommunity(); + CreateLandingPage(); + return 1; } @@ -669,5 +671,48 @@ private void CreateCommunity() ) ); } + + private void CreateLandingPage() + { + _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.LandingPage, type => type + .DisplayedAs("LandingPage") + .Creatable() + .Listable() + .Draftable() + .Versionable() + .Securable() + .WithPart(Constants.ContentTypes.LandingPage, part => part + .WithPosition("3") + ) + .WithPart("AutoroutePart", part => part + .WithPosition("2") + ) + .WithPart("LocalizationPart", part => part + .WithPosition("0") + ) + .WithPart("TitlePart", part => part + .WithPosition("1") + ) + .WithPart("FlowPart", part => part + .WithPosition("5") + ) + .WithPart("HtmlBodyPart", part => part + .WithPosition("4") + ) + ); + + _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.LandingPage, part => part + .WithField("HeaderImage", field => field + .OfType("MediaField") + .WithDisplayName("Header Image") + .WithPosition("0") + ) + .WithField("Description", field => field + .OfType("TextField") + .WithDisplayName("Description") + .WithPosition("1") + ) + ); + } } } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json index 9c01281f6..998745707 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -32,6 +32,10 @@ { "SourcePath": "../wwwroot/images/radar-icon-white.svg", "TargetPath": "radar-icon-white.svg" + }, + { + "SourcePath": "../wwwroot/images/ripples-white.svg", + "TargetPath": "ripples-white.svg" } ] }, @@ -73,6 +77,52 @@ { "name": "content", "data": [ + { + "ContentItemId": "[js: uuid()]", + "ContentItemVersionId": null, + "ContentType": "LandingPage", + "DisplayText": "Digital Radar", + "Latest": true, + "Published": true, + "ModifiedUtc": null, + "PublishedUtc": null, + "CreatedUtc": null, + "Owner": "[js: parameters('AdminUserId')]", + "Author": "[js: parameters('AdminUsername')]", + "LandingPage": { + "HeaderImage": { + "Paths": [ + "ripples-white.svg" + ], + "MediaTexts": [ + "" + ] + }, + "Description": { + "Text": "Explore, manage and discover insights across your projects" + } + }, + "AutoroutePart": { + "Path": "digital-radar", + "SetHomepage": true, + "Disabled": false, + "RouteContainedItems": false, + "Absolute": false + }, + "FlowPart": { + "Widgets": [] + }, + "LocalizationPart": { + "LocalizationSet": "4xwnrm19d4119rg6szffxkfpwt", + "Culture": "en" + }, + "TitlePart": { + "Title": "Digital Radar" + }, + "HtmlBodyPart": { + "Html": "\n
    \n
  • \n \tDiscover pathfinding projects\n
  • \n
  • \n \tExplore technologies and topics\n
  • \n
  • \n \tShare your team's work\n
  • \n
\n" + } + }, { "ContentItemId": "[js: uuid()]", "ContentItemVersionId": null, diff --git a/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs b/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs index b58f6e1f9..53ff13e69 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/ResourceManagementOptionsConfiguration.cs @@ -12,8 +12,8 @@ static ResourceManagementOptionsConfiguration() _manifest = new ResourceManifest(); _manifest - .DefineStyle("Radar Stylesheet") - .SetUrl("~/StatCan.OrchardCore.Radar/css/index.css", "~/StatCan.OrchardCore.Radar/css/index.css") + .DefineStyle("landing-page-style") + .SetUrl("~/StatCan.OrchardCore.Radar/css/landing-page.css", "~/StatCan.OrchardCore.Radar/css/landing-page.css") .SetVersion("1.0.0"); } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs index 5a0dfdc22..6a00352d7 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Startup.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Startup.cs @@ -2,8 +2,10 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using OrchardCore.Modules; using OrchardCore.Data.Migration; +using OrchardCore.ResourceManagement; namespace StatCan.OrchardCore.Radar { @@ -11,6 +13,7 @@ public class Startup : StartupBase { public override void ConfigureServices(IServiceCollection services) { + services.AddTransient, ResourceManagementOptionsConfiguration>(); services.AddScoped(); } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid new file mode 100644 index 000000000..27ba07ef1 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid @@ -0,0 +1,26 @@ +{% style name:"landing-page-style" %} + +{% zone "Header" %} + +{% assign imagePath = Model.ContentItem.Content.LandingPage.HeaderImage.Paths.first %} +
+
+
+
+
+ {{ Model.ContentItem | display_text }} +
+
+ {{ Model.ContentItem.Content.LandingPage.Description.Text }} +
+
+ {{ Model.Content.HtmlBodyPart | shape_render }} +
+
+
+
+
+ +{% endzone %} + + \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css similarity index 54% rename from src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css rename to src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css index 7047edabc..872899a0e 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/index.css +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css @@ -1,3 +1,43 @@ +.center-text { + text-align: center; +} + +.landing-page-header { + width: 100%; +} + +.header-text { + width: 600px; + margin: auto; +} + +.light-font { + font-weight: lighter; + color: #000000DE; + opacity: 1; +} + +.name { + font-size: 47px; + color: #005247; + font-weight: 300; + white-space: nowrap; +} + +.description { + font-size: 25px; + font-weight: 300; + margin: auto; + width: 60%; + line-height: normal; +} + +.list { + margin: 2rem auto 2rem auto; + white-space: nowrap; + width: fit-content; +} + .zigzag { position: relative; padding: 8px 8px 32px 8px; @@ -18,18 +58,10 @@ height: 32px; } -.ripple { - background-color: #227069; - background-image: url(../Icons/ripples.svg); - background-size: cover; - background-repeat: no-repeat; - background-position: center bottom -623px; -} - .rippleFront { background-color: #cfece9; - background-image: url(../Icons/ripples-white.svg); background-size: cover; background-repeat: no-repeat; background-position: center bottom -590px; + padding: 8rem 0rem 3rem 0rem; } diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/ripples-white.svg b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/ripples-white.svg new file mode 100644 index 000000000..ea7ef8adb --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/ripples-white.svg @@ -0,0 +1 @@ + \ No newline at end of file From 145ed0eb0610f9ab693b7e559687d33bb0febb91 Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Mon, 20 Sep 2021 07:48:51 -0400 Subject: [PATCH 012/198] feat: add landing page header --- .../StatCan.OrchardCore.Radar/Assets.json | 7 +++ .../Assets/images/canada.svg | 7 +++ .../Assets/images/goc.svg | 56 +++++++++++++++++++ .../Assets/images/radar-icon-white.svg | 18 ++++++ .../Assets/images/ripples-white.svg | 1 + .../StatCan.OrchardCore.Radar/Migrations.cs | 7 +-- .../Recipes/radar.setup.recipe.json | 8 --- .../StatCan.OrchardCore.Radar.csproj | 22 ++++++++ .../Views/Content-LandingPage.liquid | 55 ++++++++++++++---- .../wwwroot/css/landing-page.css | 26 ++++----- .../wwwroot/images/canada.svg | 7 +++ .../wwwroot/images/goc.svg | 56 +++++++++++++++++++ 12 files changed, 232 insertions(+), 38 deletions(-) create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Assets/images/canada.svg create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Assets/images/goc.svg create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Assets/images/radar-icon-white.svg create mode 100644 src/Apps/StatCan.OrchardCore.Radar/Assets/images/ripples-white.svg create mode 100644 src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/canada.svg create mode 100644 src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/goc.svg diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets.json b/src/Apps/StatCan.OrchardCore.Radar/Assets.json index 21964b0b2..0a8de2139 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Assets.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets.json @@ -5,5 +5,12 @@ "Assets/css/*.css" ], "output": "wwwroot/css/index.css" + }, + { + "copy": true, + "inputs": [ + "Assets/images/*" + ], + "output": "wwwroot/images/@" } ] \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets/images/canada.svg b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/canada.svg new file mode 100644 index 000000000..936bd1156 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/canada.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets/images/goc.svg b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/goc.svg new file mode 100644 index 000000000..5e59977b4 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/goc.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets/images/radar-icon-white.svg b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/radar-icon-white.svg new file mode 100644 index 000000000..168b10556 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/radar-icon-white.svg @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets/images/ripples-white.svg b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/ripples-white.svg new file mode 100644 index 000000000..ea7ef8adb --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets/images/ripples-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs index 23f279c73..81949b122 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs @@ -675,7 +675,7 @@ private void CreateCommunity() private void CreateLandingPage() { _contentDefinitionManager.AlterTypeDefinition(Constants.ContentTypes.LandingPage, type => type - .DisplayedAs("LandingPage") + .DisplayedAs("Landing Page") .Creatable() .Listable() .Draftable() @@ -702,11 +702,6 @@ private void CreateLandingPage() ); _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.LandingPage, part => part - .WithField("HeaderImage", field => field - .OfType("MediaField") - .WithDisplayName("Header Image") - .WithPosition("0") - ) .WithField("Description", field => field .OfType("TextField") .WithDisplayName("Description") diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json index 998745707..253c227ad 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -90,14 +90,6 @@ "Owner": "[js: parameters('AdminUserId')]", "Author": "[js: parameters('AdminUsername')]", "LandingPage": { - "HeaderImage": { - "Paths": [ - "ripples-white.svg" - ], - "MediaTexts": [ - "" - ] - }, "Description": { "Text": "Explore, manage and discover insights across your projects" } diff --git a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj index 31fd92785..6c93f4989 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj +++ b/src/Apps/StatCan.OrchardCore.Radar/StatCan.OrchardCore.Radar.csproj @@ -6,6 +6,28 @@ ..\..\..\roslynator.ruleset
+ + + + + + + + + + Never + + + Never + + + Never + + + Never + + + diff --git a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid index 27ba07ef1..a886e8f14 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid +++ b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid @@ -5,17 +5,47 @@ {% assign imagePath = Model.ContentItem.Content.LandingPage.HeaderImage.Paths.first %}
-
+
-
- {{ Model.ContentItem | display_text }} -
-
- {{ Model.ContentItem.Content.LandingPage.Description.Text }} -
-
- {{ Model.Content.HtmlBodyPart | shape_render }} -
+ + + +
+ {{ Model.ContentItem | display_text }} +
+
+
+ + +
+ {{ Model.ContentItem.Content.LandingPage.Description.Text }} +
+
+
+ + +
+ {{ Model.Content.HtmlBodyPart | shape_render }} +
+
+
+ + + + + +
@@ -23,4 +53,7 @@ {% endzone %} - \ No newline at end of file +{% shape_remove_item Model.Content "HtmlBodyPart" %} +{% shape_remove_item Model.Content "LandingPage-Description" %} + +{{ Model.Content | shape_render }} \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css index 872899a0e..f7b34d480 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css @@ -2,13 +2,8 @@ text-align: center; } -.landing-page-header { - width: 100%; -} - .header-text { - width: 600px; - margin: auto; + padding: 0 24rem 0 24rem; } .light-font { @@ -26,16 +21,21 @@ .description { font-size: 25px; - font-weight: 300; - margin: auto; - width: 60%; - line-height: normal; + font-weight: 300; + margin: auto; + line-height: normal; + padding: 0 20rem 0 20rem; } .list { - margin: 2rem auto 2rem auto; - white-space: nowrap; - width: fit-content; + display: flex; + justify-content: center; +} + +.header-footer { + display: flex; + justify-content: space-between; + padding: 0 10rem 0 10rem; } .zigzag { diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/canada.svg b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/canada.svg new file mode 100644 index 000000000..936bd1156 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/canada.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/goc.svg b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/goc.svg new file mode 100644 index 000000000..5e59977b4 --- /dev/null +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/images/goc.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 322c044ec267c33b0a5f91a4ceed6baa5e9ba86e Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Mon, 20 Sep 2021 10:51:35 -0400 Subject: [PATCH 013/198] feat: add landing page --- .../StatCan.OrchardCore.Radar/Assets.json | 2 +- .../StatCan.OrchardCore.Radar/Migrations.cs | 56 +++++++- .../Recipes/radar.setup.recipe.json | 52 ++++++-- .../Views/Content-LandingPage.liquid | 124 ++++++++++++++++-- .../wwwroot/css/landing-page.css | 29 +++- 5 files changed, 231 insertions(+), 32 deletions(-) diff --git a/src/Apps/StatCan.OrchardCore.Radar/Assets.json b/src/Apps/StatCan.OrchardCore.Radar/Assets.json index 0a8de2139..dfa5373fa 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Assets.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Assets.json @@ -2,7 +2,7 @@ { "copy": true, "inputs": [ - "Assets/css/*.css" + "Assets/css/*" ], "output": "wwwroot/css/index.css" }, diff --git a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs index 81949b122..e788621f9 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs +++ b/src/Apps/StatCan.OrchardCore.Radar/Migrations.cs @@ -693,20 +693,64 @@ private void CreateLandingPage() .WithPart("TitlePart", part => part .WithPosition("1") ) - .WithPart("FlowPart", part => part - .WithPosition("5") - ) - .WithPart("HtmlBodyPart", part => part - .WithPosition("4") - ) ); _contentDefinitionManager.AlterPartDefinition(Constants.ContentTypes.LandingPage, part => part .WithField("Description", field => field .OfType("TextField") .WithDisplayName("Description") + .WithPosition("8") + ) + .WithField("Activity1", field => field + .OfType("HtmlField") + .WithDisplayName("Activity1") + .WithPosition("2") + ) + .WithField("Activity2", field => field + .OfType("HtmlField") + .WithDisplayName("Activity2") + .WithPosition("3") + ) + .WithField("Activity3", field => field + .OfType("HtmlField") + .WithDisplayName("Activity3") + .WithPosition("4") + ) + .WithField("Activity4", field => field + .OfType("HtmlField") + .WithDisplayName("Activity4") + .WithPosition("5") + ) + .WithField("Trend1", field => field + .OfType("HtmlField") + .WithDisplayName("Trend1") + .WithPosition("7") + ) + .WithField("Activities", field => field + .OfType("TextField") + .WithDisplayName("Activities") .WithPosition("1") ) + .WithField("Trends", field => field + .OfType("TextField") + .WithDisplayName("Trends") + .WithPosition("6") + ) + .WithField("Userguide", field => field + .OfType("HtmlField") + .WithDisplayName("User guide") + .WithPosition("9") + ) + .WithField("Contactus", field => field + .OfType("HtmlField") + .WithDisplayName("Contact us") + .WithPosition("10") + ) + .WithField("Headerlist", field => field + .OfType("HtmlField") + .WithDisplayName("Header list") + .WithPosition("0") + ) ); } } diff --git a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json index 253c227ad..00bcb7c40 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json +++ b/src/Apps/StatCan.OrchardCore.Radar/Recipes/radar.setup.recipe.json @@ -14,7 +14,7 @@ "disable": [], "enable": [ "StatCan.OrchardCore.Vuetify.Grid", - "StatCan.OrchardCore.Vuetify.Image" + "StatCan.OrchardCore.Vuetify.Card" ] }, { @@ -32,10 +32,6 @@ { "SourcePath": "../wwwroot/images/radar-icon-white.svg", "TargetPath": "radar-icon-white.svg" - }, - { - "SourcePath": "../wwwroot/images/ripples-white.svg", - "TargetPath": "ripples-white.svg" } ] }, @@ -92,6 +88,46 @@ "LandingPage": { "Description": { "Text": "Explore, manage and discover insights across your projects" + }, + "Section1": { + "Text": "Recent activity" + }, + "Section2": { + "Text": "Recent trends" + }, + "Activity1": { + "Text": "Projects", + "Html": "
\n Projects\n
\n
\n In-flight projects\n
" + }, + "Activity2": { + "Text": "Proposals", + "Html": "
\n Committees\n
\n
\n Latest committees\n
" + }, + "Activity3": { + "Text": null, + "Html": "
\n Events\n
\n
\n Upcoming events\n
" + }, + "Activity4": { + "Text": null, + "Html": "
\n Proposals\n
\n
\n Current proposals\n
" + }, + "Trend1": { + "Html": "
\n Topics\n
\n
\n Most used topics across all activities\n
" + }, + "Activities": { + "Text": "Recent activities" + }, + "Trends": { + "Text": "Recent trends" + }, + "Userguide": { + "Html": "
\n User Guide\n
\n
\n Learn more about the Radar\n
" + }, + "Contactus": { + "Html": "
\n Contact Us\n
\n
\n Ask questions and send feedback\n
" + }, + "Headerlist": { + "Html": "\n
    \n
  • \n \tDiscover pathfinding projects\n
  • \n
  • \n \tExplore technologies and topics\n
  • \n
  • \n \tShare your team's work\n
  • \n
\n" } }, "AutoroutePart": { @@ -101,18 +137,12 @@ "RouteContainedItems": false, "Absolute": false }, - "FlowPart": { - "Widgets": [] - }, "LocalizationPart": { "LocalizationSet": "4xwnrm19d4119rg6szffxkfpwt", "Culture": "en" }, "TitlePart": { "Title": "Digital Radar" - }, - "HtmlBodyPart": { - "Html": "\n
    \n
  • \n \tDiscover pathfinding projects\n
  • \n
  • \n \tExplore technologies and topics\n
  • \n
  • \n \tShare your team's work\n
  • \n
\n" } }, { diff --git a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid index a886e8f14..c7389ccbe 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid +++ b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid @@ -1,23 +1,21 @@ {% style name:"landing-page-style" %} -{% zone "Header" %} - {% assign imagePath = Model.ContentItem.Content.LandingPage.HeaderImage.Paths.first %}
-
+
- + -
+
{{ Model.ContentItem | display_text }}
-
+
{{ Model.ContentItem.Content.LandingPage.Description.Text }}
@@ -25,7 +23,7 @@
- {{ Model.Content.HtmlBodyPart | shape_render }} + {{ Model.ContentItem.Content.LandingPage.Headerlist.Html | raw }}
@@ -51,9 +49,113 @@
-{% endzone %} +
+ + + +
+ {{ Model.ContentItem.Content.LandingPage.Activities.Text }} +
+
+
+ + + + +
+ {{ Model.ContentItem.Content.LandingPage.Activity1.Html | raw }} +
+
+ + + +
+
+ + + +
+ {{ Model.ContentItem.Content.LandingPage.Activity2.Html | raw }} +
+
+ + + +
+
+
+ + + + +
+ {{ Model.ContentItem.Content.LandingPage.Activity3.Html | raw }} +
+
+ + + +
+
+ + + +
+ {{ Model.ContentItem.Content.LandingPage.Activity4.Html | raw }} +
+
+ + + +
+
+
+
+
-{% shape_remove_item Model.Content "HtmlBodyPart" %} -{% shape_remove_item Model.Content "LandingPage-Description" %} +
+ + + +
+ {{ Model.ContentItem.Content.LandingPage.Trends.Text }} +
+
+
+ + + + +
+ {{ Model.ContentItem.Content.LandingPage.Trend1.Html | raw }} +
+
+ + + +
+
+
+
+
-{{ Model.Content | shape_render }} \ No newline at end of file +
+ + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css index f7b34d480..48cc5d71a 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css +++ b/src/Apps/StatCan.OrchardCore.Radar/wwwroot/css/landing-page.css @@ -1,5 +1,5 @@ -.center-text { - text-align: center; +.max-wdith { + max-width: 1200px; } .header-text { @@ -32,16 +32,39 @@ justify-content: center; } +.section-title { + color: #005247; +} + +.section-background { + background: #009C880A; +} + +.front-footer { + background: #009C88; +} + .header-footer { display: flex; justify-content: space-between; padding: 0 10rem 0 10rem; } +.card-background { + background-color: #F6FCFB; +} + +.zigzag-light { + background: #cfece9 0% 0% no-repeat; +} + +.zigzag-dark { + background: #009C88 0% 0% no-repeat; +} + .zigzag { position: relative; padding: 8px 8px 32px 8px; - background: #cfece9; } .zigzag:after { From 04df330489dad118934124d73efdca25a49aa67d Mon Sep 17 00:00:00 2001 From: Michael Fan <62428476+mfan127@users.noreply.github.com> Date: Mon, 20 Sep 2021 14:14:05 -0400 Subject: [PATCH 014/198] feat: add icon and fix zigzag --- .../Views/Content-LandingPage.liquid | 141 ++++++++++++------ .../wwwroot/css/landing-page.css | 64 +++++--- 2 files changed, 139 insertions(+), 66 deletions(-) diff --git a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid index c7389ccbe..068ef9c33 100644 --- a/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid +++ b/src/Apps/StatCan.OrchardCore.Radar/Views/Content-LandingPage.liquid @@ -2,7 +2,7 @@ {% assign imagePath = Model.ContentItem.Content.LandingPage.HeaderImage.Paths.first %}
-
+
@@ -15,7 +15,7 @@ -
+
{{ Model.ContentItem.Content.LandingPage.Description.Text }}
@@ -29,23 +29,26 @@ -
+
+
+
@@ -60,53 +63,85 @@ - - -
- {{ Model.ContentItem.Content.LandingPage.Activity1.Html | raw }} + + +
+ + mdi-flask-outline + +
+ {{ Model.ContentItem.Content.LandingPage.Activity1.Html | raw }} +
+
+
+
- +
- +
- - -
- {{ Model.ContentItem.Content.LandingPage.Activity2.Html | raw }} + + +
+ + mdi-account-multiple + +
+ {{ Model.ContentItem.Content.LandingPage.Activity2.Html | raw }} +
+
+
+
- +
- +
- - -
- {{ Model.ContentItem.Content.LandingPage.Activity3.Html | raw }} + + +
+ + mdi-calendar + +
+ {{ Model.ContentItem.Content.LandingPage.Activity3.Html | raw }} +
+
+
+
- +
- +
- - -
- {{ Model.ContentItem.Content.LandingPage.Activity4.Html | raw }} + + +
+ + mdi-alert-circle-outline + +
+ {{ Model.ContentItem.Content.LandingPage.Activity4.Html | raw }} +
+
+
+
- +
- +
@@ -124,15 +159,23 @@ - - -
- {{ Model.ContentItem.Content.LandingPage.Trend1.Html | raw }} + + +
+ + mdi-pound + +
+ {{ Model.ContentItem.Content.LandingPage.Trend1.Html | raw }} +
+
+
+
- +
- +
@@ -143,16 +186,26 @@ - -