-
Notifications
You must be signed in to change notification settings - Fork 14
Ethos #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
axalrub
wants to merge
15
commits into
master
Choose a base branch
from
ethos
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ethos #210
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
02d3b98
initial commit of assessment module
jptissot 6250f6c
adds assessment widget v1
axalrub 9dbf0ec
Adds Assessment recipe
axalrub cb49ff1
Adds cypress tests
axalrub 433fdbc
initial commit
axalrub 18a9db7
WIP - adds Ethos Widget, uses TailwindCSS
axalrub e5a5a1c
Adds the Persona Widget and recipe
axalrub 1137f62
fixes alignment and mobile view
axalrub fcc69e4
Adds anchor to media photos
axalrub 3dcd3dc
Adds default svg for photo profile, cypress tests
axalrub 3bd1c40
WIP
Mbb640 1d26188
WIP
Mbb640 1833357
WIP
Mbb640 88bfae8
WIP
Mbb640 144004f
Remove inline styling
Mbb640 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace StatCan.OrchardCore.Persona | ||
| { | ||
| public static class FeatureIds | ||
| { | ||
| public const string Persona = "StatCan.OrchardCore.Persona"; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using OrchardCore.Modules.Manifest; | ||
| using static StatCan.OrchardCore.Persona.FeatureIds; | ||
|
|
||
| [assembly: Module( | ||
| Name = "StatCan Persona", | ||
| Author = "Digital Innovation Team", | ||
| Website = "https://digital.statcan.gc.ca", | ||
| Version = "1.0.0" | ||
| )] | ||
|
|
||
| [assembly: Feature( | ||
| Id = Persona, | ||
| Name = "StatCan.Persona - Widgets", | ||
| Category = "Content", | ||
| Description = "Adds a widget used to create a Persona", | ||
| Dependencies = new[] | ||
| { | ||
| "OrchardCore.Widgets", | ||
|
|
||
| } | ||
| )] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| using OrchardCore.ContentFields.Settings; | ||
| using OrchardCore.ContentManagement.Metadata; | ||
| using OrchardCore.ContentManagement.Metadata.Settings; | ||
| using OrchardCore.Data.Migration; | ||
| using OrchardCore.Title.Models; | ||
| using StatCan.OrchardCore.Extensions; | ||
| using OrchardCore.Media.Settings; | ||
|
|
||
| namespace StatCan.OrchardCore.Persona | ||
| { | ||
| public class Migrations : DataMigration | ||
| { | ||
| private readonly IContentDefinitionManager _contentDefinitionManager; | ||
| public Migrations(IContentDefinitionManager contentDefinitionManager) | ||
| { | ||
| _contentDefinitionManager = contentDefinitionManager; | ||
| } | ||
|
|
||
| public int Create() | ||
| { | ||
| CreatePersona(); | ||
| return 1; | ||
| } | ||
|
|
||
| private void CreatePersona() { | ||
| _contentDefinitionManager.AlterTypeDefinition("Persona", type => type | ||
| .DisplayedAs("Persona") | ||
| .Stereotype("Widget") | ||
| .WithPart("Persona", part => part | ||
| .WithPosition("0") | ||
| ) | ||
| ); | ||
|
|
||
| _contentDefinitionManager.AlterPartDefinition("Persona", part => part | ||
| .WithField("Data", field => field | ||
| .OfType("TextField") | ||
| .WithDisplayName("Data") | ||
| .WithEditor("CodeMirror") | ||
| .WithPosition("0") | ||
| .WithSettings(new TextFieldSettings | ||
| { | ||
| Hint = "Enter JSON for Persona here.", | ||
| Required = true, | ||
| }) | ||
| ) | ||
| .WithField("PhotoPicker", field => field | ||
| .OfType("MediaField") | ||
| .WithDisplayName("PhotoPicker") | ||
| .WithPosition("2") | ||
| .WithSettings(new MediaFieldSettings | ||
| { | ||
| Hint = "Select the photo to use for the persona.", | ||
| Required = false, | ||
| Multiple = false, | ||
| AllowMediaText = false, | ||
| AllowAnchors = true, | ||
| }) | ||
| ) | ||
| .WithField("Colour", field => field | ||
| .OfType("TextField") | ||
| .WithDisplayName("Colour") | ||
| .WithEditor("Color") | ||
| .WithPosition("1") | ||
| .WithSettings(new TextFieldSettings | ||
| { | ||
| Hint = "Choose the colour that matches the site's theme.", | ||
| Required = true, | ||
| }) | ||
| ) | ||
| ); | ||
|
|
||
| } | ||
| } | ||
| } |
95 changes: 95 additions & 0 deletions
95
src/Modules/StatCan.OrchardCore.Ethos/Recipes/Persona.recipe.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| { | ||
| "name": "Persona", | ||
| "displayName": "Persona", | ||
| "description": "Creates a Persona tool.", | ||
| "author": "StatCan Digital Innovation", | ||
| "website": "digital.statcan.gc.ca", | ||
| "version": "1.0.0", | ||
| "issetuprecipe": false, | ||
| "categories": [], | ||
| "tags": [], | ||
| "steps": [ | ||
| { | ||
| "name": "ContentDefinition", | ||
| "ContentTypes": [ | ||
| { | ||
| "Name": "Persona", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is required since you are creating the types with the code Migration |
||
| "DisplayName": "Persona", | ||
| "Settings": { | ||
| "ContentTypeSettings": { | ||
| "Creatable": true, | ||
| "Listable": true, | ||
| "Stereotype": "Widget" | ||
| }, | ||
| "FullTextAspectSettings": {} | ||
| }, | ||
| "ContentTypePartDefinitionRecords": [ | ||
| { | ||
| "PartName": "Persona", | ||
| "Name": "Persona", | ||
| "Settings": { | ||
| "ContentTypePartSettings": { | ||
| "Position": "0" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "ContentParts": [ | ||
| { | ||
| "Name": "Persona", | ||
| "Settings": {}, | ||
| "ContentPartFieldDefinitionRecords": [ | ||
| { | ||
| "FieldName": "TextField", | ||
| "Name": "Data", | ||
| "Settings": { | ||
| "ContentPartFieldSettings": { | ||
| "DisplayName": "Data", | ||
| "Editor": "CodeMirror", | ||
| "Position": "0" | ||
| }, | ||
| "TextFieldSettings": { | ||
| "Hint": "Enter JSON for Persona here.", | ||
| "Required": true | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "FieldName": "MediaField", | ||
| "Name": "PhotoPicker", | ||
| "Settings": { | ||
| "ContentPartFieldSettings": { | ||
| "DisplayName": "PhotoPicker", | ||
| "Position": "2" | ||
| }, | ||
| "MediaFieldSettings": { | ||
| "Hint": "Select the photo to use for the persona.", | ||
| "Multiple": false, | ||
| "AllowMediaText": false, | ||
| "AllowAnchors": true | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "FieldName": "TextField", | ||
| "Name": "Colour", | ||
| "Settings": { | ||
| "ContentPartFieldSettings": { | ||
| "DisplayName": "Colour", | ||
| "Editor": "Color", | ||
| "Position": "1" | ||
| }, | ||
| "TextFieldSettings": { | ||
| "Hint": "Choose the colour that matches the site's theme.", | ||
| "Required": true | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| using Microsoft.Extensions.DependencyInjection; | ||
| using OrchardCore.Modules; | ||
| using OrchardCore.ResourceManagement; | ||
| using OrchardCore.Data.Migration; | ||
|
|
||
| namespace StatCan.OrchardCore.Persona | ||
| { | ||
| [Feature(FeatureIds.Persona)] | ||
| public class Startup : StartupBase | ||
| { | ||
| public override void ConfigureServices(IServiceCollection serviceCollection) => serviceCollection.AddScoped<IDataMigration, Migrations>(); | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
src/Modules/StatCan.OrchardCore.Ethos/StatCan.OrchardCore.Persona.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>$(AspNetCoreTargetFramework)</TargetFramework> | ||
| <AddRazorSupportForMvc>true</AddRazorSupportForMvc> | ||
| <DefaultItemExcludes>$(DefaultItemExcludes);.git*;node_modules\**</DefaultItemExcludes> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="OrchardCore.ContentManagement" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.Contents" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.DisplayManagement" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.ResourceManagement" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.ContentFields" Version="$(OrchardCoreVersion)" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="OrchardCore.Title" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.Contents" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.Autoroute" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.Media" Version="$(OrchardCoreVersion)" /> | ||
| <PackageReference Include="OrchardCore.Flows" Version="$(OrchardCoreVersion)" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\..\Lib\StatCan.OrchardCore.Extensions\StatCan.OrchardCore.Extensions.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate entry