2020-05-11 15:34:47 +02:00
using Microsoft.Extensions.DependencyInjection ;
2020-05-13 14:06:11 +02:00
using System.Collections.Generic ;
2020-07-06 15:58:31 +02:00
using System.Linq ;
using zero.Core ;
using zero.Core.Entities ;
2020-05-13 14:06:11 +02:00
using zero.Core.Options ;
2020-05-11 15:34:47 +02:00
using zero.Core.Plugins ;
2020-05-13 14:06:11 +02:00
using zero.Debug.TestData ;
2020-05-11 15:34:47 +02:00
namespace zero.TestData
{
2020-05-12 15:22:39 +02:00
public class TestPlugin : IZeroPlugin
2020-05-11 15:34:47 +02:00
{
2020-05-19 10:57:35 +02:00
public void Configure ( IZeroPluginOptions plugin , IZeroOptions zero )
2020-05-11 15:34:47 +02:00
{
2020-05-19 10:57:35 +02:00
plugin . Name = "Test Plugin" ;
2020-07-06 15:58:31 +02:00
ISection spaceSection = zero . Sections . GetAllItems (). FirstOrDefault ( x => x . Alias == Constants . Sections . Spaces );
zero . Sections . Remove ( spaceSection );
2020-05-14 13:32:33 +02:00
zero . Spaces . AddList < TeamMember >( "team" , "Team" , "Our team members" , "fth-users" );
zero . Spaces . AddList < News >( "news" , "News" , "Articles about the company" , "fth-edit" );
zero . Spaces . AddSeparator ();
zero . Spaces . AddEditor < SocialContent >( "social" , "Social" , "Links to social media" , "fth-twitter" );
2020-05-11 15:34:47 +02:00
2020-05-14 13:32:33 +02:00
zero . Features . Add ( TestFeatures . Wishlist , "Wishlist" , "Frontend wishlist for logged-in users" );
zero . Features . Add ( TestFeatures . SocialShopping , "Social shopping" , "Integrate products into social media portals" );
2020-05-13 14:06:11 +02:00
2020-05-19 15:53:01 +02:00
zero . Pages . Add < NewsPage >( "news" , "News" , "News about the company" , "fth-file-text" );
zero . Pages . Add < ContentPage >( "content" , "Page" , "Page consisting of modules" , "fth-box" , allowAsRoot : true , allowAllChildrenTypes : true );
zero . Pages . Add < ContentPage >( "root" , "Homepage" , "Entry point for the website" , "fth-home" , allowAsRoot : true , allowAllChildrenTypes : true );
zero . Pages . Add < RedirectPage >( "redirect" , "Redirect" , "Redirect to another page or an external URL" , "fth-external-link" , allowAsRoot : true , allowedChildrenTypes : new List < string >() { "content" , "redirect" });
2020-05-11 15:34:47 +02:00
}
2020-05-18 15:55:43 +02:00
public void ConfigureServices ( IServiceCollection services )
{
services . AddTransient < ITestService , TestService >();
}
2020-05-11 15:34:47 +02:00
}
}