-
Notifications
You must be signed in to change notification settings - Fork 0
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
OSOE-920: Create a reusable widget for the carousel in Lombiq.UIKit #69
Conversation
…pdating migrations file.
…pdating the part settings edit template and adding hints and default values for each option.
…e Settings - Options (in JSON format).
…ault value for CarouselWidgetPartSettings Options.
… widget; Updating UI Kit widgets tests so they work with the example page.
Lombiq.UIKit.Widgets.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs
Outdated
Show resolved
Hide resolved
Lombiq.UIKit.Widgets.Tests.UI/Lombiq.UIKit.Widgets.Tests.UI.csproj
Outdated
Show resolved
Hide resolved
Lombiq.UIKit.Widgets/Settings/CarouselWidgetPartSettingsDisplayDriver.cs
Show resolved
Hide resolved
Lombiq.UIKit.Widgets/Settings/CarouselWidgetPartSettingsDisplayDriver.cs
Outdated
Show resolved
Hide resolved
Lombiq.UIKit.Widgets/Settings/CarouselWidgetPartSettingsViewModel.cs
Outdated
Show resolved
Hide resolved
public static class ContentTypes | ||
{ | ||
public const string SlidePart = nameof(SlidePart); | ||
public const string Slide = "Slide"; |
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.
You can use nameof
here and below.
@@ -6,5 +6,5 @@ namespace Lombiq.UIKit.Widgets.Handlers; | |||
public class SlidePartHandler : ContentPartHandler<SlidePart> | |||
{ | |||
public override Task UpdatedAsync(UpdateContentContext context, SlidePart part) => | |||
Task.Run(() => context.ContentItem.DisplayText = part.Title.Text); | |||
Task.Run(() => context.ContentItem.DisplayText = part.ContentItem.Content.TitlePart.Text); |
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.
This is not necessary. The TitlePart's functionality already do this.
|
||
public static class ContentTypes | ||
{ | ||
public const string SlidePart = nameof(SlidePart); |
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.
Part names are not content types. You can keep reference them as nameof(PartName)
so you don't need consts for these.
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.
The SlidePart
is still here.
@@ -22,14 +22,12 @@ | |||
var bagItems = ((ContentItem)Model.ContentItem).As<BagPart>().ContentItems.Select(contentItem => contentItem.As<SlidePart>()); | |||
var items = new List<IShape>(); | |||
|
|||
bagItems.ForEach(async (slide) => items.Add(await New.Slide(Title: slide.Title.Text, Image: slide.Image.Paths[0]))); | |||
bagItems.ForEach(async (slide) => items.Add(await New.Slide(Title: slide.ContentItem.Content.TitlePart.Text, Image: slide.Image.Paths[0]))); |
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.
You can rely on the slide.ContentItem.DisplayText
.
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.
Make sure the carousel is usable if you do this:
- Setup the website using the SaaS recipe.
- Run the Sample Carousel recipe.
Check if the page is imported, features are enabled, images are displayed, etc.
|
||
public static class ContentTypes | ||
{ | ||
public const string SlidePart = nameof(SlidePart); |
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.
The SlidePart
is still here.
Version = "0.0.1", | ||
Description = "Module for reusable widgets based on Lombiq UI Kit.", | ||
Website = "https://github.com/Lombiq/Orchard-UIKit" | ||
)] |
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.
Add the following dependencies: Lombiq.UIKit (use an appropriate const from the module), OrchardCore.ContentFields, OrchardCore.Media.
Version = "0.0.1", | ||
Description = "Module for reusable widgets based on Lombiq UI Kit.", | ||
Website = "https://github.com/Lombiq/Orchard-UIKit" | ||
)] |
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.
Add an appropriate category.
], | ||
"tags": [ | ||
"developer", | ||
"training", |
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.
You can leave out the training.
"SlidePart": { | ||
"Image": { | ||
"Paths": [ | ||
"about-bg.jpg" |
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.
These images won't be loaded because these are not part of the recipe so won't be imported. Add a media step where you also upload these images and make them part of the repo as well.
{ | ||
"name": "feature", | ||
"enable": [ | ||
"Lombiq.UIKit.Widgets" |
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.
Also enable the Helpful Content Types feature because the Page content type won't be loaded otherwise.
…de and information and dependencies for the project.
OSOE-920
Fixes #67